Mac OS 10.8.3. This simple app runs from a custom protocol when clicking a link in the browser, for example run .
Compiled the .app with xCode, unsigned.
Works on most machines but not on some. One that doesn't work is Mac OS 10.8.2 with the gatekeeper OFF. It gives the error "failed for weird reason (13)". I guess this has got to do with permission or security. I tried chmoding Contents/MacOS/Binary to 777, but still the same.
Do I have to sign it will Apple dev certificate to make it work, or do something else in the code or plist to make it work on all machines?
plist
<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleURLSchemes</key>
<array>
<string>protocoltest</string>
</array>
<key>CFBundleURLName</key>
<string>com.TestWebLauncher</string>
</dict>
</array>
AppDelegate.m
#import "AppDelegate.h"
@implementation AppDelegate
@synthesize window = _window;
- (void)applicationDidFinishLaunching:(NSNotification *)aNotification
{
if ([invokeUrl length] == 0)
{
invokeUrl = @"no url";
}
[txt setStringValue:invokeUrl];
}
- (id)init
{
[[NSAppleEventManager sharedAppleEventManager] setEventHandler:self andSelector:@selector(handleURLEvent:withReplyEvent:) forEventClass:kInternetEventClass andEventID:kAEGetURL];
return [super init];
}
- (BOOL)handleURLEvent:(NSAppleEventDescriptor*)event withReplyEvent:(NSAppleEventDescriptor*)replyEvent
{
NSString* url = [[event paramDescriptorForKeyword:keyDirectObject] stringValue];
NSLog(@"%@", url);
invokeUrl = url;
return YES;
}
@end