Closed WuYin-Lyu closed 2 years ago
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.
thanks. "dotnet publish" did not include manifest file, which cause the problem
How did you fix this @WuYin-Lyu ?
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).
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.
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.
<?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>
app.manifest
in the same directory as your .csproj
file. Add the following lines to your csproj:
<PropertyGroup>
<ApplicationManifest>app.manifest</ApplicationManifest>
</PropertyGroup>
This is exactly what I was looking for... Thank you so much for the detailed answer.
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?
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.
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
.
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
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.
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.