electron-squirrel-startup
electron-squirrel-startup copied to clipboard
Does app.quit() terminates the application immediately?
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
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