Differentiate between resuming an installing update & a downloaded one

This commit is contained in:
Zorg committed 2016-07-24 14:37:21 -04:00
1 parent ec7766022d
commit e2a51347b9
14 files changed
+29 -29

No files matched your search

+2 -2
View File
@@ -53,10 +53,10 @@
[self.coreDriver checkForUpdatesAtAppcastURL:appcastURL withUserAgent:userAgent httpHeaders:httpHeaders includesSkippedUpdates:NO requiresSilentInstall:YES completion:completionBlock];
}
- (void)resumeUpdateWithCompletion:(SUUpdateDriverCompletion)__unused completionBlock __attribute__((noreturn))
- (void)resumeInstallingUpdateWithCompletion:(SUUpdateDriverCompletion)__unused completionBlock __attribute__((noreturn))
{
// Nothing really to do here.. this shouldn't be called.
SULog(@"Error: resumeUpdateWithCompletion: called on SUAutomaticUpdateDriver");
SULog(@"Error: resumeInstallingUpdateWithCompletion: called on SUAutomaticUpdateDriver");
abort();
}
+1 -1
View File
@@ -32,7 +32,7 @@ NS_ASSUME_NONNULL_BEGIN
- (void)checkForUpdatesAtAppcastURL:(NSURL *)appcastURL withUserAgent:(NSString *)userAgent httpHeaders:(NSDictionary *)httpHeaders includesSkippedUpdates:(BOOL)includesSkippedUpdates completion:(SUUpdateDriverCompletion)completionBlock;
- (void)resumeUpdateWithCompletion:(SUUpdateDriverCompletion)completionBlock;
- (void)resumeInstallingUpdateWithCompletion:(SUUpdateDriverCompletion)completionBlock;
- (void)resumeDownloadedUpdate:(SUDownloadedUpdate *)downloadedUpdate completion:(SUUpdateDriverCompletion)completionBlock;
+1 -1
View File
@@ -78,7 +78,7 @@
}
}
- (void)resumeUpdateWithCompletion:(SUUpdateDriverCompletion)completionBlock
- (void)resumeInstallingUpdateWithCompletion:(SUUpdateDriverCompletion)completionBlock
{
self.completionBlock = completionBlock;
+1 -1
View File
@@ -53,7 +53,7 @@ NS_ASSUME_NONNULL_BEGIN
- (void)checkForUpdatesAtAppcastURL:(NSURL *)appcastURL withUserAgent:(NSString *)userAgent httpHeaders:(NSDictionary *)httpHeaders includesSkippedUpdates:(BOOL)includesSkippedUpdates requiresSilentInstall:(BOOL)silentInstall completion:(SUUpdateDriverCompletion)completionBlock;
- (void)resumeUpdateWithCompletion:(SUUpdateDriverCompletion)completionBlock;
- (void)resumeInstallingUpdateWithCompletion:(SUUpdateDriverCompletion)completionBlock;
- (void)resumeDownloadedUpdate:(SUDownloadedUpdate *)downloadedUpdate completion:(SUUpdateDriverCompletion)completionBlock;
+7 -7
View File
@@ -31,7 +31,7 @@
@property (nonatomic) SUDownloadedUpdate *downloadedUpdate;
@property (nonatomic, readonly) SUHost *host;
@property (nonatomic) BOOL resumingUpdate;
@property (nonatomic) BOOL resumingInstallingUpdate;
@property (nonatomic) BOOL silentInstall;
@property (nonatomic, readonly, weak) id updater; // if we didn't have legacy support, I'd remove this..
@property (nullable, nonatomic, readonly, weak) id <SUUpdaterDelegate>updaterDelegate;
@@ -47,7 +47,7 @@
@synthesize delegate = _delegate;
@synthesize updateItem = _updateItem;
@synthesize host = _host;
@synthesize resumingUpdate = _resumingUpdate;
@synthesize resumingInstallingUpdate = _resumingInstallingUpdate;
@synthesize silentInstall = _silentInstall;
@synthesize updater = _updater;
@synthesize updaterDelegate = _updaterDelegate;
@@ -82,12 +82,12 @@
[self.basicDriver checkForUpdatesAtAppcastURL:appcastURL withUserAgent:userAgent httpHeaders:httpHeaders includesSkippedUpdates:includesSkippedUpdates completion:completionBlock];
}
- (void)resumeUpdateWithCompletion:(SUUpdateDriverCompletion)completionBlock
- (void)resumeInstallingUpdateWithCompletion:(SUUpdateDriverCompletion)completionBlock
{
self.resumingUpdate = YES;
self.resumingInstallingUpdate = YES;
self.silentInstall = NO;
[self.basicDriver resumeUpdateWithCompletion:completionBlock];
[self.basicDriver resumeInstallingUpdateWithCompletion:completionBlock];
}
- (void)resumeDownloadedUpdate:(SUDownloadedUpdate *)downloadedUpdate completion:(SUUpdateDriverCompletion)completionBlock
@@ -109,8 +109,8 @@
{
self.updateItem = updateItem;
if (self.resumingUpdate) {
[self.installerDriver resumeUpdateWithUpdateItem:updateItem];
if (self.resumingInstallingUpdate) {
[self.installerDriver resumeInstallingUpdateWithUpdateItem:updateItem];
}
[self.delegate basicDriverDidFindUpdateWithAppcastItem:updateItem];
+1 -1
View File
@@ -31,7 +31,7 @@ NS_ASSUME_NONNULL_BEGIN
- (instancetype)initWithHost:(SUHost *)host cachePath:(NSString *)cachePath sparkleBundle:(NSBundle *)sparkleBundle updater:(id)updater updaterDelegate:(nullable id<SUUpdaterDelegate>)updaterDelegate delegate:(nullable id<SUInstallerDriverDelegate>)delegate;
- (void)resumeUpdateWithUpdateItem:(SUAppcastItem *)updateItem;
- (void)resumeInstallingUpdateWithUpdateItem:(SUAppcastItem *)updateItem;
- (void)extractDownloadedUpdate:(SUDownloadedUpdate *)downloadedUpdate silently:(BOOL)silently completion:(void (^)(NSError * _Nullable))completionHandler;
+1 -1
View File
@@ -147,7 +147,7 @@
}
}
- (void)resumeUpdateWithUpdateItem:(SUAppcastItem *)updateItem
- (void)resumeInstallingUpdateWithUpdateItem:(SUAppcastItem *)updateItem
{
self.updateItem = updateItem;
}
+2 -2
View File
@@ -39,9 +39,9 @@
[self.basicDriver checkForUpdatesAtAppcastURL:appcastURL withUserAgent:userAgent httpHeaders:httpHeaders includesSkippedUpdates:NO completion:completionBlock];
}
- (void)resumeUpdateWithCompletion:(SUUpdateDriverCompletion)completionBlock
- (void)resumeInstallingUpdateWithCompletion:(SUUpdateDriverCompletion)completionBlock
{
[self.basicDriver resumeUpdateWithCompletion:completionBlock];
[self.basicDriver resumeInstallingUpdateWithCompletion:completionBlock];
}
- (void)resumeDownloadedUpdate:(SUDownloadedUpdate *)downloadedUpdate completion:(SUUpdateDriverCompletion)completionBlock
+2 -2
View File
@@ -40,9 +40,9 @@
[self.uiDriver checkForUpdatesAtAppcastURL:appcastURL withUserAgent:userAgent httpHeaders:httpHeaders includesSkippedUpdates:NO completion:completionBlock];
}
- (void)resumeUpdateWithCompletion:(SUUpdateDriverCompletion)completionBlock
- (void)resumeInstallingUpdateWithCompletion:(SUUpdateDriverCompletion)completionBlock
{
[self.uiDriver resumeUpdateWithCompletion:completionBlock];
[self.uiDriver resumeInstallingUpdateWithCompletion:completionBlock];
}
- (void)resumeDownloadedUpdate:(SUDownloadedUpdate *)downloadedUpdate completion:(SUUpdateDriverCompletion)completionBlock
+1 -1
View File
@@ -31,7 +31,7 @@ NS_ASSUME_NONNULL_BEGIN
- (void)checkForUpdatesAtAppcastURL:(NSURL *)appcastURL withUserAgent:(NSString *)userAgent httpHeaders:(NSDictionary *)httpHeaders includesSkippedUpdates:(BOOL)includesSkippedUpdates completion:(SUUpdateDriverCompletion)completionBlock;
- (void)resumeUpdateWithCompletion:(SUUpdateDriverCompletion)completionBlock;
- (void)resumeInstallingUpdateWithCompletion:(SUUpdateDriverCompletion)completionBlock;
- (void)resumeDownloadedUpdate:(SUDownloadedUpdate *)downloadedUpdate completion:(SUUpdateDriverCompletion)completionBlock;
+6 -6
View File
@@ -28,7 +28,7 @@
@property (weak, nonatomic, readonly) id<SUUpdaterDelegate> updaterDelegate;
@property (nonatomic, weak, readonly) id<SUUIBasedUpdateDriverDelegate> delegate;
@property (nonatomic, readonly) id<SUUserDriver> userDriver;
@property (nonatomic) BOOL resumingUpdate;
@property (nonatomic) BOOL resumingInstallingUpdate;
@property (nonatomic) BOOL resumingDownloadedUpdate;
@end
@@ -41,7 +41,7 @@
@synthesize updaterDelegate = _updaterDelegate;
@synthesize userDriver = _userDriver;
@synthesize delegate = _delegate;
@synthesize resumingUpdate = _resumingUpdate;
@synthesize resumingInstallingUpdate = _resumingInstallingUpdate;
@synthesize resumingDownloadedUpdate = _resumingDownloadedUpdate;
- (instancetype)initWithHost:(SUHost *)host sparkleBundle:(NSBundle *)sparkleBundle updater:(id)updater userDriver:(id <SUUserDriver>)userDriver updaterDelegate:(nullable id <SUUpdaterDelegate>)updaterDelegate delegate:(id<SUUIBasedUpdateDriverDelegate>)delegate
@@ -64,10 +64,10 @@
[self.coreDriver checkForUpdatesAtAppcastURL:appcastURL withUserAgent:userAgent httpHeaders:httpHeaders includesSkippedUpdates:includesSkippedUpdates requiresSilentInstall:NO completion:completionBlock];
}
- (void)resumeUpdateWithCompletion:(SUUpdateDriverCompletion)completionBlock
- (void)resumeInstallingUpdateWithCompletion:(SUUpdateDriverCompletion)completionBlock
{
self.resumingUpdate = YES;
[self.coreDriver resumeUpdateWithCompletion:completionBlock];
self.resumingInstallingUpdate = YES;
[self.coreDriver resumeInstallingUpdateWithCompletion:completionBlock];
}
- (void)resumeDownloadedUpdate:(SUDownloadedUpdate *)downloadedUpdate completion:(SUUpdateDriverCompletion)completionBlock
@@ -103,7 +103,7 @@
}
});
}];
} else if (!self.resumingUpdate) {
} else if (!self.resumingInstallingUpdate) {
[self.userDriver showUpdateFoundWithAppcastItem:updateItem reply:^(SUUpdateAlertChoice choice) {
dispatch_async(dispatch_get_main_queue(), ^{
[self.host setObject:nil forUserDefaultsKey:SUSkippedVersionKey];
+1 -1
View File
@@ -16,7 +16,7 @@ typedef void (^SUUpdateDriverCompletion)(BOOL shouldShowUpdateImmediately, SUDow
- (void)checkForUpdatesAtAppcastURL:(NSURL *)appcastURL withUserAgent:(NSString *)userAgent httpHeaders:(NSDictionary *)httpHeaders completion:(SUUpdateDriverCompletion)completionBlock;
- (void)resumeUpdateWithCompletion:(SUUpdateDriverCompletion)completionBlock;
- (void)resumeInstallingUpdateWithCompletion:(SUUpdateDriverCompletion)completionBlock;
- (void)resumeDownloadedUpdate:(SUDownloadedUpdate *)downloadedUpdate completion:(SUUpdateDriverCompletion)completionBlock;
+1 -1
View File
@@ -495,7 +495,7 @@ NSString *const SUUpdaterAppcastNotificationKey = @"SUUpdaterAppCastNotification
[self.userDriver showCanCheckForUpdates:NO];
if (installerInProgress) {
[self.driver resumeUpdateWithCompletion:completionBlock];
[self.driver resumeInstallingUpdateWithCompletion:completionBlock];
} else if (self.resumableUpdate != nil) {
[self.driver resumeDownloadedUpdate:(SUDownloadedUpdate * _Nonnull)self.resumableUpdate completion:completionBlock];
} else {
+2 -2
View File
@@ -60,9 +60,9 @@
[self.uiDriver checkForUpdatesAtAppcastURL:appcastURL withUserAgent:userAgent httpHeaders:httpHeaders includesSkippedUpdates:YES completion:completionBlock];
}
- (void)resumeUpdateWithCompletion:(SUUpdateDriverCompletion)completionBlock
- (void)resumeInstallingUpdateWithCompletion:(SUUpdateDriverCompletion)completionBlock
{
[self.uiDriver resumeUpdateWithCompletion:completionBlock];
[self.uiDriver resumeInstallingUpdateWithCompletion:completionBlock];
}
- (void)resumeDownloadedUpdate:(SUDownloadedUpdate *)downloadedUpdate completion:(SUUpdateDriverCompletion)completionBlock