Skip to content

Instantly share code, notes, and snippets.

@kellysutton
Last active December 16, 2015 17:39
Show Gist options
  • Save kellysutton/5471922 to your computer and use it in GitHub Desktop.
Save kellysutton/5471922 to your computer and use it in GitHub Desktop.
Magic sauce
NSString *pathToRelaunch = [host bundlePath];
if ([[updater delegate] respondsToSelector:@selector(pathToRelaunchForUpdater:)])
pathToRelaunch = [[updater delegate] pathToRelaunchForUpdater:updater];
NSString *relaunchToolPath = [relaunchPath stringByAppendingPathComponent: @"/Contents/MacOS/finish_installation"];
[NSTask launchedTaskWithLaunchPath: relaunchToolPath arguments:[NSArray arrayWithObjects:[host bundlePath], pathToRelaunch, [NSString stringWithFormat:@"%d", [[NSProcessInfo processInfo] processIdentifier]], tempDir, relaunch ? @"1" : @"0", nil]];
[NSApp terminate:self];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment