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

Does app.quit() terminates the application immediately?

Open marcoancona opened this issue 7 years ago • 1 comments

During the startup, I get

Uncaught Exception: Error: Cannot find module './mymodule' ...

The main.js looks like:

...
if (require('electron-squirrel-startup')) app.quit();
...
const Module = require('./mymodule'); 

Also, the event handling seems to take quite some time, like it the app was not actually closing immediately. The installation works fine though, and the app then works correctly when it is launched by the user.

Is the code after app.quit() executed? If so, shouldn't this be prevented somehow?

PS: this issue only appeared after upgrading to last version of electron and electron-squirrel

marcoancona avatar Mar 29 '17 09:03 marcoancona

It seems that the issue is solved by using

app.quit();
process.exit(0);

instead of only app.quit().

See also https://github.com/Squirrel/Squirrel.Windows/issues/446

marcoancona avatar Mar 29 '17 09:03 marcoancona