-
Notifications
You must be signed in to change notification settings - Fork 96
How to get Electron app to start on system startup? #115
Comments
There is a npm package which works great with electron for that! |
Yep. |
Can you please help me out with step wise commands to create an auto-launch electron app? I have some way of doing that. Kindly have a look and let me know what to change in this as I'm getting error with npm install electron-prebuilt --save-dev command ? Please go through this link https://stackoverflow.com/questions/45632502/getting-error-while-executing-npm-install-save-dev-electron-prebuilt?noredirect=1#comment78224205_45632502 to see exactly what is happening when I run this command STEPS : mkdir dirname Thank you for your support in advance. |
Since this issue was opened, an API has been added to Electron for starting the app at login: https://electron.atom.io/docs/api/app/#appsetloginitemsettingssettings-macos-windows |
@zeke thank you, i tried it like this, const exeName = path.basename(process.execPath); it works for me on windows. but the demo of this api in doc is not correct, the path should be the folder of your app which you want to auto startup. |
@luoboding you mean in the electron/electron docs? If so, would you be able to open a pull request that corrects it? |
sorry @zeke , my mistake, i think i misunderstand 'process, execPath' which means the path of app you are running, not the folder, i test the official demo, it works fine. sorry about that. |
Question for Windows (NSIS): What @luoboding is doing only works for me after I have run the app manually at least once. This means that if I'm using It would seem that all I need to do is to add the app to the Startup menu in the Windows start menu as a part of the installer. Surely this must be possible somehow? Yet has eluded me for some time now. Anybody knows how to pull this off? |
@RedDeathAt614 i use NSIS to pack my app, app will be opened automatically when installation is finished. |
Thanks @luoboding If anybody's interested I ended up solving it by setting
Hence just setting a key in the registry database to start the app on login and remove it again when the app is uninstalled. This seems to work nicely. |
请问如何禁止让项目在安装的时候自动启动? |
@zhao2258 you should open a new issue. |
@zhao2258 i hope this could help you. https://www.electron.build/configuration/nsis |
Sir I want to close my developer tool on click cntrl + shift + I WebPreferences = new WebPreferences |
In the index.js file, comment out this line: |
I'm having some trouble getting my Electron app to start on system startup, does anyone know how this could be done?
Ideally, I could provide users with an ability to toggle this functionality in the Electron main window menu.
The text was updated successfully, but these errors were encountered: