electron-squirrel-startup icon indicating copy to clipboard operation
electron-squirrel-startup copied to clipboard

Check if NO installer running?

Open MTRNord opened this issue 8 years ago • 7 comments

How can I check if NO installer is running? Because when it runs the Autoupdater crash because there is an lock file.

MTRNord avatar Sep 16 '16 07:09 MTRNord

This seems like a good enhancement.....not sure how it would be implemented though because basically the solution to that is to not autoUpdater.checkForUpdates when --squirrel-firstrun is in the app args (see https://github.com/electron/electron/issues/7155#issuecomment-245993316)

ccnokes avatar Jun 06 '17 03:06 ccnokes

Can it be done with electron-builder?

var autoUpdater = require('electron-auto-updater').autoUpdater;
let squirrelEvent = process.argv[1];
if (squirrelEvent !== '--squirrel-firstrun')
   autoUpdater.checkForUpdates();

kuworking avatar Jul 25 '17 10:07 kuworking

Electron-builder doesn't use Squirrel.windows by default.

develar avatar Jul 25 '17 10:07 develar

Then how can we detect the '--squirrel-firstrun' when using electron-builder?

kuworking avatar Jul 25 '17 10:07 kuworking

Please file issue to electron-builder and explain what do you want to achieve.

develar avatar Jul 25 '17 10:07 develar

It is the same issue asked here: How to avoid Autoupdater crashing when squirrel is doing its first run?

In order to avoid that we'd need to detect the --squirrel-firstrun flag, so in order to answer this question, we need to answer this other question: how can we detect the --squirrel-firstrun flag with Electron-builder?

If you suggest so I will open a separated issue, but in my eyes it would be redundant to this one

kuworking avatar Jul 25 '17 10:07 kuworking

If you can — just do not use Squirrel, default target for Windows is nsis.

develar avatar Jul 25 '17 10:07 develar