diff --git a/Sparkle/Autoupdate/Autoupdate.m b/Sparkle/Autoupdate/Autoupdate.m index 92c38e6b..9d48b1d1 100644 --- a/Sparkle/Autoupdate/Autoupdate.m +++ b/Sparkle/Autoupdate/Autoupdate.m @@ -136,7 +136,7 @@ static const NSTimeInterval SUTerminationTimeDelay = 0.5; self.statusController = [[SUStatusController alloc] initWithHost:host]; [self.statusController setButtonTitle:SULocalizedString(@"Cancel Update", @"") target:nil action:Nil isDefault:NO]; [self.statusController beginActionWithTitle:SULocalizedString(@"Installing update...", @"") - maxProgressValue:100 statusText: @""]; + maxProgressValue:installer.supportsDeterminateProgress ? 100 : 0 statusText: @""]; [self.statusController showWindow:self]; } @@ -153,7 +153,9 @@ static const NSTimeInterval SUTerminationTimeDelay = 0.5; void(^progressBlock)(double) = ^(double progress){ dispatch_async(dispatch_get_main_queue(), ^(){ - self.statusController.progressValue = progress * 100.0; + if (installer.supportsDeterminateProgress) { + self.statusController.progressValue = progress * 100.0; + } }); }; diff --git a/Sparkle/SUGuidedPackageInstaller.m b/Sparkle/SUGuidedPackageInstaller.m index 9c8e6e50..8eecd707 100644 --- a/Sparkle/SUGuidedPackageInstaller.m +++ b/Sparkle/SUGuidedPackageInstaller.m @@ -54,4 +54,11 @@ return YES; } +// We used to, but it broke due to fragile text processing +// Maybe one day someone will fix it, but until then. +- (BOOL)supportsDeterminateProgress +{ + return NO; +} + @end diff --git a/Sparkle/SUInstallerProtocol.h b/Sparkle/SUInstallerProtocol.h index 75312c47..599aa39f 100644 --- a/Sparkle/SUInstallerProtocol.h +++ b/Sparkle/SUInstallerProtocol.h @@ -31,6 +31,8 @@ NS_ASSUME_NONNULL_BEGIN // Should be thread safe - (NSString *)installationPath; +- (BOOL)supportsDeterminateProgress; + @end NS_ASSUME_NONNULL_END diff --git a/Sparkle/SUPackageInstaller.m b/Sparkle/SUPackageInstaller.m index ca2e4e7b..eba0d66e 100644 --- a/Sparkle/SUPackageInstaller.m +++ b/Sparkle/SUPackageInstaller.m @@ -78,4 +78,9 @@ static NSString *SUOpenUtilityPath = @"/usr/bin/open"; return NO; } +- (BOOL)supportsDeterminateProgress +{ + return NO; +} + @end diff --git a/Sparkle/SUPlainInstaller.m b/Sparkle/SUPlainInstaller.m index ec51b644..0cd5c041 100644 --- a/Sparkle/SUPlainInstaller.m +++ b/Sparkle/SUPlainInstaller.m @@ -265,4 +265,9 @@ return YES; } +- (BOOL)supportsDeterminateProgress +{ + return YES; +} + @end