Running a preference pane on Mac as root

424 views Asked by At

I have a preference pane installed in /Library/PreferencePanes. I want this preference pane to control an application that is running as root (it's a server). The preference pane bundle is owned by root. However, when I modify the preferences, it saves the results to ~/Library/Preferences. How do I get the results to save to /Library/Preferences instead?

1

There are 1 answers

6
paxswill On BEST ANSWER

Just with a quick look, it seems you'd need to use CFPreferences instead of NSUserDefaults. Also, you will need to elevate priviledges, which is a pain in the ass to do properly. Here's the guide for it, but Lion changed a lot specifically in authorization services, so there might not be a lot of extra info out there.