I've created an Electron app and used the npm run make
command, which runs electron-forge make
. Everything works fine, but when running the generated installer "Setup.exe" by @electron-forge/maker-squirrel
, the application opens simultaneously with a loading GIF. After the GIF finishes loading, both the GIF and the application close and then reopen. I don't want the app to open before the GIF closes, or at least not be visible. Any suggestions on how to handle this behavior?
"dependencies": {
"electron-squirrel-startup": "^1.0.0"
},
"devDependencies": {
"@electron-forge/cli": "^7.2.0",
"@electron-forge/maker-deb": "^7.2.0",
"@electron-forge/maker-rpm": "^7.2.0",
"@electron-forge/maker-squirrel": "^7.2.0",
"@electron-forge/maker-zip": "^7.2.0",
"@electron-forge/plugin-auto-unpack-natives": "^7.2.0",
"electron": "28.0.0",
"electron-reloader": "^1.2.3"
}
"scripts": {
"start": "electron-forge start",
"package": "electron-forge package",
"make": "electron-forge make",
"publish": "electron-forge publish",
"lint": "echo \"No linting configured\""
},
I have consulted the following documentation without success:
Adding this code to your main.js should work:
if (require("electron-squirrel-startup")) {
app.quit();
}