Squirrel.Windows: .net core .exes are not detected as squirrel apps even with SquirrelAwareVersion
Squirrel version(s) 1.9.1
Description
I am deploying a .net core 3 console application with squirrel, which mostly works. But the tool is not detected as a squirrel aware app so never gets called with --squirrel-install
when being installed. This is despite the fact that I have added the required SquirrelAwareVersion
version info to the file.
I can tell why it is happening and it is due to the fact that Squirrel is looking for the resource under US-English, language, but .net core and then rcedit adds what looks like a universal language resource instead. See below for my generated resource.
I sort of understand the reason for not searching all languages, but could this universal language be added as an additional search for the squirrel-aware setting?
Steps to recreate
md dotnet-test
cd dotnet-test
dotnet new console
dotnet build -r win-x64
- get rcedit-x64 from https://github.com/electron/rcedit/releases/tag/v1.1.1
rcedit-x64.exe bin\Debug\netcoreapp3.1\win-x64\dotnet-test.exe --set-version-string "SquirrelAwareVersion" "1"
Expected behavior If we manage to add the SquirrelAwareVersion to a .net core exe, then it should be detected by squirrel as a squirrel aware application
Actual behavior The tool is not detected as a squirrel aware application
Additional information
Using Resource Hacker I can see that the block that has been created has a different language code (000004b0
) than what squirrel is looking for. I guess this is a universal one when Squirrel is looking for US-English.
BLOCK "000004b0"
{
VALUE "CompanyName", "dotnet-test"
..other standard stuff
VALUE "Assembly Version", "1.0.0.0"
VALUE "SquirrelAwareVersion", "1"
}
About this issue
- Original URL
- State: open
- Created 4 years ago
- Reactions: 1
- Comments: 16 (9 by maintainers)
Commits related to this issue
- Add support for language neutral VersionInfo in target .exes Fixes #1644 — committed to mungojam/Squirrel.Windows by mungojam 4 years ago
- Add support for language neutral VersionInfo in target .exes Fixes #1644 — committed to mungojam/Squirrel.Windows by mungojam 4 years ago
The situation is worse with .net 5 because it includes
createdump.exe
as standard in the deployment. So in all cases you will have at least 2 executables that Squirrel will try and run. I hope my PR can be merged to resolve this.Sorry for the spam. My PR now fully fixes support for .net core. Please give it a test if you can.
Hi, @anaisbetts. Many thanks for all your work on Squirrel over the years. Just wondering if there is any chance you would please be able to merge this or something like this? We want to move our app to Core (now .NET 6) but this is blocking us as we have 2 exe’s in our app. (One of them is a seldom used service that required admin permissions, which we run only when needed so that most users don’t have to worry about elevating). Also, the problem is compounded for every .Net 5 or 6 app, since createdump.exe is now included in published apps, even if they are only one exe.
Is there anything we can do to help with moving this along? If so, please just say the word and we will do our best to assist.
My workaround is to remove the shortcuts right after application start so that the user isn’t aware of this problem…
Really nice @mungojam , I will give this a try.
Sorry, I didn’t get around to it in the end and now I’ve had to move onto other things. I’d love it to get fixed still but the workaround works for our current tools for now.
Fortunately we don’t have that particular problem as we don’t have other exes but the thought had crossed my mind. And we’ve done an even hackier workaround to get the stub executable and shortcut to it to be created automatically for any exe.
I’m glad to see that maintenance of this repo has picked up again. It’s a really neat tool just in need of some loving. I will try and create a PR for this one and have some more confidence now that it will get considered
Unfortunately I ran into the same issue today with my .NET Core 3.1 application which I can’t make SquirrelAware. The problem is, it’s using CefSharp which creates a shortcut on the desktop as well. A workaround is to run the Updater.exe from code:
Update.exe --removeShortcut=CefSharp.BrowserSubprocess.exe
This is a bit hacky though. Have you found a better workaround for this already?