OK, I get the idea, Thanks. Can't get it to work though. Here's example code: NSString *installedToolPath = [[NSString alloc] initWithFormat:@"file://Library/PrivilegedHelperTools/se.ejeklint.mytool"]; NSDictionary *installedToolDict = [[NSBundle bundleWithURL:[NSURL URLWithString:installedToolPath]] infoDictionary]; and I get a NULL dictionary back. Same goes for the tool embedded in my app. URLs are ok. I have the link flag like this: -sectcreate __TEXT __info_plist "$(SRCROOT)/daemon-info.plist" What have I missed? /Per 17 nov 2010 kl. 16.01 skrev Richard Brown:
Per, The method I use is to get the version number of the installed tool and compare it against the version in the app bundle. Since we know that SMJobBless installs the helper executable in /Library/PrivilegedHelperTools, you can create the URL to /Library/PrivilegedHelperTools/com.yourdomain.yourapp.helper and use NSBundle's + bundleWithURL: method and then call - infoDictionary (or similarly use CFBundleCopyInfoDictionaryForURL) to get the helper tool's info dict. You can then query the dictionary for its version, and decide whether to prompt for blessing rights. HTH, Richard
On Mon, Nov 15, 2010 at 10:00, <launchd-dev-request@lists.macosforge.org> wrote:
From: Per Ejeklint <ejeklint@me.com> To: launchd-dev@lists.macosforge.org Date: Mon, 15 Nov 2010 11:21:07 +0100 Subject: [launchd-dev] Not calling SMJobBless if not needed? This is slightly off-topic I guess but the expertise is definitely on this list. :)
I'm using SMJobBless to install and update a launchd daemon from my app and it works like a charm. Only thing is that the user must authenticate at every launch of the app and not just when the provided daemon is actually newer than the running one. Is there a way work around this with ServiceManagement framework? Or another simple way? I'm new to this part of Mac OS X stuff, so I apologize if I'm posting to the wrong list.
/Per