Electron Squirrel.Windows: .msi not working

2.6k views Asked by At

I developed an Electron app and with the use of eletron-packager and then electron-squirrel-startup I created .exe and .msi installer files. The .exe file is working fine, but the .msi is not. It looks like it just stops at some point and turns off. In the Control Panel I can see “my_app Machine-Wide Installer”, I am not sure if that is the desired effect, but nonetheless, my_app is not installed.

I have a pretty basic handleSquirrelEvents function:

switch (squirrelEvent) {
    case '--squirrel-install':
    case '--squirrel-updated':
        // Optionally do things such as:
        // - Add your .exe to the PATH
        // - Write to the registry for things like file associations and
        //   explorer context menus

        // Install desktop and start menu shortcuts
        spawnUpdate(['--createShortcut', exeName]);

        setTimeout(application.quit, 1000);
        return true;

    case '--squirrel-uninstall':
        // Undo anything you did in the --squirrel-install and
        // --squirrel-updated handlers

        // Remove desktop and start menu shortcuts
        spawnUpdate(['--removeShortcut', exeName]);

        setTimeout(application.quit, 1000);
        return true;

    case '--squirrel-obsolete':
        // This is called on the outgoing version of your app before
        // we update to the new version - it's the opposite of
        // --squirrel-updated

        application.quit();
        return true;
}

It's a bit far-fetched but maybe it has something to do with digital signatures?

2

There are 2 answers

0
madasionka On BEST ANSWER

I found this : https://github.com/Squirrel/Squirrel.Windows/blob/master/docs/using/machine-wide-installs.md

It says:

Machine-wide Installs Squirrel's Releasify command generates an MSI file suitable for installation via Group Policy. This MSI isn't a general-purpose installer, this means that once you run the MSI, users from now on will get the app installed, on next Login.

So, most normal users should continue to run the Setup.exe's generated by Releasify, but if you want to have an IT Admin Friendly version, you can hand off the MSI

Most users of Squirrel won't have to do anything new to enable this behavior, though certain NuGet package IDs / names might cause problems with MSI.

It looks like my .msi is working just fine only I expected different results.

2
Stein Åsmul On

Just a first suggestion - it is not a real answer. I will update as we get more information: if you have the Windows SDK installed you can search for Orca-x86_en-us.msi. Install this MSI and you will get access to "Orca" - an MSI file viewer. Open your MSI in Orca and run validation via Tools -> Validate. Click Go (and perhaps uncheck the tick box for INFO messages). There should be a shortcut to Orca added to your start menu. Please update your answer with any error messages.