3

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?

madasionka
  • 812
  • 2
  • 10
  • 29
  • Can we see this MSI? If we can I am sure we can figure out what is going on. If it is large you can run an [**admin install**](https://stackoverflow.com/questions/1547809/extract-msi-from-exe/24987512#24987512) on it and upload only the base MSI (without embedded cabs) somewhere. That means it can't be installed, but it can be viewed. Read about admin installs in the link above, or just try to run (in a standard command prompt - adjust paths as appropriate): ``msiexec /a File.msi TARGETDIR=C:\MyInstallPoint /qn`` to create one. – Stein Åsmul Sep 15 '17 at 12:37
  • I didn't realize Squirrel made MSI. I thought the last time I checked it only made EXE (per-user autoupdating) – Christopher Painter Sep 15 '17 at 13:55
  • @SteinÅsmul Thanks for answering! I am not sure what you mean. I ran the `cmd` command you mentioned, which created an `.exe` file, that works great (altough I'm still trying to figure out what's wrong with the `.msi`). I don't exactly know you would like me to upload. – madasionka Sep 18 '17 at 08:40

2 Answers2

1

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.

Stein Åsmul
  • 39,960
  • 25
  • 91
  • 164
  • FWIW I've written a few NW and Electron apps and I just package them up using WiX/IsWiX just like any other desktop application. I don't see anything special about them that need their own niche packaging stack. – Christopher Painter Sep 15 '17 at 23:08
  • @SteinÅsmul Thanks, I did what you said and ran the Orca validation which produced no errors. This was useful, because thanks to that I think I found the answer why the `.msi` is not working as I expected (for details see my answer below). – madasionka Sep 18 '17 at 10:03
1

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.

madasionka
  • 812
  • 2
  • 10
  • 29