27 Jan
2011
27 Jan
'11
5:49 p.m.
On 1/25/2011 6:10 PM, "Iceberg-Dev" <dev.iceberg@gmail.com> wrote:
By payload, do you mean an installation package payload?
If so, then you need to require root/admin authentication in the installation package (to be able to install stuff in /Library/ LaunchDaemons/.
And you don't need both a postinstall and postupgrade scripts. A postflight script is enough if you're using a bundle package. A postinstall script is OK if you are using a flat package.
You don't need to use whoami. Just use sudo before /bin/launchctl.
To clarify, I did mean the payload. In my case, I'm using The Luggage to build the package, so the authorization defaults it sets work. Good point about postflight, as I will be creating a bundle package for the time being.