I have a Cocoa application that, periodically, needs to install pkg X onto the system. I know that I need to work with the Authentication Services framework to get this going, and I’m reviewing it right now as I’ve never worked with it before.
However, pkg X updates frequently and I don’t want to prompt my users for a password every time my application needs to install it. Is there a way such that I can grant my application a “certificate” of sorts such that, if a user enables a checkbox when prompted for credentials one time, they will never have to re-enter them again?
You can look at Apple’s SMJobBless sample code. Using the technique illustrated there, you can created a privileged helper tool. You would need authentication/authorization once to bless the tool and not again after that. The tool could use
/usr/sbin/installerto install the package.