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 (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to