From cc75f340e8dd6f9bd6aa8979abcfc2c3eec69197 Mon Sep 17 00:00:00 2001 From: Marcus Osobase Date: Tue, 3 May 2016 15:56:34 -0400 Subject: [PATCH] Automatically download update and wait until restart to install --- Sparkle/SUAutomaticUpdateDriver.m | 8 ++++++++ Sparkle/SUUpdater.h | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/Sparkle/SUAutomaticUpdateDriver.m b/Sparkle/SUAutomaticUpdateDriver.m index c88aaeaf..e7d1b8b0 100644 --- a/Sparkle/SUAutomaticUpdateDriver.m +++ b/Sparkle/SUAutomaticUpdateDriver.m @@ -46,6 +46,14 @@ static const NSTimeInterval SUAutomaticUpdatePromptImpatienceTimer = 60 * 60 * 2 - (void)showUpdateAlert { + + id updaterDelegate = [self.updater delegate]; + if ([updaterDelegate suppressSparkleUI]) + { + [self automaticUpdateAlertFinishedWithChoice:SUInstallLaterChoice]; + return; + } + self.interruptible = NO; [self invalidateShowUpdateAlertTimer]; diff --git a/Sparkle/SUUpdater.h b/Sparkle/SUUpdater.h index 623c57d2..b26c6e67 100644 --- a/Sparkle/SUUpdater.h +++ b/Sparkle/SUUpdater.h @@ -61,7 +61,7 @@ SU_EXPORT @interface SUUpdater : NSObject - (instancetype)initForBundle:(NSBundle *)bundle; -@property (nonatomic) BOOL suppressUI; +-(BOOL)suppressSparkleUI; /*! Explicitly checks for updates and displays a progress dialog while doing so.