Permalink
Browse files

Fixes 253187

Added a delegate method called pathToRelaunchForUpdater: which can be used for plugins to provide the path which should be used when relaunching the client after installing an update.
  • Loading branch information...
1 parent d1c0978 commit e249e3cfb6636b54cf095e345191a949a8b3ca2f @andymatuschak andymatuschak committed Jul 31, 2008
Showing with 7 additions and 1 deletion.
  1. +4 −1 SUBasicUpdateDriver.m
  2. +3 −0 SUUpdater.h
View
5 SUBasicUpdateDriver.m
@@ -265,7 +265,10 @@ - (void)relaunchHostApp
return;
}
- [NSTask launchedTaskWithLaunchPath:relaunchPath arguments:[NSArray arrayWithObjects:[host bundlePath], [NSString stringWithFormat:@"%d", [[NSProcessInfo processInfo] processIdentifier]], nil]];
+ NSString *pathToRelaunch = [host bundlePath];
+ if ([[updater delegate] respondsToSelector:@selector(pathToRelaunchForUpdater:)])
+ pathToRelaunch = [[updater delegate] pathToRelaunchForUpdater:updater];
+ [NSTask launchedTaskWithLaunchPath:relaunchPath arguments:[NSArray arrayWithObjects:pathToRelaunch, [NSString stringWithFormat:@"%d", [[NSProcessInfo processInfo] processIdentifier]], nil]];
[NSApp terminate:self];
}
View
3 SUUpdater.h
@@ -89,6 +89,9 @@
// If you don't implement this method or return nil, the standard version comparator will be used.
- (id <SUVersionComparison>)versionComparatorForUpdater:(SUUpdater *)updater;
+// Returns the path which is used to relaunch the client after the update is installed. By default, the path of the host bundle.
+- (NSString *)pathToRelaunchForUpdater:(SUUpdater *)updater;
+
@end
// Define some minimum intervals to avoid DOS-like checking attacks. These are in seconds.

0 comments on commit e249e3c

Please sign in to comment.