Skip to content

Commit

Permalink
macOS: Sparkle updated to 1.15
Browse files Browse the repository at this point in the history
  • Loading branch information
Paul Tsochantaris authored and Paul Tsochantaris committed Dec 2, 2016
1 parent 1a141b1 commit 150e7a8
Show file tree
Hide file tree
Showing 99 changed files with 187 additions and 59 deletions.
4 changes: 4 additions & 0 deletions Trailer/Sparkle.framework/Versions/A/Headers/SUAppcast.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,11 @@
#ifndef SUAPPCAST_H
#define SUAPPCAST_H

#if __has_feature(modules)
@import Foundation;
#else
#import <Foundation/Foundation.h>
#endif
#import "SUExport.h"

@class SUAppcastItem;
Expand Down
6 changes: 5 additions & 1 deletion Trailer/Sparkle.framework/Versions/A/Headers/SUAppcastItem.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,16 @@
#ifndef SUAPPCASTITEM_H
#define SUAPPCASTITEM_H

#if __has_feature(modules)
@import Foundation;
#else
#import <Foundation/Foundation.h>
#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;
Expand Down
12 changes: 9 additions & 3 deletions Trailer/Sparkle.framework/Versions/A/Headers/SUErrors.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,11 @@
#ifndef SUERRORS_H
#define SUERRORS_H

#if __has_feature(modules)
@import Foundation;
#else
#import <Foundation/Foundation.h>
#endif
#import "SUExport.h"

/**
Expand All @@ -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,
Expand All @@ -39,6 +44,7 @@ typedef NS_ENUM(OSStatus, SUError) {
SURelaunchError = 4004,
SUInstallationError = 4005,
SUDowngradeError = 4006,
SUInstallationCancelledError = 4007,

// System phase errors
SUSystemPowerOffError = 5000
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,11 @@
#ifndef SUSTANDARDVERSIONCOMPARATOR_H
#define SUSTANDARDVERSIONCOMPARATOR_H

#if __has_feature(modules)
@import Foundation;
#else
#import <Foundation/Foundation.h>
#endif
#import "SUExport.h"
#import "SUVersionComparisonProtocol.h"

Expand Down
174 changes: 136 additions & 38 deletions Trailer/Sparkle.framework/Versions/A/Headers/SUUpdater.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,11 @@
#ifndef SUUPDATER_H
#define SUUPDATER_H

#if __has_feature(modules)
@import Foundation;
#else
#import <Foundation/Foundation.h>
#endif
#import "SUExport.h"
#import "SUVersionComparisonProtocol.h"
#import "SUVersionDisplayProtocol.h"
Expand All @@ -28,64 +32,158 @@ SU_EXPORT @interface SUUpdater : NSObject

@property (unsafe_unretained) IBOutlet id<SUUpdaterDelegate> 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;
/*!
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;

/*!
The menu item validation used for the -checkForUpdates: action
*/
- (BOOL)validateMenuItem:(NSMenuItem *)menuItem;

/*!
Checks for updates, but does not display any UI unless an update is found.
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;

/*!
* The URL of the appcast used to download update information.
*
* This property must be called on the main thread.
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;

@property (nonatomic, copy) NSString *userAgentString;

@property (copy) NSDictionary *httpHeaders;
/*!
The host bundle that is being updated.
*/
@property (readonly, strong) NSBundle *hostBundle;

@property BOOL sendsSystemProfile;
/*!
The bundle this class (SUUpdater) is loaded into.
*/
@property (strong, readonly) NSBundle *sparkleBundle;

@property BOOL automaticallyDownloadsUpdates;
/*!
The user agent used when checking for updates.
@property (nonatomic, copy) NSString *decryptionPassword;
The default implementation can be overrided.
*/
@property (nonatomic, copy) NSString *userAgentString;

/*!
Explicitly checks for updates and displays a progress dialog while doing so.
The HTTP headers used when checking for updates.
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.
The keys of this dictionary are HTTP header fields (NSString) and values are corresponding values (NSString)
*/
- (IBAction)checkForUpdates:(id)sender;
@property (copy) NSDictionary *httpHeaders;

/*!
Checks for updates, but does not display any UI unless an update is found.
A property indicating whether or not the user's system profile information is sent when checking for updates.
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.
Setting this property will persist in the host bundle's user defaults.
*/
@property BOOL sendsSystemProfile;

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.
/*!
A property indicating the decryption password used for extracting updates shipped as Apple Disk Images (dmg)
*/
- (void)checkForUpdatesInBackground;
@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;

Expand All @@ -96,17 +194,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.
Expand All @@ -116,6 +203,12 @@ 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
Expand Down Expand Up @@ -172,6 +265,9 @@ SU_EXPORT extern NSString *const SUUpdaterAppcastNotificationKey;
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.
*/
- (NSString *)feedURLStringForUpdater:(SUUpdater *)updater;
Expand Down Expand Up @@ -263,7 +359,7 @@ SU_EXPORT extern NSString *const SUUpdaterAppcastNotificationKey;
\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.
\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.
*/
Expand Down Expand Up @@ -338,6 +434,8 @@ SU_EXPORT extern NSString *const SUUpdaterAppcastNotificationKey;

/*!
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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,11 @@
#ifndef SUVERSIONCOMPARISONPROTOCOL_H
#define SUVERSIONCOMPARISONPROTOCOL_H

#if __has_feature(modules)
@import Cocoa;
#else
#import <Cocoa/Cocoa.h>
#endif
#import "SUExport.h"

/*!
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@
// Copyright 2009 Elgato Systems GmbH. All rights reserved.
//

#if __has_feature(modules)
@import Cocoa;
#else
#import <Cocoa/Cocoa.h>
#endif
#import "SUExport.h"

/*!
Expand Down
4 changes: 4 additions & 0 deletions Trailer/Sparkle.framework/Versions/A/Headers/Sparkle.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,11 @@
#ifndef SPARKLE_H
#define SPARKLE_H

#if __has_feature(modules)
@import Cocoa;
#else
#import <Cocoa/Cocoa.h>
#endif

// 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:
Expand Down
Loading

0 comments on commit 150e7a8

Please sign in to comment.