diff --git a/InstallerLauncher/SUInstallerLauncher.m b/InstallerLauncher/SUInstallerLauncher.m index 2a66af53..87843837 100644 --- a/InstallerLauncher/SUInstallerLauncher.m +++ b/InstallerLauncher/SUInstallerLauncher.m @@ -9,6 +9,7 @@ #import "SUInstallerLauncher.h" #import "SUFileManager.h" #import "SULog.h" +#import @implementation SUInstallerLauncher @@ -23,15 +24,14 @@ SULog(@"Failed to release quarantine on installer at %@ with error %@", installerPath, quarantineError); } - BOOL taskDidLaunch = NO; - @try { - [NSTask launchedTaskWithLaunchPath:installerPath arguments:arguments]; - taskDidLaunch = YES; - } @catch (NSException *exception) { - SULog(@"Raised exception when launching update tool: %@", exception); + NSError *launchError = nil; + NSRunningApplication *runningApplication = [[NSWorkspace sharedWorkspace] launchApplicationAtURL:[NSURL fileURLWithPath:installerPath] options:NSWorkspaceLaunchDefault configuration:@{NSWorkspaceLaunchConfigurationArguments : arguments} error:&launchError]; + + if (runningApplication != nil) { + SULog(@"Failed to launch AutoUpdate app with error: %@", launchError); } - completionHandler(taskDidLaunch); + completionHandler(runningApplication != nil); }); } diff --git a/Sparkle/SUInstallerDriver.m b/Sparkle/SUInstallerDriver.m index 7663f981..cc062056 100644 --- a/Sparkle/SUInstallerDriver.m +++ b/Sparkle/SUInstallerDriver.m @@ -360,7 +360,7 @@ } } - NSString *relaunchToolPath = [[NSBundle bundleWithPath:relaunchPath] executablePath]; + NSString *relaunchToolPath = [[NSBundle bundleWithPath:relaunchPath] bundlePath]; if (!relaunchToolPath || ![[NSFileManager defaultManager] fileExistsAtPath:relaunchPath]) { // Note that we explicitly use the host app's name here, since updating plugin for Mail relaunches Mail, not just the plugin. NSError *error =