diff --git a/Sparkle.framework/Versions/A/Headers/SUAppcast.h b/Sparkle.framework/Versions/A/Headers/SUAppcast.h index a035f18..d7363d0 100644 --- a/Sparkle.framework/Versions/A/Headers/SUAppcast.h +++ b/Sparkle.framework/Versions/A/Headers/SUAppcast.h @@ -9,19 +9,32 @@ #ifndef SUAPPCAST_H #define SUAPPCAST_H +#if __has_feature(modules) +@import Foundation; +#else #import +#endif #import "SUExport.h" +NS_ASSUME_NONNULL_BEGIN + @class SUAppcastItem; SU_EXPORT @interface SUAppcast : NSObject -@property (copy) NSString *userAgentString; -@property (copy) NSDictionary *httpHeaders; +@property (copy, nullable) NSString *userAgentString; -- (void)fetchAppcastFromURL:(NSURL *)url completionBlock:(void (^)(NSError *))err; +#if __has_feature(objc_generics) +@property (copy, nullable) NSDictionary *httpHeaders; +#else +@property (copy, nullable) NSDictionary *httpHeaders; +#endif + +- (void)fetchAppcastFromURL:(NSURL *)url inBackground:(BOOL)bg completionBlock:(void (^)(NSError *_Nullable))err; - (SUAppcast *)copyWithoutDeltaUpdates; -@property (readonly, copy) NSArray *items; +@property (readonly, copy, nullable) NSArray *items; @end +NS_ASSUME_NONNULL_END + #endif diff --git a/Sparkle.framework/Versions/A/Headers/SUAppcastItem.h b/Sparkle.framework/Versions/A/Headers/SUAppcastItem.h index 86843bf..9ed52c9 100644 --- a/Sparkle.framework/Versions/A/Headers/SUAppcastItem.h +++ b/Sparkle.framework/Versions/A/Headers/SUAppcastItem.h @@ -9,18 +9,23 @@ #ifndef SUAPPCASTITEM_H #define SUAPPCASTITEM_H +#if __has_feature(modules) +@import Foundation; +#else #import +#endif #import "SUExport.h" SU_EXPORT @interface SUAppcastItem : NSObject @property (copy, readonly) NSString *title; -@property (copy, readonly) NSDate *date; +@property (copy, readonly) NSString *dateString; @property (copy, readonly) NSString *itemDescription; @property (strong, readonly) NSURL *releaseNotesURL; @property (copy, readonly) NSString *DSASignature; @property (copy, readonly) NSString *minimumSystemVersion; @property (copy, readonly) NSString *maximumSystemVersion; @property (strong, readonly) NSURL *fileURL; +@property (nonatomic, readonly) uint64_t contentLength; @property (copy, readonly) NSString *versionString; @property (copy, readonly) NSString *displayVersionString; @property (copy, readonly) NSDictionary *deltaUpdates; diff --git a/Sparkle.framework/Versions/A/Headers/SUErrors.h b/Sparkle.framework/Versions/A/Headers/SUErrors.h index d73aadb..8557d7f 100644 --- a/Sparkle.framework/Versions/A/Headers/SUErrors.h +++ b/Sparkle.framework/Versions/A/Headers/SUErrors.h @@ -9,7 +9,11 @@ #ifndef SUERRORS_H #define SUERRORS_H +#if __has_feature(modules) +@import Foundation; +#else #import +#endif #import "SUExport.h" /** @@ -23,10 +27,11 @@ typedef NS_ENUM(OSStatus, SUError) { SUNoUpdateError = 1001, SUAppcastError = 1002, SURunningFromDiskImageError = 1003, - - // Downlaod phase errors. + + // Download phase errors. SUTemporaryDirectoryError = 2000, - + SUDownloadError = 2001, + // Extraction phase errors. SUUnarchivingError = 3000, SUSignatureError = 3001, @@ -39,6 +44,7 @@ typedef NS_ENUM(OSStatus, SUError) { SURelaunchError = 4004, SUInstallationError = 4005, SUDowngradeError = 4006, + SUInstallationCancelledError = 4007, // System phase errors SUSystemPowerOffError = 5000 diff --git a/Sparkle.framework/Versions/A/Headers/SUStandardVersionComparator.h b/Sparkle.framework/Versions/A/Headers/SUStandardVersionComparator.h index d7f2a48..ed11921 100644 --- a/Sparkle.framework/Versions/A/Headers/SUStandardVersionComparator.h +++ b/Sparkle.framework/Versions/A/Headers/SUStandardVersionComparator.h @@ -9,10 +9,16 @@ #ifndef SUSTANDARDVERSIONCOMPARATOR_H #define SUSTANDARDVERSIONCOMPARATOR_H +#if __has_feature(modules) +@import Foundation; +#else #import +#endif #import "SUExport.h" #import "SUVersionComparisonProtocol.h" +NS_ASSUME_NONNULL_BEGIN + /*! Sparkle's default version comparator. @@ -22,8 +28,15 @@ */ SU_EXPORT @interface SUStandardVersionComparator : NSObject +/*! + Initializes a new instance of the standard version comparator. + */ +- (instancetype)init; + /*! Returns a singleton instance of the comparator. + + It is usually preferred to alloc/init new a comparator instead. */ + (SUStandardVersionComparator *)defaultComparator; @@ -35,4 +48,5 @@ SU_EXPORT @interface SUStandardVersionComparator : NSObject +#if __has_feature(modules) +@import Cocoa; +#else +#import +#endif #import "SUExport.h" #import "SUVersionComparisonProtocol.h" #import "SUVersionDisplayProtocol.h" @@ -28,64 +32,162 @@ SU_EXPORT @interface SUUpdater : NSObject @property (unsafe_unretained) IBOutlet id delegate; +/*! + The shared updater for the main bundle. + + This is equivalent to passing [NSBundle mainBundle] to SUUpdater::updaterForBundle: + */ + (SUUpdater *)sharedUpdater; + +/*! + The shared updater for a specified bundle. + + If an updater has already been initialized for the provided bundle, that shared instance will be returned. + */ + (SUUpdater *)updaterForBundle:(NSBundle *)bundle; + +/*! + Designated initializer for SUUpdater. + + If an updater has already been initialized for the provided bundle, that shared instance will be returned. + */ - (instancetype)initForBundle:(NSBundle *)bundle; -@property (readonly, strong) NSBundle *hostBundle; -@property (strong, readonly) NSBundle *sparkleBundle; - -@property BOOL automaticallyChecksForUpdates; - -@property NSTimeInterval updateCheckInterval; - /*! - * The URL of the appcast used to download update information. - * - * This property must be called on the main thread. - */ -@property (copy) NSURL *feedURL; + Explicitly checks for updates and displays a progress dialog while doing so. -@property (nonatomic, copy) NSString *userAgentString; + This method is meant for a main menu item. + Connect any menu item to this action in Interface Builder, + and Sparkle will check for updates and report back its findings verbosely + when it is invoked. -@property (copy) NSDictionary *httpHeaders; - -@property BOOL sendsSystemProfile; - -@property BOOL automaticallyDownloadsUpdates; - -@property (nonatomic, copy) NSString *decryptionPassword; - -/*! - Explicitly checks for updates and displays a progress dialog while doing so. - - This method is meant for a main menu item. - Connect any menu item to this action in Interface Builder, - and Sparkle will check for updates and report back its findings verbosely - when it is invoked. + This will find updates that the user has opted into skipping. */ - (IBAction)checkForUpdates:(id)sender; /*! - Checks for updates, but does not display any UI unless an update is found. + The menu item validation used for the -checkForUpdates: action + */ +- (BOOL)validateMenuItem:(NSMenuItem *)menuItem; - This is meant for programmatically initating a check for updates. That is, - it will display no UI unless it actually finds an update, in which case it - proceeds as usual. +/*! + Checks for updates, but does not display any UI unless an update is found. - If the fully automated updating is turned on, however, this will invoke that - behavior, and if an update is found, it will be downloaded and prepped for - installation. + This is meant for programmatically initating a check for updates. That is, + it will display no UI unless it actually finds an update, in which case it + proceeds as usual. + + If automatic downloading of updates it turned on and allowed, however, + this will invoke that behavior, and if an update is found, it will be downloaded + in the background silently and will be prepped for installation. + + This will not find updates that the user has opted into skipping. */ - (void)checkForUpdatesInBackground; +/*! + A property indicating whether or not to check for updates automatically. + + Setting this property will persist in the host bundle's user defaults. + The update schedule cycle will be reset in a short delay after the property's new value is set. + This is to allow reverting this property without kicking off a schedule change immediately + */ +@property BOOL automaticallyChecksForUpdates; + +/*! + A property indicating whether or not updates can be automatically downloaded in the background. + + Note that automatic downloading of updates can be disallowed by the developer + or by the user's system if silent updates cannot be done (eg: if they require authentication). + In this case, -automaticallyDownloadsUpdates will return NO regardless of how this property is set. + + Setting this property will persist in the host bundle's user defaults. + */ +@property BOOL automaticallyDownloadsUpdates; + +/*! + A property indicating the current automatic update check interval. + + Setting this property will persist in the host bundle's user defaults. + The update schedule cycle will be reset in a short delay after the property's new value is set. + This is to allow reverting this property without kicking off a schedule change immediately + */ +@property NSTimeInterval updateCheckInterval; + +/*! + Begins a "probing" check for updates which will not actually offer to + update to that version. + + However, the delegate methods + SUUpdaterDelegate::updater:didFindValidUpdate: and + SUUpdaterDelegate::updaterDidNotFindUpdate: will be called, + so you can use that information in your UI. + + Updates that have been skipped by the user will not be found. + */ +- (void)checkForUpdateInformation; + +/*! + The URL of the appcast used to download update information. + + Setting this property will persist in the host bundle's user defaults. + If you don't want persistence, you may want to consider instead implementing + SUUpdaterDelegate::feedURLStringForUpdater: or SUUpdaterDelegate::feedParametersForUpdater:sendingSystemProfile: + + This property must be called on the main thread. + */ +@property (copy) NSURL *feedURL; + +/*! + The host bundle that is being updated. + */ +@property (readonly, strong) NSBundle *hostBundle; + +/*! + The bundle this class (SUUpdater) is loaded into. + */ +@property (strong, readonly) NSBundle *sparkleBundle; + +/*! + The user agent used when checking for updates. + + The default implementation can be overrided. + */ +@property (nonatomic, copy) NSString *userAgentString; + +/*! + The HTTP headers used when checking for updates. + + The keys of this dictionary are HTTP header fields (NSString) and values are corresponding values (NSString) + */ +#if __has_feature(objc_generics) +@property (copy) NSDictionary *httpHeaders; +#else +@property (copy) NSDictionary *httpHeaders; +#endif + +/*! + A property indicating whether or not the user's system profile information is sent when checking for updates. + + Setting this property will persist in the host bundle's user defaults. + */ +@property BOOL sendsSystemProfile; + +/*! + A property indicating the decryption password used for extracting updates shipped as Apple Disk Images (dmg) + */ +@property (nonatomic, copy) NSString *decryptionPassword; + /*! Checks for updates and, if available, immediately downloads and installs them. A progress dialog is shown but the user will never be prompted to read the release notes. - + You may want to respond to the userDidCancelDownload delegate method in case the user clicks the "Cancel" button while the update is downloading. + + If you are writing a UI-less background application, you probably want to instead use + SUUpdaterDelegate::updater:willInstallUpdateOnQuit:immediateInstallationInvocation: */ - (void)installUpdatesIfAvailable; @@ -96,17 +198,6 @@ SU_EXPORT @interface SUUpdater : NSObject */ @property (readonly, copy) NSDate *lastUpdateCheckDate; -/*! - Begins a "probing" check for updates which will not actually offer to - update to that version. - - However, the delegate methods - SUUpdaterDelegate::updater:didFindValidUpdate: and - SUUpdaterDelegate::updaterDidNotFindUpdate: will be called, - so you can use that information in your UI. - */ -- (void)checkForUpdateInformation; - /*! Appropriately schedules or cancels the update checking timer according to the preferences for time interval and automatic checks. @@ -116,251 +207,14 @@ SU_EXPORT @interface SUUpdater : NSObject */ - (void)resetUpdateCycle; +/*! + A property indicating whether or not an update is in progress. + + Note this property is not indicative of whether or not user initiated updates can be performed. + Use SUUpdater::validateMenuItem: for that instead. + */ @property (readonly) BOOL updateInProgress; @end -// ----------------------------------------------------------------------------- -// SUUpdater Notifications for events that might be interesting to more than just the delegate -// The updater will be the notification object -// ----------------------------------------------------------------------------- -SU_EXPORT extern NSString *const SUUpdaterDidFinishLoadingAppCastNotification; -SU_EXPORT extern NSString *const SUUpdaterDidFindValidUpdateNotification; -SU_EXPORT extern NSString *const SUUpdaterDidNotFindUpdateNotification; -SU_EXPORT extern NSString *const SUUpdaterWillRestartNotification; -#define SUUpdaterWillRelaunchApplicationNotification SUUpdaterWillRestartNotification; -#define SUUpdaterWillInstallUpdateNotification SUUpdaterWillRestartNotification; - -// Key for the SUAppcastItem object in the SUUpdaterDidFindValidUpdateNotification userInfo -SU_EXPORT extern NSString *const SUUpdaterAppcastItemNotificationKey; -// Key for the SUAppcast object in the SUUpdaterDidFinishLoadingAppCastNotification userInfo -SU_EXPORT extern NSString *const SUUpdaterAppcastNotificationKey; - -// ----------------------------------------------------------------------------- -// SUUpdater Delegate: -// ----------------------------------------------------------------------------- - -/*! - Provides methods to control the behavior of an SUUpdater object. - */ -@protocol SUUpdaterDelegate -@optional - -/*! - Returns whether to allow Sparkle to pop up. - - For example, this may be used to prevent Sparkle from interrupting a setup assistant. - - \param updater The SUUpdater instance. - */ -- (BOOL)updaterMayCheckForUpdates:(SUUpdater *)updater; - -/*! - Returns additional parameters to append to the appcast URL's query string. - - This is potentially based on whether or not Sparkle will also be sending along the system profile. - - \param updater The SUUpdater instance. - \param sendingProfile Whether the system profile will also be sent. - - \return An array of dictionaries with keys: "key", "value", "displayKey", "displayValue", the latter two being specifically for display to the user. - */ -- (NSArray *)feedParametersForUpdater:(SUUpdater *)updater sendingSystemProfile:(BOOL)sendingProfile; - -/*! - Returns a custom appcast URL. - - Override this to dynamically specify the entire URL. - - \param updater The SUUpdater instance. - */ -- (NSString *)feedURLStringForUpdater:(SUUpdater *)updater; - -/*! - Returns whether Sparkle should prompt the user about automatic update checks. - - Use this to override the default behavior. - - \param updater The SUUpdater instance. - */ -- (BOOL)updaterShouldPromptForPermissionToCheckForUpdates:(SUUpdater *)updater; - -/*! - Called after Sparkle has downloaded the appcast from the remote server. - - Implement this if you want to do some special handling with the appcast once it finishes loading. - - \param updater The SUUpdater instance. - \param appcast The appcast that was downloaded from the remote server. - */ -- (void)updater:(SUUpdater *)updater didFinishLoadingAppcast:(SUAppcast *)appcast; - -/*! - Returns the item in the appcast corresponding to the update that should be installed. - - If you're using special logic or extensions in your appcast, - implement this to use your own logic for finding a valid update, if any, - in the given appcast. - - \param appcast The appcast that was downloaded from the remote server. - \param updater The SUUpdater instance. - */ -- (SUAppcastItem *)bestValidUpdateInAppcast:(SUAppcast *)appcast forUpdater:(SUUpdater *)updater; - -/*! - Called when a valid update is found by the update driver. - - \param updater The SUUpdater instance. - \param item The appcast item corresponding to the update that is proposed to be installed. - */ -- (void)updater:(SUUpdater *)updater didFindValidUpdate:(SUAppcastItem *)item; - -/*! - Called when a valid update is not found. - - \param updater The SUUpdater instance. - */ -- (void)updaterDidNotFindUpdate:(SUUpdater *)updater; - -/*! - Called immediately before downloading the specified update. - - \param updater The SUUpdater instance. - \param item The appcast item corresponding to the update that is proposed to be downloaded. - \param request The mutable URL request that will be used to download the update. - */ -- (void)updater:(SUUpdater *)updater willDownloadUpdate:(SUAppcastItem *)item withRequest:(NSMutableURLRequest *)request; - -/*! - Called after the specified update failed to download. - - \param updater The SUUpdater instance. - \param item The appcast item corresponding to the update that failed to download. - \param error The error generated by the failed download. - */ -- (void)updater:(SUUpdater *)updater failedToDownloadUpdate:(SUAppcastItem *)item error:(NSError *)error; - -/*! - Called when the user clicks the cancel button while and update is being downloaded. - - \param updater The SUUpdater instance. - */ -- (void)userDidCancelDownload:(SUUpdater *)updater; - -/*! - Called immediately before installing the specified update. - - \param updater The SUUpdater instance. - \param item The appcast item corresponding to the update that is proposed to be installed. - */ -- (void)updater:(SUUpdater *)updater willInstallUpdate:(SUAppcastItem *)item; - -/*! - Returns whether the relaunch should be delayed in order to perform other tasks. - - This is not called if the user didn't relaunch on the previous update, - in that case it will immediately restart. - - \param updater The SUUpdater instance. - \param item The appcast item corresponding to the update that is proposed to be installed. - \param invocation The invocation that must be completed before continuing with the relaunch. - - \return \c YES to delay the relaunch until \p invocation is invoked. - */ -- (BOOL)updater:(SUUpdater *)updater shouldPostponeRelaunchForUpdate:(SUAppcastItem *)item untilInvoking:(NSInvocation *)invocation; - -/*! - Returns whether the application should be relaunched at all. - - Some apps \b cannot be relaunched under certain circumstances. - This method can be used to explicitly prevent a relaunch. - - \param updater The SUUpdater instance. - */ -- (BOOL)updaterShouldRelaunchApplication:(SUUpdater *)updater; - -/*! - Called immediately before relaunching. - - \param updater The SUUpdater instance. - */ -- (void)updaterWillRelaunchApplication:(SUUpdater *)updater; - -/*! - Returns an object that compares version numbers to determine their arithmetic relation to each other. - - This method allows you to provide a custom version comparator. - If you don't implement this method or return \c nil, - the standard version comparator will be used. - - \sa SUStandardVersionComparator - - \param updater The SUUpdater instance. - */ -- (id)versionComparatorForUpdater:(SUUpdater *)updater; - -/*! - Returns an object that formats version numbers for display to the user. - - If you don't implement this method or return \c nil, - the standard version formatter will be used. - - \sa SUUpdateAlert - - \param updater The SUUpdater instance. - */ -- (id)versionDisplayerForUpdater:(SUUpdater *)updater; - -/*! - Returns the path which is used to relaunch the client after the update is installed. - - The default is the path of the host bundle. - - \param updater The SUUpdater instance. - */ -- (NSString *)pathToRelaunchForUpdater:(SUUpdater *)updater; - -/*! - Called before an updater shows a modal alert window, - to give the host the opportunity to hide attached windows that may get in the way. - - \param updater The SUUpdater instance. - */ -- (void)updaterWillShowModalAlert:(SUUpdater *)updater; - -/*! - Called after an updater shows a modal alert window, - to give the host the opportunity to hide attached windows that may get in the way. - - \param updater The SUUpdater instance. - */ -- (void)updaterDidShowModalAlert:(SUUpdater *)updater; - -/*! - Called when an update is scheduled to be silently installed on quit. - - \param updater The SUUpdater instance. - \param item The appcast item corresponding to the update that is proposed to be installed. - \param invocation Can be used to trigger an immediate silent install and relaunch. - */ -- (void)updater:(SUUpdater *)updater willInstallUpdateOnQuit:(SUAppcastItem *)item immediateInstallationInvocation:(NSInvocation *)invocation; - -/*! - Calls after an update that was scheduled to be silently installed on quit has been canceled. - - \param updater The SUUpdater instance. - \param item The appcast item corresponding to the update that was proposed to be installed. - */ -- (void)updater:(SUUpdater *)updater didCancelInstallUpdateOnQuit:(SUAppcastItem *)item; - -/*! - Called after an update is aborted due to an error. - - \param updater The SUUpdater instance. - \param error The error that caused the abort - */ -- (void)updater:(SUUpdater *)updater didAbortWithError:(NSError *)error; - -@end - #endif diff --git a/Sparkle.framework/Versions/A/Headers/SUUpdaterDelegate.h b/Sparkle.framework/Versions/A/Headers/SUUpdaterDelegate.h new file mode 100644 index 0000000..39249ac --- /dev/null +++ b/Sparkle.framework/Versions/A/Headers/SUUpdaterDelegate.h @@ -0,0 +1,274 @@ +// +// SUUpdaterDelegate.h +// Sparkle +// +// Created by Mayur Pawashe on 12/25/16. +// Copyright © 2016 Sparkle Project. All rights reserved. +// + +#if __has_feature(modules) +@import Foundation; +#else +#import +#endif + +#import "SUExport.h" + +@protocol SUVersionComparison, SUVersionDisplay; +@class SUUpdater, SUAppcast, SUAppcastItem; + +NS_ASSUME_NONNULL_BEGIN + +// ----------------------------------------------------------------------------- +// SUUpdater Notifications for events that might be interesting to more than just the delegate +// The updater will be the notification object +// ----------------------------------------------------------------------------- +SU_EXPORT extern NSString *const SUUpdaterDidFinishLoadingAppCastNotification; +SU_EXPORT extern NSString *const SUUpdaterDidFindValidUpdateNotification; +SU_EXPORT extern NSString *const SUUpdaterDidNotFindUpdateNotification; +SU_EXPORT extern NSString *const SUUpdaterWillRestartNotification; +#define SUUpdaterWillRelaunchApplicationNotification SUUpdaterWillRestartNotification; +#define SUUpdaterWillInstallUpdateNotification SUUpdaterWillRestartNotification; + +// Key for the SUAppcastItem object in the SUUpdaterDidFindValidUpdateNotification userInfo +SU_EXPORT extern NSString *const SUUpdaterAppcastItemNotificationKey; +// Key for the SUAppcast object in the SUUpdaterDidFinishLoadingAppCastNotification userInfo +SU_EXPORT extern NSString *const SUUpdaterAppcastNotificationKey; + +// ----------------------------------------------------------------------------- +// SUUpdater Delegate: +// ----------------------------------------------------------------------------- + +/*! + Provides methods to control the behavior of an SUUpdater object. + */ +@protocol SUUpdaterDelegate +@optional + +/*! + Returns whether to allow Sparkle to pop up. + + For example, this may be used to prevent Sparkle from interrupting a setup assistant. + + \param updater The SUUpdater instance. + */ +- (BOOL)updaterMayCheckForUpdates:(SUUpdater *)updater; + +/*! + Returns additional parameters to append to the appcast URL's query string. + + This is potentially based on whether or not Sparkle will also be sending along the system profile. + + \param updater The SUUpdater instance. + \param sendingProfile Whether the system profile will also be sent. + + \return An array of dictionaries with keys: "key", "value", "displayKey", "displayValue", the latter two being specifically for display to the user. + */ +#if __has_feature(objc_generics) +- (NSArray *> *)feedParametersForUpdater:(SUUpdater *)updater sendingSystemProfile:(BOOL)sendingProfile; +#else +- (NSArray *)feedParametersForUpdater:(SUUpdater *)updater sendingSystemProfile:(BOOL)sendingProfile; +#endif + +/*! + Returns a custom appcast URL. + + Override this to dynamically specify the entire URL. + + An alternative may be to use SUUpdaterDelegate::feedParametersForUpdater:sendingSystemProfile: + and let the server handle what kind of feed to provide. + + \param updater The SUUpdater instance. + */ +- (nullable NSString *)feedURLStringForUpdater:(SUUpdater *)updater; + +/*! + Returns whether Sparkle should prompt the user about automatic update checks. + + Use this to override the default behavior. + + \param updater The SUUpdater instance. + */ +- (BOOL)updaterShouldPromptForPermissionToCheckForUpdates:(SUUpdater *)updater; + +/*! + Called after Sparkle has downloaded the appcast from the remote server. + + Implement this if you want to do some special handling with the appcast once it finishes loading. + + \param updater The SUUpdater instance. + \param appcast The appcast that was downloaded from the remote server. + */ +- (void)updater:(SUUpdater *)updater didFinishLoadingAppcast:(SUAppcast *)appcast; + +/*! + Returns the item in the appcast corresponding to the update that should be installed. + + If you're using special logic or extensions in your appcast, + implement this to use your own logic for finding a valid update, if any, + in the given appcast. + + \param appcast The appcast that was downloaded from the remote server. + \param updater The SUUpdater instance. + */ +- (nullable SUAppcastItem *)bestValidUpdateInAppcast:(SUAppcast *)appcast forUpdater:(SUUpdater *)updater; + +/*! + Called when a valid update is found by the update driver. + + \param updater The SUUpdater instance. + \param item The appcast item corresponding to the update that is proposed to be installed. + */ +- (void)updater:(SUUpdater *)updater didFindValidUpdate:(SUAppcastItem *)item; + +/*! + Called when a valid update is not found. + + \param updater The SUUpdater instance. + */ +- (void)updaterDidNotFindUpdate:(SUUpdater *)updater; + +/*! + Called immediately before downloading the specified update. + + \param updater The SUUpdater instance. + \param item The appcast item corresponding to the update that is proposed to be downloaded. + \param request The mutable URL request that will be used to download the update. + */ +- (void)updater:(SUUpdater *)updater willDownloadUpdate:(SUAppcastItem *)item withRequest:(NSMutableURLRequest *)request; + +/*! + Called after the specified update failed to download. + + \param updater The SUUpdater instance. + \param item The appcast item corresponding to the update that failed to download. + \param error The error generated by the failed download. + */ +- (void)updater:(SUUpdater *)updater failedToDownloadUpdate:(SUAppcastItem *)item error:(NSError *)error; + +/*! + Called when the user clicks the cancel button while and update is being downloaded. + + \param updater The SUUpdater instance. + */ +- (void)userDidCancelDownload:(SUUpdater *)updater; + +/*! + Called immediately before installing the specified update. + + \param updater The SUUpdater instance. + \param item The appcast item corresponding to the update that is proposed to be installed. + */ +- (void)updater:(SUUpdater *)updater willInstallUpdate:(SUAppcastItem *)item; + +/*! + Returns whether the relaunch should be delayed in order to perform other tasks. + + This is not called if the user didn't relaunch on the previous update, + in that case it will immediately restart. + + \param updater The SUUpdater instance. + \param item The appcast item corresponding to the update that is proposed to be installed. + \param invocation The invocation that must be completed with `[invocation invoke]` before continuing with the relaunch. + + \return \c YES to delay the relaunch until \p invocation is invoked. + */ +- (BOOL)updater:(SUUpdater *)updater shouldPostponeRelaunchForUpdate:(SUAppcastItem *)item untilInvoking:(NSInvocation *)invocation; + +/*! + Returns whether the application should be relaunched at all. + + Some apps \b cannot be relaunched under certain circumstances. + This method can be used to explicitly prevent a relaunch. + + \param updater The SUUpdater instance. + */ +- (BOOL)updaterShouldRelaunchApplication:(SUUpdater *)updater; + +/*! + Called immediately before relaunching. + + \param updater The SUUpdater instance. + */ +- (void)updaterWillRelaunchApplication:(SUUpdater *)updater; + +/*! + Returns an object that compares version numbers to determine their arithmetic relation to each other. + + This method allows you to provide a custom version comparator. + If you don't implement this method or return \c nil, + the standard version comparator will be used. + + \sa SUStandardVersionComparator + + \param updater The SUUpdater instance. + */ +- (nullable id)versionComparatorForUpdater:(SUUpdater *)updater; + +/*! + Returns an object that formats version numbers for display to the user. + + If you don't implement this method or return \c nil, + the standard version formatter will be used. + + \sa SUUpdateAlert + + \param updater The SUUpdater instance. + */ +- (nullable id)versionDisplayerForUpdater:(SUUpdater *)updater; + +/*! + Returns the path which is used to relaunch the client after the update is installed. + + The default is the path of the host bundle. + + \param updater The SUUpdater instance. + */ +- (nullable NSString *)pathToRelaunchForUpdater:(SUUpdater *)updater; + +/*! + Called before an updater shows a modal alert window, + to give the host the opportunity to hide attached windows that may get in the way. + + \param updater The SUUpdater instance. + */ +- (void)updaterWillShowModalAlert:(SUUpdater *)updater; + +/*! + Called after an updater shows a modal alert window, + to give the host the opportunity to hide attached windows that may get in the way. + + \param updater The SUUpdater instance. + */ +- (void)updaterDidShowModalAlert:(SUUpdater *)updater; + +/*! + Called when an update is scheduled to be silently installed on quit. + This is after an update has been automatically downloaded in the background. + (i.e. SUUpdater::automaticallyDownloadsUpdates is YES) + + \param updater The SUUpdater instance. + \param item The appcast item corresponding to the update that is proposed to be installed. + \param invocation Can be used to trigger an immediate silent install and relaunch. + */ +- (void)updater:(SUUpdater *)updater willInstallUpdateOnQuit:(SUAppcastItem *)item immediateInstallationInvocation:(NSInvocation *)invocation; + +/*! + Calls after an update that was scheduled to be silently installed on quit has been canceled. + + \param updater The SUUpdater instance. + \param item The appcast item corresponding to the update that was proposed to be installed. + */ +- (void)updater:(SUUpdater *)updater didCancelInstallUpdateOnQuit:(SUAppcastItem *)item; + +/*! + Called after an update is aborted due to an error. + + \param updater The SUUpdater instance. + \param error The error that caused the abort + */ +- (void)updater:(SUUpdater *)updater didAbortWithError:(NSError *)error; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Sparkle.framework/Versions/A/Headers/SUVersionComparisonProtocol.h b/Sparkle.framework/Versions/A/Headers/SUVersionComparisonProtocol.h index 10c4266..c654fc4 100644 --- a/Sparkle.framework/Versions/A/Headers/SUVersionComparisonProtocol.h +++ b/Sparkle.framework/Versions/A/Headers/SUVersionComparisonProtocol.h @@ -9,9 +9,15 @@ #ifndef SUVERSIONCOMPARISONPROTOCOL_H #define SUVERSIONCOMPARISONPROTOCOL_H -#import +#if __has_feature(modules) +@import Foundation; +#else +#import +#endif #import "SUExport.h" +NS_ASSUME_NONNULL_BEGIN + /*! Provides version comparison facilities for Sparkle. */ @@ -27,4 +33,5 @@ @end +NS_ASSUME_NONNULL_END #endif diff --git a/Sparkle.framework/Versions/A/Headers/SUVersionDisplayProtocol.h b/Sparkle.framework/Versions/A/Headers/SUVersionDisplayProtocol.h index 97fae4c..980efb3 100644 --- a/Sparkle.framework/Versions/A/Headers/SUVersionDisplayProtocol.h +++ b/Sparkle.framework/Versions/A/Headers/SUVersionDisplayProtocol.h @@ -6,7 +6,11 @@ // Copyright 2009 Elgato Systems GmbH. All rights reserved. // -#import +#if __has_feature(modules) +@import Foundation; +#else +#import +#endif #import "SUExport.h" /*! @@ -20,6 +24,6 @@ Both versions are provided so that important distinguishing information can be displayed while also leaving out unnecessary/confusing parts. */ -- (void)formatVersion:(NSString **)inOutVersionA andVersion:(NSString **)inOutVersionB; +- (void)formatVersion:(NSString *_Nonnull*_Nonnull)inOutVersionA andVersion:(NSString *_Nonnull*_Nonnull)inOutVersionB; @end diff --git a/Sparkle.framework/Versions/A/Headers/Sparkle.h b/Sparkle.framework/Versions/A/Headers/Sparkle.h index 20ed697..d3f6ff2 100644 --- a/Sparkle.framework/Versions/A/Headers/Sparkle.h +++ b/Sparkle.framework/Versions/A/Headers/Sparkle.h @@ -9,8 +9,6 @@ #ifndef SPARKLE_H #define SPARKLE_H -#import - // This list should include the shared headers. It doesn't matter if some of them aren't shared (unless // there are name-space collisions) so we can list all of them to start with: @@ -18,6 +16,7 @@ #import "SUAppcastItem.h" #import "SUStandardVersionComparator.h" #import "SUUpdater.h" +#import "SUUpdaterDelegate.h" #import "SUVersionComparisonProtocol.h" #import "SUVersionDisplayProtocol.h" #import "SUErrors.h" diff --git a/Sparkle.framework/Versions/A/PrivateHeaders/SUUnarchiver.h b/Sparkle.framework/Versions/A/PrivateHeaders/SUUnarchiver.h index ccd5611..a52bf5a 100644 --- a/Sparkle.framework/Versions/A/PrivateHeaders/SUUnarchiver.h +++ b/Sparkle.framework/Versions/A/PrivateHeaders/SUUnarchiver.h @@ -6,31 +6,16 @@ // Copyright 2006 Andy Matuschak. All rights reserved. // -#ifndef SUUNARCHIVER_H -#define SUUNARCHIVER_H - #import -@class SUHost; -@protocol SUUnarchiverDelegate; +NS_ASSUME_NONNULL_BEGIN + +@protocol SUUnarchiverProtocol; @interface SUUnarchiver : NSObject -@property (copy, readonly) NSString *archivePath; -@property (copy, readonly) NSString *updateHostBundlePath; -@property (copy, readonly) NSString *decryptionPassword; -@property (weak) id delegate; ++ (nullable id )unarchiverForPath:(NSString *)path updatingHostBundlePath:(nullable NSString *)hostPath decryptionPassword:(nullable NSString *)decryptionPassword; -+ (SUUnarchiver *)unarchiverForPath:(NSString *)path updatingHostBundlePath:(NSString *)host withPassword:(NSString *)decryptionPassword; - -- (void)start; @end -@protocol SUUnarchiverDelegate -- (void)unarchiverDidFinish:(SUUnarchiver *)unarchiver; -- (void)unarchiverDidFail:(SUUnarchiver *)unarchiver; -@optional -- (void)unarchiver:(SUUnarchiver *)unarchiver extractedProgress:(double)progress; -@end - -#endif +NS_ASSUME_NONNULL_END diff --git a/Sparkle.framework/Versions/A/Resources/Autoupdate.app/Contents/Info.plist b/Sparkle.framework/Versions/A/Resources/Autoupdate.app/Contents/Info.plist index 5cb9c8d..a8fa522 100644 --- a/Sparkle.framework/Versions/A/Resources/Autoupdate.app/Contents/Info.plist +++ b/Sparkle.framework/Versions/A/Resources/Autoupdate.app/Contents/Info.plist @@ -3,13 +3,13 @@ BuildMachineOSBuild - 15E49a + 16E175b CFBundleDevelopmentRegion English CFBundleExecutable Autoupdate CFBundleIconFile - AppIcon + AppIcon.icns CFBundleIdentifier org.sparkle-project.Sparkle.Autoupdate CFBundleInfoDictionaryVersion @@ -17,7 +17,7 @@ CFBundlePackageType APPL CFBundleShortVersionString - 1.14.0 + 1.17.0 12-g72ee4aa2 CFBundleSignature ???? CFBundleSupportedPlatforms @@ -25,21 +25,21 @@ MacOSX CFBundleVersion - 1.14.0 + 1.17.0 DTCompiler com.apple.compilers.llvm.clang.1_0 DTPlatformBuild - 7C1002 + 8W120l DTPlatformVersion GM DTSDKBuild - 15C43 + 16E153d DTSDKName - macosx10.11 + macosx10.12 DTXcode - 0721 + 0830 DTXcodeBuild - 7C1002 + 8W120l LSBackgroundOnly 1 LSMinimumSystemVersion diff --git a/Sparkle.framework/Versions/A/Resources/Autoupdate.app/Contents/MacOS/Autoupdate b/Sparkle.framework/Versions/A/Resources/Autoupdate.app/Contents/MacOS/Autoupdate index 0e70736..e3cb6c6 100755 Binary files a/Sparkle.framework/Versions/A/Resources/Autoupdate.app/Contents/MacOS/Autoupdate and b/Sparkle.framework/Versions/A/Resources/Autoupdate.app/Contents/MacOS/Autoupdate differ diff --git a/Sparkle.framework/Versions/A/Resources/Autoupdate.app/Contents/MacOS/fileop b/Sparkle.framework/Versions/A/Resources/Autoupdate.app/Contents/MacOS/fileop new file mode 100755 index 0000000..b592f66 Binary files /dev/null and b/Sparkle.framework/Versions/A/Resources/Autoupdate.app/Contents/MacOS/fileop differ diff --git a/Sparkle.framework/Versions/A/Resources/Autoupdate.app/Contents/Resources/AppIcon.icns b/Sparkle.framework/Versions/A/Resources/Autoupdate.app/Contents/Resources/AppIcon.icns index 93fb79e..7f2a571 100644 Binary files a/Sparkle.framework/Versions/A/Resources/Autoupdate.app/Contents/Resources/AppIcon.icns and b/Sparkle.framework/Versions/A/Resources/Autoupdate.app/Contents/Resources/AppIcon.icns differ diff --git a/Sparkle.framework/Versions/A/Resources/Autoupdate.app/Contents/Resources/SUStatus.nib b/Sparkle.framework/Versions/A/Resources/Autoupdate.app/Contents/Resources/SUStatus.nib index 30f3c2c..f6d608b 100644 Binary files a/Sparkle.framework/Versions/A/Resources/Autoupdate.app/Contents/Resources/SUStatus.nib and b/Sparkle.framework/Versions/A/Resources/Autoupdate.app/Contents/Resources/SUStatus.nib differ diff --git a/Sparkle.framework/Versions/A/Resources/Info.plist b/Sparkle.framework/Versions/A/Resources/Info.plist index 64d696e..6c7e79d 100644 --- a/Sparkle.framework/Versions/A/Resources/Info.plist +++ b/Sparkle.framework/Versions/A/Resources/Info.plist @@ -3,7 +3,7 @@ BuildMachineOSBuild - 15E49a + 16E175b CFBundleDevelopmentRegion en CFBundleExecutable @@ -17,7 +17,7 @@ CFBundlePackageType FMWK CFBundleShortVersionString - 1.14.0 + 1.17.0 12-g72ee4aa2 CFBundleSignature ???? CFBundleSupportedPlatforms @@ -25,20 +25,20 @@ MacOSX CFBundleVersion - 1.14.0 + 1.17.0 DTCompiler com.apple.compilers.llvm.clang.1_0 DTPlatformBuild - 7C1002 + 8W120l DTPlatformVersion GM DTSDKBuild - 15C43 + 16E153d DTSDKName - macosx10.11 + macosx10.12 DTXcode - 0721 + 0830 DTXcodeBuild - 7C1002 + 8W120l diff --git a/Sparkle.framework/Versions/A/Resources/SUStatus.nib b/Sparkle.framework/Versions/A/Resources/SUStatus.nib index 30f3c2c..f6d608b 100644 Binary files a/Sparkle.framework/Versions/A/Resources/SUStatus.nib and b/Sparkle.framework/Versions/A/Resources/SUStatus.nib differ diff --git a/Sparkle.framework/Versions/A/Resources/en.lproj/SUAutomaticUpdateAlert.nib b/Sparkle.framework/Versions/A/Resources/en.lproj/SUAutomaticUpdateAlert.nib index df090b4..c8294b5 100644 Binary files a/Sparkle.framework/Versions/A/Resources/en.lproj/SUAutomaticUpdateAlert.nib and b/Sparkle.framework/Versions/A/Resources/en.lproj/SUAutomaticUpdateAlert.nib differ diff --git a/Sparkle.framework/Versions/A/Resources/en.lproj/SUUpdateAlert.nib b/Sparkle.framework/Versions/A/Resources/en.lproj/SUUpdateAlert.nib index 7ed2647..b9d3968 100644 Binary files a/Sparkle.framework/Versions/A/Resources/en.lproj/SUUpdateAlert.nib and b/Sparkle.framework/Versions/A/Resources/en.lproj/SUUpdateAlert.nib differ diff --git a/Sparkle.framework/Versions/A/Resources/en.lproj/SUUpdatePermissionPrompt.nib b/Sparkle.framework/Versions/A/Resources/en.lproj/SUUpdatePermissionPrompt.nib index 9c0c887..787ec56 100644 Binary files a/Sparkle.framework/Versions/A/Resources/en.lproj/SUUpdatePermissionPrompt.nib and b/Sparkle.framework/Versions/A/Resources/en.lproj/SUUpdatePermissionPrompt.nib differ diff --git a/Sparkle.framework/Versions/A/Resources/it.lproj/SUAutomaticUpdateAlert.nib b/Sparkle.framework/Versions/A/Resources/it.lproj/SUAutomaticUpdateAlert.nib index 74eb026..e599970 100644 Binary files a/Sparkle.framework/Versions/A/Resources/it.lproj/SUAutomaticUpdateAlert.nib and b/Sparkle.framework/Versions/A/Resources/it.lproj/SUAutomaticUpdateAlert.nib differ diff --git a/Sparkle.framework/Versions/A/Resources/it.lproj/SUUpdateAlert.nib b/Sparkle.framework/Versions/A/Resources/it.lproj/SUUpdateAlert.nib index a7bc37b..f5893cb 100644 Binary files a/Sparkle.framework/Versions/A/Resources/it.lproj/SUUpdateAlert.nib and b/Sparkle.framework/Versions/A/Resources/it.lproj/SUUpdateAlert.nib differ diff --git a/Sparkle.framework/Versions/A/Resources/it.lproj/SUUpdatePermissionPrompt.nib b/Sparkle.framework/Versions/A/Resources/it.lproj/SUUpdatePermissionPrompt.nib index 7581873..fa3cc74 100644 Binary files a/Sparkle.framework/Versions/A/Resources/it.lproj/SUUpdatePermissionPrompt.nib and b/Sparkle.framework/Versions/A/Resources/it.lproj/SUUpdatePermissionPrompt.nib differ diff --git a/Sparkle.framework/Versions/A/Sparkle b/Sparkle.framework/Versions/A/Sparkle index 5b7ce17..10a0859 100755 Binary files a/Sparkle.framework/Versions/A/Sparkle and b/Sparkle.framework/Versions/A/Sparkle differ