clowd / Clowd.Squirrel

Quick and easy installer and automatic updates for cross-platform dotnet applications
426 stars 39 forks source link

Debugging Squirrel CLI 2.9? #105

Closed RandomEngy closed 2 years ago

RandomEngy commented 2 years ago

I'm getting this error after upgrading Visual Studio to 17.3:

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).

VS 17.3 still seems to work on a brand new project just fine so it's something with my particular project. But I definitely have the <SquirrelAwareVersion xmlns="urn:schema-squirrel-com:asm.v1">1</SquirrelAwareVersion> in my app.manifest like before, and <ApplicationManifest>app.manifest</ApplicationManifest> in my project file. I also inspected the built DLL with a disassembler and confirmed that the entry is there in the manifest.

I figured that I might be able to download the source and debug to see why exactly it's not detecting it anymore, though it's crashing:

[ERRO] System.Exception: Could not find 'Update.exe'.
   at Squirrel.HelperExe.FindHelperFile(String toFind, Func`2 predicate) in ./Internal/HelperExe.cs:line 81
   at Squirrel.HelperExe.UpdatePath(Func`2 predicate) in ./Internal/HelperExe.cs:line 20
   at SquirrelCli.Program.Releasify(ReleasifyOptions options) in ./Program.cs:line 177
   at SquirrelCli.Program.Pack(PackOptions options) in ./Program.cs:line 149
   at SquirrelCli.CommandAction`1.Execute(IEnumerable`1 args) in ./ValidatedOptionSet.cs:line 168
   at SquirrelCli.CommandSet.Execute(String[] args) in ./ValidatedOptionSet.cs:line 209
   at SquirrelCli.Program.Main(String[] args) in ./Program.cs:line 87

Is there a simple way to get the locally built CLI to run?

caesay commented 2 years ago

If you are using 2.9:

Alternatively, if you have compiled Update.exe somewhere other than the default location, or wish to use pre-built binaries from a NuGet Package, you can tell Squirrel where to look by using the hidden --addSearchPath= parameter.

I also inspected the built DLL with a disassembler and confirmed that the entry is there in the manifest.

Squirrel needs this manifest to exist in the final .exe that dotnet produces. You should verify with ResourceHacker or similar that the final native YourApp.exe has an application manifest containing the Squirrel string, and not just the DLL.

caesay commented 2 years ago

SquirrelAwareExecutableDetector.cs is where you'll find the manifest detection code.

RandomEngy commented 2 years ago

Thanks, this worked perfectly. Found the root cause of my problem, which is that a newer version of dotnet did not accept multiple properties in the same command-line argument to publish, so it wasn't using the publish profile and files were missing from the pack directory.