I have created the Mac Package in order to install some of my stuff. I have the postflight script that is supposed to copy over some data to /Library/Application Support/Apple/Mail/Stationery/Apple/Contents/Resources/Stationery/Contents/Resources/ - and for reasons mentioned in here: How can I build a Mac package on linux? (BOM file problem) it needs to be postflight script.
However it did not work (it was just downloading a zip file, unpacking it and cp to mentioned location). So I've checked the errors by adding 2> to cp and here's what happened:
cp: /Library/Application Support/Apple/Mail/Stationery/Apple/Contents/Resources/Stationery/Contents/Resources/: Permission denied
I've double check my Info.plist and looks like proper setting is preserved:
<key>IFPkgFlagAuthorizationAction</key>
<string>RootAuthorization</string>
But the script still don't have permissions. I've tried the "whoami" and it returned currently logged in user. What's more curious, the installer ia actually asking for admin authentication. You guys have any ideas what should I do to have this script running as root/admin/whoever with greater permissions?
I think it's impossible in Lion.Installer of Lion launches scripts from current user.