Fix: call completionHandler before probe to prevent race with installer messages
sendInstallationData kicks off the installer process, but completionHandler
was deferred until the probe callback fired. Installer messages like
SPUExtractionStarted could arrive on the main queue in the gap, triggering
installerDidStartExtracting -> clearDownloadedUpdate before the caller set
_downloadedUpdateForRemoval. A subsequent clearDownloadedUpdate (e.g. from
installerDidFailToApplyDeltaUpdate) then found both ivars nil and hit the
assertion.
The probe result is only logged, so completing before the probe is safe.
In most scenarios, they were skipped because INSTALL_PATH is unset.
In XQuartz, we build Sparkle using `xcodebuild install INSTALL_PATH=...`,
so these XPCServices would get installed into the frameworks path of our
app bundle. This change fixes that by explicitly setting SKIP_INSTALL.
Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
A developer can set ARCHS to arm64 only if they want to exclude Intel, or add arm64e if they want to build for arm64e.
The ARCHS_COMMAND_LINE_TOOLS (for BinaryDelta, generate_appcast, sign_update) should however not include arm64e yet (as SPM dependencies aren't happy with that).
* Change desired with to Automatic
* Increase content compression resistance priority to required (1000)
This matches the sizing layout of the status text next to the action button.
We don't force pretty print when writing new XML data now when we insert a signing warning. This may mean the signing warning prefix may start on the same line as the first XML element, but I think this is alright since the rest of the warning starts on its own line.
If Sparkle.framework isn't in Contents/Frameworks/ then we do a deep scan in the app bundle (but ignore Contents/Resources/). Sparkle may be placed in a plug-in or other parent framework.
Also remove legacy SparkleCore lookup which is no longer needed.
This strips the beginning sparkle sign warning comment (if present) in the release notes downloader driver rather than the user driver. The comment is also stripped (if present) in generate_appcast when inserting embedded release notes.
Also improve markdown compatibility with sparkle-cli and alternative user driver in Sparkle Test App.
This provides enhanced opt-in security preventing informational attacks that for example suggest the user the auto-updater is broken and an update needs to be installed from a compromised website (assuming the developer's website is hijacked).
To opt in, developers need to add SURequireSignedFeed Info.plist key to their bundle.
generate_appcast and sign_update have been updated to support signing appcast feeds and release note files (both need to be signed). By default, they embed a HTML comment warning in the files that further modifications will invalidate previously signed signatures. Signed appcasts include a signing block comment at the end of the XML file describing the signature of the content preceding it. Signed release notes will have their signatures annotated in the <sparkle:releaseNotesLink> element with a sparkle:edSignature attribute (and optionally a sparkle:length attribute for diagnostic purposes).
A signingValidationStatus property is also now added to SUAppcast and SUAppcastItem indicating the signing status (skipped, succeeded, failed).
The standard user driver's release notes HTML web view rejects external file references when appcasts are signed. A bug has also been fixed where the update alert would not provide errors when loading external release note files fails. These changes also introduce a showing new error / localizable strings when the release notes is not signed correctly or fails to load.
As a hardening policy, we also enforce SUVerifyUpdateBeforeExtraction when opting into signed feeds, so key rotation is only possible with Developer ID code signed dmg archives.
A fallback feed signing failure expiration policy has also been added. When a signed feed has failed validation for more than a configurable period of time (by default SUSignedFeedFailureExpirationInterval is set to 20 days), Sparkle will allow appcast items to be shown to the user. However, these items operate in a safe mode that strip abusable information like release notes / descriptions / links, sanitize the version strings, and they cannot be marked critical or informational, nor be installed automatically. After this policy expires, this allows users installing updates as long as the updates are signed correctly, or be aware that the updater has not been functioning correctly.
Fixes#971.
* Supports Markdown ordered/unordered lists, paragraphs, headers, code blocks, inline styling. Block quotes and thematic breaks are handled in simple manner through indentation and extra newline respectively. Tables are not supported. HTML isn't supported.
* Requires macOS 12 or later due to leveraging Foundation / presentation intents for markdown processing. Older OS's and older Sparkle versions >= 2.4.0 will fall back to plain-text interpretation. Additionally, TextKit 2 is now adopted for macOS 12+, and TextKit 1 only code is to be avoided.
* Adds delegate method to allow formatting / modifying the presented text before it will be shown for plain-text and markdown release notes. This, for example, can be used to adapting release notes based on currently installed version, but it could also open up styling release notes in other ways.
* Adds sparkle:format="markdown" option to <description> element for embedded release notes (in addition to already existingsparkle:format="plain-text" option)
* Adds support for generate_appcast to handle markdown release note files and embedded release notes.
* Adds a MARKDOWN test mode to Sparkle Test App.
This allows specifying a minimum version the host bundle needs to be on before upgrading. This may be useful for new appcast features where this requirement can be used instead of switching to a new appcast.
This allows us to determine if automatic downloading/installing of updates option (typically a checkbox) should be enabled or not. This property is based on whether or not automatically checking of updates is enabled, or the SUAllowsAutomaticUpdates option (if specified by developer for custom needs).
The update alert now updates hiding/unhiding the automatic downloading checkbox if the automatic update checking option changes.
The test application is now updated to use -[SPUUpdater allowsAutomaticUpdates] for enabling/disabling the automatic downloads update checkbox.
The Sparkle Test App will opt into a private setting that changes some of the default and minimum values for Debug builds.
This also removes the "WARNING: This is running a Debug build of Sparkle 2; don't use this in production!" log in Debug builds, and removes some unused constants internal to Sparkle.
This is the update check interval used after an update has been downloaded/staged to be installed automatically in the background. By default this is 1 week (in seconds) but this change now allows it to be configured.
The first requirement we support is arm64 which allows updates to mark themselves as Apple silicon only.
The message that shows up when users check for updates tells them their Mac is too old and a newer Apple silicon Mac is required for new updates. This introduces a new localizable string.
This requirement is also inferred if the minimum system version is >= 27.0
generate_appcast is also updated to handle a new branch for hardwareRequirements element, and for automatically populating it if needed.
Fixes#2796