How do I register a cocoa bundle identifier?
How do I register a cocoa bundle identifier?
- Subject: How do I register a cocoa bundle identifier?
- From: Jules Colding <email@hidden>
- Date: Wed, 20 Aug 2008 15:05:57 +0200
Hi,
I have this cocoa bundle which contains an executable (a shell tool)
in the "Contents/MacOS" directory. I would like to register to bundle
so that I can execute the contained program with "open -b com.
42tools.julia.backend" from the terminal.
I've tried using LSRegisterFSRef() with various paths in the FSRef -
the executablePath, the bundlePath and the path of the "Info.plist"
file as below:
static void
register_bundle(void)
{
FSRef fsref;
OSStatus oss;
NSBundle *bundle = [NSBundle mainBundle];
NSString *plist = [NSString stringWithFormat:@"%@/Contents/
Info.plist", [bundle bundlePath]];
oss = FSPathMakeRef([plist UTF8String], &fsref, NULL);
NSLog(@"FSPathMakeRef = %d", oss);
oss = LSRegisterFSRef(&fsref, true);
NSLog(@"LSRegisterFSRef = %d", oss);
}
LSRegisterFSRef() returns "-10811" ("kLSNotAnApplicationErr") for all
of them. Is there a way to do what I want?
Thanks a lot in advance,
jules
_______________________________________________
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