From 0b640d5d206d98e6fc89d358413f7446a19f5c98 Mon Sep 17 00:00:00 2001 From: Zorg Date: Tue, 19 Apr 2016 20:55:36 -0400 Subject: [PATCH] Fix bug where updated app can think a new update has already been downloaded This is fixed by invalidating the local port connection from Autoupdate right before launching the new update --- Sparkle/Autoupdate/AppInstaller.m | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Sparkle/Autoupdate/AppInstaller.m b/Sparkle/Autoupdate/AppInstaller.m index 304b245e..d29b2a38 100644 --- a/Sparkle/Autoupdate/AppInstaller.m +++ b/Sparkle/Autoupdate/AppInstaller.m @@ -552,6 +552,12 @@ static const NSTimeInterval SUDisplayProgressTimeDelay = 0.7; [installerProgressRunningApplication terminate]; shouldLaunchInstallerProgress = NO; + // Invalidate the local port before re-launching the updated app + // If we don't do this, the updated app could think the installation can be resumable, + // if it checks for updates immediately on launch + [self.localPort invalidate]; + self.localPort = nil; + NSString *installationPath = [SUInstaller installationPathForHost:self.host]; if (self.shouldRelaunch) {