Launch AutoUpdate via LaunchServices again.

I was being stupid for trying to launch the executable rather than the app.
This commit is contained in:
Zorg committed 2016-04-02 05:34:31 -04:00
1 parent a3a2310952
commit 38a69cee5b
2 files changed
+8 -8

No files matched your search

+7 -7
View File
@@ -9,6 +9,7 @@
#import "SUInstallerLauncher.h"
#import "SUFileManager.h"
#import "SULog.h"
#import <AppKit/AppKit.h>
@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);
});
}
+1 -1
View File
@@ -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 =