Mono: set the program to run on startup for an alternate OS

I have an application that is programmed in C # 3.5 under Windows. This application is also Mono compatible, so it is also used on Mac OS and Linux operating system.

My application has a "Run on startup" option. At the moment it is inactive when the operating system is not a window as I am using the registry.

But I am looking for a way to accomplish the same operation for other operating systems. And that should be doable with Mono. I need at least for macOS (most recent versions) and Linux systems (mostly Ubuntu if it differs from one distro to another).

Edit: This is a "custom app" with a UI ...

+2


source to share


2 answers


Unfortunately, each operating system has different ways to customize it. On Mac + Unix / Linux, you pretty much want this to be a user level parameter.

For Mac, you can check the System Startup options (for non-gui apps) or manually add them to the user's Startup Items.



On Linux, you will have more trouble as differnet distributions handle this differently. To start the system, you often want to add a startup script to /etc/rc.d/rc.local (not -gui, system startup, but this can vary depending on distributions). If this is a user application, for Linux I would leave it to the user and completely take the option as it is usually handled at the user level and the tools vary depending on the desktop environment.

+6


source


For linux:

If you want your application to run as a deamon when the system boots, you need to look at the initscripts, which differ between distributions.



If you want your application to run when the user logs into their desktop, it depends on the user's desktop environment. For example, for kde4, you can put a link to your application in ~ / .kde4 / Autostart.

+2


source







All Articles