From 1c09a01ef9fed65195e5970939288676bff8a908 Mon Sep 17 00:00:00 2001 From: Dmytro Tretiakov Date: Thu, 31 Jul 2014 15:09:30 +0300 Subject: [PATCH] Corrected method name. --- SUUpdater.h | 2 +- SUUpdater.m | 2 +- finish_installation.m | 9 +++++++-- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/SUUpdater.h b/SUUpdater.h index e04bc641..b09cf902 100644 --- a/SUUpdater.h +++ b/SUUpdater.h @@ -73,7 +73,7 @@ - (BOOL)updateInProgress; -- (BOOL)isUpdateInProgress; +- (BOOL)installationInProgress; @end diff --git a/SUUpdater.m b/SUUpdater.m index ca329b85..c8d6b13e 100644 --- a/SUUpdater.m +++ b/SUUpdater.m @@ -45,7 +45,7 @@ static NSMutableDictionary *sharedUpdaters = nil; static NSString * const SUUpdaterDefaultsObservationContext = @"SUUpdaterDefaultsObservationContext"; -- (BOOL)isUpdateInProgress +- (BOOL)installationInProgress { BOOL result = NO; @try diff --git a/finish_installation.m b/finish_installation.m index 582c15f4..59c2ba1f 100644 --- a/finish_installation.m +++ b/finish_installation.m @@ -54,6 +54,13 @@ selfPath: (NSString*)inSelfPath alreadyInstalled:(BOOL)inalreadyInstalled shouldRelaunch = relaunch; alreadyInstalled = inalreadyInstalled; + if (NULL != hostpath) + { + NSString *bundlePath = [[NSFileManager defaultManager] stringWithFileSystemRepresentation:hostpath length:strlen(hostpath)]; + NSBundle *theBundle = [NSBundle bundleWithPath:bundlePath]; + host = [[SUHost alloc] initWithBundle: theBundle]; + } + BOOL alreadyTerminated = (getppid() == 1); // ppid is launchd (1) => parent terminated already if( alreadyTerminated ) @@ -143,8 +150,6 @@ selfPath: (NSString*)inSelfPath alreadyInstalled:(BOOL)inalreadyInstalled - (void) install { - NSBundle *theBundle = [NSBundle bundleWithPath: [[NSFileManager defaultManager] stringWithFileSystemRepresentation: hostpath length:strlen(hostpath)]]; - host = [[SUHost alloc] initWithBundle: theBundle]; installationPath = [[host installationPath] copy]; // Perhaps a poor assumption but: if we're not relaunching, we assume we shouldn't be showing any UI either. Because non-relaunching installations are kicked off without any user interaction, we shouldn't be interrupting them.