diff --git a/Plugin/Sparkle/SUUIBasedUpdateDriver.m b/Plugin/Sparkle/SUUIBasedUpdateDriver.m index 2e83c9e4..2dfef64e 100644 --- a/Plugin/Sparkle/SUUIBasedUpdateDriver.m +++ b/Plugin/Sparkle/SUUIBasedUpdateDriver.m @@ -141,7 +141,17 @@ - (void)installUpdate { [statusController beginActionWithTitle:SULocalizedString(@"Installing update...", @"Take care not to overflow the status window.") maxProgressValue:0 statusText:nil]; [statusController setButtonEnabled:NO]; - [super installUpdate]; + [super installUpdate]; + + // modification by @simX, 2009-07-02; if a user chooses to not relaunch + // the app, the status window still stays on the screen; with this fix, + // it doesn't; unsure if this is the best place to do this, but it seems + // to work + if (statusController) + { + [statusController close]; + [statusController autorelease]; + } } - (void)abortUpdateWithError:(NSError *)error diff --git a/Plugin/SparkleManager.m b/Plugin/SparkleManager.m index 886aa511..e7ecad8d 100644 --- a/Plugin/SparkleManager.m +++ b/Plugin/SparkleManager.m @@ -124,6 +124,30 @@ - (NSString*)pathToRelaunchForUpdater:(SUUpdater*)updater { return _pathToRelaunch; } +- (BOOL)updater:(SUUpdater *)updater +shouldPostponeRelaunchForUpdate:(SUAppcastItem *)update + untilInvoking:(NSInvocation *)invocation; +{ + NSString *appNameString = [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleName"]; + int relaunchResult = NSRunAlertPanel([NSString stringWithFormat:@"Relaunch %@ now?",appNameString], + [NSString stringWithFormat:@"To use the new features of ClickToFlash, %@ needs to be relaunched.",appNameString], + @"Relaunch", + @"Do not relaunch", + nil); + + BOOL shouldPostpone = YES; + if (relaunchResult == NSAlertDefaultReturn) { + // we want to relaunch now, so don't postpone the relaunch + + shouldPostpone = NO; + } else { + // we want to postpone the relaunch and let the user decide when to do so, + // so we don't even bother with saving the invocation and reinvoking + // it later + } + return shouldPostpone; +} + - (NSString *)pathToRelaunch { return _pathToRelaunch;