I am writing an application which is capable of running as a regular application – with a GUI, AND as a ‘daemon’ – servicing other GUI based applets.
The user is expected to decide in which mode they want to run the application.
The questions are:
-
Can this be done? On Windows, I am able to do this by allowing user to ‘install as a service’ and I can programmatically check if the application HAS been started as a service or not – and take the appropriate code path. What is the equivalent in MacOS?
-
On startup, how do I check if the application is being launched in regular mode, or launched as a daemon
-
What are the system interactions which I need to specifically hook into if it is launched as a daemon.