diff --git a/Autoupdate/AppInstaller.m b/Autoupdate/AppInstaller.m index 4cbd6990..fdeba401 100644 --- a/Autoupdate/AppInstaller.m +++ b/Autoupdate/AppInstaller.m @@ -430,8 +430,8 @@ static const NSTimeInterval SUDisplayProgressTimeDelay = 0.7; dispatch_async(dispatch_get_main_queue(), ^{ // This flag has an impact on interactive type installations and showing UI progress during non-interactive installations self.shouldShowUI = (BOOL)showsUI; - // We only allow relaunching if the application has been alive - self.shouldRelaunch = (BOOL)relaunch && !self.terminationListener.terminated; + // Don't test if the application was alive initially, leave that to the progress agent if we decide to relaunch + self.shouldRelaunch = (BOOL)relaunch; if (self.performedStage1Installation) { // Resume the installation if we aren't done with stage 2 yet, and remind the client we are prepared to relaunch @@ -513,9 +513,9 @@ static const NSTimeInterval SUDisplayProgressTimeDelay = 0.7; NSData *sendData = [NSData dataWithBytes:&targetTerminated length:sizeof(targetTerminated)]; [self.communicator handleMessageWithIdentifier:SPUInstallationFinishedStage2 data:sendData]; - if (!self.terminationListener.terminated) { - [self.agentConnection.agent sendTerminationSignal]; - } + // Don't check if the target is already terminated, leave that to the progress agent + // We could be slightly off if there were multiple instances running + [self.agentConnection.agent sendTerminationSignal]; }); } else { SULog(@"Error: Failed to resume installer on stage 2 because installation cannot be installed silently"); diff --git a/Sparkle/InstallerProgress/InstallerProgressAppController.m b/Sparkle/InstallerProgress/InstallerProgressAppController.m index 6654cd7d..c419a1df 100644 --- a/Sparkle/InstallerProgress/InstallerProgressAppController.m +++ b/Sparkle/InstallerProgress/InstallerProgressAppController.m @@ -234,7 +234,7 @@ static const NSTimeInterval SUTerminationTimeDelay = 0.3; - (void)sendTerminationSignal { dispatch_async(dispatch_get_main_queue(), ^{ - if (!self.willTerminate && self.applicationBundle != nil && self.applicationInitiallyAlive) { + if (!self.willTerminate && self.applicationBundle != nil) { // Note we are sending an Apple quit event, which gives the application or user a chance to delay or cancel the request, which is what we desire for (NSRunningApplication *runningApplication in [self runningApplicationsWithBundle:self.applicationBundle]) { [runningApplication terminate];