diff --git a/CHANGELOG b/CHANGELOG index 165dbac4..4b2b5142 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,117 @@ +# 2.0.0 + +* Support for Sandboxed applications +* Support for writing custom user interfaces +* Command line utility to update Sparkle-based applications and bundles +* More modern architecture which moves extraction, validation, and installation into a submitted launchd agent/daemon. +* Decoupled AppKit and UI logic in the framework from core functionality +* Ensure (most) API / ABI compatibility with Sparkle 1.x +* Introduced new SPUStandardUpdaterController, SPUUpdater, SPUUserDriver classes/protocols. +* Deprecated SUUpdater, albeit it is still functional for transitional purposes +* The installer will attempt installing the update after extraction is finished, even if the user quits the process and doesn't relaunch the application explicitly. +* Updates can be downloaded in the background automatically (if enabled) and be resumed by the user later, even if the user has insufficent permission to install them initially. +* Authentication now occurs before launching the installer and before terminating the application, which can be canceled by the user cleanly. +* Sudden termination for silent updates isn't disabled because Sparkle doesn't listen for AppKit events anymore such as termination or power off (note the installer running as a separate process listens for termination). +* Distributing updates without EdDSA signing the archives is now deprecated. +* Sparkle's icon in the official branch is no longer used for installation. Instead, the icon of the bundle to update is used. A 32x32 image representation of the icon is needed for the authorization dialog. +* Delegation methods may have been removed or added to the newer updater API. Please review `SPUUpdaterDelegate` if using `SPUUpdater`. + +Please visit [Sparkle's website](http://sparkle-project.org) for more information on documentation and migration. + +# 1.24.0 + + * Prioritize UserDefaults when fetching value for EnableAutomaticChecks (Nicolas Bosi) + * Improve best appcast item selection handling (Ian Bytchek) + * Create lockfile for improved compatibility with 3rd party updaters (CoreCode) + * Enable SPM support via binary target (Jonas Zaugg) + * `generate_appcast` improvements: + * follow symbolic links (Denis Dzyubenko) + * update the release notes element’s URL when required (Brad Andalman) + * Added output filename option to generate_appcast (Brad Andalman) + * Added —release-notes-url-prefix to generate_appcast (Brad Andalman) + * Command line option to provide a download url prefix is now parsed and set on each archive item (Dominik H) + * Added help command line option (Dominik H) + * Locale updates: + * Update zh_CN localization (柳东原 · Dongyuan Liu) + * Update Sparkle.strings (Vojtěch Koňařík) + * Update Croatian (#1603) (milotype) + * Update SUUpdateAlert.xib (DanielFirlej) + * fix: read SUAutomaticallyUpdate from Info.plist (Trevor DeVore) + * Fix casting Boolean to BOOL on Apple Silicon (Kevin Wojniak) + * Use build matrix to test on multiple Xcode versions (Rajiv Shah) + * Set UpdateAlert and AutomaticUpdateAlert window's fullscreen collectionBehavior to NSWindowCollectionBehaviorFullScreenAuxiliary to allow them to present on top of the Main App's window if it's fullscreen. (Micah Moore) + * Fixed error about "about:blank" release notes (Louis Pontoise) + * Support App Store URL scheme in release note webview (Bi11) + * Use the SHA-256 hash of the archive as the cache path (Nate Weaver) + * Don't return an optional from the FileHandle method (Nate Weaver) + * Added URL+Hashing (Nate Weaver) + +# 1.23.0 + + * Support generating appcast with localizations (#1499) (Alik Vovkotrub) + * Support versions with git commit SHA (#1504) (Alec Larson) + * Hide "Skip..." and "Remind..." buttons when they're not relevant (#1480) (Kenneth Johnsen) + * Preserve Finder tags while updating apps (#1512) (CoreCode) + * Read-only update alert dialog formatting improvements (#1515) (Quinn Taylor) + * Check if `SUBundleName` is set before normalizing (Jake Fenton) + * `NSInteger` cast warning on Xcode 11 (Marga Keuvelaar) + * Correct appcast file extension (Tom Vos) + * Update Sparkle.strings (Emir Sarı) + * Fix spelling (#1508) (Frank Chiarulli Jr) + +# 1.22.0 + + * Enabled "Hardened Runtime" build option for Apple's notarization requirement + * Add delegate methods to suppress update alerts (George Nachman) + * Improved error when running from translocated location (Michael Buckley) + * Add phased rollout feature (#1381) (Fabian Jäger) + * Ignore non-standard permissions in delta updates instead of failing the build (Kornel Lesiński) + * Notify user when installed version is newer than the latest in the appcast (CoreCode) + * Reset timers after computer sleep (CoreCode) + * Block-based alternatives to `NSInvocation`-based delegate methods (Fabian Jäger) + * Add delegate `userDidSkipThisVersion` (BobZombie, Leo Natan, bono yusuke) + * Pass item to updaterShouldShowUpdateAlertForScheduledUpdate delegate method (George Nachman) + * Support providing private key as argument in `generate_appcast` (Yakuhzi, marchyang) + * Separate the ed25519 sources into a new static library (Tony Arnold) + * Disambiguate signing error messages (Nate Weaver) + * Use `XMLNode.Options.nodePrettyPrint` in `generate_appcast` instead of trying to add whitespace manually (fumoboy007) + * Annotate SUHost for nullability (Michael Buckley) + * Use SUAVAILABLE macro (Christiaan Hofman) + * Fix warnings when using modules (nivekkagicom) + * Correction of Czech localization inconsistency (#1403) (vojtakonarik) + * BR locale fix (BR Lingo) + * Update Japanese localization (fujisoft) + * French Sparkle.strings (Jean-Baptiste) + +# 1.21.3 + + * Losslessly reduced the size of PNG (Barijaona Ramaholimihaso) + * Catch exceptions from subcommands (Julian Mayer) + * `generate_appcast` can sign any bundles instead of just apps (Nate Weaver) + * Check that effectiveAppearance is being observed before calling removeObserver (Pierluigi) + +# 1.21.2 + + * Allow EdDSA for delta updates, too (Kornel) + * Warning fixes (Brian Bergstrand) + * Improvements to release notes view context menu and dark mode (Bi11) + +# 1.21.0 + + * Added support EdDSA (ed25519) signatures (Kornel) + * DSA signatures are considered outdated, and Apple's `Security.framework` only supports weaker SHA-1-based DSA. + * Both old DSA and new EdDSA are still supported (and one app can use both), but new applications should use EdDSA only, and we recommend migrating away from DSA signatures. + * `generate_keys` is now a Swift tool that stores EdDSA private keys in the Keychain + * Existing apps can continue using their old DSA keys, but we've dropped support for generation of old DSA keys + * `sign_update` is now a Swift tool that signs using EdDSA from private keys in the Keychain + * The old DSA-based signing script has been moved to `bin/old_dsa_scripts` + * The old DSA-based signing script has been fixed to work on pre-10.13 systems (Thomas Tempelmann) + * `generate_appcast` has been updated to support EdDSA signatures + * It can sign both DSA (if `dsa_priv.pem` file is specified) and EdDSA (from Keychain) + * The tool now uses Caches directory and doesn't generate unnecessary delta files + * Fixed verification of delta updates on filesystems that change permissions of symlinks + * Fixed `NSURLSession` leak (Michael Ehrmann) + # 1.20.0 * `generate_appcast` option to read private key directly from the keychain (Tamás Lustyik) @@ -544,4 +658,4 @@ Important security fixes: # 0.1 -* Initial Release +* Initial Release \ No newline at end of file diff --git a/INSTALL.markdown b/INSTALL.markdown deleted file mode 100644 index 3e38f752..00000000 --- a/INSTALL.markdown +++ /dev/null @@ -1,60 +0,0 @@ -# Building - -If release products have not already been built, they can be built by: - -``` -cd /Sparkle/ - -git submodule update --init --recursive -make release -``` - -Upon success, a Finder window will open revealing an archive containing the newly-built Sparkle binaries. Expand the archive (e.g., to the Desktop). - -Alternatively, you can build the "Distribution" scheme from within the Xcode project. - -Debug builds of Sparkle can also be built from Xcode. Note that debug builds change Sparkle's default behavior to ease development. Never use a debug build of Sparkle for distribution. - -# Installing - -To install Sparkle, drag Sparkle.framework into your project as you would any other framework. Make sure you have a build phase to copy the framework into your application's Frameworks directory at build time. - -# XPC Services and Embedded Applications - -If your application is sandboxed, you will need to embed one or more of Sparkle's XPC services into your application. These are used to perform privileged operations that your sandboxed app, and the rest of the Sparkle framework, are not authorized to perform. Even if you are not strictly required to use a particular XPC service, there may still be some merit to separating privileges. - -* `SparkleInstallerLauncher`, `SparkleInstallerConnection`, and `SparkleInstallerStatus`: These are required for most sandboxed apps, and are used by Sparkle to perform the privileged operations of upgrading your app, relaunching it, and reporting progress to the app as it proceeds. - -* `SparkleDownloader`: This is required only if your sandboxed app does not already possess the "com.apple.security.network.client" entitlement, allowing it to make outgoing HTTP(S) connections. If you do decide to include the Downloader service and your app does not pass Apple's App Transport Security requirements, then you may have to add exceptions inside the downloader service's Info.plist. - -Note: If your sandboxed app does not have the networking entitlement mentioned above, then linked release notes cannot contain external references (e.g.: images or external style sheets), because loading them will be prevented by the sandbox. - -Apps that are not sandboxed may still want to embed the services if they need to code sign the services with their own signatures. The copies of these services within the built Sparkle framework will have the same signature as the framework. - -If you want to code sign Sparkle's installer tools (Autoupdate and Updater.app), then you should include the SparkleInstallerLauncher XPC service even if your app is not sandboxed. Note that Sparkle keeps a copy of these tools inside the framework, because using the XPC services is optional, and they need to be inside the XPC service for security reasons. If you wish, you can remove them from the framework if you use the InstallerLauncher service. - -If you code sign your application, these XPC services also need to be signed by you with the attached entitlements. Included is a script to automate this. - -Here is an example of invoking the script with a Developer ID identity (replace `XXX` appropriately): - -``` -./bin/codesign_embedded_executable "Developer ID Application: XXX" XPCServices/*.xpc - -./bin/codesign_embedded_executable "Developer ID Application: XXX" ./Sparkle.framework/Versions/A/Resources/Autoupdate - -./bin/codesign_embedded_executable "Developer ID Application: XXX" ./Sparkle.framework/Versions/A/Resources/Updater.app/ -``` - -After signing the executables, add them to the appropriate copy phases and link settings in the app target. Check the "Code Sign on Copy" option for the FW phase (it's not offered for the XPC copy phase). - -Note that the `codesign_embedded_executable` script uses the hardened runtime option, so your app can be notarized ([required](https://developer.apple.com/documentation/security/notarizing_your_app_before_distribution?language=objc) for macOS 10.14.5 and higher). - -# Testing - -If you're not using the sandboxed version, you can just lower the `CURRENT_PROJECT_VERSION` in your app target below the latest version in your appcast, build & run from Xcode, and hit the Check for Updates… UI element. - -For the sandboxed version, testing with a debug build running from Xcode doesn't work—the "Extracting Update" phase either hangs or fails. You'll have to do an Archive build and export a Developer ID-signed or notarized app. - -# Known Issues - -Search the [issues database](https://github.com/sparkle-project/Sparkle/issues) for bugs specific to the `ui-separation-and-xpc` branch. diff --git a/README.markdown b/README.markdown index 140ec2fd..9fc1d3a8 100644 --- a/README.markdown +++ b/README.markdown @@ -1,17 +1,18 @@ -# Sparkle 2.x (Beta) +# Sparkle 2.x (Beta) [![Build Status](https://github.com/sparkle-project/Sparkle/workflows/Build%20%26%20Tests/badge.svg?branch=2.x)] sponsored by: StackPath Secure and reliable software update framework for Cocoa developers. Sparkle shows familiar update window with release notes -This is the upcoming new version of Sparkle, based on the `ui-separation-and-xpc` branch. -Major new features are support for sandboxing, custom user interfaces, updating other bundles, and a modern secure architecture. +This is the upcoming new version of Sparkle. +Major new features are support for sandboxing, custom user interfaces, updating other bundles, and a more modern secure architecture. + +For the production ready version of Sparkle, please see the [Sparkle 1.x (master) branch](https://github.com/sparkle-project/Sparkle/tree/master). Sparkle 2.x is currently in beta. Some people already use it in production, but some work is still required before it can be released: -1. Documentation for the website needs to be written (see [https://github.com/sparkle-project/sparkle-project.github.io](sparkle-project.github.io)) -2. Changes from the master branch need to be merged -3. Bugs and issues have to be fixed +1. A transitional phase needs to be made for primary development, testing / bug-fixing, and migration. +2. Changes from the master branch need to be re-evaluated and ported. The current status of Sparkle 2.x is tracked in issue [#1523](https://github.com/sparkle-project/Sparkle/issues/1523). @@ -19,71 +20,50 @@ If you can help with any of the above, please submit pull requests! New issues that are found should be [reported here](https://github.com/sparkle-project/Sparkle/issues). Internal design documents can be found in [Documentation](Documentation/). Discussion of this fork can be found in [this issue](https://github.com/sparkle-project/Sparkle/issues/363). -# Features +Please visit [Sparkle's website](http://sparkle-project.org) for up to date documentation on using and migrating over to Sparkle 2.x. Refer to [Changelog](CHANGELOG) for a more detailed list of changes. -## Sandboxing +## Features -This fork includes several XPC services that are generally optional to include in your application, but are required for sandboxed applications. See the [INSTALL](INSTALL.markdown) file for more detail. - -When sandboxed, linked release notes are allowed. External references inside the linked release notes are only allowed if the host application has an incoming network entitlement. Lastly, updates can still be extracted from DMG files just as they are in the official branch. - -## Custom User Interfaces - -Sparkle shows a custom update window with release notes - -See the `SPUUserDriver` protocol and classes that implement it for how to write your own user interface. This enables extensibility of Sparkle without altering or extending internal classes. - -Hold shift when launching the `Sparkle Test App` to try out the experimental user interface shown above (note: this custom interface requires running macOS 10.10 or later). - -## Command Line Tool - -Sparkle shows command line interface to installing updates - -The `sparkle` command line tool can be used to update any Sparkle supported bundle. `sparkle` is a great demonstration of updating other bundles, though that aspect is not limited to just this tool! - -This utility may also be an ideal choice for plug-ins where loading a copy of Sparkle's framework into a host's application may lead to conflicts or have undesirable consequences. - -## Modern Security - -Not only is sandboxing supported, but launchd is now used for submitting the installer. XPC is used to communicate to the launchd job. Uses of `AuthorizationExecuteWithPrivileges`, which is neither secure or reliable, have been removed. Installation on standard user accounts has been tested heavily rather than being treated as an edge case. - -Extraction, validation, and installation of the update are all handled by the installer. The XPC services and the installer job don't implicitly trust the other end of the connection. Signing downloads with a DSA signature is now encouraged more aggressively. - -Usage of AppKit has been minimized greatly. No linkage of it is found in the installer daemon. All code core to Sparkle's functionality prevents it from being imported. Only user driver classes and a progress agent may use AppKit for showing UI. A `SparkleCore.framework` target has been created that just uses the core. - -## API Compatibility - -Despite decoupling update scheduling, UI, installation, and minimizing AppKit usage, a great deal of effort was made to maintain ABI compatibility with older versions of Sparkle. A deprecated `SUUpdater` shim exists for maintaining runtime compatibility. Please check out `SPUStandardUpdaterController` and `SPUUpdater` instead for modern replacements. - -Interactive package based installations have been deprecated in favor for guided package installations. As a consequence, interactive installations now have to be opted into (eg: `foo.sparkle_interactive.pkg`). A `sparkle:installationType="package"` or `sparkle:installationType="interactive-package"` tag is also now required in the appcast enclosure item for package based installs. - -No attempt is made to preserve compatibility with regards to subclassing Sparkle's internal classes. Doing this is not supported or maintainable anymore. Much of this desire will go away with the extensibility provided by the user driver API. - -New Sparkle classes are now prefixed with `SPU` rather than `SU`. Older classes still use the `SU` prefix to maintain compatibility. - -## Misc. Changes - -* Updates are more instant to install once extracted. The "installing update" dialog seldomly shows up after the old application quits. -* The installer will attempt installing the update after extraction is finished, even if the user quits the process and doesn't relaunch the application explicitly. -* Updates can be downloaded in the background automatically (if enabled) and be resumed by the user later, even if the user has insufficent permission to install them initially. -* Authentication now occurs before launching the installer and before terminating the application, which can be canceled by the user cleanly. -* Sudden termination for silent updates isn't disabled because Sparkle doesn't listen for AppKit events anymore such as termination or power off (note the installer running as a separate process listens for termination). -* Distributing updates without DSA signing the archives is now deprecated. -* Sparkle's icon in the official branch is no longer used for installation. Instead, the icon of the bundle to update is used. A 32x32 image representation of the icon is needed for the authorization dialog. -* Delegation methods may have been removed or added to the newer updater API. Please review `SPUUpdaterDelegate` if using `SPUUpdater`. +* Seamless. There's no mention of Sparkle; your icons and app name are used. +* Secure. Updates are verified using EdDSA signatures and Apple Code Signing. +* Fast. Supports delta updates which only patch files that have changed. +* Easy to install. Sparkle requires no code in your app, and only needs static files on a web server. +* Supports bundles, preference panes, plugins, and other non-.app software. Can install .pkg files for more complicated products. +* Handles permissions, quarantine and automatically asks for authentication if needed. +* Uses RSS-based appcasts for release information. Appcasts are a de-facto standard supported by 3rd party update-tracking programs and websites. +* Stays hidden until second launch for better first impressions. +* Truly self-updating — the user can choose to automatically download and install all updates in the background. +* Ability to mark updates as critical. +* Progress and status notifications for the host app. ## Requirements -* Runtime: **macOS 10.9** or greater for 64bit, **macOS 10.10** or greater for 32bit (this has been bumped up!) -* Build: Xcode 7 or greater required. +* Runtime: macOS 10.9 or greater +* Build: Latest major Xcode (stable or beta, whichever is latest) and one major version less; at least Xcode 12 if using Swift Package Manager. * HTTPS server for serving updates (see [App Transport Security](http://sparkle-project.org/documentation/app-transport-security/)) ## Usage -See [getting started guide](https://sparkle-project.org/documentation/). No code is necessary, but a bit of Xcode configuration is required. If your app is sandboxed, see the [INSTALL](INSTALL.markdown) document for more details about installing XPC binaries that support sandboxed apps. +See [getting started guide](https://sparkle-project.org/documentation/). No code is necessary, but a bit of Xcode configuration is required. ## Development +This repository uses git submodules, and will not build unless you clone recursively. Also, GitHub-provided ZIP/tar archives are broken due to GitHub not supporting git submodules properly. + + git clone https://github.com/sparkle-project/Sparkle + git checkout 2.x + git submodule update --init --recursive + +### Troubleshooting + + * Please check **Console.app**. Sparkle prints detailed information there about all problems it encounters. It often also suggests solutions to the problems, so please read Sparkle's log messages carefully. + + * Use the `generate_appcast` tool which creates appcast files, correct signatures, and delta updates automatically. + + * Make sure the URL specified in [`SUFeedURL`](https://sparkle-project.org/documentation/customization/) is valid (typos/404s are a common error!), and that it uses modern TLS ([test it](https://www.ssllabs.com/ssltest/)). + + * Delete your app's preferences (in `~/Library/Preferences/`) if you've set another feed URL programmatically via Sparkle's Objective-C interface. + ### API symbols Sparkle is built with `-fvisibility=hidden -fvisibility-inlines-hidden` which means no symbols are exported by default. @@ -95,9 +75,7 @@ If you are adding a symbol to the public API you must decorate the declaration w Alternatively, build the Distribution scheme in the Xcode UI. -See the [INSTALL](INSTALL.markdown) file after building Sparkle, especially if interested in sandboxing support. The XPC services are not required for non-sandboxed applications. - -## Code of Conduct +### Code of Conduct We pledge to have an open and welcoming environment. See our [Code of Conduct](CODE_OF_CONDUCT.md).