Set installer driver's update item when resuming an update

This commit is contained in:
Zorg committed 2016-05-01 17:56:42 -04:00
1 parent 738490af07
commit 704518278c
3 files changed
+15 -2

No files matched your search

+7
View File
@@ -27,6 +27,7 @@
@property (nonatomic) SUAppcastItem *updateItem;
@property (nonatomic, readonly) SUHost *host;
@property (nonatomic) BOOL resumingUpdate;
@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;
@property (nonatomic) NSString *userAgent;
@@ -41,6 +42,7 @@
@synthesize delegate = _delegate;
@synthesize updateItem = _updateItem;
@synthesize host = _host;
@synthesize resumingUpdate = _resumingUpdate;
@synthesize updater = _updater;
@synthesize updaterDelegate = _updaterDelegate;
@synthesize userAgent = _userAgent;
@@ -97,6 +99,7 @@
- (void)resumeUpdateWithCompletion:(SUUpdateDriverCompletion)completionBlock
{
self.resumingUpdate = YES;
[self.basicDriver resumeUpdateWithCompletion:completionBlock];
}
@@ -111,6 +114,10 @@
{
self.updateItem = updateItem;
if (self.resumingUpdate) {
[self.installerDriver resumeUpdateWithUpdateItem:updateItem];
}
[self.delegate basicDriverDidFindUpdateWithAppcastItem:updateItem];
}
+2
View File
@@ -31,6 +31,8 @@ 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)extractDownloadName:(NSString *)downloadName withUpdateItem:(SUAppcastItem *)updateItem temporaryDirectory:(NSString *)temporaryDirectory completion:(void (^)(NSError * _Nullable))completionHandler;
- (void)installWithToolAndRelaunch:(BOOL)relaunch displayingUserInterface:(BOOL)showUI;
+6 -2
View File
@@ -210,6 +210,11 @@
}
}
- (void)resumeUpdateWithUpdateItem:(SUAppcastItem *)updateItem
{
self.updateItem = updateItem;
}
- (void)sendInstallationData
{
NSString *pathToRelaunch = [self.host bundlePath];
@@ -526,8 +531,7 @@
- (void)installWithToolAndRelaunch:(BOOL)relaunch displayingUserInterface:(BOOL)showUI
{
#warning this assertion no longer holds trues due to resumability - matters for commented invocation code below
//assert(self.updateItem);
assert(self.updateItem);
if (![self mayUpdateAndRestart])
{