mirror of
https://github.com/sparkle-project/Sparkle
synced 2026-11-25 04:47:55 +00:00
For sparkle-cli and out-of-process updaters, I added a did finish installing event. I also have logic dealing with whether an update can be silently installed or not. I made closing status windows before app termination a reponsibility for the user driver now, not the installer drivers. I improved checking for updates before starting the updater, if Sparle didn't ask the user for permission yet. Currently, Autoupdate can persist in the background even when the app is terminated, if we don't have sufficient privilleges to install right away for example, or if an update isn't silent. After much thinking, I need to ditch this strategy because: 1. An app can be manually replaced and so the installer would have to monitor that 2. We leave a zombie process running
69 lines
2.1 KiB
Objective-C
69 lines
2.1 KiB
Objective-C
//
|
|
// SUCoreBasedUpdateDriver.h
|
|
// Sparkle
|
|
//
|
|
// Created by Mayur Pawashe on 3/18/16.
|
|
// Copyright © 2016 Sparkle Project. All rights reserved.
|
|
//
|
|
|
|
#import <Foundation/Foundation.h>
|
|
#import "SUStatusCompletionResults.h"
|
|
#import "SUUpdateDriver.h"
|
|
|
|
NS_ASSUME_NONNULL_BEGIN
|
|
|
|
@class SUHost, SUAppcastItem;
|
|
@protocol SUUpdaterDelegate;
|
|
|
|
@protocol SUCoreBasedUpdateDriverDelegate <NSObject>
|
|
|
|
- (void)basicDriverDidFindUpdateWithAppcastItem:(SUAppcastItem *)updateItem;
|
|
|
|
- (void)installerDidFinishPreparationAndWillInstallImmediately:(BOOL)willInstallImmediately silently:(BOOL)willInstallSilently;
|
|
|
|
- (void)coreDriverIsRequestingAbortUpdateWithError:(nullable NSError *)error;
|
|
|
|
- (void)basicDriverIsRequestingAbortUpdateWithError:(nullable NSError *)error;
|
|
|
|
- (BOOL)basicDriverShouldSignalShowingUpdateImmediately;
|
|
|
|
@optional
|
|
|
|
- (void)basicDriverDidFinishLoadingAppcast;
|
|
|
|
- (void)downloadDriverWillBeginDownload;
|
|
|
|
- (void)downloadDriverDidReceiveResponse:(NSURLResponse *)response;
|
|
|
|
- (void)downloadDriverDidReceiveDataOfLength:(NSUInteger)length;
|
|
|
|
- (void)coreDriverDidFinishDownloadingUpdate;
|
|
|
|
- (void)installerDidStartInstalling;
|
|
|
|
- (void)installerDidExtractUpdateWithProgress:(double)progress;
|
|
|
|
- (void)installerIsRequestingAppTermination;
|
|
|
|
- (void)installerDidFinishInstallation;
|
|
|
|
@end
|
|
|
|
@interface SUCoreBasedUpdateDriver : NSObject
|
|
|
|
- (instancetype)initWithHost:(SUHost *)host sparkleBundle:(NSBundle *)sparkleBundle updater:(id)updater updaterDelegate:(nullable id <SUUpdaterDelegate>)updaterDelegate delegate:(id<SUCoreBasedUpdateDriverDelegate>)delegate;
|
|
|
|
- (void)checkForUpdatesAtAppcastURL:(NSURL *)appcastURL withUserAgent:(NSString *)userAgent httpHeaders:(NSDictionary *)httpHeaders includesSkippedUpdates:(BOOL)includesSkippedUpdates completion:(SUUpdateDriverCompletion)completionBlock;
|
|
|
|
- (void)resumeUpdateWithCompletion:(SUUpdateDriverCompletion)completionBlock;
|
|
|
|
- (void)downloadUpdateFromAppcastItem:(SUAppcastItem *)updateItem;
|
|
|
|
- (void)finishInstallationWithResponse:(SUInstallUpdateStatus)installUpdateStatus;
|
|
|
|
- (void)abortUpdateWithError:(nullable NSError *)error;
|
|
|
|
@end
|
|
|
|
NS_ASSUME_NONNULL_END
|