Launch a System Agent from an Installer script
Launch a System Agent from an Installer script
- Subject: Launch a System Agent from an Installer script
- From: Nick <email@hidden>
- Date: Sun, 11 Dec 2011 07:45:47 +0200
Hello
I am writing a background application, that has to be installed first
using Installer (created using PackageMaker or Packages) and then the
installer should launch the agent for the first time. The application
is a user mode agent, that just shows its icon in Status Bar.
The problem is I can't launch this agent in the right "context".
Installer's PostInstall script is executed with the root privileges,
and if i execute there "launchctl
/Library/LaunchAgents/com.nick.mycoolapp.plist", i get the agent
started in the "root context", not in the current user's context..
Some applications (like Dropbox) install an icon there (i am not sure
if dropbox is an agent, however it autostarts when the system starts
and places its icon on the Status Bar).
Can I somehow get the right context, and execute the script on behalf
of the currently logged in user? Is there any way to "lower"
privileges?
The systems are Snow Leopard and Lion, it also would be great if I
could do that on Leopard.
Thank you!
P.s. where should one send questions related to launchd? It seems that
launchd-dev mailing list has been dropped.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Installer-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden