From 80bc8353ed9d9f4c1807dd4e365e06d863f89efd Mon Sep 17 00:00:00 2001 From: Zorg Date: Tue, 12 Jul 2016 19:50:00 -0400 Subject: [PATCH] Handle defer installation when resuming updates in sparkle-cli --- sparkle-cli/SUCommandLineUserDriver.m | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/sparkle-cli/SUCommandLineUserDriver.m b/sparkle-cli/SUCommandLineUserDriver.m index b6e39fcb..fb4fc802 100644 --- a/sparkle-cli/SUCommandLineUserDriver.m +++ b/sparkle-cli/SUCommandLineUserDriver.m @@ -152,8 +152,17 @@ - (void)showResumableUpdateFoundWithAppcastItem:(SUAppcastItem *)appcastItem reply:(void (^)(SUInstallUpdateStatus))reply { dispatch_async(dispatch_get_main_queue(), ^{ + [self.coreComponent registerInstallUpdateHandler:reply]; [self showUpdateWithAppcastItem:appcastItem updateAdjective:@"resumable"]; - reply(SUInstallAndRelaunchUpdateNow); + + if (self.deferInstallation) { + if (self.verbose) { + fprintf(stderr, "Deferring Installation.\n"); + } + [self.coreComponent installUpdateWithChoice:SUDismissUpdateInstallation]; + } else { + [self.coreComponent installUpdateWithChoice:SUInstallAndRelaunchUpdateNow]; + } }); }