SMLoginItemSetEnabled ACL Problem
SMLoginItemSetEnabled ACL Problem
- Subject: SMLoginItemSetEnabled ACL Problem
- From: Pax <email@hidden>
- Date: Thu, 25 Apr 2013 16:16:44 +0100
Forgive me for having two questions in flight at once. This is an entirely separate issue - and this might not even be the right forum for it. I can't find a sandbox / app store forum to ask though.
My app should be able to launch itself at start up - but the helper app doesn't seem to work. In fact, it doesn't even launch! All I get is this error:
25/04/2013 12:53:33.376 xpcd[226]: (null): Code identity[pid: 273::com.PaxSoftware.DeviceInfoLoginHelperApp (/Applications/DeviceInfo.app/Contents/Library/LoginItems/DeviceInfoLoginHelperApp.app)] is not in ACL for container: ~/Library/Containers/com.PaxSoftware.DeviceInfoLoginHelperApp/Data -- allowing access.
I haven't attached any source code because it's not getting as far as executing anything. If anyone can suggest what I might look at (probably a plist, I'd have thought - so I've included those settings), I'd be most grateful.
Plist:
Bundle identifier = com.PaxSoftware.${PRODUCT_NAME:rfc1034identifier}
Application is background only = true
The login helper App is included in the main app, and the code in the main app seems to function correctly:
- (IBAction)autoLaunchChange:(id)sender
{
// Creating helper app complete URL
NSURL *url = [[NSURL fileURLWithPath:[[NSBundle mainBundle] bundlePath]] URLByAppendingPathComponent:
@"Contents/Library/LoginItems/DeviceInfoLoginHelperApp.app"];
// Registering helper app
if (LSRegisterURL((__bridge CFURLRef)url, true) != noErr)
{
NSLog(@"LSRegisterURL failed!");
}
if (!SMLoginItemSetEnabled ((CFStringRef)@"com.PaxSoftware.DeviceInfoLoginHelperApp", ([autoLaunch state]==NSOnState)))
{
[
autoLaunch setState:NSOffState];
NSAlert *alert = [NSAlert alertWithMessageText:@"An error occurred"
defaultButton:@"OK"
alternateButton:nil
otherButton:nil
informativeTextWithFormat:@"Couldn't set DeviceInfo Launch State."];
[alert runModal];
}
}
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden