From 251feb7e0767205c5e80faee186ac41c95507b31 Mon Sep 17 00:00:00 2001 From: Zorg Date: Sat, 27 Aug 2016 02:24:37 -0400 Subject: [PATCH] Rename registerRelaunchBundlePath to registerApplicationBundlePath --- Autoupdate/AppInstaller.m | 2 +- .../InstallerProgressAppController.m | 16 ++++++++-------- .../SPUInstallerAgentProtocol.h | 2 +- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/Autoupdate/AppInstaller.m b/Autoupdate/AppInstaller.m index fdeba401..f6094ad3 100644 --- a/Autoupdate/AppInstaller.m +++ b/Autoupdate/AppInstaller.m @@ -299,7 +299,7 @@ static const NSTimeInterval SUDisplayProgressTimeDelay = 0.7; // For a plug-in this makes a big difference; we want to wait until the app hosting the plug-in terminates // Otherwise for an app, the relaunch path and host path should be identical - [self.agentConnection.agent registerRelaunchBundlePath:self.relaunchPath reply:^(NSNumber * _Nullable processIdentifier) { + [self.agentConnection.agent registerApplicationBundlePath:self.relaunchPath reply:^(NSNumber * _Nullable processIdentifier) { dispatch_async(dispatch_get_main_queue(), ^{ self.terminationListener = [[TerminationListener alloc] initWithProcessIdentifier:processIdentifier]; [self startInstallation]; diff --git a/Sparkle/InstallerProgress/InstallerProgressAppController.m b/Sparkle/InstallerProgress/InstallerProgressAppController.m index c419a1df..936ee814 100644 --- a/Sparkle/InstallerProgress/InstallerProgressAppController.m +++ b/Sparkle/InstallerProgress/InstallerProgressAppController.m @@ -192,17 +192,17 @@ static const NSTimeInterval SUTerminationTimeDelay = 0.3; return [matchedRunningApplications copy]; } -- (void)registerRelaunchBundlePath:(NSString *)relaunchBundlePath reply:(void (^)(NSNumber *))reply +- (void)registerApplicationBundlePath:(NSString *)applicationBundlePath reply:(void (^)(NSNumber *))reply { dispatch_async(dispatch_get_main_queue(), ^{ - if (relaunchBundlePath != nil && !self.willTerminate) { - NSBundle *relaunchBundle = [NSBundle bundleWithPath:relaunchBundlePath]; - if (relaunchBundle == nil) { - SULog(@"Error: Encountered invalid path for waiting termination: %@", relaunchBundlePath); + if (applicationBundlePath != nil && !self.willTerminate) { + NSBundle *applicationBundle = [NSBundle bundleWithPath:applicationBundlePath]; + if (applicationBundle == nil) { + SULog(@"Error: Encountered invalid path for waiting termination: %@", applicationBundlePath); [self cleanupAndExitWithStatus:EXIT_FAILURE]; } - NSArray *runningApplications = [self runningApplicationsWithBundle:relaunchBundle]; + NSArray *runningApplications = [self runningApplicationsWithBundle:applicationBundle]; // We're just picking the first running application to send.. // Ideally we'd send them all and have the installer monitor all of them but I don't want to deal with that complexity at the moment @@ -216,7 +216,7 @@ static const NSTimeInterval SUTerminationTimeDelay = 0.3; reply(processIdentifier); self.repliedToRegistration = YES; - self.applicationBundle = relaunchBundle; + self.applicationBundle = applicationBundle; self.applicationInitiallyAlive = (processIdentifier != nil); } }); @@ -243,7 +243,7 @@ static const NSTimeInterval SUTerminationTimeDelay = 0.3; }); } -// The pathToRelaunch passed to here is not necessarily the same as the one passed in -registerRelaunchBundlePath:reply: if the developer uses SPARKLE_NORMALIZE_INSTALLED_APPLICATION_NAME +// The pathToRelaunch passed to here is not necessarily the same as the one passed in -registerApplicationBundlePath:reply: if the developer uses SPARKLE_NORMALIZE_INSTALLED_APPLICATION_NAME // Note the installer won't tell us to launch an application unless it was already running before - (void)relaunchPath:(NSString *)pathToRelaunch { diff --git a/Sparkle/InstallerProgress/SPUInstallerAgentProtocol.h b/Sparkle/InstallerProgress/SPUInstallerAgentProtocol.h index 7bf8823d..255166c7 100644 --- a/Sparkle/InstallerProgress/SPUInstallerAgentProtocol.h +++ b/Sparkle/InstallerProgress/SPUInstallerAgentProtocol.h @@ -12,7 +12,7 @@ NS_ASSUME_NONNULL_BEGIN @protocol SPUInstallerAgentProtocol -- (void)registerRelaunchBundlePath:(NSString *)relaunchBundlePath reply:(void (^)(NSNumber * _Nullable processIdentifier))reply; +- (void)registerApplicationBundlePath:(NSString *)applicationBundlePath reply:(void (^)(NSNumber * _Nullable processIdentifier))reply; - (void)registerInstallationInfoData:(NSData *)installationInfoData;