mirror of
https://github.com/sparkle-project/Sparkle
synced 2026-11-24 04:38:16 +00:00
Simplify code path.
This commit is contained in:
1 parent
223436a6b7
commit
bfaeffc8f9
1 file changed
+2
-3
Vendored
+2
-3
@@ -352,11 +352,10 @@
|
||||
}
|
||||
|
||||
NSBundle *sparkleBundle = [NSBundle bundleWithIdentifier:SUBundleIdentifier];
|
||||
NSString *const finishInstallToolName = [[sparkleBundle infoDictionary] objectForKey:SURelaunchToolNameKey];
|
||||
|
||||
// Copy the relauncher into a temporary directory so we can get to it after the new version's installed.
|
||||
// Only the paranoid survive: if there's already a stray copy of relaunch there, we would have problems.
|
||||
NSString *relaunchPathToCopy = [sparkleBundle pathForResource:finishInstallToolName ofType:@"app"];
|
||||
NSString *const relaunchPathToCopy = [sparkleBundle pathForResource:[[sparkleBundle infoDictionary] objectForKey:SURelaunchToolNameKey] ofType:@"app"];
|
||||
if (relaunchPathToCopy != nil)
|
||||
{
|
||||
NSString *targetPath = [[self.host appSupportPath] stringByAppendingPathComponent:[relaunchPathToCopy lastPathComponent]];
|
||||
@@ -386,7 +385,7 @@
|
||||
if ([updaterDelegate respondsToSelector:@selector(pathToRelaunchForUpdater:)]) {
|
||||
pathToRelaunch = [updaterDelegate pathToRelaunchForUpdater:self.updater];
|
||||
}
|
||||
NSString *relaunchToolPath = [[self.relaunchPath stringByAppendingPathComponent:@"/Contents/MacOS"] stringByAppendingPathComponent:finishInstallToolName];
|
||||
NSString *relaunchToolPath = [[NSBundle bundleWithPath:self.relaunchPath] executablePath];
|
||||
[NSTask launchedTaskWithLaunchPath:relaunchToolPath arguments:@[[self.host bundlePath],
|
||||
pathToRelaunch,
|
||||
[NSString stringWithFormat:@"%d", [[NSProcessInfo processInfo] processIdentifier]],
|
||||
|
||||
Reference in new issue
Block a user