프로젝트 소스 공개

This commit is contained in:
2026-09-06 17:11:40 +09:00
commit 0f0431de5a
676 changed files with 106118 additions and 0 deletions
+134
View File
@@ -0,0 +1,134 @@
Copyright (c) 2006-2013 Andy Matuschak.
Copyright (c) 2009-2013 Elgato Systems GmbH.
Copyright (c) 2011-2014 Kornel Lesiński.
Copyright (c) 2015-2017 Mayur Pawashe.
Copyright (c) 2014 C.W. Betts.
Copyright (c) 2014 Petroules Corporation.
Copyright (c) 2014 Big Nerd Ranch.
All rights reserved.
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
=================
EXTERNAL LICENSES
=================
bspatch.c and bsdiff.c, from bsdiff 4.3 <http://www.daemonology.net/bsdiff/>:
Copyright 2003-2005 Colin Percival
All rights reserved
Redistribution and use in source and binary forms, with or without
modification, are permitted providing that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
--
sais.c and sais.h, from sais-lite (2010/08/07) <https://sites.google.com/site/yuta256/sais>:
The sais-lite copyright is as follows:
Copyright (c) 2008-2010 Yuta Mori All Rights Reserved.
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the "Software"), to deal in the Software without
restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following
conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
--
Portable C implementation of Ed25519, from https://github.com/orlp/ed25519
Copyright (c) 2015 Orson Peters <orsonpeters@gmail.com>
This software is provided 'as-is', without any express or implied warranty. In no event will the
authors be held liable for any damages arising from the use of this software.
Permission is granted to anyone to use this software for any purpose, including commercial
applications, and to alter it and redistribute it freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not claim that you wrote the
original software. If you use this software in a product, an acknowledgment in the product
documentation would be appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be misrepresented as
being the original software.
3. This notice may not be removed or altered from any source distribution.
--
SUSignatureVerifier.m:
Copyright (c) 2011 Mark Hamlin.
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted providing that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
+18
View File
@@ -0,0 +1,18 @@
# Sparkle 2.9.4
ProjectQuint vendors the official Sparkle 2.9.4 binary distribution for macOS
automatic updates.
- Upstream: https://github.com/sparkle-project/Sparkle
- Release archive SHA-256:
`ce89daf967db1e1893ed3ebd67575ed82d3902563e3191ca92aaec9164fbdef9`
- Framework binary SHA-256:
`8a25650d0ac4f5df6c76b3da58f508c71e6c4b2fb0ddf921ac95dc53a3bdb22c`
- Sparkle signing-key Keychain account:
`com.teamdenia.projectquint`
- Ed25519 public key:
`w94qM58k8MAhIxYYQiR1ivyR5CyMW1tlRV68lQoLehA=`
The private Ed25519 key is intentionally stored only in the macOS login
Keychain. It must never be copied into this project, the application bundle,
the website, or the deployment server.
+1
View File
@@ -0,0 +1 @@
Versions/Current/Autoupdate
+1
View File
@@ -0,0 +1 @@
Versions/Current/Headers
+1
View File
@@ -0,0 +1 @@
Versions/Current/Modules
+1
View File
@@ -0,0 +1 @@
Versions/Current/PrivateHeaders
+1
View File
@@ -0,0 +1 @@
Versions/Current/Resources
+1
View File
@@ -0,0 +1 @@
Versions/Current/Sparkle
+1
View File
@@ -0,0 +1 @@
Versions/Current/Updater.app
Binary file not shown.
@@ -0,0 +1,32 @@
//
// SPUAppcastSigningValidationStatus.h
// Sparkle
//
// Created on 12/30/25.
// Copyright © 2025 Sparkle Project. All rights reserved.
//
#ifndef SPUAppcastSigningValidationStatus_h
#define SPUAppcastSigningValidationStatus_h
typedef NS_ENUM(NSInteger, SPUAppcastSigningValidationStatus)
{
/**
The bundle does not opt into requiring appcast signing and no validation of the appcast feed is done.
*/
SPUAppcastSigningValidationStatusSkipped = 0,
/**
The appcast is signed and validation has passed succesfully.
*/
SPUAppcastSigningValidationStatusSucceeded,
/**
The appcast is signed and validation has failed. In this case, appcast items operate in a 'safe' fallback mode
meaning that they cannot be marked as a critical update, cannot be marked as informational update,
and will not have any release note or link references.
*/
SPUAppcastSigningValidationStatusFailed,
};
#endif /* SPUAppcastSigningValidationStatus_h */
@@ -0,0 +1,52 @@
//
// SPUDownloadData.h
// Sparkle
//
// Created by Mayur Pawashe on 8/10/16.
// Copyright © 2016 Sparkle Project. All rights reserved.
//
#import <Foundation/Foundation.h>
#if defined(BUILDING_SPARKLE_SOURCES_EXTERNALLY)
// Ignore incorrect warning
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wquoted-include-in-framework-header"
#import "SUExport.h"
#pragma clang diagnostic pop
#else
#import <Sparkle/SUExport.h>
#endif
NS_ASSUME_NONNULL_BEGIN
/**
* A class for containing downloaded data along with some information about it.
*/
SU_EXPORT NS_SWIFT_SENDABLE @interface SPUDownloadData : NSObject <NSSecureCoding>
/**
* The raw data that was downloaded.
*/
@property (nonatomic, readonly) NSData *data;
/**
* The URL that was fetched from.
*
* This may be different from the URL in the request if there were redirects involved.
*/
@property (nonatomic, readonly, copy) NSURL *URL;
/**
* The IANA charset encoding name if available. Eg: "utf-8"
*/
@property (nonatomic, readonly, nullable, copy) NSString *textEncodingName;
/**
* The MIME type if available. Eg: "text/plain"
*/
@property (nonatomic, readonly, nullable, copy) NSString *MIMEType;
@end
NS_ASSUME_NONNULL_END
@@ -0,0 +1,127 @@
//
// SPUStandardUpdaterController.h
// Sparkle
//
// Created by Mayur Pawashe on 2/28/16.
// Copyright © 2016 Sparkle Project. All rights reserved.
//
#import <Foundation/Foundation.h>
#if defined(BUILDING_SPARKLE_SOURCES_EXTERNALLY)
// Ignore incorrect warning
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wquoted-include-in-framework-header"
#import "SUExport.h"
#pragma clang diagnostic pop
#else
#import <Sparkle/SUExport.h>
#endif
NS_ASSUME_NONNULL_BEGIN
@class SPUUpdater;
@class SPUStandardUserDriver;
@class NSMenuItem;
@protocol SPUUserDriver, SPUUpdaterDelegate, SPUStandardUserDriverDelegate;
/**
A controller class that instantiates a `SPUUpdater` and allows binding UI to its updater settings.
This class can be instantiated in a nib or created programmatically using `-initWithUpdaterDelegate:userDriverDelegate:` or `-initWithStartingUpdater:updaterDelegate:userDriverDelegate:`.
The controller's updater targets the application's main bundle and uses Sparkle's standard user interface.
Typically, this class is used by sticking it as a custom NSObject subclass in an Interface Builder nib (probably in MainMenu) but it works well programmatically too.
The controller creates an `SPUUpdater` instance using a `SPUStandardUserDriver` and allows hooking up the check for updates action and handling menu item validation.
It also allows hooking up the updater's and user driver's delegates.
If you need more control over what bundle you want to update, or you want to provide a custom user interface (via `SPUUserDriver`), please use `SPUUpdater` directly instead.
This class must be used on the main thread.
*/
SU_EXPORT NS_SWIFT_UI_ACTOR @interface SPUStandardUpdaterController : NSObject
{
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wobjc-interface-ivars"
/**
* Interface builder outlet for the updater's delegate.
*/
IBOutlet __weak id<SPUUpdaterDelegate> updaterDelegate;
/**
* Interface builder outlet for the user driver's delegate.
*/
IBOutlet __weak id<SPUStandardUserDriverDelegate> userDriverDelegate;
#pragma clang diagnostic pop
}
/**
Accessible property for the updater. Some properties on the updater can be binded via KVO
When instantiated from a nib, don't perform update checks before the application has finished launching in a MainMenu nib (i.e applicationDidFinishLaunching:) or before the corresponding window/view controller has been loaded (i.e, windowDidLoad or viewDidLoad). The updater is not guaranteed to be started yet before these points.
*/
@property (nonatomic, readonly) SPUUpdater *updater;
/**
Accessible property for the updater's user driver.
*/
@property (nonatomic, readonly) SPUStandardUserDriver *userDriver;
/**
Create a new `SPUStandardUpdaterController` from a nib.
You cannot call this initializer directly. You must instantiate a `SPUStandardUpdaterController` inside of a nib (typically the MainMenu nib) to use it.
To create a `SPUStandardUpdaterController` programmatically, use `-initWithUpdaterDelegate:userDriverDelegate:` or `-initWithStartingUpdater:updaterDelegate:userDriverDelegate:` instead.
*/
- (instancetype)init NS_UNAVAILABLE;
/**
Create a new `SPUStandardUpdaterController` programmatically.
The updater is started automatically. See `-startUpdater` for more information.
Note the `updaterDelegate` and `userDriverDelegate` are weakly referenced, so you are responsible for keeping them alive.
*/
- (instancetype)initWithUpdaterDelegate:(nullable id<SPUUpdaterDelegate>)updaterDelegate userDriverDelegate:(nullable id<SPUStandardUserDriverDelegate>)userDriverDelegate;
/**
Create a new `SPUStandardUpdaterController` programmatically allowing you to specify whether or not to start the updater immediately.
You can specify whether or not you want to start the updater immediately.
If you do not start the updater, you must invoke `-startUpdater` at a later time to start it.
Note the `updaterDelegate` and `userDriverDelegate` are weakly referenced, so you are responsible for keeping them alive.
*/
- (instancetype)initWithStartingUpdater:(BOOL)startUpdater updaterDelegate:(nullable id<SPUUpdaterDelegate>)updaterDelegate userDriverDelegate:(nullable id<SPUStandardUserDriverDelegate>)userDriverDelegate;
/**
Starts the updater if it has not already been started.
You should only call this method yourself if you opted out of starting the updater on initialization.
Hence, do not call this yourself if you are instantiating this controller from a nib.
This invokes `-[SPUUpdater startUpdater:]`. If the application is misconfigured with Sparkle, an error is logged and an alert is shown to the user (after a few seconds) to contact the developer.
If you want more control over this behavior, you can create your own `SPUUpdater` instead of using `SPUStandardUpdaterController`.
*/
- (void)startUpdater;
/**
Explicitly checks for updates and displays a progress dialog while doing so.
This method is meant for a main menu item.
Connect any NSMenuItem to this action in Interface Builder or programmatically,
and Sparkle will check for updates and report back its findings verbosely when it is invoked.
When the target/action of the menu item is set to this controller and this method,
this controller also handles enabling/disabling the menu item by checking
`-[SPUUpdater canCheckForUpdates]`
This action checks updates by invoking `-[SPUUpdater checkForUpdates]`
*/
- (IBAction)checkForUpdates:(nullable id)sender;
@end
NS_ASSUME_NONNULL_END
@@ -0,0 +1,47 @@
//
// SPUStandardUserDriver.h
// Sparkle
//
// Created by Mayur Pawashe on 2/14/16.
// Copyright © 2016 Sparkle Project. All rights reserved.
//
#import <Foundation/Foundation.h>
#if defined(BUILDING_SPARKLE_SOURCES_EXTERNALLY)
// Ignore incorrect warning
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wquoted-include-in-framework-header"
#import "SPUUserDriver.h"
#import "SUExport.h"
#pragma clang diagnostic pop
#else
#import <Sparkle/SPUUserDriver.h>
#import <Sparkle/SUExport.h>
#endif
NS_ASSUME_NONNULL_BEGIN
@protocol SPUStandardUserDriverDelegate;
/**
Sparkle's standard built-in user driver for updater interactions
*/
SU_EXPORT NS_SWIFT_UI_ACTOR @interface SPUStandardUserDriver : NSObject <SPUUserDriver>
/**
Initializes a Sparkle's standard user driver for user update interactions
@param hostBundle The target bundle of the host that is being updated.
@param delegate The optional delegate to this user driver. Note the standard user driver weakly references the delegate, so you are responsible for keeping it alive.
*/
- (instancetype)initWithHostBundle:(NSBundle *)hostBundle delegate:(nullable id<SPUStandardUserDriverDelegate>)delegate;
/**
Use initWithHostBundle:delegate: instead.
*/
- (instancetype)init NS_UNAVAILABLE;
@end
NS_ASSUME_NONNULL_END
@@ -0,0 +1,209 @@
//
// SPUStandardUserDriverDelegate.h
// Sparkle
//
// Created by Mayur Pawashe on 3/3/16.
// Copyright © 2016 Sparkle Project. All rights reserved.
//
#import <Foundation/Foundation.h>
#if defined(BUILDING_SPARKLE_SOURCES_EXTERNALLY)
// Ignore incorrect warning
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wquoted-include-in-framework-header"
#import "SUExport.h"
#pragma clang diagnostic pop
#else
#import <Sparkle/SUExport.h>
#endif
NS_ASSUME_NONNULL_BEGIN
@protocol SUVersionDisplay;
@class SUAppcastItem;
@class SPUUserUpdateState;
/**
A protocol for Sparkle's standard user driver's delegate
This includes methods related to UI interactions
*/
SU_EXPORT @protocol SPUStandardUserDriverDelegate <NSObject>
@optional
/**
Called before showing a modal alert window,
to give the opportunity to hide attached windows that may get in the way.
*/
- (void)standardUserDriverWillShowModalAlert;
/**
Called after showing a modal alert window,
to give the opportunity to hide attached windows that may get in the way.
*/
- (void)standardUserDriverDidShowModalAlert;
/**
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.
*/
- (_Nullable id <SUVersionDisplay>)standardUserDriverRequestsVersionDisplayer;
/**
Decides whether or not the standard user driver should provide an option to show full release notes to the user.
When a user checks for new updates and no new update is found, Sparkle by default will offer to show the application's version history to the user
by providing a "Version History" button in the no new update available alert.
If this delegate method is implemented to return `NO`, then Sparkle will not provide an option to show full release notes to the user.
@param item The appcast item corresponding to the latest version available.
@return @c YES to allow Sparkle to show full release notes to the user, otherwise @c NO to disallow this.
*/
- (BOOL)standardUserDriverShouldShowVersionHistoryForAppcastItem:(SUAppcastItem *)item;
/**
Handles showing the full release notes to the user.
When a user checks for new updates and no new update is found, Sparkle will offer to show the application's version history to the user
by providing a "Version History" button in the no new update available alert.
If this delegate method is not implemented, Sparkle will instead offer to open the
`fullReleaseNotesLink` (or `releaseNotesLink` if the former is unavailable) from the appcast's latest `item` in the user's web browser.
If this delegate method is implemented, Sparkle will instead ask the delegate to show the full release notes to the user.
A delegate may want to implement this method if they want to show in-app or offline release notes.
@param item The appcast item corresponding to the latest version available.
*/
- (void)standardUserDriverShowVersionHistoryForAppcastItem:(SUAppcastItem *)item;
/**
Specifies whether or not the download, extraction, and installing status windows allows to be minimized.
By default, the status window showing the current status of the update (download, extraction, ready to install) is allowed to be minimized
for regular application bundle updates.
@return @c YES if the status window is allowed to be minimized (default behavior), otherwise @c NO.
*/
- (BOOL)standardUserDriverAllowsMinimizableStatusWindow;
/**
Declares whether or not gentle scheduled update reminders are supported.
The delegate may implement scheduled update reminders that are presented in a gentle manner by implementing one or both of:
`-standardUserDriverWillHandleShowingUpdate:forUpdate:state:` and `-standardUserDriverShouldHandleShowingScheduledUpdate:andInImmediateFocus:`
Visit https://sparkle-project.org/documentation/gentle-reminders for more information and examples.
@return @c YES if gentle scheduled update reminders are implemented by standard user driver delegate, otherwise @c NO (default).
*/
@property (nonatomic, readonly) BOOL supportsGentleScheduledUpdateReminders;
/**
Specifies if the standard user driver should handle showing a new scheduled update, or if its delegate should handle showing the update instead.
If you implement this method and return @c NO the delegate is then responsible for showing the update,
which must be implemented and done in `-standardUserDriverWillHandleShowingUpdate:forUpdate:state:`
The motivation for the delegate being responsible for showing updates is to override Sparkle's default behavior
and add gentle reminders for new updates.
Returning @c YES is the default behavior and allows the standard user driver to handle showing the update.
If the standard user driver handles showing the update, `immediateFocus` reflects whether or not it will show the update in immediate and utmost focus.
The standard user driver may choose to show the update in immediate and utmost focus when the app was launched recently
or the system has been idle for some time.
If `immediateFocus` is @c NO the standard user driver may want to defer showing the update until the user comes back to the app.
For background running applications, when `immediateFocus` is @c NO the standard user driver will always want to show
the update alert immediately, but behind other running applications or behind the app's own windows if it's currently active.
There should be no side effects made when implementing this method so you should just return @c YES or @c NO
You will also want to implement `-standardUserDriverWillHandleShowingUpdate:forUpdate:state:` for adding additional update reminders.
This method is not called for user-initiated update checks. The standard user driver always handles those.
Visit https://sparkle-project.org/documentation/gentle-reminders for more information and examples.
@param update The update the standard user driver should show.
@param immediateFocus If @c immediateFocus is @c YES, then the standard user driver proposes to show the update in immediate and utmost focus. See discussion for more details.
@return @c YES if the standard user should handle showing the scheduled update (default behavior), otherwise @c NO if the delegate handles showing it.
*/
- (BOOL)standardUserDriverShouldHandleShowingScheduledUpdate:(SUAppcastItem *)update andInImmediateFocus:(BOOL)immediateFocus;
/**
Called before an update will be shown to the user.
If the standard user driver handles showing the update, `handleShowingUpdate` will be `YES`.
Please see `-standardUserDriverShouldHandleShowingScheduledUpdate:andInImmediateFocus:` for how the standard user driver
may handle showing scheduled updates when `handleShowingUpdate` is `YES` and `state.userInitiated` is `NO`.
If the delegate declared it handles showing the update by returning @c NO in `-standardUserDriverShouldHandleShowingScheduledUpdate:andInImmediateFocus:`
then the delegate should handle showing update reminders in this method, or at some later point.
In this case, `handleShowingUpdate` will be @c NO.
To bring the update alert in focus, you may call `-[SPUStandardUpdaterController checkForUpdates:]` or `-[SPUUpdater checkForUpdates]`.
You may want to show additional UI indicators in your application that will show this update in focus
and want to dismiss additional UI indicators in `-standardUserDriverWillFinishUpdateSession` or `-standardUserDriverDidReceiveUserAttentionForUpdate:`
If `state.userInitiated` is @c YES then the standard user driver always handles showing the new update and `handleShowingUpdate` will be @c YES.
In this case, it may still be useful for the delegate to intercept this method right before a new update will be shown.
This method is not called when bringing an update that has already been presented back in focus.
Visit https://sparkle-project.org/documentation/gentle-reminders for more information and examples.
@param handleShowingUpdate @c YES if the standard user driver handles showing the update, otherwise @c NO if the delegate handles showing the update.
@param update The update that will be shown.
@param state The user state of the update which includes if the update check was initiated by the user.
*/
- (void)standardUserDriverWillHandleShowingUpdate:(BOOL)handleShowingUpdate forUpdate:(SUAppcastItem *)update state:(SPUUserUpdateState *)state;
/**
Called when a new update first receives attention from the user.
This occurs either when the user first brings the update alert in utmost focus or when the user makes a choice to install an update or dismiss/skip it.
This may be useful to intercept for dismissing custom attention-based UI indicators (e.g, user notifications) introduced when implementing
`-standardUserDriverWillHandleShowingUpdate:forUpdate:state:`
For custom UI indicators that need to still be on screen after the user has started to install an update, please see `-standardUserDriverWillFinishUpdateSession`.
@param update The new update that the user gave attention to.
*/
- (void)standardUserDriverDidReceiveUserAttentionForUpdate:(SUAppcastItem *)update;
/**
Called before the standard user driver session will finish its current update session.
This may occur after the user has dismissed / skipped a new update or after an update error has occurred.
For updaters updating external/other bundles, this may also be called after an update has been successfully installed.
This may be useful to intercept for dismissing custom UI indicators introduced when implementing
`-standardUserDriverWillHandleShowingUpdate:forUpdate:state:`
For UI indicators that need to be dismissed when the user has given attention to a new update alert,
please see `-standardUserDriverDidReceiveUserAttentionForUpdate:`
*/
- (void)standardUserDriverWillFinishUpdateSession;
/**
Called before the standard user driver shows plain-text or markdown release notes text to the user.
The delegate has the opportunity to return a new attributed string for the release notes text that will be shown to the user.
The `bundleDisplayVersion` and `bundleVersion` are supplied in case they're useful for creating a new attributed string.
This method will not be invoked for HTML release notes. It is only applicable to plain-text and markdown release notes.
@param releaseNotesAttributedString The release notes text that the standard user driver wants to show to the user.
@param update The new update the release notes will be shown for.
@param bundleDisplayVersion The current display version (or `CFBundleShortVersionString`) of the bundle that is being updated.
@param bundleVersion The current version (or `CFBundleVersion`) of the bundle that is being updated.
@return A new attributed string for the release notes text to show, or @c nil if the `releaseNotesAttributedString` should still be used.
*/
- (NSAttributedString * _Nullable)standardUserDriverWillShowReleaseNotesText:(NSAttributedString *)releaseNotesAttributedString forUpdate:(SUAppcastItem *)update withBundleDisplayVersion:(NSString *)bundleDisplayVersion bundleVersion:(NSString *)bundleVersion;
@end
NS_ASSUME_NONNULL_END
@@ -0,0 +1,33 @@
//
// SPUUpdateCheck.h
// SPUUpdateCheck
//
// Created by Mayur Pawashe on 8/28/21.
// Copyright © 2021 Sparkle Project. All rights reserved.
//
#ifndef SPUUpdateCheck_h
#define SPUUpdateCheck_h
/**
Describes the type of update check being performed.
Each update check corresponds to an update check method on `SPUUpdater`.
*/
typedef NS_ENUM(NSInteger, SPUUpdateCheck)
{
/**
The user-initiated update check corresponding to `-[SPUUpdater checkForUpdates]`.
*/
SPUUpdateCheckUpdates = 0,
/**
The background scheduled update check corresponding to `-[SPUUpdater checkForUpdatesInBackground]`.
*/
SPUUpdateCheckUpdatesInBackground = 1,
/**
The informational probe update check corresponding to `-[SPUUpdater checkForUpdateInformation]`.
*/
SPUUpdateCheckUpdateInformation = 2
};
#endif /* SPUUpdateCheck_h */
@@ -0,0 +1,42 @@
//
// SPUUpdatePermissionRequest.h
// Sparkle
//
// Created by Mayur Pawashe on 8/14/16.
// Copyright © 2016 Sparkle Project. All rights reserved.
//
#import <Foundation/Foundation.h>
#if defined(BUILDING_SPARKLE_SOURCES_EXTERNALLY)
// Ignore incorrect warning
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wquoted-include-in-framework-header"
#import "SUExport.h"
#pragma clang diagnostic pop
#else
#import <Sparkle/SUExport.h>
#endif
NS_ASSUME_NONNULL_BEGIN
/**
This class represents information needed to make a permission request for checking updates.
*/
SU_EXPORT NS_SWIFT_SENDABLE @interface SPUUpdatePermissionRequest : NSObject<NSSecureCoding>
/**
Initializes a new update permission request instance.
@param systemProfile The system profile information.
*/
- (instancetype)initWithSystemProfile:(NSArray<NSDictionary<NSString *, NSString *> *> *)systemProfile;
/**
A read-only property for the user's system profile.
*/
@property (nonatomic, readonly) NSArray<NSDictionary<NSString *, NSString *> *> *systemProfile;
@end
NS_ASSUME_NONNULL_END
@@ -0,0 +1,403 @@
//
// SPUUpdater.h
// Sparkle
//
// Created by Andy Matuschak on 1/4/06.
// Copyright 2006 Andy Matuschak. All rights reserved.
//
#import <Foundation/Foundation.h>
#if defined(BUILDING_SPARKLE_SOURCES_EXTERNALLY)
// Ignore incorrect warning
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wquoted-include-in-framework-header"
#import "SUExport.h"
#import "SPUUserDriver.h"
#pragma clang diagnostic pop
#else
#import <Sparkle/SUExport.h>
#import <Sparkle/SPUUserDriver.h>
#endif
NS_ASSUME_NONNULL_BEGIN
@class SUAppcastItem, SUAppcast;
@protocol SPUUpdaterDelegate;
/**
The main API in Sparkle for controlling the update mechanism.
This class is used to configure the update parameters as well as manually and automatically schedule and control checks for updates.
For convenience, you can create a standard or nib instantiable updater by using `SPUStandardUpdaterController`.
Prefer to set initial properties in your bundle's Info.plist as described in [Customizing Sparkle](https://sparkle-project.org/documentation/customization/).
Otherwise only if you need dynamic behavior for user settings should you set properties on the updater such as:
- `automaticallyChecksForUpdates`
- `updateCheckInterval`
- `automaticallyDownloadsUpdates`
- `feedURL`
Please view the documentation on each of these properties for more detail if you are to configure them dynamically.
This class must be used on the main thread.
*/
SU_EXPORT NS_SWIFT_UI_ACTOR @interface SPUUpdater : NSObject
/**
Initializes a new `SPUUpdater` instance
This creates an updater, but to start it and schedule update checks `-startUpdater:` needs to be invoked first.
Related: See `SPUStandardUpdaterController` which wraps a `SPUUpdater` instance and is suitable for instantiating inside of nib files.
@param hostBundle The bundle that should be targeted for updating.
@param applicationBundle The application bundle that should be waited for termination and relaunched (unless overridden). Usually this can be the same as hostBundle. This may differ when updating a plug-in or other non-application bundle.
@param userDriver The user driver that Sparkle uses for user update interaction.
@param delegate The delegate for `SPUUpdater`. Note the updater weakly references the delegate, so you are responsible for keeping it alive.
*/
- (instancetype)initWithHostBundle:(NSBundle *)hostBundle applicationBundle:(NSBundle *)applicationBundle userDriver:(id <SPUUserDriver>)userDriver delegate:(nullable id<SPUUpdaterDelegate>)delegate;
/**
Use `-initWithHostBundle:applicationBundle:userDriver:delegate:` or `SPUStandardUpdaterController` standard adapter instead.
If you want to drop an updater into a nib, use `SPUStandardUpdaterController`.
*/
- (instancetype)init NS_UNAVAILABLE;
/**
Starts the updater.
This method first checks if Sparkle is configured properly. A valid feed URL should be set before this method is invoked.
If the configuration is valid, an update cycle is started in the next main runloop cycle.
During this cycle, a permission prompt may be brought up (if needed) for checking if the user wants automatic update checking.
Otherwise if automatic update checks are enabled, a scheduled update alert may be brought up if enough time has elapsed since the last check.
See `automaticallyChecksForUpdates` for more information.
After starting the updater and before the next runloop cycle, one of `-checkForUpdates`, `-checkForUpdatesInBackground`, or `-checkForUpdateInformation` can be invoked.
This may be useful if you want to check for updates immediately or without showing a potential permission prompt.
If the updater cannot be started (i.e, due to a configuration issue in the application), you may want to fall back appropriately.
For example, the standard updater controller (`SPUStandardUpdaterController`) alerts the user that the app is misconfigured and to contact the developer.
This must be called on the main thread.
@param error The error that is populated if this method fails. Pass NULL if not interested in the error information.
@return YES if the updater started otherwise NO with a populated error
*/
- (BOOL)startUpdater:(NSError * __autoreleasing *)error;
/**
Checks for new updates, and displays progress while doing so if needed.
This is meant for users initiating a new update check or checking the current update progress.
If an update hasn't started, the user may be shown that a new check for updates is occurring.
If an update has already been downloaded or begun installing from a previous session, the user may be presented to install that update.
If the user is already being presented with an update or update permission prompt, that notice may be shown to the user in active focus
(as long as the user driver is the standard `SPUStandardUserDriver` or if it implements `-[SPUUserDriver showUpdateInFocus]`).
This will find updates that the user has previously opted into skipping.
See `canCheckForUpdates` property which can determine when this method may be invoked.
This must be called on the main thread.
*/
- (void)checkForUpdates;
/**
Checks for new updates in the background.
You usually should not call this method directly. By default Sparkle calls this method automatically
on a scheduled basis if automatic update checks are enabled. This is done by checking the current state of
`automaticallyChecksForUpdates`, `updateCheckInterval`, `lastUpdateCheckDate`, and
`SUScheduledImpatientCheckInterval`.
If you want to additionally force an update check on every app launch though, it's recommended to only call this method immediately after starting the updater,
and only when automatic update checks are enabled (by checking `automaticallyChecksForUpdates` is `YES`). Calling this method at later points
could interfere with Sparkle's scheduler in unexpected ways.
If you want to reset the updater's cycle after an updater setting change, please use `resetUpdateCycle` or `resetUpdateCycleAfterShortDelay` instead.
Updates that are found may not be presented immediately to the user, either due to automatic downloading/installing of updates being on or
due to gentle reminders https://sparkle-project.org/documentation/gentle-reminders/ for example.
Updates that have been skipped by the user will not be found.
This method does not do anything if there is a `sessionInProgress`.
This must be called on the main thread.
*/
- (void)checkForUpdatesInBackground;
/**
Begins a "probing" check for updates which will not actually offer to
update to that version.
However, the delegate methods
`-[SPUUpdaterDelegate updater:didFindValidUpdate:]` and
`-[SPUUpdaterDelegate updaterDidNotFindUpdate:]` will be called,
so you can use that information in your UI.
`-[SPUUpdaterDelegate updater:didFinishUpdateCycleForUpdateCheck:error:]` will be called when
this probing check is completed.
Updates that have been skipped by the user will not be found.
This method does not do anything if there is a `sessionInProgress`.
This must be called on the main thread.
*/
- (void)checkForUpdateInformation;
/**
A property indicating whether or not updates can be checked by the user.
An update check can be made by the user when an update session isn't in progress.
An update check can also be made when an update or its progress is being shown to the user
(as long as the user driver is the standard `SPUStandardUserDriver` or if it implements `-[SPUUserDriver showUpdateInFocus]`).
A user cannot check for updates when data (such as the feed or an update) is still being downloaded automatically in the background.
This property is suitable to use for menu item validation for seeing if `-checkForUpdates` can be invoked.
This property is also KVO-compliant.
Note this property does not reflect whether or not an update session is in progress. Please see `sessionInProgress` property instead.
*/
@property (nonatomic, readonly) BOOL canCheckForUpdates;
/**
A property indicating whether or not an update session is in progress.
An update session is in progress when the appcast is being downloaded, an update is being downloaded,
an update is being shown, update permission is being requested, or the installer is being started.
An active session is when Sparkle's fired scheduler is running.
Note an update session may not be running even though Sparkle's installer (ran as a separate process) may be running,
or even though the update has been downloaded but the installation has been deferred. In both of these cases, a new update session
may be activated with the update resumed at a later point (automatically or manually).
See also:
- `canCheckForUpdates` property which is more suited for menu item validation and deciding if the user can initiate update checks.
- `-[SPUUpdaterDelegate updater:didFinishUpdateCycleForUpdateCheck:error:]` which lets the updater delegate know when an update cycle and session finishes.
*/
@property (nonatomic, readonly) BOOL sessionInProgress;
/**
A property indicating whether or not to check for updates automatically.
By default, Sparkle asks users on second launch for permission if they want automatic update checks enabled
and sets this property based on their response. If `SUEnableAutomaticChecks` is set in the Info.plist,
this permission request is not performed however.
Setting this property will persist in the host bundle's user defaults.
Hence developers shouldn't maintain an additional user default for this property.
Only set this property if the user wants to change the default via a user settings option.
Do not always set it on launch unless you want to ignore the user's preference.
For testing environments, you can disable update checks by passing `-SUEnableAutomaticChecks NO`
to your app's command line arguments instead of setting this property.
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.
This property is KVO compliant. This property must be called on the main thread.
*/
@property (nonatomic) BOOL automaticallyChecksForUpdates;
/**
A property indicating the current automatic update check interval in seconds.
Prefer to set SUScheduledCheckInterval directly in your Info.plist for setting the initial value.
Setting this property will persist in the host bundle's user defaults.
Hence developers shouldn't maintain an additional user default for this property.
Only set this property if the user wants to change the default via a user settings option.
Do not always set it on launch unless you want to ignore the user's preference.
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.
This property is KVO compliant. This property must be called on the main thread.
*/
@property (nonatomic) NSTimeInterval updateCheckInterval;
/**
A property indicating whether or not updates can be automatically downloaded in the background.
By default, updates are not automatically downloaded.
By default starting from Sparkle 2.4, users are provided an option to opt in to automatically downloading and installing updates when they are asked if they want automatic update checks enabled.
The default value for this option is based on what the developer sets `SUAutomaticallyUpdate` in their Info.plist.
This is not done if `SUEnableAutomaticChecks` is set in the Info.plist however. Please check `automaticallyChecksForUpdates` property for more details.
Note that the developer can disallow automatic downloading of updates from being enabled (via `SUAllowsAutomaticUpdates` Info.plist key).
In this case, this property will return NO regardless of how this property is set.
Prefer to set `SUAutomaticallyUpdate` directly in your Info.plist for setting the initial value.
Setting this property will persist in the host bundle's user defaults.
Hence developers shouldn't maintain an additional user default for this property.
Only set this property if the user wants to change the default via a user settings option.
Do not always set it on launch unless you want to ignore the user's preference.
This property is KVO compliant. This property must be called on the main thread.
*/
@property (nonatomic) BOOL automaticallyDownloadsUpdates;
/**
A property indicating whether or not the *option* to automatically download updates in the background can be turned on.
This property can be used to determine whether an option to automatically download/install updates should be enabled.
Its value depends on `automaticallyChecksForUpdates`, or the `SUAllowsAutomaticUpdates`in the host bundle's Info.plist if specified.
Don't set `SUAllowsAutomaticUpdates` in the Info.plist unless you need custom behavior.
This property is KVO compliant. This property must be called on the main thread.
*/
@property (nonatomic, readonly) BOOL allowsAutomaticUpdates;
/**
The URL of the appcast used to download update information.
If the updater's delegate implements `-[SPUUpdaterDelegate feedURLStringForUpdater:]`, this will return that feed URL.
Otherwise if the feed URL has been set before using `-[SPUUpdater setFeedURL:]`, the feed URL returned will be retrieved from the host bundle's user defaults.
Otherwise the feed URL in the host bundle's Info.plist will be returned.
If no feed URL can be retrieved, returns nil.
For setting a primary feed URL, please set the `SUFeedURL` property in your Info.plist.
For setting an alternative feed URL, please prefer `-[SPUUpdaterDelegate feedURLStringForUpdater:]` over `-setFeedURL:`.
Please see the documentation for `-setFeedURL:` for migrating away from that API.
This property must be called on the main thread; calls from background threads will return nil.
*/
@property (nonatomic, readonly, nullable) NSURL *feedURL;
/**
Set the URL of the appcast used to download update information. This method is deprecated.
Setting this property will persist in the host bundle's user defaults.
To avoid this undesirable behavior, please consider implementing
`-[SPUUpdaterDelegate feedURLStringForUpdater:]` instead of using this method.
Calling `-clearFeedURLFromUserDefaults` will remove any feed URL that has been set in the host bundle's user defaults.
Passing nil to this method can also do this, but using `-clearFeedURLFromUserDefaults` is preferred.
To migrate away from using this API, you must clear and remove any feed URLs set in the user defaults through this API.
If you do not need to alternate between multiple feeds, set the SUFeedURL in your Info.plist instead of invoking this method.
For beta updates, you may consider migrating to `-[SPUUpdaterDelegate allowedChannelsForUpdater:]` in the future.
Updaters that update other developer's bundles should not call this method.
This method must be called on the main thread; calls from background threads will have no effect.
*/
- (void)setFeedURL:(nullable NSURL *)feedURL __deprecated_msg("Please call -[SPUUpdater clearFeedURLFromUserDefaults] to migrate away from using this API and transition to either specifying the feed URL in your Info.plist, using channels in Sparkle 2, or using -[SPUUpdaterDelegate feedURLStringForUpdater:] to specify the dynamic feed URL at runtime");
/**
Clears any feed URL from the host bundle's user defaults that was set via `-setFeedURL:`
You should call this method if you have used `-setFeedURL:` in the past and want to stop using that API.
Otherwise for compatibility Sparkle will prefer to use the feed URL that was set in the user defaults over the one that was specified in the host bundle's Info.plist,
which is often undesirable (except for testing purposes).
If a feed URL is found stored in the host bundle's user defaults (from calling `-setFeedURL:`) before it gets cleared,
then that previously set URL is returned from this method.
This method should be called as soon as possible, after your application finished launching or right after the updater has been started
if you manually manage starting the updater.
Updaters that update other developer's bundles should not call this method.
This method must be called on the main thread.
@return A previously set feed URL in the host bundle's user defaults, if available, otherwise this returns `nil`
*/
- (nullable NSURL *)clearFeedURLFromUserDefaults;
/**
The host bundle that is being updated.
*/
@property (nonatomic, readonly) NSBundle *hostBundle;
/**
The user agent used when checking for updates.
By default the user agent string returned is in the format:
`$(BundleDisplayName)/$(BundleDisplayVersion) Sparkle/$(SparkleDisplayVersion)`
BundleDisplayVersion is derived from the main application's Info.plist's CFBundleShortVersionString.
Note if Sparkle is being used to update another application, the bundle information retrieved is from the main application performing the updating.
This default implementation can be overridden.
*/
@property (nonatomic, copy) NSString *userAgentString;
/**
The HTTP headers used when checking for updates, downloading release notes, and downloading updates.
The keys of this dictionary are HTTP header fields and values are corresponding values.
*/
@property (nonatomic, copy, nullable) NSDictionary<NSString *, NSString *> *httpHeaders;
/**
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.
This property is KVO compliant. This property must be called on the main thread.
*/
@property (nonatomic) BOOL sendsSystemProfile;
/**
The date of the last update check or nil if no check has been performed yet.
For testing purposes, the last update check is stored in the `SULastCheckTime` key in the host bundle's user defaults.
For example, `defaults delete my-bundle-id SULastCheckTime` can be invoked to clear the last update check time and test
if update checks are automatically scheduled.
This property must be called on the main thread.
*/
@property (nonatomic, readonly, copy, nullable) NSDate *lastUpdateCheckDate;
/**
Appropriately re-schedules the update checking timer according to the current updater settings.
This method should only be called in response to a user changing updater settings. This method may trigger a new update check to occur in the background if an updater setting such as the updater's feed or allowed channels has changed.
If the `updateCheckInterval` or `automaticallyChecksForUpdates` properties are changed, this method is automatically invoked after a short delay using `-resetUpdateCycleAfterShortDelay`. In these cases, manually resetting the update cycle is not necessary.
See also `-resetUpdateCycleAfterShortDelay` which gives the user a short delay before triggering a cycle reset.
This must be called on the main thread.
*/
- (void)resetUpdateCycle;
/**
Appropriately re-schedules the update checking timer according to the current updater settings after a short cancellable delay.
This method calls `resetUpdateCycle` after a short delay to give the user a short amount of time to cancel changing an updater setting.
If this method is called again, any previous reset request that is still inflight will be cancelled.
For example, if the user changes the `automaticallyChecksForUpdates` setting to `YES`, but quickly undoes their change then
no cycle reset will be done.
If the `updateCheckInterval` or `automaticallyChecksForUpdates` properties are changed, this method is automatically invoked. In these cases, manually resetting the update cycle is not necessary.
This must be called on the main thread.
*/
- (void)resetUpdateCycleAfterShortDelay;
/**
The system profile information that is sent when checking for updates.
*/
@property (nonatomic, readonly, copy) NSArray<NSDictionary<NSString *, NSString *> *> *systemProfileArray;
@end
NS_ASSUME_NONNULL_END
@@ -0,0 +1,485 @@
//
// SPUUpdaterDelegate.h
// Sparkle
//
// Created by Mayur Pawashe on 8/12/16.
// Copyright © 2016 Sparkle Project. All rights reserved.
//
#import <Foundation/Foundation.h>
#if defined(BUILDING_SPARKLE_SOURCES_EXTERNALLY)
// Ignore incorrect warning
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wquoted-include-in-framework-header"
#import "SUExport.h"
#import "SPUUpdateCheck.h"
#import "SPUUserUpdateState.h"
#pragma clang diagnostic pop
#else
#import <Sparkle/SUExport.h>
#import <Sparkle/SPUUpdateCheck.h>
#import <Sparkle/SPUUserUpdateState.h>
#endif
@protocol SUVersionComparison;
@class SPUUpdater, SUAppcast, SUAppcastItem, SPUUserUpdateState;
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;
// -----------------------------------------------------------------------------
// System Profile Keys
// -----------------------------------------------------------------------------
SU_EXPORT extern NSString *const SUSystemProfilerApplicationNameKey;
SU_EXPORT extern NSString *const SUSystemProfilerApplicationVersionKey;
SU_EXPORT extern NSString *const SUSystemProfilerCPU64bitKey;
SU_EXPORT extern NSString *const SUSystemProfilerCPUCountKey;
SU_EXPORT extern NSString *const SUSystemProfilerCPUFrequencyKey;
SU_EXPORT extern NSString *const SUSystemProfilerCPUTypeKey;
SU_EXPORT extern NSString *const SUSystemProfilerCPUSubtypeKey;
SU_EXPORT extern NSString *const SUSystemProfilerHardwareModelKey;
SU_EXPORT extern NSString *const SUSystemProfilerMemoryKey;
SU_EXPORT extern NSString *const SUSystemProfilerOperatingSystemVersionKey;
SU_EXPORT extern NSString *const SUSystemProfilerPreferredLanguageKey;
// -----------------------------------------------------------------------------
// SPUUpdater Delegate:
// -----------------------------------------------------------------------------
/**
Provides delegation methods to control the behavior of an `SPUUpdater` object.
*/
NS_SWIFT_UI_ACTOR @protocol SPUUpdaterDelegate <NSObject>
@optional
/**
Returns whether to allow Sparkle to check for updates.
For example, this may be used to prevent Sparkle from interrupting a setup assistant.
Alternatively, you may want to consider starting the updater after eg: the setup assistant finishes.
Note in Swift, this method returns Void and is marked with the throws keyword. If this method
doesn't throw an error, the updater may perform an update check. Otherwise if an error is thrown (we recommend using an NSError),
then the updater may not perform an update check.
@param updater The updater instance.
@param updateCheck The type of update check that will be performed if the updater is allowed to check for updates.
@param error The populated error object if the updater may not perform a new update check. The @c NSLocalizedDescriptionKey user info key should be populated indicating a description of the error.
@return @c YES if the updater is allowed to check for updates, otherwise @c NO
*/
- (BOOL)updater:(SPUUpdater *)updater mayPerformUpdateCheck:(SPUUpdateCheck)updateCheck error:(NSError * __autoreleasing *)error;
/**
Returns the set of Sparkle channels the updater is allowed to find new updates from.
An appcast item can specify a channel the update is posted to. Without specifying a channel, the appcast item is posted to the default channel.
For instance:
```
<item>
<sparkle:version>2.0 Beta 1</sparkle:version>
<sparkle:channel>beta</sparkle:channel>
</item>
```
This example posts an update to the @c beta channel, so only updaters that are allowed to use the @c beta channel can find this update.
If the @c <sparkle:channel> element is not present, the update item is posted to the default channel and can be found by any updater.
You can pick any name you'd like for the channel. The valid characters for channel names are letters, numbers, dashes, underscores, and periods.
Note to use this feature, all app versions that your users may update from in your feed must use a version of Sparkle that supports this feature.
This feature was added in Sparkle 2.
@return The set of channel names the updater is allowed to find new updates in. An empty set is the default behavior,
which means the updater will only look for updates in the default channel. The default channel is always included in the allowed set.
*/
- (NSSet<NSString *> *)allowedChannelsForUpdater:(SPUUpdater *)updater;
/**
Returns a custom appcast URL used for checking for new updates.
Override this to dynamically specify the feed URL.
@param updater The updater instance.
@return An appcast feed URL to check for new updates in, or @c nil for the default behavior and if you don't want to be delegated this task.
*/
- (nullable NSString *)feedURLStringForUpdater:(SPUUpdater *)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 updater 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<NSDictionary<NSString *, NSString *> *> *)feedParametersForUpdater:(SPUUpdater *)updater sendingSystemProfile:(BOOL)sendingProfile;
/**
Returns whether Sparkle should prompt the user about checking for new updates automatically.
Use this to override the default behavior, which is to prompt for permission to check for updates on second app launch
(if SUEnableAutomaticChecks is not specified).
This method is not called if SUEnableAutomaticChecks is defined in Info.plist or
if the user has responded to a permission prompt before.
@param updater The updater instance.
@return @c YES if the updater should prompt for permission to check for new updates automatically, otherwise @c NO
*/
- (BOOL)updaterShouldPromptForPermissionToCheckForUpdates:(SPUUpdater *)updater;
/**
Returns an allowed list of system profile keys to be appended to the appcast URL's query string.
By default all keys will be included. This method allows overriding which keys should only be allowed.
@param updater The updater instance.
@return An array of system profile keys to include in the appcast URL's query string. Elements must be one of the `SUSystemProfiler*Key` constants. Return @c nil for the default behavior and if you don't want to be delegated this task.
*/
- (nullable NSArray<NSString *> *)allowedSystemProfileKeysForUpdater:(SPUUpdater *)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 updater instance.
@param appcast The appcast that was downloaded from the remote server.
*/
- (void)updater:(SPUUpdater *)updater didFinishLoadingAppcast:(SUAppcast *)appcast;
/**
Called when a new valid update is found by the update driver.
@param updater The updater instance.
@param item The appcast item corresponding to the update that is proposed to be installed.
*/
- (void)updater:(SPUUpdater *)updater didFindValidUpdate:(SUAppcastItem *)item;
/**
Called when a valid new update is not found.
There are various reasons a new update is unavailable and can't be installed.
The userInfo dictionary on the error is populated with three keys:
- `SPULatestAppcastItemFoundKey`: if available, this may provide the latest `SUAppcastItem` that was found. This will be @c nil if it's unavailable.
- `SPUNoUpdateFoundReasonKey`: This will provide the `SPUNoUpdateFoundReason`.
For example the reason could be because the latest version in the feed requires a newer OS version or could be because the user is already on the latest version.
- `SPUNoUpdateFoundUserInitiatedKey`: A boolean that indicates if a new update was not found when the user intitiated an update check manually.
@param updater The updater instance.
@param error An error containing information on why a new valid update was not found
*/
- (void)updaterDidNotFindUpdate:(SPUUpdater *)updater error:(NSError *)error;
/**
Called when a valid new update is not found.
If more information is needed on why an update was not found, use `-[SPUUpdaterDelegate updaterDidNotFindUpdate:error:]` instead.
@param updater The updater instance.
*/
- (void)updaterDidNotFindUpdate:(SPUUpdater *)updater;
/**
Returns the item in the appcast corresponding to the update that should be installed.
Please consider using or migrating to other supported features before adopting this method.
Specifically:
- If you want to filter out certain tagged updates (like beta updates), consider `-[SPUUpdaterDelegate allowedChannelsForUpdater:]` instead.
- If you want to treat certain updates as informational-only, consider supplying @c <sparkle:informationalUpdate> with a set of affected versions users are updating from.
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.
Do not base your logic by filtering out items with a minimum or maximum OS version or minimum autoupdate version
because Sparkle already has logic for determining whether or not those items should be filtered out.
Also do not return a non-top level item from the appcast such as a delta item. Delta items will be ignored.
Sparkle picks the delta item from your selection if the appropriate one is available.
This method will not be invoked with an appcast that has zero items. Pick the best item from the appcast.
If an item is available that has the same version as the application or bundle to update, do not pick an item that is worse than that version.
This method may be called multiple times for different selections and filters. This method should be efficient.
Return `+[SUAppcastItem emptyAppcastItem]` if no appcast item is valid.
Return @c nil if you don't want to be delegated this task and want to let Sparkle handle picking the best valid update.
@param appcast The appcast that was downloaded from the remote server.
@param updater The updater instance.
@return The best valid appcast item.
*/
- (nullable SUAppcastItem *)bestValidUpdateInAppcast:(SUAppcast *)appcast forUpdater:(SPUUpdater *)updater;
/**
Returns whether or not the updater should proceed with the new chosen update from the appcast.
By default, the updater will always proceed with the best selected update found in an appcast. Override this to override this behavior.
If you return @c NO and populate the @c error, the user is not shown this @c updateItem nor is the update downloaded or installed.
Note in Swift, this method returns Void and is marked with the throws keyword. If this method doesn't throw an error, the updater will proceed with the update.
Otherwise if an error is thrown (we recommend using an NSError), then the will not proceed with the update.
@param updater The updater instance.
@param updateItem The selected update item to proceed with.
@param updateCheck The type of update check that would be performed if proceeded.
@param error An error object that must be populated by the delegate if the updater should not proceed with the update. The @c NSLocalizedDescriptionKey user info key should be populated indicating a description of the error.
@return @c YES if the updater should proceed with @c updateItem, otherwise @c NO if the updater should not proceed with the update with an @c error populated.
*/
- (BOOL)updater:(SPUUpdater *)updater shouldProceedWithUpdate:(SUAppcastItem *)updateItem updateCheck:(SPUUpdateCheck)updateCheck error:(NSError * __autoreleasing *)error;
/**
Called when a user makes a choice to install, dismiss, or skip an update.
If the @c choice is `SPUUserUpdateChoiceDismiss` and @c state.stage is `SPUUserUpdateStageDownloaded` the downloaded update is kept
around until the next time Sparkle reminds the user of the update.
If the @c choice is `SPUUserUpdateChoiceDismiss` and @c state.stage is `SPUUserUpdateStageInstalling` the update is still set to install on application termination.
If the @c choice is `SPUUserUpdateChoiceSkip` the user will not be reminded in the future for this update unless they initiate an update check themselves.
If @c updateItem.isInformationOnlyUpdate is @c YES the @c choice cannot be `SPUUserUpdateChoiceInstall`.
@param updater The updater instance.
@param choice The choice (install, dismiss, or skip) the user made for this @c updateItem
@param updateItem The appcast item corresponding to the update that the user made a choice on.
@param state The current state for the update which includes if the update has already been downloaded or already installing.
*/
- (void)updater:(SPUUpdater *)updater userDidMakeChoice:(SPUUserUpdateChoice)choice forUpdate:(SUAppcastItem *)updateItem state:(SPUUserUpdateState *)state;
/**
Returns whether the release notes (if available) should be downloaded after an update is found and shown.
This is specifically for the @c <releaseNotesLink> element in the appcast item.
@param updater The updater instance.
@param updateItem The update item to download and show release notes from.
@return @c YES to download and show the release notes if available, otherwise @c NO. The default behavior is @c YES.
*/
- (BOOL)updater:(SPUUpdater *)updater shouldDownloadReleaseNotesForUpdate:(SUAppcastItem *)updateItem;
/**
Called immediately before downloading the specified update.
@param updater The updater 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:(SPUUpdater *)updater willDownloadUpdate:(SUAppcastItem *)item withRequest:(NSMutableURLRequest *)request;
/**
Called immediately after successful download of the specified update.
@param updater The SUUpdater instance.
@param item The appcast item corresponding to the update that has been downloaded.
*/
- (void)updater:(SPUUpdater *)updater didDownloadUpdate:(SUAppcastItem *)item;
/**
Called after the specified update failed to download.
@param updater The updater 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:(SPUUpdater *)updater failedToDownloadUpdate:(SUAppcastItem *)item error:(NSError *)error;
/**
Called when the user cancels an update while it is being downloaded.
@param updater The updater instance.
*/
- (void)userDidCancelDownload:(SPUUpdater *)updater;
/**
Called immediately before extracting the specified downloaded update.
@param updater The SUUpdater instance.
@param item The appcast item corresponding to the update that is proposed to be extracted.
*/
- (void)updater:(SPUUpdater *)updater willExtractUpdate:(SUAppcastItem *)item;
/**
Called immediately after extracting the specified downloaded update.
@param updater The SUUpdater instance.
@param item The appcast item corresponding to the update that has been extracted.
*/
- (void)updater:(SPUUpdater *)updater didExtractUpdate:(SUAppcastItem *)item;
/**
Called immediately before installing the specified update.
@param updater The updater instance.
@param item The appcast item corresponding to the update that is proposed to be installed.
*/
- (void)updater:(SPUUpdater *)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.
This may also not be called if the application is not going to relaunch after it terminates.
@param updater The updater instance.
@param item The appcast item corresponding to the update that is proposed to be installed.
@param installHandler The install handler that must be completed before continuing with the relaunch.
@return @c YES to delay the relaunch until @c installHandler is invoked.
*/
- (BOOL)updater:(SPUUpdater *)updater shouldPostponeRelaunchForUpdate:(SUAppcastItem *)item untilInvokingBlock:(void (^)(void))installHandler;
/**
Returns whether the application should be relaunched at all.
Some apps **cannot** be relaunched under certain circumstances.
This method can be used to explicitly prevent a relaunch.
@param updater The updater instance.
@return @c YES if the updater should be relaunched, otherwise @c NO if it shouldn't.
*/
- (BOOL)updaterShouldRelaunchApplication:(SPUUpdater *)updater;
/**
Called immediately before relaunching.
@param updater The updater instance.
*/
- (void)updaterWillRelaunchApplication:(SPUUpdater *)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.
Note that the standard version comparator may be used during installation for preventing a downgrade,
even if you provide a custom comparator here.
@param updater The updater instance.
@return The custom version comparator or @c nil if you don't want to be delegated this task.
*/
- (nullable id<SUVersionComparison>)versionComparatorForUpdater:(SPUUpdater *)updater __deprecated_msg("Custom version comparators are deprecated because they are incompatible with how the system compares different versions of an app.");
/**
Called when a background update will be scheduled after a delay.
Automatic update checks need to be enabled for this to trigger.
@param delay The delay in seconds until the next scheduled update will occur. This is an approximation and may vary due to system state.
@param updater The updater instance.
*/
- (void)updater:(SPUUpdater *)updater willScheduleUpdateCheckAfterDelay:(NSTimeInterval)delay;
/**
Called when no update checks will be scheduled in the future.
This may later change if automatic update checks become enabled.
@param updater The updater instance.
*/
- (void)updaterWillNotScheduleUpdateCheck:(SPUUpdater *)updater;
/**
Returns the decryption password (if any) which is used to extract the update archive DMG.
Return @c nil if no password should be used.
@param updater The updater instance.
@return The password used for decrypting the archive, or @c nil if no password should be used.
*/
- (nullable NSString *)decryptionPasswordForUpdater:(SPUUpdater *)updater;
/**
Called when an update is scheduled to be silently installed on quit after downloading the update automatically.
If you want to intercept this method without taking control of installing the update, return @c NO.
This will let future update cycles to run and allow Sparkle to present the update to the user later if certain conditions are met.
For example, critical updates will be presented to the user right away. Other updates may be presented later if the user hasn't terminated the application
for a long time (defined by `SUScheduledImpatientCheckInterval`).
If you want to take control of installing the update, return @c YES.
This stalls the current update cycle and prevents future update cycles from running. When the opportunity arrives, you can invoke `immediateInstallHandler` to
install the update and relaunch the application without any UI interaction shown.
In either case Sparkle will always attempt to install the update when the app terminates.
@param updater The updater instance.
@param item The appcast item corresponding to the update that is proposed to be installed.
@param immediateInstallHandler The install handler to immediately install the update and relaunch the application. This handler can only be used if @c YES is returned. For Sparkle 2.3 onwards, this handler can be invoked multiple times in case the application cancels the termination request.
@return @c YES if you will handle installing the update using `immediateInstallHandler` or @c NO to allow Sparkle's update scheduler to continue running.
*/
- (BOOL)updater:(SPUUpdater *)updater willInstallUpdateOnQuit:(SUAppcastItem *)item immediateInstallationBlock:(void (^)(void))immediateInstallHandler;
/**
Called after the update driver aborts due to an error.
The update driver runs when checking for updates. This delegate method is called an error occurs during this process.
Some special possible values of `error.code` are:
- `SUNoUpdateError`: No new update was found.
- `SUInstallationCanceledError`: The user canceled installing the update when requested for authorization.
@param updater The updater instance.
@param error The error that caused the update driver to abort.
*/
- (void)updater:(SPUUpdater *)updater didAbortWithError:(NSError *)error;
/**
Called after the update driver finishes.
The update driver runs when checking for updates. This delegate method is called when that check is finished.
An update may be scheduled to be installed during the update cycle, or no updates may be found, or an available update may be dismissed or skipped (which is the same as no error).
If the @c error is @c nil, no error has occurred.
Some special possible values of `error.code` are:
- `SUNoUpdateError`: No new update was found.
- `SUInstallationCanceledError`: The user canceled installing the update when requested for authorization.
@param updater The updater instance.
@param updateCheck The type of update check was performed.
@param error The error that caused the update driver to abort. This is @c nil if the update driver finished normally and there is no error.
*/
- (void)updater:(SPUUpdater *)updater didFinishUpdateCycleForUpdateCheck:(SPUUpdateCheck)updateCheck error:(nullable NSError *)error;
/* Deprecated methods */
- (BOOL)updaterMayCheckForUpdates:(SPUUpdater *)updater __deprecated_msg("Please use -[SPUUpdaterDelegate updater:mayPerformUpdateCheck:error:] instead.");
- (void)updater:(SPUUpdater *)updater userDidSkipThisVersion:(SUAppcastItem *)item __deprecated_msg("Please use -[SPUUpdaterDelegate updater:userDidMakeChoice:forUpdate:state:] instead.");
@end
NS_ASSUME_NONNULL_END
@@ -0,0 +1,98 @@
//
// SPUUpdaterSettings.h
// Sparkle
//
// Created by Mayur Pawashe on 3/27/16.
// Copyright © 2016 Sparkle Project. All rights reserved.
//
#import <Foundation/Foundation.h>
#if defined(BUILDING_SPARKLE_SOURCES_EXTERNALLY)
// Ignore incorrect warning
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wquoted-include-in-framework-header"
#import "SUExport.h"
#pragma clang diagnostic pop
#else
#import <Sparkle/SUExport.h>
#endif
NS_ASSUME_NONNULL_BEGIN
/**
This class can be used for reading and updating updater settings.
It retrieves the settings by first looking into the host's user defaults.
If the setting is not found in there, then the host's Info.plist file is looked at.
For updating updater settings, changes are made in the host's user defaults.
*/
SU_EXPORT NS_SWIFT_UI_ACTOR @interface SPUUpdaterSettings : NSObject
- (instancetype)init NS_UNAVAILABLE;
- (instancetype)initWithHostBundle:(NSBundle *)hostBundle;
/**
* Indicates whether or not automatic update checks are enabled.
*
* This property is KVO compliant. This property must be called on the main thread.
*/
@property (nonatomic) BOOL automaticallyChecksForUpdates;
/**
* The regular update check interval.
*
* This property is KVO compliant. This property must be called on the main thread.
*/
@property (nonatomic) NSTimeInterval updateCheckInterval;
/**
* Indicates whether or not automatically downloading updates is allowed to be turned on by the user.
*
* This property is determined by checking `automaticallyChecksForUpdates` and `allowsAutomaticUpdatesOption`.
*
* This property is KVO compliant. This property must be called on the main thread.
*/
@property (readonly, nonatomic) BOOL allowsAutomaticUpdates;
/**
* Indicates whether or not automatically downloading updates is enabled by the user or developer.
*
* Note this does not indicate whether or not automatic downloading of updates is allowable.
* See `-allowsAutomaticUpdates` property for that.
*
* This property is KVO compliant. This property must be called on the main thread.
*/
@property (nonatomic) BOOL automaticallyDownloadsUpdates;
/**
* Indicates whether or not the developer allows turning on updates being automatically downloaded and installed.
* If this value is nil, the developer has not explicitly specified this option (which is the default).
*
* Please prefer to use `allowsAutomaticUpdates` instead.
*/
@property (readonly, nonatomic, nullable) NSNumber *allowsAutomaticUpdatesOption;
/**
* The impatient update check interval.
*
* If an update has already been downloaded automatically in the background, Sparkle may not notify users of the update immediately,
* and tries to install the update siliently on quit without notifying the user.
*
* Sparkle uses this long impatient update check interval to decide when to notify the user of the update if they haven't quit the app for a long time.
* By default this check interval is set to 604800 seconds (which is 1 week). This interval must be bigger than the `updateCheckInterval`.
*/
@property (nonatomic, readonly) NSTimeInterval impatientUpdateCheckInterval;
/**
* Indicates whether or not anonymous system profile information is sent when checking for updates.
*
* This property is KVO compliant. This property must be called on the main thread.
*/
@property (nonatomic) BOOL sendsSystemProfile;
@end
NS_ASSUME_NONNULL_END
@@ -0,0 +1,304 @@
//
// SPUUserDriver.h
// Sparkle
//
// Created by Mayur Pawashe on 2/14/16.
// Copyright © 2016 Sparkle Project. All rights reserved.
//
#import <Foundation/Foundation.h>
#if defined(BUILDING_SPARKLE_SOURCES_EXTERNALLY)
// Ignore incorrect warning
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wquoted-include-in-framework-header"
#import "SPUUserUpdateState.h"
#import "SUExport.h"
#pragma clang diagnostic pop
#else
#import <Sparkle/SPUUserUpdateState.h>
#import <Sparkle/SUExport.h>
#endif
NS_ASSUME_NONNULL_BEGIN
@class SPUUpdatePermissionRequest, SUUpdatePermissionResponse, SUAppcastItem, SPUDownloadData;
/**
The API in Sparkle for controlling the user interaction.
This protocol is used for implementing a user interface for the Sparkle updater. Sparkle's internal drivers tell
an object that implements this protocol what actions to take and show to the user.
Every method in this protocol can be assumed to be called from the main thread.
*/
SU_EXPORT NS_SWIFT_UI_ACTOR @protocol SPUUserDriver <NSObject>
/**
* Show an updater permission request to the user
*
* Ask the user for their permission regarding update checks.
* This is typically only called once per app installation.
*
* @param request The update permission request.
* @param reply A reply with a update permission response.
*/
- (void)showUpdatePermissionRequest:(SPUUpdatePermissionRequest *)request reply:(void (^)(SUUpdatePermissionResponse *))reply;
/**
* Show the user initiating an update check
*
* Respond to the user initiating an update check. Sparkle uses this to show the user a window with an indeterminate progress bar.
*
* @param cancellation Invoke this cancellation block to cancel the update check before the update check is completed.
*/
- (void)showUserInitiatedUpdateCheckWithCancellation:(void (^)(void))cancellation;
/**
* Show the user a new update is found.
*
* Let the user know a new update is found and ask them what they want to do.
* Before this point, `-showUserInitiatedUpdateCheckWithCancellation:` may be called.
*
* The potential `stage`s on the updater @c state are:
*
* `SPUUpdateStateNotDownloaded` - Update has not been downloaded yet.
*
* `SPUUpdateStateDownloaded` - Update has already been downloaded in the background automatically (via `SUAutomaticallyUpdate`) but not started installing yet.
*
* `SPUUpdateStateInstalling` - Update has been downloaded and already started installing.
*
* The `userInitiated` property on the @c state indicates if the update was initiated by the user or if it was automatically scheduled in the background.
*
* Additionally, these properties on the @c appcastItem are of importance:
*
* @c appcastItem.informationOnlyUpdate indicates if the update is only informational and should not be downloaded. You can direct the user to the infoURL property of the appcastItem in their web browser. Sometimes information only updates are used as a fallback in case a bad update is shipped, so you'll want to support this case.
*
* @c appcastItem.majorUpgrade indicates if the update is a major or paid upgrade.
*
* @c appcastItem.criticalUpdate indicates if the update is a critical update.
*
* @c appcastItem.signingValidationStatus indicates the signing validation status of the appcast, which may be applicable if appcast signing is required.
*
* A reply of `SPUUserUpdateChoiceInstall` begins or resumes downloading, extracting, or installing the update.
* If the state.stage is `SPUUserUpdateStateInstalling`, this may send a quit event to the application and relaunch it immediately (in this state, this behaves as a fast "install and Relaunch").
* If the state.stage is `SPUUpdateStateNotDownloaded` or `SPUUpdateStateDownloaded` the user may be presented an authorization prompt to install the update after `-showDownloadDidStartExtractingUpdate` is called if authorization is required for installation. For example, this may occur if the update on disk is owned by a different user (e.g. root or admin for non-admin users), or if the update is a package install.
* Do not use a reply of `SPUUserUpdateChoiceInstall` if @c appcastItem.informationOnlyUpdate is YES.
*
* A reply of `SPUUserUpdateChoiceDismiss` dismisses the update for the time being. The user may be reminded of the update at a later point.
* If the state.stage is `SPUUserUpdateStateDownloaded`, the downloaded update is kept after dismissing until the next time an update is shown to the user.
* If the state.stage is `SPUUserUpdateStateInstalling`, the installing update is also preserved after dismissing. In this state however, the update will also still be installed after the application is terminated.
*
* A reply of `SPUUserUpdateChoiceSkip` skips this particular version and won't notify the user again, unless they initiate an update check themselves.
* If @c appcastItem.majorUpgrade is YES, the major update and any future minor updates to that major release are skipped, unless a future minor update specifies a `<sparkle:ignoreSkippedUpgradesBelowVersion>` requirement.
* If the state.stage is `SPUUpdateStateInstalling`, the installation is also canceled when the update is skipped.
*
* @param appcastItem The Appcast Item containing information that reflects the new update.
* @param state The current state of the user update. See above discussion for notable properties.
* @param reply The reply which indicates if the update should be installed, dismissed, or skipped. See above discussion for more details.
*/
- (void)showUpdateFoundWithAppcastItem:(SUAppcastItem *)appcastItem state:(SPUUserUpdateState *)state reply:(void (^)(SPUUserUpdateChoice))reply;
/**
* Show the user the release notes for the new update
*
* Display the release notes to the user. This will be called after showing the new update.
* This is only applicable if the release notes are linked from the appcast, and are not directly embedded inside of the appcast file.
* That is, this may be invoked if the releaseNotesURL from the appcast item is non-nil.
*
* @param downloadData The data for the release notes that was downloaded from the new update's appcast.
*/
- (void)showUpdateReleaseNotesWithDownloadData:(SPUDownloadData *)downloadData;
/**
* Show the user that the new update's release notes could not be downloaded
*
* This will be called after showing the new update.
* This is only applicable if the release notes are linked from the appcast, and are not directly embedded inside of the appcast file.
* That is, this may be invoked if the releaseNotesURL from the appcast item is non-nil.
*
* @param error The error associated with why the new update's release notes could not be downloaded.
*/
- (void)showUpdateReleaseNotesFailedToDownloadWithError:(NSError *)error;
/**
* Show the user a new update was not found
*
* Let the user know a new update was not found after they tried initiating an update check.
* Before this point, `-showUserInitiatedUpdateCheckWithCancellation:` may be called.
*
* There are various reasons a new update is unavailable and can't be installed.
* The @c error object is populated with recovery and suggestion strings suitable to be shown in an alert.
*
* The @c userInfo dictionary on the @c error is also populated with two keys:
*
* `SPULatestAppcastItemFoundKey`: if available, this may provide the latest SUAppcastItem that was found.
*
* `SPUNoUpdateFoundReasonKey`: if available, this will provide the `SUNoUpdateFoundReason`. For example the reason could be because
* the latest version in the feed requires a newer OS version or could be because the user is already on the latest version.
*
* @param error The error associated with why a new update was not found. See above discussion for more details.
* @param acknowledgement Acknowledge to the updater that no update found error was shown.
*/
- (void)showUpdateNotFoundWithError:(NSError *)error acknowledgement:(void (^)(void))acknowledgement NS_SWIFT_ASYNC(2);
/**
* Show the user an update error occurred
*
* Let the user know that the updater failed with an error. This will not be invoked without the user having been
* aware that an update was in progress.
*
* Before this point, any of the non-error user driver methods may have been invoked.
*
* @param error The error associated with what update error occurred.
* @param acknowledgement Acknowledge to the updater that the error was shown.
*/
- (void)showUpdaterError:(NSError *)error acknowledgement:(void (^)(void))acknowledgement NS_SWIFT_ASYNC(2);
/**
* Show the user that downloading the new update initiated
*
* Let the user know that downloading the new update started.
*
* @param cancellation Invoke this cancellation block to cancel the download at any point before `-showDownloadDidStartExtractingUpdate` is invoked.
*/
- (void)showDownloadInitiatedWithCancellation:(void (^)(void))cancellation;
/**
* Show the user the content length of the new update that will be downloaded
*
* @param expectedContentLength The expected content length of the new update being downloaded.
* An implementor should be able to handle if this value is invalid (more or less than actual content length downloaded).
* Additionally, this method may be called more than once for the same download in rare scenarios.
*/
- (void)showDownloadDidReceiveExpectedContentLength:(uint64_t)expectedContentLength;
/**
* Show the user that the update download received more data
*
* This may be an appropriate time to advance a visible progress indicator of the download
* @param length The length of the data that was just downloaded
*/
- (void)showDownloadDidReceiveDataOfLength:(uint64_t)length;
/**
* Show the user that the update finished downloading and started extracting
*
* Sparkle uses this to show an indeterminate progress bar.
*
* Before this point, `showDownloadDidReceiveDataOfLength:` or `showUpdateFoundWithAppcastItem:state:reply:` may be called.
* An update can potentially resume at this point after having been automatically downloaded in the background (without the user driver) before.
*
* After extraction starts, the user may be shown an authorization prompt to install the update if authorization is required for installation.
* For example, this may occur if the update on disk is owned by a different user (e.g. root or admin for non-admin users), or if the update is a package install.
*/
- (void)showDownloadDidStartExtractingUpdate;
/**
* Show the user that the update is extracting with progress
*
* Let the user know how far along the update extraction is.
*
* Before this point, `-showDownloadDidStartExtractingUpdate` is called.
*
* @param progress The progress of the extraction from a 0.0 to 1.0 scale
*/
- (void)showExtractionReceivedProgress:(double)progress;
/**
* Show the user that the update is ready to install & relaunch
*
* Let the user know that the update is ready to install and relaunch, and ask them whether they want to proceed.
* Note if the target application has already terminated, this method may not be invoked.
*
* A reply of `SPUUserUpdateChoiceInstall` installs the update the new update immediately. The application is relaunched only if it is still running by the time this reply is invoked. If the application terminates on its own, Sparkle will attempt to automatically install the update.
*
* A reply of `SPUUserUpdateChoiceDismiss` dismisses the update installation for the time being. Note the update may still be installed automatically after the application terminates.
*
* A reply of `SPUUserUpdateChoiceSkip` cancels the current update that has begun installing and dismisses the update. In this circumstance, the update is canceled but this update version is not skipped in the future.
*
* Before this point, `-showExtractionReceivedProgress:` or `-showUpdateFoundWithAppcastItem:state:reply:` may be called.
*
* @param reply The reply which indicates if the update should be installed, dismissed, or skipped. See above discussion for more details.
*/
- (void)showReadyToInstallAndRelaunch:(void (^)(SPUUserUpdateChoice))reply;
/**
* Show the user that the update is installing
*
* Let the user know that the update is currently installing.
*
* Before this point, `-showReadyToInstallAndRelaunch:` or `-showUpdateFoundWithAppcastItem:state:reply:` will be called.
*
* @param applicationTerminated Indicates if the application has been terminated already.
* If the application hasn't been terminated, a quit event is sent to the running application before installing the update.
* If the application or user delays or cancels termination, there may be an indefinite period of time before the application fully quits.
* It is up to the implementor whether or not to decide to continue showing installation progress in this case.
*
* @param retryTerminatingApplication This handler gives a chance for the application to re-try sending a quit event to the running application before installing the update.
* The application may cancel or delay termination. This handler gives the user driver another chance to allow the user to try terminating the application again.
* If the application does not delay or cancel application termination, there is no need to invoke this handler. This handler may be invoked multiple times.
* Note this handler should not be invoked if @c applicationTerminated is already @c YES
*/
- (void)showInstallingUpdateWithApplicationTerminated:(BOOL)applicationTerminated retryTerminatingApplication:(void (^)(void))retryTerminatingApplication;
/**
* Show the user that the update installation finished
*
* Let the user know that the update finished installing.
*
* This will only be invoked if the updater process is still alive, which is typically not the case if
* the updater's lifetime is tied to the application it is updating. This implementation must not try to reference
* the old bundle prior to the installation, which will no longer be around.
*
* Before this point, `-showInstallingUpdateWithApplicationTerminated:retryTerminatingApplication:` will be called.
*
* @param relaunched Indicates if the update was relaunched.
* @param acknowledgement Acknowledge to the updater that the finished installation was shown.
*/
- (void)showUpdateInstalledAndRelaunched:(BOOL)relaunched acknowledgement:(void (^)(void))acknowledgement NS_SWIFT_ASYNC(2);
/**
* Dismiss the current update installation
*
* Stop and tear down everything.
* Dismiss all update windows, alerts, progress, etc from the user.
* Basically, stop everything that could have been started. Sparkle may invoke this when aborting or finishing an update.
*/
- (void)dismissUpdateInstallation;
@optional
/**
* Show the user the current presented update or its progress in utmost focus
*
* The user wishes to check for updates while the user is being shown update progress.
* Bring whatever is on screen to frontmost focus (permission request, update information, downloading or extraction status, choice to install update, etc).
* Implementing this method is optional.
*/
- (void)showUpdateInFocus;
/*
* Below are deprecated methods that have been replaced by better alternatives.
* The deprecated methods will be used if the alternatives have not been implemented yet.
* In the future support for using these deprecated methods may be removed however.
*/
// Clients should move to non-deprecated methods
// Deprecated methods are only (temporarily) kept around for compatibility reasons
- (void)showUpdateNotFoundWithAcknowledgement:(void (^)(void))acknowledgement __deprecated_msg("Implement -showUpdateNotFoundWithError:acknowledgement: instead");
- (void)showUpdateInstallationDidFinishWithAcknowledgement:(void (^)(void))acknowledgement __deprecated_msg("Implement -showUpdateInstalledAndRelaunched:acknowledgement: instead");
- (void)dismissUserInitiatedUpdateCheck __deprecated_msg("Transition to new UI appropriately when a new update is shown, when no update is found, or when an update error occurs.");
- (void)showInstallingUpdate __deprecated_msg("Implement -showInstallingUpdateWithApplicationTerminated:retryTerminatingApplication: instead.");
- (void)showSendingTerminationSignal __deprecated_msg("Implement -showInstallingUpdateWithApplicationTerminated:retryTerminatingApplication: instead.");
- (void)showInstallingUpdateWithApplicationTerminated:(BOOL)applicationTerminated __deprecated_msg("Implement -showInstallingUpdateWithApplicationTerminated:retryTerminatingApplication: instead.");;
@end
NS_ASSUME_NONNULL_END
@@ -0,0 +1,85 @@
//
// SPUUserUpdateState.h
// Sparkle
//
// Created by Mayur Pawashe on 2/29/16.
// Copyright © 2016 Sparkle Project. All rights reserved.
//
#ifndef SPUUserUpdateState_h
#define SPUUserUpdateState_h
#import <Foundation/Foundation.h>
#if defined(BUILDING_SPARKLE_SOURCES_EXTERNALLY)
// Ignore incorrect warning
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wquoted-include-in-framework-header"
#import "SUExport.h"
#pragma clang diagnostic pop
#else
#import <Sparkle/SUExport.h>
#endif
NS_ASSUME_NONNULL_BEGIN
/**
A choice made by the user when prompted with a new update.
*/
typedef NS_ENUM(NSInteger, SPUUserUpdateChoice) {
/**
Dismisses the update and skips being notified of it in the future.
*/
SPUUserUpdateChoiceSkip,
/**
Downloads (if needed) and installs the update.
*/
SPUUserUpdateChoiceInstall,
/**
Dismisses the update until Sparkle reminds the user of it at a later time.
*/
SPUUserUpdateChoiceDismiss,
};
/**
Describes the current stage an update is undergoing.
*/
typedef NS_ENUM(NSInteger, SPUUserUpdateStage) {
/**
The update has not been downloaded.
*/
SPUUserUpdateStageNotDownloaded,
/**
The update has already been downloaded but not begun installing.
*/
SPUUserUpdateStageDownloaded,
/**
The update has already been downloaded and began installing in the background.
*/
SPUUserUpdateStageInstalling
};
/**
This represents the user's current update state.
*/
SU_EXPORT NS_SWIFT_SENDABLE @interface SPUUserUpdateState : NSObject<NSSecureCoding>
- (instancetype)init NS_UNAVAILABLE;
/**
The current update stage.
This stage indicates if data has been already downloaded or not, or if an update is currently being installed.
*/
@property (nonatomic, readonly) SPUUserUpdateStage stage;
/**
Indicates whether or not the update check was initiated by the user.
*/
@property (nonatomic, readonly) BOOL userInitiated;
@end
NS_ASSUME_NONNULL_END
#endif /* SPUUserUpdateState_h */
@@ -0,0 +1,54 @@
//
// SUAppcast.h
// Sparkle
//
// Created by Andy Matuschak on 3/12/06.
// Copyright 2006 Andy Matuschak. All rights reserved.
//
#ifndef SUAPPCAST_H
#define SUAPPCAST_H
#import <Foundation/Foundation.h>
#if defined(BUILDING_SPARKLE_SOURCES_EXTERNALLY)
// Ignore incorrect warning
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wquoted-include-in-framework-header"
#import "SUExport.h"
#import "SPUAppcastSigningValidationStatus.h"
#pragma clang diagnostic pop
#else
#import <Sparkle/SUExport.h>
#import <Sparkle/SPUAppcastSigningValidationStatus.h>
#endif
NS_ASSUME_NONNULL_BEGIN
@class SUAppcastItem;
/**
The appcast representing a collection of `SUAppcastItem` items in the feed.
*/
SU_EXPORT NS_SWIFT_SENDABLE @interface SUAppcast : NSObject
- (instancetype)init NS_UNAVAILABLE;
/**
The collection of update items.
These `SUAppcastItem` items are in the same order as specified in the appcast XML feed and are thus not sorted by version.
*/
@property (readonly, nonatomic, copy) NSArray<SUAppcastItem *> *items;
/**
The appcast signing validation status.
Please see documentation of @c SPUAppcastSigningValidationStatus values for more information.
*/
@property (nonatomic, readonly) SPUAppcastSigningValidationStatus signingValidationStatus;
@end
NS_ASSUME_NONNULL_END
#endif
@@ -0,0 +1,448 @@
//
// SUAppcastItem.h
// Sparkle
//
// Created by Andy Matuschak on 3/12/06.
// Copyright 2006 Andy Matuschak. All rights reserved.
//
#ifndef SUAPPCASTITEM_H
#define SUAPPCASTITEM_H
#import <Foundation/Foundation.h>
#ifdef BUILDING_SPARKLE_SOURCES_EXTERNALLY
// Ignore incorrect warning
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wquoted-include-in-framework-header"
#import "SUExport.h"
#import "SPUAppcastSigningValidationStatus.h"
#pragma clang diagnostic pop
#else
#import <Sparkle/SUExport.h>
#import <Sparkle/SPUAppcastSigningValidationStatus.h>
#endif
NS_ASSUME_NONNULL_BEGIN
/**
The appcast item describing an update in the application's appcast feed.
An appcast item represents a single update item in the `SUAppcast` contained within the @c <item> element.
Every appcast item must have a `versionString`, and either a `fileURL` or an `infoURL`.
All the remaining properties describing an update to the application are optional.
Extended documentation and examples on using appcast item features are available at:
https://sparkle-project.org/documentation/publishing/
*/
SU_EXPORT NS_SWIFT_SENDABLE @interface SUAppcastItem : NSObject<NSSecureCoding>
/**
The version of the update item.
Sparkle uses this property to compare update items and determine the best available update item in the `SUAppcast`.
This corresponds to the application update's @c CFBundleVersion
This is extracted from the @c <sparkle:version> element, or the @c sparkle:version attribute from the @c <enclosure> element.
*/
@property (nonatomic, copy, readonly) NSString *versionString;
/**
The human-readable display version of the update item if provided.
This is the version string shown to the user when they are notified of a new update.
This corresponds to the application update's @c CFBundleShortVersionString
This is extracted from the @c <sparkle:shortVersionString> element, or the @c sparkle:shortVersionString attribute from the @c <enclosure> element.
If no short version string is available, this falls back to the update's `versionString`.
*/
@property (nonatomic, copy, readonly) NSString *displayVersionString;
/**
The file URL to the update item if provided.
This download contains the actual update Sparkle will attempt to install.
In cases where a download cannot be provided, an `infoURL` must be provided instead.
A file URL should have an accompanying `contentLength` provided.
This is extracted from the @c url attribute in the @c <enclosure> element.
*/
@property (nonatomic, readonly, nullable) NSURL *fileURL;
/**
The content length of the download in bytes.
This property is used as a fallback when the server doesn't report the content length of the download.
In that case, it is used to report progress of the downloading update to the user.
A warning is outputted if this property is not equal the server's expected content length (if provided).
This is extracted from the @c length attribute in the @c <enclosure> element.
It should be specified if a `fileURL` is provided.
*/
@property (nonatomic, readonly) uint64_t contentLength;
/**
The info URL to the update item if provided.
This informational link is used to direct the user to learn more about an update they cannot download/install directly from within the application.
The link should point to the product's web page.
The informational link will be used if `informationOnlyUpdate` is @c YES
This is extracted from the @c <link> element.
*/
@property (nonatomic, readonly, nullable) NSURL *infoURL;
/**
Indicates whether or not the update item is only informational and has no download.
If `infoURL` is not present, this is @c NO
If `fileURL` is not present, this is @c YES
Otherwise this is determined based on the contents extracted from the @c <sparkle:informationalUpdate> element.
*/
@property (nonatomic, getter=isInformationOnlyUpdate, readonly) BOOL informationOnlyUpdate;
/**
The title of the appcast item if provided.
This is extracted from the @c <title> element.
*/
@property (nonatomic, copy, readonly, nullable) NSString *title;
/**
The date string of the appcast item if provided.
The `date` property is constructed from this property and expects this string to comply with the following date format:
`E, dd MMM yyyy HH:mm:ss Z`
This is extracted from the @c <pubDate> element.
*/
@property (nonatomic, copy, readonly, nullable) NSString *dateString;
/**
The date constructed from the `dateString` property if provided.
Sparkle by itself only uses this property for phased group rollouts specified via `phasedRolloutInterval`, but clients may query this property too.
This date is constructed using the @c en_US locale.
*/
@property (nonatomic, copy, readonly, nullable) NSDate *date;
/**
The release notes URL of the appcast item if provided.
This external link points to an HTML file that Sparkle downloads and renders to show the user a new or old update item's changelog.
An alternative to using an external release notes link is providing an embedded `itemDescription`.
This is extracted from the @c <sparkle:releaseNotesLink> element.
*/
@property (nonatomic, readonly, nullable) NSURL *releaseNotesURL;
/**
The description of the appcast item if provided.
A description may be provided for inline/embedded release notes for new updates using @c <![CDATA[...]]>
This is an alternative to providing a `releaseNotesURL`.
This is extracted from the @c <description> element.
*/
@property (nonatomic, copy, readonly, nullable) NSString *itemDescription;
/**
The format of the `itemDescription` for inline/embedded release notes if provided.
This may be:
- @c html
- @c plain-text
This is extracted from the @c sparkle:descriptionFormat attribute in the @c <description> element.
If the format is not provided in the @c <description> element of the appcast item, then this property may default to `html`.
If the @c <description> element of the appcast item is not available, this property is `nil`.
*/
@property (nonatomic, readonly, nullable) NSString *itemDescriptionFormat;
/**
The full release notes URL of the appcast item if provided.
The link should point to the product's full changelog.
Sparkle's standard user interface offers to show these full release notes when a user checks for a new update and no new update is available.
This is extracted from the @c <sparkle:fullReleaseNotesLink> element.
*/
@property (nonatomic, readonly, nullable) NSURL *fullReleaseNotesURL;
/**
The required minimum system operating version string for this update if provided.
This version string should contain three period-separated components.
Example: @c 10.13.0
Use `minimumOperatingSystemVersionIsOK` property to test if the current running system passes this requirement.
This is extracted from the @c <sparkle:minimumSystemVersion> element.
*/
@property (nonatomic, copy, readonly, nullable) NSString *minimumSystemVersion;
/**
Indicates whether or not the current running system passes the `minimumSystemVersion` requirement.
*/
@property (nonatomic, readonly) BOOL minimumOperatingSystemVersionIsOK;
/**
This update will be ignored if the application's version precedes this update's minimum version.
This application's version corresponds to the bundle's @c CFBundleVersion
The minimum update version is extracted from the @c <sparkle:minimumUpdateVersion> element.
Use `minimumUpdateVersionIsOK` property to test if the current bundle passes this requirement.
Old applications must be using Sparkle 2.9 or later, otherwise this property will be ignored.
*/
@property (nonatomic, copy, readonly, nullable) NSString *minimumUpdateVersion;
/**
Indicates whether or not the current bundle passes the `minimumUpdateVersion` requirement.
*/
@property (nonatomic, readonly) BOOL minimumUpdateVersionIsOK;
/**
The required maximum system operating version string for this update if provided.
A maximum system operating version requirement should only be made in unusual scenarios.
This version string should contain three period-separated components.
Example: @c 10.14.0
Use `maximumOperatingSystemVersionIsOK` property to test if the current running system passes this requirement.
This is extracted from the @c <sparkle:maximumSystemVersion> element.
*/
@property (nonatomic, copy, readonly, nullable) NSString *maximumSystemVersion;
/**
Indicates whether or not the current running system passes the `maximumSystemVersion` requirement.
*/
@property (nonatomic, readonly) BOOL maximumOperatingSystemVersionIsOK;
/**
The required hardware requirements for this update if provided.
Example: @c arm64
Use `arm64HardwareRequirementIsOK` property to test if the current running system passes the @c arm64 requirement.
This is extracted from the @c <sparkle:hardwareRequirements> element, which is a comma-delimited list of hardware requirements.
*/
@property (nonatomic, copy, readonly) NSSet<NSString *> *hardwareRequirements;
/**
Indicates whether or not the current running system passes the arm64 requirement if specified in the `hardwareRequirements` requirement.
*/
@property (nonatomic, readonly) BOOL arm64HardwareRequirementIsOK;
/**
The channel the update item is on if provided.
An update item may specify a custom channel name (such as @c beta) that can only be found by updaters that filter for that channel.
If no channel is provided, the update item is assumed to be on the default channel.
This is extracted from the @c <sparkle:channel> element.
Old applications must be using Sparkle 2 or later to interpret the channel element and to ignore unmatched channels.
*/
@property (nonatomic, readonly, nullable) NSString *channel;
/**
The installation type of the update at `fileURL`
This may be:
- @c application - indicates this is a regular application update.
- @c package - indicates this is a package installer update.
This is extracted from the @c sparkle:installationType attribute in the @c <enclosure> element.
If no installation type is provided in the enclosure, the installation type is inferred from the `fileURL` file extension instead.
If the file extension is @c pkg or @c mpkg, the installation type is @c package otherwise it is @c application
Hence, the installation type in the enclosure element only needs to be specified for package based updates distributed inside of a @c zip or other archive format.
Old applications must be using Sparkle 1.26 or later to support downloading bare package updates (`pkg` or `mpkg`) that are not additionally archived inside of a @c zip or other archive format.
*/
@property (nonatomic, copy, readonly) NSString *installationType;
/**
The appcast signing validation status that this appcast item came from.
Please see documentation of @c SPUAppcastSigningValidationStatus values for more information.
*/
@property (readonly, nonatomic) SPUAppcastSigningValidationStatus signingValidationStatus;
/**
The phased rollout interval of the update item in seconds if provided.
This is the interval between when different groups of users are notified of a new update.
For this property to be used by Sparkle, the published `date` on the update item must be present as well.
After each interval after the update item's `date`, a new group of users become eligible for being notified of the new update.
This is extracted from the @c <sparkle:phasedRolloutInterval> element.
Old applications must be using Sparkle 1.25 or later to support phased rollout intervals, otherwise they may assume updates are immediately available.
*/
@property (nonatomic, copy, readonly, nullable) NSNumber* phasedRolloutInterval;
/**
The minimum bundle version string this update requires for automatically downloading and installing updates if provided.
If an application's bundle version meets this version requirement, it can install the new update item in the background automatically.
Otherwise if the requirement is not met, the user is always prompted to install the update. In this case, the update is assumed to be a `majorUpgrade`.
If the update is a `majorUpgrade` and the update is skipped by the user, other future update alerts with the same `minimumAutoupdateVersion` will also be skipped automatically unless an update specifies `ignoreSkippedUpgradesBelowVersion`.
This version string corresponds to the application's @c CFBundleVersion
This is extracted from the @c <sparkle:minimumAutoupdateVersion> element.
*/
@property (nonatomic, copy, readonly, nullable) NSString *minimumAutoupdateVersion;
/**
Indicates whether or not the update item is a major upgrade.
An update is a major upgrade if the application's bundle version doesn't meet the `minimumAutoupdateVersion` requirement.
*/
@property (nonatomic, getter=isMajorUpgrade, readonly) BOOL majorUpgrade;
/**
Previously skipped upgrades by the user will be ignored if they skipped an update whose version precedes this version.
This can only be applied if the update is a `majorUpgrade`.
This version string corresponds to the application's @c CFBundleVersion
This is extracted from the @c <sparkle:ignoreSkippedUpgradesBelowVersion> element.
Old applications must be using Sparkle 2.1 or later, otherwise this property will be ignored.
*/
@property (nonatomic, readonly, nullable) NSString *ignoreSkippedUpgradesBelowVersion;
/**
Indicates whether or not the update item is critical.
Critical updates are shown to the user more promptly. Sparkle's standard user interface also does not allow them to be skipped.
This is determined and extracted from a top-level @c <sparkle:criticalUpdate> element or a @c sparkle:criticalUpdate element inside of a @c sparkle:tags element.
Old applications must be using Sparkle 2 or later to support the top-level @c <sparkle:criticalUpdate> element.
*/
@property (nonatomic, getter=isCriticalUpdate, readonly) BOOL criticalUpdate;
/**
Specifies the operating system the download update is available for if provided.
If this property is not provided, then the supported operating system is assumed to be macOS.
Known potential values for this string are @c macos and @c windows
Sparkle on Mac ignores update items that are for other operating systems.
This is only useful for sharing appcasts between Sparkle on Mac and Sparkle on other operating systems.
Use `macOsUpdate` property to test if this update item is for macOS.
This is extracted from the @c sparkle:os attribute in the @c <enclosure> element.
*/
@property (nonatomic, copy, readonly, nullable) NSString *osString;
/**
Indicates whether or not this update item is for macOS.
This is determined from the `osString` property.
*/
@property (nonatomic, getter=isMacOsUpdate, readonly) BOOL macOsUpdate;
/**
The delta updates for this update item.
Sparkle uses these to download and apply a smaller update based on the version the user is updating from.
The key is based on the @c sparkle:version of the update.
The value is an update item that will have `deltaUpdate` be @c YES
Clients typically should not need to examine the contents of the delta updates.
This is extracted from the @c <sparkle:deltas> element.
*/
@property (nonatomic, copy, readonly, nullable) NSDictionary<NSString *, SUAppcastItem *> *deltaUpdates;
/**
The expected size of the Sparkle executable file before applying this delta update.
This attribute is used to test if the delta item can still be applied. If Sparkle's executable file has changed (e.g. from having an architecture stripped),
then the delta item cannot be applied.
This is extracted from the @c sparkle:deltaFromSparkleExecutableSize attribute from the @c <enclosure> element of a @c sparkle:deltas item.
This attribute is optional for delta update items.
*/
@property (nonatomic, nonatomic, readonly, nullable) NSNumber *deltaFromSparkleExecutableSize;
/**
An expected set of Sparkle's locales present on disk before applying this delta update.
This attribute is used to test if the delta item can still be applied. If Sparkle's list of locales present on disk (.lproj directories) do not contain any items from this set,
(e.g. from having localization files stripped) then the delta item cannot be applied. This set does not need to be a complete list of locales. Sparkle may even decide
to not process all them. 1-10 should be a decent amount.
This is extracted from the @c sparkle:deltaFromSparkleLocales attribute from the @c <enclosure> element of a @c sparkle:deltas item.
The locales extracted from this attribute are delimited by a comma (e.g. "en,ca,fr,hr,hu"). This attribute is optional for delta update items.
*/
@property (nonatomic, nonatomic, readonly, nullable) NSSet<NSString *> *deltaFromSparkleLocales;
/**
Indicates whether or not the update item is a delta update.
An update item is a delta update if it is in the `deltaUpdates` of another update item.
*/
@property (nonatomic, getter=isDeltaUpdate, readonly) BOOL deltaUpdate;
/**
The dictionary representing the entire appcast item.
This is useful for querying custom extensions or elements from the appcast item.
*/
@property (nonatomic, readonly, copy) NSDictionary *propertiesDictionary;
- (instancetype)init NS_UNAVAILABLE;
/**
An empty appcast item.
This may be used as a potential return value in `-[SPUUpdaterDelegate bestValidUpdateInAppcast:forUpdater:]`
*/
+ (instancetype)emptyAppcastItem;
// Deprecated initializers
- (nullable instancetype)initWithDictionary:(NSDictionary *)dict __deprecated_msg("Properties that depend on the system or application version are not supported when used with this initializer. The designated initializer is available in SUAppcastItem+Private.h. Please first explore other APIs or contact us to describe your use case.");
- (nullable instancetype)initWithDictionary:(NSDictionary *)dict failureReason:(NSString * _Nullable __autoreleasing *_Nullable)error __deprecated_msg("Properties that depend on the system or application version are not supported when used with this initializer. The designated initializer is available in SUAppcastItem+Private.h. Please first explore other APIs or contact us to describe your use case.");
- (nullable instancetype)initWithDictionary:(NSDictionary *)dict relativeToURL:(NSURL * _Nullable)appcastURL failureReason:(NSString * _Nullable __autoreleasing *_Nullable)error __deprecated_msg("Properties that depend on the system or application version are not supported when used with this initializer. The designated initializer is available in SUAppcastItem+Private.h. Please first explore other APIs or contact us to describe your use case.");
@end
NS_ASSUME_NONNULL_END
#endif
@@ -0,0 +1,111 @@
//
// SUErrors.h
// Sparkle
//
// Created by C.W. Betts on 10/13/14.
// Copyright (c) 2014 Sparkle Project. All rights reserved.
//
#ifndef SUERRORS_H
#define SUERRORS_H
#import <Foundation/Foundation.h>
#if defined(BUILDING_SPARKLE_SOURCES_EXTERNALLY)
// Ignore incorrect warning
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wquoted-include-in-framework-header"
#import "SUExport.h"
#pragma clang diagnostic pop
#else
#import <Sparkle/SUExport.h>
#endif
/**
* Error domain used by Sparkle
*/
SU_EXPORT extern NSString *const SUSparkleErrorDomain;
typedef NS_ENUM(OSStatus, SUError) {
// Configuration phase errors
SUNoPublicDSAFoundError = 0001,
SUInsufficientSigningError = 0002,
SUInsecureFeedURLError = 0003,
SUInvalidFeedURLError = 0004,
SUInvalidUpdaterError = 0005,
SUInvalidHostBundleIdentifierError = 0006,
SUInvalidHostVersionError = 0007,
// Appcast phase errors.
SUAppcastParseError = 1000,
SUNoUpdateError = 1001,
SUAppcastError = 1002,
SURunningFromDiskImageError = 1003,
SUResumeAppcastError = 1004,
SURunningTranslocated = 1005,
SUWebKitTerminationError = 1006,
SUReleaseNotesError = 1007,
// Download phase errors.
SUTemporaryDirectoryError = 2000,
SUDownloadError = 2001,
// Extraction phase errors.
SUUnarchivingError = 3000,
SUSignatureError = 3001,
SUValidationError = 3002,
// Installation phase errors.
SUFileCopyFailure = 4000,
SUAuthenticationFailure = 4001,
SUMissingUpdateError = 4002,
SUMissingInstallerToolError = 4003,
SURelaunchError = 4004,
SUInstallationError = 4005,
SUDowngradeError = 4006,
SUInstallationCanceledError = 4007,
SUInstallationAuthorizeLaterError = 4008,
SUNotValidUpdateError = 4009,
SUAgentInvalidationError = 4010,
//SUInstallationRootInteractiveError = 4011,
SUInstallationWriteNoPermissionError = 4012,
// API misuse errors.
SUIncorrectAPIUsageError = 5000
};
/**
The reason why a new update is not available.
*/
typedef NS_ENUM(OSStatus, SPUNoUpdateFoundReason) {
/**
A new update is unavailable for an unknown reason.
*/
SPUNoUpdateFoundReasonUnknown,
/**
A new update is unavailable because the user is on the latest known version in the appcast feed.
*/
SPUNoUpdateFoundReasonOnLatestVersion,
/**
A new update is unavailable because the user is on a version newer than the latest known version in the appcast feed.
*/
SPUNoUpdateFoundReasonOnNewerThanLatestVersion,
/**
A new update is unavailable because the user's operating system version is too old for the update.
*/
SPUNoUpdateFoundReasonSystemIsTooOld,
/**
A new update is unavailable because the user's operating system version is too new for the update.
*/
SPUNoUpdateFoundReasonSystemIsTooNew,
/**
A new update is unavailable because the user's system is an Intel Mac that doesn't support ARM64.
*/
SPUNoUpdateFoundReasonHardwareDoesNotSupportARM64,
};
SU_EXPORT extern NSString *const SPUNoUpdateFoundReasonKey;
SU_EXPORT extern NSString *const SPULatestAppcastItemFoundKey;
SU_EXPORT extern NSString *const SPUNoUpdateFoundUserInitiatedKey;
#endif
@@ -0,0 +1,18 @@
//
// SUExport.h
// Sparkle
//
// Created by Jake Petroules on 2014-08-23.
// Copyright (c) 2014 Sparkle Project. All rights reserved.
//
#ifndef SUEXPORT_H
#define SUEXPORT_H
#ifdef BUILDING_SPARKLE
#define SU_EXPORT __attribute__((visibility("default")))
#else
#define SU_EXPORT
#endif
#endif
@@ -0,0 +1,63 @@
//
// SUStandardVersionComparator.h
// Sparkle
//
// Created by Andy Matuschak on 12/21/07.
// Copyright 2007 Andy Matuschak. All rights reserved.
//
#ifndef SUSTANDARDVERSIONCOMPARATOR_H
#define SUSTANDARDVERSIONCOMPARATOR_H
#import <Foundation/Foundation.h>
#if defined(BUILDING_SPARKLE_SOURCES_EXTERNALLY)
// Ignore incorrect warning
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wquoted-include-in-framework-header"
#import "SUExport.h"
#import "SUVersionComparisonProtocol.h"
#pragma clang diagnostic pop
#else
#import <Sparkle/SUExport.h>
#import <Sparkle/SUVersionComparisonProtocol.h>
#endif
NS_ASSUME_NONNULL_BEGIN
/**
Sparkle's default version comparator.
This comparator is adapted from MacPAD, by Kevin Ballard.
It's "dumb" in that it does essentially string comparison,
in components split by character type.
*/
SU_EXPORT @interface SUStandardVersionComparator : NSObject <SUVersionComparison>
/**
Initializes a new instance of the standard version comparator.
*/
- (instancetype)init;
/**
A singleton instance of the comparator.
*/
@property (nonatomic, class, readonly) SUStandardVersionComparator *defaultComparator;
/**
Compares two version strings through textual analysis.
These version strings should be in the format of x, x.y, or x.y.z where each component is a number.
For example, valid version strings include "1.5.3", "500", or "4000.1"
These versions that are compared correspond to the @c CFBundleVersion values of the updates.
@param versionA The first version string to compare.
@param versionB The second version string to compare.
@return A comparison result between @c versionA and @c versionB
*/
- (NSComparisonResult)compareVersion:(NSString *)versionA toVersion:(NSString *)versionB;
@end
NS_ASSUME_NONNULL_END
#endif
@@ -0,0 +1,73 @@
//
// SUUpdatePermissionResponse.h
// Sparkle
//
// Created by Mayur Pawashe on 2/8/16.
// Copyright © 2016 Sparkle Project. All rights reserved.
//
#import <Foundation/Foundation.h>
#if defined(BUILDING_SPARKLE_SOURCES_EXTERNALLY)
// Ignore incorrect warning
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wquoted-include-in-framework-header"
#import "SUExport.h"
#pragma clang diagnostic pop
#else
#import <Sparkle/SUExport.h>
#endif
NS_ASSUME_NONNULL_BEGIN
/**
This class represents a response for permission to check updates.
*/
SU_EXPORT NS_SWIFT_SENDABLE @interface SUUpdatePermissionResponse : NSObject<NSSecureCoding>
/**
Initializes a new update permission response instance.
@param automaticUpdateChecks Flag to enable automatic update checks.
@param sendSystemProfile Flag for if system profile information should be sent to the server hosting the appcast.
*/
- (instancetype)initWithAutomaticUpdateChecks:(BOOL)automaticUpdateChecks sendSystemProfile:(BOOL)sendSystemProfile;
/**
Initializes a new update permission response instance.
@param automaticUpdateChecks Flag to enable automatic update checks.
@param automaticUpdateDownloading Flag to enable automatic downloading and installing of updates. If this is nil, this option will be ignored.
@param sendSystemProfile Flag for if system profile information should be sent to the server hosting the appcast.
*/
- (instancetype)initWithAutomaticUpdateChecks:(BOOL)automaticUpdateChecks automaticUpdateDownloading:(NSNumber * _Nullable)automaticUpdateDownloading sendSystemProfile:(BOOL)sendSystemProfile;
/*
Use -initWithAutomaticUpdateChecks:sendSystemProfile: instead.
*/
- (instancetype)init NS_UNAVAILABLE;
/**
A read-only property indicating if update checks should be done automatically.
*/
@property (nonatomic, readonly) BOOL automaticUpdateChecks;
/**
A read-only property indicating if updates should be automatically downloaded and installed.
If this property is `nil`, then no user choice was made for this option.
If `automaticUpdateChecks` is `NO` then this property should not be `@(YES)`.
Set it to `NO` if the user was given the choice of automatically downloading and installing updates,
otherwise set it to `nil`.
*/
@property (nonatomic, readonly, nullable) NSNumber *automaticUpdateDownloading;
/**
A read-only property indicating if system profile should be sent or not.
*/
@property (nonatomic, readonly) BOOL sendSystemProfile;
@end
NS_ASSUME_NONNULL_END
@@ -0,0 +1,212 @@
//
// SUUpdater.h
// Sparkle
//
// Created by Andy Matuschak on 1/4/06.
// Copyright 2006 Andy Matuschak. All rights reserved.
//
#ifndef SUUPDATER_H
#define SUUPDATER_H
#import <Foundation/Foundation.h>
#if defined(BUILDING_SPARKLE_SOURCES_EXTERNALLY)
// Ignore incorrect warning
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wquoted-include-in-framework-header"
#import "SUExport.h"
#import "SUVersionComparisonProtocol.h"
#import "SUVersionDisplayProtocol.h"
#import "SUUpdaterDelegate.h"
#pragma clang diagnostic pop
#else
#import <Sparkle/SUExport.h>
#import <Sparkle/SUVersionComparisonProtocol.h>
#import <Sparkle/SUVersionDisplayProtocol.h>
#import <Sparkle/SUUpdaterDelegate.h>
#endif
@class SUAppcastItem, SUAppcast, NSMenuItem;
@protocol SUUpdaterDelegate;
/**
The legacy API in Sparkle for controlling the update mechanism.
This class is now deprecated and acts as a thin wrapper around `SPUUpdater` and `SPUStandardUserDriver`.
If you are migrating to Sparkle 2, use `SPUStandardUpdaterController` instead, or `SPUUpdater` if you need more control.
*/
__deprecated_msg("Deprecated in Sparkle 2. Use SPUStandardUpdaterController instead, or SPUUpdater if you need more control.")
SU_EXPORT @interface SUUpdater : NSObject
@property (unsafe_unretained, nonatomic) 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;
/*!
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 initiating 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 (nonatomic) 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.
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 (nonatomic) 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 (nonatomic) 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 (nonatomic, copy) NSURL *feedURL;
/*!
The host bundle that is being updated.
*/
@property (readonly, nonatomic) NSBundle *hostBundle;
/*!
The bundle this class (SUUpdater) is loaded into.
*/
@property (nonatomic, readonly) NSBundle *sparkleBundle;
/*!
The user agent used when checking for and downloading updates.
The default implementation can be overridden.
*/
@property (nonatomic, copy) NSString *userAgentString;
/*!
The HTTP headers used when checking for and downloading updates.
The keys of this dictionary are HTTP header fields (NSString) and values are corresponding values (NSString)
*/
@property (copy, nonatomic) NSDictionary<NSString *, NSString *> *httpHeaders;
/*!
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 (nonatomic) BOOL sendsSystemProfile;
/*!
A property indicating the decryption password used for extracting updates shipped as Apple Disk Images (dmg)
*/
@property (nonatomic, copy) NSString *decryptionPassword;
/*!
Returns the date of last update check.
\returns \c nil if no check has been performed.
*/
@property (nonatomic, readonly, copy) NSDate *lastUpdateCheckDate;
/*!
Appropriately schedules or cancels the update checking timer according to
the preferences for time interval and automatic checks.
This call does not change the date of the next check,
but only the internal NSTimer.
*/
- (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 (nonatomic, readonly) BOOL updateInProgress;
@end
#endif
@@ -0,0 +1,363 @@
//
// SUUpdaterDelegate.h
// Sparkle
//
// Created by Mayur Pawashe on 3/12/16.
// Copyright © 2016 Sparkle Project. All rights reserved.
//
#import <Foundation/Foundation.h>
#if defined(BUILDING_SPARKLE_SOURCES_EXTERNALLY)
// Ignore incorrect warning
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wquoted-include-in-framework-header"
#import "SUExport.h"
#pragma clang diagnostic pop
#else
#import <Sparkle/SUExport.h>
#endif
@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.
*/
__deprecated_msg("Deprecated in Sparkle 2. See SPUUpdaterDelegate instead")
@protocol SUUpdaterDelegate <NSObject>
@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<NSDictionary<NSString *, NSString *> *> *)feedParametersForUpdater:(SUUpdater *)updater sendingSystemProfile:(BOOL)sendingProfile;
/*!
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 just before the scheduled update driver prompts the user to install an update.
\param updater The SUUpdater instance.
\return YES to allow the update prompt to be shown (the default behavior), or NO to suppress it.
*/
- (BOOL)updaterShouldShowUpdateAlertForScheduledUpdate:(SUUpdater *)updater forItem:(SUAppcastItem *)item;
/*!
Called after the user dismisses the update alert.
\param updater The SUUpdater instance.
\param permanently YES if the alert will not appear again for this update; NO if it may reappear.
*/
- (void)updater:(SUUpdater *)updater didDismissUpdateAlertPermanently:(BOOL)permanently forItem:(SUAppcastItem *)item;
/*!
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 immediately after successful download of the specified update.
\param updater The SUUpdater instance.
\param item The appcast item corresponding to the update that has been downloaded.
*/
- (void)updater:(SUUpdater *)updater didDownloadUpdate:(SUAppcastItem *)item;
/*!
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 extracting the specified downloaded update.
\param updater The SUUpdater instance.
\param item The appcast item corresponding to the update that is proposed to be extracted.
*/
- (void)updater:(SUUpdater *)updater willExtractUpdate:(SUAppcastItem *)item;
/*!
Called immediately after extracting the specified downloaded update.
\param updater The SUUpdater instance.
\param item The appcast item corresponding to the update that has been extracted.
*/
- (void)updater:(SUUpdater *)updater didExtractUpdate:(SUAppcastItem *)item;
/*!
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;
/*!
Called when an update is skipped by the user.
\param updater The updater instance.
\param item The appcast item corresponding to the update that the user skipped.
*/
- (void)updater:(SUUpdater *)updater userDidSkipThisVersion:(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.
This may also not be called if the application is not going to relaunch after it terminates.
\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 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.
This method acts as a simpler alternative to SUUpdaterDelegate::updater:shouldPostponeRelaunchForUpdate:untilInvoking: avoiding usage of NSInvocation, which is not available in Swift environments.
\param updater The SUUpdater instance.
\param item The appcast item corresponding to the update that is proposed to be installed.
\return \c YES to delay the relaunch.
*/
- (BOOL)updater:(SUUpdater *)updater shouldPostponeRelaunchForUpdate:(SUAppcastItem *)item;
/*!
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;
/*!
Called immediately after relaunching. SUUpdater delegate must be set before applicationDidFinishLaunching: to catch this event.
\param updater The SUUpdater instance.
*/
- (void)updaterDidRelaunchApplication:(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. Note that the
standard version comparator may be used during installation for preventing
a downgrade, even if you provide a custom comparator here.
\sa SUStandardVersionComparator
\param updater The SUUpdater instance.
*/
- (nullable id<SUVersionComparison>)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 <SUVersionDisplay>)versionDisplayerForUpdater:(SUUpdater *)updater;
/*!
Returns the path to the application which is used to relaunch after the update is installed.
The installer also waits for the termination of the application at this path.
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;
/*!
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)
This method acts as a more modern alternative to SUUpdaterDelegate::updater:willInstallUpdateOnQuit:immediateInstallationInvocation: using a block instead of NSInvocation, which is not available in Swift environments.
\param updater The SUUpdater instance.
\param item The appcast item corresponding to the update that is proposed to be installed.
\param installationBlock Can be used to trigger an immediate silent install and relaunch.
*/
- (void)updater:(SUUpdater *)updater willInstallUpdateOnQuit:(SUAppcastItem *)item immediateInstallationBlock:(void (^)(void))installationBlock;
/*!
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.
\deprecated This method is no longer invoked. The installer will try to its best ability to install the update.
*/
- (void)updater:(SUUpdater *)updater didCancelInstallUpdateOnQuit:(SUAppcastItem *)item __deprecated;
/*!
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
@@ -0,0 +1,42 @@
//
// SUVersionComparisonProtocol.h
// Sparkle
//
// Created by Andy Matuschak on 12/21/07.
// Copyright 2007 Andy Matuschak. All rights reserved.
//
#ifndef SUVERSIONCOMPARISONPROTOCOL_H
#define SUVERSIONCOMPARISONPROTOCOL_H
#import <Foundation/Foundation.h>
#if defined(BUILDING_SPARKLE_SOURCES_EXTERNALLY)
// Ignore incorrect warning
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wquoted-include-in-framework-header"
#import "SUExport.h"
#pragma clang diagnostic pop
#else
#import <Sparkle/SUExport.h>
#endif
NS_ASSUME_NONNULL_BEGIN
/**
Provides version comparison facilities for Sparkle.
*/
@protocol SUVersionComparison
/**
An abstract method to compare two version strings.
Should return NSOrderedAscending if b > a, NSOrderedDescending if b < a,
and NSOrderedSame if they are equivalent.
*/
- (NSComparisonResult)compareVersion:(NSString *)versionA toVersion:(NSString *)versionB; // *** MAY BE CALLED ON NON-MAIN THREAD!
@end
NS_ASSUME_NONNULL_END
#endif
@@ -0,0 +1,78 @@
//
// SUVersionDisplayProtocol.h
// EyeTV
//
// Created by Uli Kusterer on 08.12.09.
// Copyright 2009 Elgato Systems GmbH. All rights reserved.
//
#import <Foundation/Foundation.h>
#if defined(BUILDING_SPARKLE_SOURCES_EXTERNALLY)
// Ignore incorrect warning
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wquoted-include-in-framework-header"
#import "SUExport.h"
#pragma clang diagnostic pop
#else
#import <Sparkle/SUExport.h>
#endif
@class SUAppcastItem;
NS_ASSUME_NONNULL_BEGIN
/**
Applies special display formatting to version numbers of the bundle to update and the update before presenting them to the user.
*/
SU_EXPORT @protocol SUVersionDisplay <NSObject>
/**
Formats an update's version string and bundle's version string for display.
This method is used to format both the display version of the update and the display version of the bundle to update.
The display versions returned by this method are then used for presenting to the user when a new update is available,
or when the user cannot download/install the latest update for a specific reason, or when the user has a newer version
installed than the latest known version in the update feed.
On input, the `update.displayVersionString` and `*inOutBundleDisplayVersion` may be the same, but the
`update.versionString` and `bundleVersion` will differ. To differentiate between these display versions, you may
choose to return different display version strings for the update and bundle.
@param update The update to format the update display version from. You can query `update.displayVersionString` and `update.versionString` to retrieve the update's version information.
@param inOutBundleDisplayVersion On input, the display version string (or `CFBundleShortVersionString`) of the bundle to update. On output, this is the display version string of the bundle to show to the user.
@param bundleVersion The version (or CFBundleVersion) of the bundle to update.
@return A new display version string of the `update.displayVersionString` to show to the user.
*/
- (NSString *)formatUpdateDisplayVersionFromUpdate:(SUAppcastItem *)update andBundleDisplayVersion:(NSString * _Nonnull __autoreleasing * _Nonnull)inOutBundleDisplayVersion withBundleVersion:(NSString *)bundleVersion;
@optional
/**
Formats a bundle's version string for display.
This method is used to format the display version of the bundle.
This method may be used when no new update is available and the user is already on the latest known version.
In this case, no new update version is shown to the user.
This method is optional. If it's not implemented, Sparkle will default to using the `bundleDisplayVersion` passed to this method.
@param bundleDisplayVersion The display version string (or `CFBundleShortVersionString`) of the bundle to update.
@param bundleVersion The version (or `CFBundleVersion`) of the bundle to update.
@param matchingUpdate The update in the feed that corresponds to the current bundle, or `nil` if no matching update item could be found in the feed.
@return A new display version string of the bundle to show to the user.
*/
- (NSString *)formatBundleDisplayVersion:(NSString *)bundleDisplayVersion withBundleVersion:(NSString *)bundleVersion matchingUpdate:(SUAppcastItem * _Nullable)matchingUpdate;
/**
Formats two version strings.
Both versions are provided so that important distinguishing information
can be displayed while also leaving out unnecessary/confusing parts.
*/
- (void)formatVersion:(NSString *_Nonnull*_Nonnull)inOutVersionA andVersion:(NSString *_Nonnull*_Nonnull)inOutVersionB __deprecated_msg("Please use -formatUpdateDisplayVersionFromUpdate:andBundleDisplayVersion:withBundleVersion:");
@end
NS_ASSUME_NONNULL_END
@@ -0,0 +1,39 @@
//
// Sparkle.h
// Sparkle
//
// Created by Andy Matuschak on 3/16/06. (Modified by CDHW on 23/12/07)
// Copyright 2006 Andy Matuschak. All rights reserved.
//
#ifndef SPARKLE_H
#define SPARKLE_H
// 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:
#import <Sparkle/SUExport.h>
#import <Sparkle/SUAppcast.h>
#import <Sparkle/SUAppcastItem.h>
#import <Sparkle/SUStandardVersionComparator.h>
#import <Sparkle/SPUUpdater.h>
#import <Sparkle/SPUUpdaterDelegate.h>
#import <Sparkle/SPUUpdaterSettings.h>
#import <Sparkle/SUVersionComparisonProtocol.h>
#import <Sparkle/SUVersionDisplayProtocol.h>
#import <Sparkle/SUErrors.h>
#import <Sparkle/SPUUpdatePermissionRequest.h>
#import <Sparkle/SUUpdatePermissionResponse.h>
#import <Sparkle/SPUUserDriver.h>
#import <Sparkle/SPUDownloadData.h>
// UI bits
#import <Sparkle/SPUStandardUpdaterController.h>
#import <Sparkle/SPUStandardUserDriver.h>
#import <Sparkle/SPUStandardUserDriverDelegate.h>
// Deprecated bits
#import <Sparkle/SUUpdater.h>
#import <Sparkle/SUUpdaterDelegate.h>
#endif
@@ -0,0 +1,6 @@
framework module Sparkle {
umbrella header "Sparkle.h"
export *
module * { export * }
}
@@ -0,0 +1,38 @@
//
// Sparkle.private.modulemap
// Sparkle
//
// Created on 4/30/25.
// Copyright © 2025 Sparkle Project. All rights reserved.
//
framework module Sparkle_Private {
// Nothing exported here
}
explicit module Sparkle_Private.SPUStandardUserDriver {
header "SPUStandardUserDriver+Private.h"
export *
}
explicit module Sparkle_Private.SPUGentleUserDriverReminders {
header "SPUGentleUserDriverReminders.h"
export *
}
explicit module Sparkle_Private.SPUUserAgent {
header "SPUUserAgent+Private.h"
export *
}
explicit module Sparkle_Private.SUAppcastItem {
header "SUAppcastItem+Private.h"
header "SPUAppcastItemStateResolver.h"
export *
}
explicit module Sparkle_Private.SUInstallerLauncher {
header "SUInstallerLauncher+Private.h"
header "SPUInstallationType.h"
export *
}
@@ -0,0 +1,38 @@
//
// SPUAppcastItemStateResolver.h
// Sparkle
//
// Created by Mayur Pawashe on 5/31/21.
// Copyright © 2021 Sparkle Project. All rights reserved.
//
#import <Foundation/Foundation.h>
#if defined(BUILDING_SPARKLE_SOURCES_EXTERNALLY)
// Ignore incorrect warning
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wquoted-include-in-framework-header"
#import "SUExport.h"
#pragma clang diagnostic pop
#else
#import <Sparkle/SUExport.h>
#endif
NS_ASSUME_NONNULL_BEGIN
@class SUStandardVersionComparator, SPUAppcastItemState;
@protocol SUVersionComparison;
/**
Private exposed class used to resolve Appcast Item properties that rely on external factors such as a host.
This resolver is used for constructing appcast items.
*/
SU_EXPORT @interface SPUAppcastItemStateResolver : NSObject
- (instancetype)init NS_UNAVAILABLE;
- (instancetype)initWithHostVersion:(NSString *)hostVersion applicationVersionComparator:(id<SUVersionComparison>)applicationVersionComparator standardVersionComparator:(SUStandardVersionComparator *)standardVersionComparator;
@end
NS_ASSUME_NONNULL_END
@@ -0,0 +1,22 @@
//
// SPUGentleUserDriverReminders.h
// Sparkle
//
// Copyright © 2022 Sparkle Project. All rights reserved.
//
#ifndef SPUGentleUserDriverReminders_h
#define SPUGentleUserDriverReminders_h
/**
A private protocol for user drivers implementing gentle scheduled reminders
*/
@protocol SPUGentleUserDriverReminders
- (void)logGentleScheduledUpdateReminderWarningIfNeeded;
- (void)resetTimeSinceOpportuneUpdateNotice;
@end
#endif /* SPUGentleUserDriverReminders_h */
@@ -0,0 +1,19 @@
//
// SPUInstallationType.h
// Sparkle
//
// Created by Mayur Pawashe on 7/24/16.
// Copyright © 2016 Sparkle Project. All rights reserved.
//
#ifndef SPUInstallationType_h
#define SPUInstallationType_h
#define SPUInstallationTypeApplication @"application" // the default installation type for ordinary application updates
#define SPUInstallationTypeGuidedPackage @"package" // the preferred installation type for package installations
#define SPUInstallationTypeInteractivePackage @"interactive-package" // removed installation type; use guided package instead
#define SPUInstallationTypesArray (@[SPUInstallationTypeApplication, SPUInstallationTypeGuidedPackage])
#define SPUValidInstallationType(x) ((x != nil) && [SPUInstallationTypesArray containsObject:(NSString * _Nonnull)x])
#endif /* SPUInstallationType_h */
@@ -0,0 +1,40 @@
//
// SPUStandardUserDriver+Private.h
// Sparkle
//
// Copyright © 2022 Sparkle Project. All rights reserved.
//
#ifndef SPUStandardUserDriver_Private_h
#define SPUStandardUserDriver_Private_h
#if defined(BUILDING_SPARKLE_SOURCES_EXTERNALLY)
// Ignore incorrect warning
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wquoted-include-in-framework-header"
#import "SPUStandardUserDriver.h"
#import "SUExport.h"
#pragma clang diagnostic pop
#else
#import <Sparkle/SPUStandardUserDriver.h>
#import <Sparkle/SUExport.h>
#endif
@class NSWindowController;
NS_ASSUME_NONNULL_BEGIN
SU_EXPORT @interface SPUStandardUserDriver (Private)
/**
Private API for accessing the active update alert's window controller.
This is the window controller that shows the update's release notes and install choices.
This can be accessed in -[SPUStandardUserDriverDelegate standardUserDriverWillHandleShowingUpdate:forUpdate:state:]
*/
@property (nonatomic, readonly, nullable) NSWindowController *activeUpdateAlert;
@end
NS_ASSUME_NONNULL_END
#endif /* SPUStandardUserDriver_Private_h */
@@ -0,0 +1,29 @@
//
// SPUUserAgent+Private.h
// Sparkle
//
// Created by Mayur Pawashe on 11/12/21.
// Copyright © 2021 Sparkle Project. All rights reserved.
//
#import <Foundation/Foundation.h>
#if defined(BUILDING_SPARKLE_SOURCES_EXTERNALLY)
// Ignore incorrect warning
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wquoted-include-in-framework-header"
#import "SUExport.h"
#pragma clang diagnostic pop
#else
#import <Sparkle/SUExport.h>
#endif
NS_ASSUME_NONNULL_BEGIN
@class SUHost;
SU_EXPORT NSString *SPUMakeUserAgentWithHost(SUHost *responsibleHost, NSString * _Nullable displayNameSuffix);
SU_EXPORT NSString *SPUMakeUserAgentWithBundle(NSBundle *responsibleBundle, NSString * _Nullable displayNameSuffix);
NS_ASSUME_NONNULL_END
@@ -0,0 +1,50 @@
//
// SUAppcastItem+Private.h
// Sparkle
//
// Created by Mayur Pawashe on 4/30/21.
// Copyright © 2021 Sparkle Project. All rights reserved.
//
#ifndef SUAppcastItem_Private_h
#define SUAppcastItem_Private_h
#import <Foundation/Foundation.h>
#import <Sparkle/SUAppcastItem.h>
NS_ASSUME_NONNULL_BEGIN
// Available in SPUAppcastItemStateResolver.h (a private exposed header)
@class SPUAppcastItemStateResolver;
@class SUSignatures;
@interface SUAppcastItem (Private) <NSSecureCoding>
/**
Initializes with data from a dictionary provided by the RSS class and state resolver
This initializer method is intended to be marked "private" and discouraged from public usage.
This method is available however. Talk to us to describe your use case and if you need to construct appcast items yourself.
*/
- (nullable instancetype)initWithDictionary:(NSDictionary *)dict relativeToURL:(NSURL * _Nullable)appcastURL stateResolver:(SPUAppcastItemStateResolver *)stateResolver signingValidationStatus:(SPUAppcastSigningValidationStatus)signingValidationStatus failureReason:(NSString * _Nullable __autoreleasing *_Nullable)error;
/**
The EdDSA and DSA signatures of the update along with their statuses.
*/
@property (readonly, nonatomic, nullable) SUSignatures *signatures;
/**
The EdDSA signature of the external release notes along with its status.
*/
@property (readonly, nonatomic, nullable) SUSignatures *releaseNotesSignatures;
/**
The expected content length of the release notes file.
*/
@property (readonly, nonatomic) uint64_t releaseNotesContentLength;
@end
NS_ASSUME_NONNULL_END
#endif /* SUAppcastItem_Private_h */
@@ -0,0 +1,37 @@
//
// SUInstallerLauncher+Private.h
// SUInstallerLauncher+Private
//
// Created by Mayur Pawashe on 8/21/21.
// Copyright © 2021 Sparkle Project. All rights reserved.
//
#ifndef SUInstallerLauncher_Private_h
#define SUInstallerLauncher_Private_h
#if defined(BUILDING_SPARKLE_SOURCES_EXTERNALLY)
// Ignore incorrect warning
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wquoted-include-in-framework-header"
#import "SUExport.h"
#import "SPUInstallationType.h"
#pragma clang diagnostic pop
#else
#import <Sparkle/SUExport.h>
// Chances are clients will need this too
#import <Sparkle/SPUInstallationType.h>
#endif
@class NSString;
/**
Private API for determining if the system needs authorization access to update a bundle path
This API is not supported when used directly from a Sandboxed applications and will always return @c YES in that case.
@param bundlePath The bundle path to test if authorization is needed when performing an update that replaces this bundle.
@return @c YES if Sparkle thinks authorization is needed to update the @c bundlePath, otherwise @c NO.
*/
SU_EXPORT BOOL SPUSystemNeedsAuthorizationAccessForBundlePath(NSString *bundlePath);
#endif /* SUInstallerLauncher_Private_h */
@@ -0,0 +1,48 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>BuildMachineOSBuild</key>
<string>25E246</string>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
<string>Sparkle</string>
<key>CFBundleIdentifier</key>
<string>org.sparkle-project.Sparkle</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>Sparkle</string>
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>2.9.4</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleSupportedPlatforms</key>
<array>
<string>MacOSX</string>
</array>
<key>CFBundleVersion</key>
<string>2059</string>
<key>DTCompiler</key>
<string>com.apple.compilers.llvm.clang.1_0</string>
<key>DTPlatformBuild</key>
<string>25C57</string>
<key>DTPlatformName</key>
<string>macosx</string>
<key>DTPlatformVersion</key>
<string>26.2</string>
<key>DTSDKBuild</key>
<string>25C57</string>
<key>DTSDKName</key>
<string>macosx26.2</string>
<key>DTXcode</key>
<string>2620</string>
<key>DTXcodeBuild</key>
<string>17C52</string>
<key>LSMinimumSystemVersion</key>
<string>10.13</string>
</dict>
</plist>
@@ -0,0 +1,13 @@
@media (prefers-color-scheme: dark) {
html {
color-scheme: dark;
color: white;
background: transparent;
}
:link {
color: #419CFF;
}
:link:active {
color: #FF1919;
}
}
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,93 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>BuildMachineOSBuild</key>
<string>25E246</string>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
<string>Updater</string>
<key>CFBundleIdentifier</key>
<string>org.sparkle-project.Sparkle.Updater</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleLocalizations</key>
<array>
<string>en</string>
<string>ca</string>
<string>ar</string>
<string>cs</string>
<string>da</string>
<string>de</string>
<string>el</string>
<string>es</string>
<string>fa</string>
<string>fi</string>
<string>fr</string>
<string>he</string>
<string>hr</string>
<string>hu</string>
<string>is</string>
<string>it</string>
<string>ja</string>
<string>ko</string>
<string>nb</string>
<string>nl</string>
<string>nn</string>
<string>pl</string>
<string>pt-BR</string>
<string>pt-PT</string>
<string>ro</string>
<string>ru</string>
<string>sk</string>
<string>sl</string>
<string>sv</string>
<string>th</string>
<string>tr</string>
<string>uk</string>
<string>vi</string>
<string>zh_CN</string>
<string>zh_HK</string>
<string>zh_TW</string>
</array>
<key>CFBundleName</key>
<string>Updater</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>2.9.4</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleSupportedPlatforms</key>
<array>
<string>MacOSX</string>
</array>
<key>CFBundleVersion</key>
<string>2059</string>
<key>DTCompiler</key>
<string>com.apple.compilers.llvm.clang.1_0</string>
<key>DTPlatformBuild</key>
<string>25C57</string>
<key>DTPlatformName</key>
<string>macosx</string>
<key>DTPlatformVersion</key>
<string>26.2</string>
<key>DTSDKBuild</key>
<string>25C57</string>
<key>DTSDKName</key>
<string>macosx26.2</string>
<key>DTXcode</key>
<string>2620</string>
<key>DTXcodeBuild</key>
<string>17C52</string>
<key>LSApplicationCategoryType</key>
<string>public.app-category.utilities</string>
<key>LSMinimumSystemVersion</key>
<string>10.13</string>
<key>LSUIElement</key>
<string>1</string>
<key>NSPrincipalClass</key>
<string>NSApplication</string>
</dict>
</plist>
@@ -0,0 +1 @@
APPL????
@@ -0,0 +1,128 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>files</key>
<dict>
<key>Resources/SUStatus.nib</key>
<data>
GTcyeZW17TcmJWdEEfhoJMkZPyc=
</data>
</dict>
<key>files2</key>
<dict>
<key>Resources/SUStatus.nib</key>
<dict>
<key>hash2</key>
<data>
u6Fd03omr4dHYhS2iwbWRVEYzlB/13hj9JR9ZUpgRa8=
</data>
</dict>
</dict>
<key>rules</key>
<dict>
<key>^Resources/</key>
<true/>
<key>^Resources/.*\.lproj/</key>
<dict>
<key>optional</key>
<true/>
<key>weight</key>
<real>1000</real>
</dict>
<key>^Resources/.*\.lproj/locversion.plist$</key>
<dict>
<key>omit</key>
<true/>
<key>weight</key>
<real>1100</real>
</dict>
<key>^Resources/Base\.lproj/</key>
<dict>
<key>weight</key>
<real>1010</real>
</dict>
<key>^version.plist$</key>
<true/>
</dict>
<key>rules2</key>
<dict>
<key>.*\.dSYM($|/)</key>
<dict>
<key>weight</key>
<real>11</real>
</dict>
<key>^(.*/)?\.DS_Store$</key>
<dict>
<key>omit</key>
<true/>
<key>weight</key>
<real>2000</real>
</dict>
<key>^(Frameworks|SharedFrameworks|PlugIns|Plug-ins|XPCServices|Helpers|MacOS|Library/(Automator|Spotlight|LoginItems))/</key>
<dict>
<key>nested</key>
<true/>
<key>weight</key>
<real>10</real>
</dict>
<key>^.*</key>
<true/>
<key>^Info\.plist$</key>
<dict>
<key>omit</key>
<true/>
<key>weight</key>
<real>20</real>
</dict>
<key>^PkgInfo$</key>
<dict>
<key>omit</key>
<true/>
<key>weight</key>
<real>20</real>
</dict>
<key>^Resources/</key>
<dict>
<key>weight</key>
<real>20</real>
</dict>
<key>^Resources/.*\.lproj/</key>
<dict>
<key>optional</key>
<true/>
<key>weight</key>
<real>1000</real>
</dict>
<key>^Resources/.*\.lproj/locversion.plist$</key>
<dict>
<key>omit</key>
<true/>
<key>weight</key>
<real>1100</real>
</dict>
<key>^Resources/Base\.lproj/</key>
<dict>
<key>weight</key>
<real>1010</real>
</dict>
<key>^[^/]+$</key>
<dict>
<key>nested</key>
<true/>
<key>weight</key>
<real>10</real>
</dict>
<key>^embedded\.provisionprofile$</key>
<dict>
<key>weight</key>
<real>20</real>
</dict>
<key>^version\.plist$</key>
<dict>
<key>weight</key>
<real>20</real>
</dict>
</dict>
</dict>
</plist>
@@ -0,0 +1,62 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>BuildMachineOSBuild</key>
<string>25E246</string>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
<string>Downloader</string>
<key>CFBundleIdentifier</key>
<string>org.sparkle-project.DownloaderService</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>Downloader</string>
<key>CFBundlePackageType</key>
<string>XPC!</string>
<key>CFBundleShortVersionString</key>
<string>2.9.4</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleSupportedPlatforms</key>
<array>
<string>MacOSX</string>
</array>
<key>CFBundleVersion</key>
<string>2059</string>
<key>DTCompiler</key>
<string>com.apple.compilers.llvm.clang.1_0</string>
<key>DTPlatformBuild</key>
<string>25C57</string>
<key>DTPlatformName</key>
<string>macosx</string>
<key>DTPlatformVersion</key>
<string>26.2</string>
<key>DTSDKBuild</key>
<string>25C57</string>
<key>DTSDKName</key>
<string>macosx26.2</string>
<key>DTXcode</key>
<string>2620</string>
<key>DTXcodeBuild</key>
<string>17C52</string>
<key>LSMinimumSystemVersion</key>
<string>10.13</string>
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<false/>
</dict>
<key>NSHumanReadableCopyright</key>
<string>Copyright © 2016 Sparkle Project. All rights reserved.</string>
<key>XPCService</key>
<dict>
<key>RunLoopType</key>
<string>NSRunLoop</string>
<key>ServiceType</key>
<string>Application</string>
</dict>
</dict>
</plist>
@@ -0,0 +1,115 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>files</key>
<dict/>
<key>files2</key>
<dict/>
<key>rules</key>
<dict>
<key>^Resources/</key>
<true/>
<key>^Resources/.*\.lproj/</key>
<dict>
<key>optional</key>
<true/>
<key>weight</key>
<real>1000</real>
</dict>
<key>^Resources/.*\.lproj/locversion.plist$</key>
<dict>
<key>omit</key>
<true/>
<key>weight</key>
<real>1100</real>
</dict>
<key>^Resources/Base\.lproj/</key>
<dict>
<key>weight</key>
<real>1010</real>
</dict>
<key>^version.plist$</key>
<true/>
</dict>
<key>rules2</key>
<dict>
<key>.*\.dSYM($|/)</key>
<dict>
<key>weight</key>
<real>11</real>
</dict>
<key>^(.*/)?\.DS_Store$</key>
<dict>
<key>omit</key>
<true/>
<key>weight</key>
<real>2000</real>
</dict>
<key>^(Frameworks|SharedFrameworks|PlugIns|Plug-ins|XPCServices|Helpers|MacOS|Library/(Automator|Spotlight|LoginItems))/</key>
<dict>
<key>nested</key>
<true/>
<key>weight</key>
<real>10</real>
</dict>
<key>^.*</key>
<true/>
<key>^Info\.plist$</key>
<dict>
<key>omit</key>
<true/>
<key>weight</key>
<real>20</real>
</dict>
<key>^PkgInfo$</key>
<dict>
<key>omit</key>
<true/>
<key>weight</key>
<real>20</real>
</dict>
<key>^Resources/</key>
<dict>
<key>weight</key>
<real>20</real>
</dict>
<key>^Resources/.*\.lproj/</key>
<dict>
<key>optional</key>
<true/>
<key>weight</key>
<real>1000</real>
</dict>
<key>^Resources/.*\.lproj/locversion.plist$</key>
<dict>
<key>omit</key>
<true/>
<key>weight</key>
<real>1100</real>
</dict>
<key>^Resources/Base\.lproj/</key>
<dict>
<key>weight</key>
<real>1010</real>
</dict>
<key>^[^/]+$</key>
<dict>
<key>nested</key>
<true/>
<key>weight</key>
<real>10</real>
</dict>
<key>^embedded\.provisionprofile$</key>
<dict>
<key>weight</key>
<real>20</real>
</dict>
<key>^version\.plist$</key>
<dict>
<key>weight</key>
<real>20</real>
</dict>
</dict>
</dict>
</plist>
@@ -0,0 +1,57 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>BuildMachineOSBuild</key>
<string>25E246</string>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
<string>Installer</string>
<key>CFBundleIdentifier</key>
<string>org.sparkle-project.InstallerLauncher</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>Installer</string>
<key>CFBundlePackageType</key>
<string>XPC!</string>
<key>CFBundleShortVersionString</key>
<string>2.9.4</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleSupportedPlatforms</key>
<array>
<string>MacOSX</string>
</array>
<key>CFBundleVersion</key>
<string>2059</string>
<key>DTCompiler</key>
<string>com.apple.compilers.llvm.clang.1_0</string>
<key>DTPlatformBuild</key>
<string>25C57</string>
<key>DTPlatformName</key>
<string>macosx</string>
<key>DTPlatformVersion</key>
<string>26.2</string>
<key>DTSDKBuild</key>
<string>25C57</string>
<key>DTSDKName</key>
<string>macosx26.2</string>
<key>DTXcode</key>
<string>2620</string>
<key>DTXcodeBuild</key>
<string>17C52</string>
<key>LSMinimumSystemVersion</key>
<string>10.13</string>
<key>NSHumanReadableCopyright</key>
<string>Copyright © 2016 Sparkle Project. All rights reserved.</string>
<key>XPCService</key>
<dict>
<key>JoinExistingSession</key>
<true/>
<key>ServiceType</key>
<string>Application</string>
</dict>
</dict>
</plist>
@@ -0,0 +1,115 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>files</key>
<dict/>
<key>files2</key>
<dict/>
<key>rules</key>
<dict>
<key>^Resources/</key>
<true/>
<key>^Resources/.*\.lproj/</key>
<dict>
<key>optional</key>
<true/>
<key>weight</key>
<real>1000</real>
</dict>
<key>^Resources/.*\.lproj/locversion.plist$</key>
<dict>
<key>omit</key>
<true/>
<key>weight</key>
<real>1100</real>
</dict>
<key>^Resources/Base\.lproj/</key>
<dict>
<key>weight</key>
<real>1010</real>
</dict>
<key>^version.plist$</key>
<true/>
</dict>
<key>rules2</key>
<dict>
<key>.*\.dSYM($|/)</key>
<dict>
<key>weight</key>
<real>11</real>
</dict>
<key>^(.*/)?\.DS_Store$</key>
<dict>
<key>omit</key>
<true/>
<key>weight</key>
<real>2000</real>
</dict>
<key>^(Frameworks|SharedFrameworks|PlugIns|Plug-ins|XPCServices|Helpers|MacOS|Library/(Automator|Spotlight|LoginItems))/</key>
<dict>
<key>nested</key>
<true/>
<key>weight</key>
<real>10</real>
</dict>
<key>^.*</key>
<true/>
<key>^Info\.plist$</key>
<dict>
<key>omit</key>
<true/>
<key>weight</key>
<real>20</real>
</dict>
<key>^PkgInfo$</key>
<dict>
<key>omit</key>
<true/>
<key>weight</key>
<real>20</real>
</dict>
<key>^Resources/</key>
<dict>
<key>weight</key>
<real>20</real>
</dict>
<key>^Resources/.*\.lproj/</key>
<dict>
<key>optional</key>
<true/>
<key>weight</key>
<real>1000</real>
</dict>
<key>^Resources/.*\.lproj/locversion.plist$</key>
<dict>
<key>omit</key>
<true/>
<key>weight</key>
<real>1100</real>
</dict>
<key>^Resources/Base\.lproj/</key>
<dict>
<key>weight</key>
<real>1010</real>
</dict>
<key>^[^/]+$</key>
<dict>
<key>nested</key>
<true/>
<key>weight</key>
<real>10</real>
</dict>
<key>^embedded\.provisionprofile$</key>
<dict>
<key>weight</key>
<real>20</real>
</dict>
<key>^version\.plist$</key>
<dict>
<key>weight</key>
<real>20</real>
</dict>
</dict>
</dict>
</plist>
File diff suppressed because it is too large Load Diff
+1
View File
@@ -0,0 +1 @@
B
+1
View File
@@ -0,0 +1 @@
Versions/Current/XPCServices
BIN
View File
Binary file not shown.

Some files were not shown because too many files have changed in this diff Show More