Skip to content
This repository has been archived by the owner on Jul 5, 2024. It is now read-only.

Exception: There are no SquirreAwareApp's in the provided package #81

Closed
WuYin-Lyu opened this issue May 26, 2022 · 13 comments
Closed

Exception: There are no SquirreAwareApp's in the provided package #81

WuYin-Lyu opened this issue May 26, 2022 · 13 comments
Labels
question Further information is requested

Comments

@WuYin-Lyu
Copy link

When using Releasify to pack my project. I get an exception: There are no SquirreAwareApp's in the provided package.
Squirrel is looking into "lib" folder for the SquirrelAwareValue. In most framework dependent app, the SquirrelAwareValue will be in "lib%framework%" folder. Is it better to search SquirrelAwareValue in "lib%framework%" folder.

@caesay
Copy link
Member

caesay commented May 26, 2022

You can place your app files into any lib directory. lib/blah is valid, and so is lib/framework.

The reason you are getting this message is because you have not marked any executables as SquirrelAware by following the readme and adding the required entry to your application manifest.

Please review the Readme, confirm you have completed the steps and re-open an issue if you are still having problems.

@caesay caesay closed this as completed May 26, 2022
@caesay caesay added the question Further information is requested label May 26, 2022
@WuYin-Lyu
Copy link
Author

WuYin-Lyu commented May 27, 2022

thanks.
"dotnet publish" did not include manifest file, which cause the problem

@ypicard
Copy link

ypicard commented Jun 8, 2022

How did you fix this @WuYin-Lyu ?

@ypicard
Copy link

ypicard commented Jun 8, 2022

I do not understand how you specify the SquirrelAwareVersion .

I have added [assembly: AssemblyMetadata("SquirrelAwareVersion", "1")] to my AssemblyInfo.cs but this does not work, and i still get:

[ERRO] System.ArgumentException: There are no SquirreAwareApp's in the provided package.
Please mark an exe as aware using the assembly manifest, or use the '--allowUnaware' argument 
to skip this validation and create a package anyway (not recommended).

@caesay
Copy link
Member

caesay commented Jun 8, 2022

Hi, @ypicard, please review the main readme.md. This fork does not support the AssemblyMetadata attribute, you must mark your binary as Squirrel aware by following the quick-start guide and adding to your assembly manifest.

@ypicard
Copy link

ypicard commented Jun 8, 2022

All right, I have not found where it is specifically said that AssemblyMetadata is not supported, sorry. I am quite new to the Windows / c# / dotnet world and did not know about the difference.

In the readme, the following is stated:

Add SquirrelAwareVersion to your assembly manifest to indicate that your exe supports Squirrel.

<?xml version="1.0" encoding="utf-8"?>
<assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1">
  <SquirrelAwareVersion xmlns="urn:schema-squirrel-com:asm.v1">1</SquirrelAwareVersion>
</assembly>

I am currently working on a c# project. Would you be able to tell me where I am supposed to add this specifically? in the .csproj file? With what syntax? It seems to require ItemGroup, Property or some other nesting to be valid.

Thank you very much for the help.

@caesay
Copy link
Member

caesay commented Jun 8, 2022

If you are using Visual Studio

  1. Right click your project in the solution explorer and add a new item
    image
  2. Choose to add a new Application Manifest File
    image
  3. Replace the contents of that file with the text from the readme
    <?xml version="1.0" encoding="utf-8"?>
    <assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1">
      <SquirrelAwareVersion xmlns="urn:schema-squirrel-com:asm.v1">1</SquirrelAwareVersion>
    </assembly>

If you are not using Visual Studio

  1. Create a new file called app.manifest in the same directory as your .csproj file.

  2. Set the contents of the file to the xml shown above

  3. Add the following lines to your csproj:

    <PropertyGroup>
      <ApplicationManifest>app.manifest</ApplicationManifest>
    </PropertyGroup>

@ypicard
Copy link

ypicard commented Jun 10, 2022

This is exactly what I was looking for... Thank you so much for the detailed answer.

@knd775
Copy link

knd775 commented Jun 10, 2022

My problem is that when using a single file self-contained executable, this doesn't work. The executable itself doesn't use my manifest, but the embedded dll does. Any workarounds or other options?

@caesay
Copy link
Member

caesay commented Jun 10, 2022

I can confirm that the manifest is included in the final exe in every variation of published dotnet app. Including self contained and publishsinglefile. If the manifest is not present, please check and share your build instructions and csproj contents.

@caesay
Copy link
Member

caesay commented Jun 10, 2022

Alternatively, for those who do not wish to use an assembly manifest, you can create a file called YourFile.exe.squirrel in your build output directory and set the contents of the file to 1.

@caesay caesay pinned this issue Jun 12, 2022
@rzamponiAtIgt
Copy link

Is there a specific reason why you removed the possibility to simply set the AssemblyMetadataAttribute?
In our company we used a custom SDK to create AssemblyMetadataAttributes with the required squirrel.windows properties SquirrelAwareVersion, SquirrelAppName and SquirrelInstallerOutputPath during build. While the usage of the <YourFile.exe.squirrel> file is a valid workaround it feels a bit clumsy in comparison to the attribute.

@caesay
Copy link
Member

caesay commented Jun 17, 2022

Yes, there are a few reasons. Searching for the attribute requires a dependency on Mono.Cecil which is not a light weight dependency and has been known to have bugs and cause issues in Squirrel.Windows.

It requires us to find and load the .net assembly with Mono.Cecil, which is not possible if the application is .net core because the entry assembly is a native exe and not a .net dll. There is a work-around for self-contained but non-bundled apps where we can try and find the entry dll by replacing .exe with .dll and hoping it exists, but this work-around does not work for apps created with PublishSingleFIle.

Also, this attribute is not viable for native apps using Squirrel, meaning we need to provide several different approaches for marking a binary as SquirrelAware for .net and for native applications, whereas the sidecar file (your.exe.squirre) and the application manifest (<SquirrelAwareVersion>1</SquirrelAwareVersion>) work uniformly for all the aforementioned cases.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

5 participants