--- ApplicationController.h.orig 2011-08-04 21:55:51.000000000 +0200 +++ ApplicationController.h 2011-08-04 21:56:11.000000000 +0200 @@ -30,8 +30,6 @@ - (IBAction)openPreferencesWindow:(id)sender; - (IBAction)showAboutPanel:(id)sender; -- (IBAction)installCliTool:(id)sender; - - (IBAction)saveAction:sender; - (IBAction) showHelp:(id) sender; --- ApplicationController.m.orig 2011-08-04 21:55:57.000000000 +0200 +++ ApplicationController.m 2011-08-04 21:57:31.000000000 +0200 @@ -123,48 +123,6 @@ [NSApp orderFrontStandardAboutPanelWithOptions:dict]; } -- (IBAction)installCliTool:(id)sender; -{ - BOOL success = NO; - NSString* installationPath = @"/usr/local/bin/"; - NSString* installationName = @"gitx"; - NSString* toolPath = [[NSBundle mainBundle] pathForResource:@"gitx" ofType:@""]; - if (toolPath) { - AuthorizationRef auth; - if (AuthorizationCreate(NULL, kAuthorizationEmptyEnvironment, kAuthorizationFlagDefaults, &auth) == errAuthorizationSuccess) { - char const* mkdir_arg[] = { "-p", [installationPath UTF8String], NULL}; - char const* mkdir = "/bin/mkdir"; - AuthorizationExecuteWithPrivileges(auth, mkdir, kAuthorizationFlagDefaults, (char**)mkdir_arg, NULL); - char const* arguments[] = { "-f", "-s", [toolPath UTF8String], [[installationPath stringByAppendingString: installationName] UTF8String], NULL }; - char const* helperTool = "/bin/ln"; - if (AuthorizationExecuteWithPrivileges(auth, helperTool, kAuthorizationFlagDefaults, (char**)arguments, NULL) == errAuthorizationSuccess) { - int status; - int pid = wait(&status); - if (pid != -1 && WIFEXITED(status) && WEXITSTATUS(status) == 0) - success = true; - else - errno = WEXITSTATUS(status); - } - - AuthorizationFree(auth, kAuthorizationFlagDefaults); - } - } - - if (success) { - [[NSAlert alertWithMessageText:@"Installation Complete" - defaultButton:nil - alternateButton:nil - otherButton:nil - informativeTextWithFormat:@"The gitx tool has been installed to %@", installationPath] runModal]; - } else { - [[NSAlert alertWithMessageText:@"Installation Failed" - defaultButton:nil - alternateButton:nil - otherButton:nil - informativeTextWithFormat:@"Installation to %@ failed", installationPath] runModal]; - } -} - /** Returns the support folder for the application, used to store the Core Data store file. This code uses a folder named "GitTest" for