Move a lot of the installation work to be done during the first phase of installation (when possible), before the target app needs to be terminated. For the common case where the old and new bundles are on the same volume, the final phase of installation requiring a restart is now just an atomic swap.
Also move the termination listener to the agent app which resolves some launch/CI failures we've been seeing.
This also allows embedded release notes to be plain text using sparkle:format="plain-text" attribute.
Also, Catalyst apps only support plain text release notes (compared to before where release notes weren't supported for Catalyst apps).
Reset opportune time for showing update notice when updater starts as well.
Also update updater header API documentation and add private protocol for gentle scheduled reminder APIs that the updater uses.
* Use UniformTypeIdentifiers framework to replace deprecated types
kUTType* constants are deprecated since macOS 12. The UniformTypeIdentifiers framework is available since the macOS 11 SDK.
* Replace renamed constants
* Use API_AVAILABLE macro instead of __OSX_AVAILABLE
* Remove duplicate localization identifiers
Some localizations have multiple identifiers, e.g. Canadian French has "fr-CA", "fr_ca" and "fr_CA" and Norwegian Bokmål has "nb" and "no" (though "no" can include Norwegian Nynorsk, Xcode seems to treat it as Bokmål and therefore a duplicate of "nb"). This commit removes superfluous identifiers and keeps the identifier that Xcode uses by default.
This also removes the no.lproj/ directory which contains either obsolete localized strings or strings that are present in nb.lproj/ too.
Furthermore, this renames the .lproj/ directories for "pt_PT"/"pt_BR" to "pt-PT"/"pt-BR" since the latter identifiers are the default in Xcode.
* Update localizable strings to match the current localizations
Replaces the following characters in the localizable strings:
- ellipses (... → …)
- curly apostrophe (' → ’)
- em dashes (-- → —)
- non-breaking spaces
These were already used in the .strings files.
* Regenerate Sparkle.strings
This applies the changes in the previous commit to the strings files of the base localization.
This also removes the following strings, which are no longer present in the source:
- "%1$@ wants permission to update %2$@."
- "%1$@ wants permission to update."
- "An error occurred while downloading the update feed."
- "An error occurred while installing the update. Please try again later."
- "An error occurred while relaunching %1$@, but the new version will be available next time you run %1$@."
- "Are you sure you want to skip this upgrade?"
- "Don't Skip"
- "Skip Upgrade"
- "The update is improperly signed."
- "You already have the newest version of %@."
- "B", "GB", "KB" and "MB"
* Update localized Sparkle.strings
This applies the changes in the previous commits to the strings files of the localizations.
* Re-import localizations
This updates the .strings files using xcodebuild to:
- remove obsolete localizable strings,
- incorporate (changed) localization comments and
- replace UTF-16 encoded .strings files with UTF-8.
* Update Dutch localization
* Update French localization
This replaces single quotes and spaces with apostrophes and non-breaking spaces.
Sparkle currently requires at least Xcode 12 (or the macOS 11 SDK), therefore fallbacks for older versions are no longer needed.
* Remove +isOperatingSystemAtLeastVersion: method
* Remove +operatingSystemVersion accessor method
* Remove SUTouchBarForwardDeclarations header
They should not be bundle IDs because they may surface up in the UI.
Particularly, the Installer XPC Service may show up in the authorization prompt when authorization is required to install an update.
Normally when a major upgrade is skipped, subsequent updates for that major release are skipped. This element however allows publishing updates that ignore the user skipping the major version before a specific sub-release.
In generate_appcast we:
* Validate code signing integrity of new updates
* Add hidden flag to disable checking for nested code during validation
* Warn if new and old apps have differing signing identities when generating deltas
This new format introduces:
* A new container format which stores metadata in a way that is more efficient for compression, decompression, and size. Creation time can be 2x faster, apply time can be a few seconds faster, size savings can be 500 KB - couple of MB due to metadata alone.
* An array of supported compression formats including lzma, bzip2, zlib and more. We now default to lzma which is as competitive as bzip2 (which we were using in version 2 format) in applying/creation times, but can save several MB on size.
* Tracking of files from an old app being replicated in different locations in the new app. This can track unchanged files being renamed and can result in significant savings if the files are large.
Version 2 format is still the default. To use version 3, pass --version=3 to BinaryDelta when creating a patch. We will switch the default to version 3 later. generate_appcast support is upcoming.
* Don't expose SPUDownloadData initializer publicly
* Make SUAppcast -init unavailable
* Fix documented default user agent string
* Improve header documentation for SUAppcast(Item) and comparators
* Update more API documentation headers
Also allow returning nil in -allowedSystemProfileKeysForUpdater:
* Clarify documentation on -allowedSystemProfileKeysForUpdater:
* Rename willIdleScheduling -> notSchedule for delegate method
* Make minor correctness fix for reading info URL
Add generate_appcast options for appcast selection features
We can now supply for new update items:
* Link
* Channel name
* Last major version / minimum autoupdate version
* Phased rollout interval
* Last critical update version
* Originating informational update versions
We can also specify the maximum number of delta items to generate.
Lastly we can specify which versions to create new items for now. This allows applying flags for only specific versions, or for exceptional cases allows adding old versions that do not meet the most recent updates threshold (maxNewVersionsInFeed) -- think for updates for a prior OS or for a prior major version.
We do not override the minimum system version element on already existing items now, if the element already exists. Apps don't strictly need to specify LSMinimumSystemVersion and this allows users specifying it themselves in the feed.
The help page for generate_appcast was expanded with how the archive directory looks like, how release notes work, that old entries are kept in tact, and how extracted archives are cached..
We now write out the number of new updates written and the number of existing items updated, to make the generated result be less confusing.
Bug fixes:
* The scheme now builds for Debug so I can properly debug generate_appcast from within Xcode (distribution builds are still in Release)
* Newly generated items were appended at the end of the appcast and not necessarily inserted in the correct order (on top). As a workaround when we process existing items, we remove them, and re-add them.
* Fixed an off-by-one error for maximum number of delta files we can generate.
Fixes#1903
This allows developers to post updates to specific channels like for beta updates. Updaters only get notifications from channels they're allowed to be on.