James Harcourt
James Harcourt

Reputation: 6379

Squirrel creating and executing all EXE files in package

We have a new Squirrel package which contains our C# executable (.Net Core 3.0) and the open source NSSM (3rd party EXE).

Just having this EXE present causes it to 1 - get a shortcut and 2 - be executed by Squirrel which is trying to be helpful. However we don't want NSSM to be executed!

In our C# app I have implemented and handled Squirrel events and proven this with a messagebox as shown:

using (var mgr = new UpdateManager("http://updatepath"))
{
    SquirrelAwareApp.HandleEvents(
        onInitialInstall: v => MessageBox.Show("onInitialInstall"),
        onAppUpdate: v => MessageBox.Show("onAppUpdate"),
        onAppUninstall: v => mgr.RemoveShortcutForThisExe(),
        onFirstRun: () => MessageBox.Show("onFirstRun"));
}

My messagebox for `onFirstRun1 handler shows correctly so I know Squirrel events are being handled and my C# app is Squirrel aware.

However, NSSM is still being launched and the Squirrel install log file shows this still:

[20/06/21 18:52:09] info: ApplyReleasesImpl: About to save shortcut: C:\Users\me\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\path\NSSM 32-bit.lnk (target C:\Users\me\AppData\Local\MyInstaller\nssm.exe, workingDir C:\Users\me\AppData\Local\MyInstaller\app-1.0.3, args , toastActivatorCSLID b08a06b3-8113-5e78-bdad-e989db8e9d25) [20/06/21 18:52:09] info: ApplyReleasesImpl: Creating shortcut for nssm.exe => C:\Users\me\Desktop\NSSM 32-bit.lnk [20/06/21 18:52:09] info: ApplyReleasesImpl: About to save shortcut: C:\Users\me\Desktop\NSSM 32-bit.lnk (target C:\Users\me\AppData\Local\MyInstaller\nssm.exe, workingDir C:\Users\me\AppData\Local\MyInstaller\app-1.0.3, args , toastActivatorCSLID b08a06b3-8113-5e78-bdad-e989db8e9d25) [20/06/21 18:52:09] info: ApplyReleasesImpl: Starting fixPinnedExecutables

Upvotes: 0

Views: 1383

Answers (1)

James Harcourt
James Harcourt

Reputation: 6379

From the repo owner:

"I believe the problem here is that .net core creates a stub executable, which doesn't get the squirrel attribute(s) embedded - instead, they end up in your DLL. The solution here would be to update squirrel to play better with .net core, which it seems no one wants to take on."

Upvotes: 0

Related Questions