mirror of
https://github.com/sparkle-project/Sparkle
synced 2026-11-27 05:04:27 +00:00
Differentiate between resuming an installing update & a downloaded one
This commit is contained in:
1 parent
ec7766022d
commit
e2a51347b9
14 files changed
+29
-29
No files matched your search
Vendored
+2
-2
@@ -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();
|
||||
}
|
||||
|
||||
|
||||
Vendored
+1
-1
@@ -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;
|
||||
|
||||
|
||||
Vendored
+1
-1
@@ -78,7 +78,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
- (void)resumeUpdateWithCompletion:(SUUpdateDriverCompletion)completionBlock
|
||||
- (void)resumeInstallingUpdateWithCompletion:(SUUpdateDriverCompletion)completionBlock
|
||||
{
|
||||
self.completionBlock = completionBlock;
|
||||
|
||||
|
||||
Vendored
+1
-1
@@ -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;
|
||||
|
||||
|
||||
Vendored
+7
-7
@@ -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];
|
||||
|
||||
Vendored
+1
-1
@@ -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;
|
||||
|
||||
|
||||
Vendored
+1
-1
@@ -147,7 +147,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
- (void)resumeUpdateWithUpdateItem:(SUAppcastItem *)updateItem
|
||||
- (void)resumeInstallingUpdateWithUpdateItem:(SUAppcastItem *)updateItem
|
||||
{
|
||||
self.updateItem = updateItem;
|
||||
}
|
||||
|
||||
Vendored
+2
-2
@@ -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
|
||||
|
||||
Vendored
+2
-2
@@ -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
|
||||
|
||||
Vendored
+1
-1
@@ -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;
|
||||
|
||||
|
||||
Vendored
+6
-6
@@ -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];
|
||||
|
||||
Vendored
+1
-1
@@ -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;
|
||||
|
||||
|
||||
Vendored
+1
-1
@@ -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
@@ -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
|
||||
|
||||
Reference in new issue
Block a user