From 623f5358834143d8eeb25296451b94dee7adc332 Mon Sep 17 00:00:00 2001 From: Zorg Date: Fri, 3 Jun 2016 23:16:21 -0400 Subject: [PATCH] We can do guided installation silently if we're root --- Sparkle/SUGuidedPackageInstaller.m | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Sparkle/SUGuidedPackageInstaller.m b/Sparkle/SUGuidedPackageInstaller.m index b038ca04..95fd3652 100644 --- a/Sparkle/SUGuidedPackageInstaller.m +++ b/Sparkle/SUGuidedPackageInstaller.m @@ -45,7 +45,7 @@ - (BOOL)performSecondStageAllowingAuthorization:(BOOL)allowsAuthorization withEnvironment:(SUAuthorizationEnvironment * _Nullable)authorizationEnvironment allowingUI:(BOOL)allowsUI error:(NSError * __autoreleasing *)error { - if (!allowsUI) { + if (!allowsUI && ![self canInstallSilently]) { if (error != NULL) { *error = [NSError errorWithDomain:SUSparkleErrorDomain code:SUInstallationError userInfo:@{NSLocalizedDescriptionKey : @"Guided installer cannot continue if showing UI is not allowed"}]; } @@ -80,7 +80,6 @@ }; validInstallation = [self.fileManager authorizeAndExecuteWithPrivilegesAtPath:installerPath arguments:arguments]; - if (!validInstallation && error != NULL) { *error = [NSError errorWithDomain:SUSparkleErrorDomain code:SUInstallationError userInfo:@{NSLocalizedDescriptionKey : @"Failed to authorize installer"}]; }