I am working on a project that uses Electron.NET and Blazor. I am looking for a solution how to start it automatically on OS(Win || MAC || Linux) start. ElectronNET.API -> Version="9.31.2" .NET Version = netcoreapp3.1
Asked
Active
Viewed 98 times
1 Answers
0
There is a folder in Windows 10/11 located at %AppData%\Microsoft\Windows\Start Menu\Programs\Startup
. If you put a shortcut to your app in there it will run at startup for the current user.
If you want to run at startup for all users you will need:
- admin escalation
- create a task in Windows Task Scheduler with the trigger
When the computer starts
I don't know how to do any of that on a Mac/Linux, but likely the basic process will be the same:
- find an o/s specific way of starting a program
- get your app to detect the platform it's running on
- invoke said process putting shortcuts, links or config entries in the right places
I don't think Electron/ElectronNET has any specific helpers for this sort of thing.
There is an npm library called auto-launch
that you would use if you were building Electron rather than ElectronNET. See NPM - auto-launch and also this article on how to use it in Electron. You might be able to port something into your app from there.

Richard Hauer
- 1,298
- 9
- 22