Minimum OS preprocessor checks should only be used when compiler may generate compile warnings for deprecated APIs when the deployment target is raised.
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).
* Add deprecations/warnings for incorrect feed & update checking usage
This change deprecates -[SPUUpdater setFeedURL:] and logs warnings when the updater detects that feed URLs from user defaults are still being used.
This change also logs a warning when checkForUpdatesInBackground is used incorrectly if Sparkle is configured to ask the user's permission to check for updates but a check is done when automatic update checking is NO.
This change adjusts the layout constraints between the title and message text to be more proper.
This issue is only noticeable in Russian, Spanish, Ukrainian, and Slovenian on my machine.
Issue has been present in Sparkle 1 as well.
By default, if the SUAllowsAutomaticUpdates Info.plist key is not specified, the update alert option to allow automatic downloading/installing of updates will only be shown if automatic checking of updates is enabled. However, the developer can now override this by setting SUAllowsAutomaticUpdates to true in Info.plist which indicates the option should be available even if automatic checking of updates is not enabled.
If the app termination request is delayed or canceled, the user can check for updates again with the standard user driver and try installing/relaunching again, which will trigger the installer to send another quit event to the running application.
Before the install/relaunch window would close but the check for updates option would still be present but not functional.
In the installer progress agent, when we find all potential running applications for a host bundle, we should also consider any translocated running apps that look-alike the host bundle.
This matters when updating external bundles. For example if sparkle-cli tries to update an app on disk in ~/Downloads/ but a running instance of the app is translocated, sparkle-cli should terminate the translocated instance of the app before installing the update.
It's possible this could generate a false positive but we err on the side of safety here. We only use running translocated apps if we find no regular matching apps.
We fix the validation check for using the output option when multiple feeds are present, fix not generating new feeds when no prior feed is available, and fix incorrect logic with cleaning up delta files when multiple feeds are present.
Document --versions in generate_appcast better and add comments to explain why certain policies were made.
Add separate option to automatically pruned old update files. Now we only automatically move old update files aside. If the user passes --auto-prune-update-files we will also remove the old update files automatically.
Move old release notes files too.
Don't make old-updates directory hidden.
We preserve a batch of updates for each branch point (defined by an update's {majorVersion, minSystemVersion, maxSystemVersion, channel}). The latest for each branch point is used for generating delta updates.
We prune older update items that are no longer needed in the feed or needed for generating delta updates from newer items. We move pruned update files into a separate hidden directory, which is later garbage collected after a couple weeks based on each file's last modification date.
To insert new update items that are older than the latest update in the feed, --version flag needs to be used.
The overall goal is to have the feed only keep a small window of updates to serve to the user. This will also ease future processing generate_appcast needs to do and ensure the cache's directory doesn't blow up by pruning old updates.
Wait for appcast item registration before finishing automatic update driver.
This fixes a potential race issue where sometimes the automatic update driver on completion would sometimes not trigger to prompt an update alert immediately for critical updates. Note in this case, the update would still be installed on app termination and would still be scheduled to alert the user on the regular update check interval, so this issue is not severe.
* Set layout constraint constant between buttons and description to 20
* Disable update alert resizing when no release notes are available
* Fix layout constraint warning
* Set alert autosave frame name only when release notes are shown
The one exception is an updater that is targeted to update another / non-main bundle.
Note we still allow configuration of not using DSA or EdDSA with the deprecation warning in tact.
We fix one memory leak when calculating sha's, one memory leak in the xar delta applying path, and avoid creating Bundles for reading the Sparkle framework version.
There are some other small leaks with the xar delta creation/applying code but since it's a legacy implementation and the APIs are undocumented I don't want to touch it too much.
The biggest culprit here is the leak when calculating sha's I believe, if you have many archive items.
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.
On macOS 13 (Ventura) and later, installation could fail if Gatekeeper blocks app modifications. Note this is only applicable for external updaters like sparkle-cli where the updater and target bundle to update have different team identifiers.
We set the status window's collection behavior to full screen auxiliary. This is how the collection behavior for the update alerts and permission prompts are set up, but we never applied it to the status window.
With this change, bringing the status window up front (e.g, for downloading an update) does not push the other app's windows back into the stage manager tiles.
In the UI driver, this is when the user chooses to Install & Relaunch.
In the automatic download based driver, this is when Sparkle hands off responsibility to its delegate to install the update and they trigger the callback to relaunch the app.
Even if the updater is set to not automatically check for updates.
This fixes a bug where an update cycle may not complete if the automatic update driver first started, and the update should have been resumed but automatic update checks were disabled by the developer.
The developer would have had to disable automatic update checks, check updates in the background themselves, have updates set to download automatically/silently, and be in a situation where the update would be deferred to non-silent update (for example, user requiring authorization to install, critical update being presented, info-only update being presented).
* Log warning if gentle reminders aren't implemented for background app
* Don't let background running app steal focus from other apps except at launch
* Don't set update alert window level to floating for background apps
* Show update alert in back for currently active background apps
* Disable warnings for direct ivar access
* Center update status window to last update alert window shown
* Activate app from user initiated checks if it's not active
* Set systemHasBeenIdle to YES only if the app isn't preventing display sleep
* Don't make status window key if update alert wasn't key window
Don't allow status window to be minimizable for non-app bundle updates due to atomicity concerns.
Add delegate method to allow developer to configure if they want the status window to be minimizable.
We wait until a more opportune time when the app becomes re-activated, but if too much time has passed we will show the update anyway. A few exceptions are:
* App just launched
* User has been idle on their machine
* User initiates update check themselves
When the framework or sparkle-cli is run as root, we always launch the installer (Autoupdate) in the system domain.
For the progress tool agent, we chown() the copied Updater.app so the Updater app has proper ownership of it (and clean it up later). The progress tool app may not be able to clean up the parent directory, but that's okay and will be garbage collected on a later run.
To get the username and home directory for the user session when running the framework as root, we use the SecurityConfiguration framework. Sparkle needs and depends on an active GUI user login session. If a user ssh's in to install an update, that user must be the same as the active logged in user.
Installing interactive based package updates as root is not supported. For sparkle-cli, we disallow using --interactive when running as root.
An additional error exit code is added for sparkle-cli when ran as root and trying to install a interactive based package update, which is unsupported.
Also log out the download failure when a delta update fails to download (such as a 404 error for example).
Additionally, add a check to make sure that top-level appcast items cannot be delta update items.
* 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
We don't support applying delta updates on these systems (due to lack of permission support), so we shouldn't even try downloading delta updates in this case.
For creation, we will disallow creating delta updates if a custom resource fork icon data is found in either the old or app bundles.
For applying, we will just ignore the icon data when performing hash verification and continue applying the patch.
* 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
* Don't activate app when bringing up update alert errors
* Don't set status window level to floating
* Make status window minimize-able after checking for updates
* Allow install button to have focus when app has just launched
* Reset install button focus when app becomes active again
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.
The update code uses the compareFiles function to determine the sort order of file names in a directory, which is then compared with a list of files in the Sparkle update info. If the list of files of a directory from Sparkle's update is different than what is on disk, the Sparkle abandons the update and does a full download. This bug would prevent Sparkle from updating properly when the file lists are calculated on an English language system, but then checked on a destination Japanese system.
The fix is to use strcoll_l(), which is locale-independent, when comparing file names for sorting. This will ignore any locale changes the host application has made that could potentially affect Sparkle's sort order.
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.
This allows marking all updates below a specific version as informational only.
A new element (sparkle:belowVersion) was introduced this over a new attribute for sparkle:version due to compatibility reasons.
This allows marking all updates below a specific version as informational only.
A new element (sparkle:belowVersion) was introduced this over a new attribute for sparkle:version due to compatibility reasons.
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
Accounts are intended to be used for when working on products that belong to different organizations. This way multiple keys related to Sparkle can be stored in the keychain.
We also add a --verify option to sign_update which allows verifying that updates are signed correctly.
* Only track 0755 permissions for symbolic links
Also warn the user when encountering symbolic links that have a non-standard permission mode.
* Warn users when bad or irregular permissions are encountered
We have one heuristic for when a .framework version changes, and another for when a file with the same name moves to another location.
To support this, we added a clone + binary diff command.
Also document and improve the format.
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.
For development we should include task-get-allow entitlements. For distribution if people use custom workflows, they need to properly re-sign the app without preserving this entitlement
When we don't have any information for existing items, we have been appending new items below the existing ones. We should insert new items such that new items are inserted in order of version descending.
This removes the com.apple.security.get-task-allow entitlement on helper executable tools and XPC Services. While this is not a big deal, I don't think we should distribute executables with this entitlement which allows debugging them (with SIP / hardened runtime on). Note notarization ought to reject this entitlement with library validation enabled, so people must be getting around this anyway (either by using Xcode's Archive / Export which automatically strips this entitlement, or re-signing Sparkle tools without preserving entitlements).
* Make canCheckForUpdates property KVO compliant/observable
Also set updater session in progress when probing for update check interval to use.
* Add assert that driver must be nil in checkForUpdatesWithDriver:..
* Fix init'ing updater delegates in standard updater controller in nibs
* Convert updaterDelegate/userDriverDelegate properties to ivars
This should allow connecting outlets in IB while disallowing setting them programmatically.
* Update author to Sparkle Project when generating documentation
* Sync change log from 1.27.0
* Add recommendation to not call checkForUpdatesInBackground directly
* Add testing documentation for latsUpdateCheckDate
* Fix formatting with user driver header documentation
This fixes a minor bug where canCheckForUpdates returned NO on a user initiated update check that shows an update that was already downloaded / begun installing. Now that it returns YES, the update can be shown in utmost focus by the user again.
This bot has owner access to the repo and should be able to push changes to protected branches, as long as the workflows are being ran from trusted branches / remotes.
Also extract changelog and use it for the draft.
The workflow assumes changelog and version information have been updated and the tag has not been created yet before running it. When the workflow finishes, it should take you to a release page with the uploaded binaries, where you can verify the final details and publish a tag officially.
Also the following improvements were made:
* Change CURRENT_PROJECT_VERSION to represent a monotonically increasing bundle version (starting at 2000)
* Add MARKETING_VERSION to represent marketing version of Sparkle, comprised of SPARKLE_VERSION_MAJOR, SPARKLE_VERSION_MINOR, SPARKLE_VERSION_PATCH, and the new SPARKLE_VERSION_SUFFIX for pre-releases.
* Verify code signing signatures of extracted SPM zip file in make release and CI
* Generate changes to Sparkle podspec, just like the Package.swift file, based on current marketing version
* Improve format of Info.plist version strings when appending git hash info, eliminating unnecessary whitespace
* Simplify validating that XPC Service versions align with framework version
* Handle lightweight tags in addition to annotated tags in release-move-tag.sh
* 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
It doesn't make much sense to call this method programmatically due to it checking a specific selector. A client should set the menu item's target/action to the controller/checkForUpdates: action or call SPUUpdater methods directly.
* Update changelog for Sparkle 2
* Add more updates about appcast elements/attributes
* Clarify bestValidUpdateInAppcast method is discouraged for some cases
* Re-order changelog bullets
* Use https:// in sample links
* Don't ignore -Wcompletion-handler if compiler doesn't understand it
Older Xcode versions threw a warning at not recognizing this warning.
* Silence WKWebView warning too
If EdDSA verification passes we don't need to have DSA verification pass, and don't need to require the new update to contain a DSA signature or keys.
Also reject updates if app has EdDSA but no EdDSA signature is provided
Set $USER and $HOME variables when running guided pkg installers
This allows pre/post install scripts to reference the user's environment correctly. The standard pkg installer GUI preserves these two variables.
* Allow delegate to pick no valid items
We now allow returning SUAppcastItem.emptyAppcastItem in -bestValidUpdateInAppcast:forUpdater: to indicate no update should be picked.
We preserve returning nil to indicate Sparkle handles the best appcast selection instead.
People have expressed needs for both of these decisions (and deprecated SUUpdater relies on the nil behavior).
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.
We should recommend using sparkle:version and sparkle:shortVersionString elements inside the appcast item instead of inside the enclosure for consistency.
Delta updates do not need to specify sparkle:version, and can inherit the top level element. This clears up some confusion and reduces duplication (and reduces error proneness / saves me work when testing delta / info-only features).
This is also consistent with informational updates. Regardless whether you want to make an update informational only or not, the sparkle:version stays in the same top-level place.
This is a backwards compatible change. Very old versions of Sparkle (possibly up to a decade or more ago) have supported specifying sparkle:version as a top level item. Winsparkle supports it as well because it's needed for info-only updates.
This is only changing what we recommend / standardize. The attribute variants are still usable.
External tools relying on Sparkle's feed format may have to adapt to this standardization (they have always needed to support info-only updates with a missing enclosure which apps do leverage anyway).
I updated generate_appcast to prefer the element variants and updated the tool so it understands them (this was a bug).
When user is on version >= latest appcast feed item, we give them an option to view version history.
When user can't update because of a min/max OS requirement, we give them an option to view product's website.
* Make updater/userDriver properties non-null
* Expose starting the updater and allowing it to be done later instead of at instantiation (so clients in some cases will not need to make their controller declared as an optional)
* Make sender in checkForUpdates: nullable
Example:
<sparkle:informationalUpdate>
<sparkle:version>1.5.0</sparkle:version>
<sparkle:version>1.5.1</sparkle:version>
</sparkle:informationalUpdate>
Means that updating only from versions 1.5.0 and 1.5.1 are shown an informational update (provided there is an info link).
<sparkle:informationalUpdate></sparkle:informationalUpdate>
Means that updating from any version gets an informational update (provided there is an info link).
No presence of this new element falls back to current behavior in Sparkle where an informational update is shown if an enclosure is missing but an info link is provided.
In some cases for shared headers in downloader XPC Service or generate_appcast / sign_update tools, I had to do a little dance for using double quote imports.
This version indicates the version that was first marked critical. So versions below this specified version will treat the update as critical while versions >= the specified version will not.
Also move sparkle:criticalUpdate to root level element instead of it being a tag. The tagged version is now deprecated and doesn't support the version field.
We unify the user driver method showing the update to take a generic state object now. The current fields of the state object are its current stage, if it's user initiated, and if the update is a major one.
We also remove deprecated code paths that were complex to support and will otherwise generate in compile errors if people adopt the new API.
* Prefer using the latest update that passes minimumAutoupdateVersion
When an update is not found:
* Find latest appcast item that may fail min/max OS
* Report that user cannot install an update due to unsupported OS
We should enforce update session is in progress before checking for new updates. I've tested checking for updates regularly, in background, and informational updates.
An update check could have been made while the permission request was in flight, which we don't want to happen.
The message string gets cached and I don't think this is the proper way to localize the auth dialog (which I think has some other mechanism). So I am removing localization here for now until this can possibly be done properly.
All the top level appcast items are non-delta items. The client needs to give us back a non-delta update item. We then fetch the appropriate delta item ourselves.
We don't have a dismiss method for every transition state and we don't want to. This should be up to the UI to determine how to transition from one UI state to another UI state.
When the update is shown to the user, the menu item for checking for updates is no longer disabled. Instead it is enabled, and when invoked, will bring the update to utmost focus back to the user again.
This is consistent with other options (eg Preferences...) that bring up windows. Improved user experience here is that updates are now less "lost".
We (re)define properties on SPUUpdater:
canCheckForUpdates - to mean that the user can check for updates (start a new update check or show the already present update frontmost)
sessionInProgress - to mean if Sparkle's internal driver / scheduler is running (i.e, downloading appcast or update, showing update, starting installation).
Add entitlements to InstallerConnection and InstallerStatus services and add option to specify bundle id in the now renamed codesign_xpc_service.py script.
Testing WebKit2 is more important than testing sandboxed downloader service.
More people should be adding entitlements to their app for connection services, so we will do that in the test app too.
Deprecate the "done" statuses for user initiated update checks and downloading updates because they really did nothing but burden implementor (there was a relic of an XPC reason back in the day that no longer applies).
This is useful for plug-ins that may want Sparkle to open eg a .prefpane or .saver instead of re-launching System Preferences (which is the app used to wait for termination; normally we only relaunch an app that was proven to be alive).
In a plug-in world, it may not be possible to tell which is more desirable so we provide both options. In 1.x, there was a delegate -pathToRelaunchForUpdater: method to pick between these, however in 2.x for hardening sake, there isn't an API to open any arbitrary bundle path so we provide explicit options.
And remove logic in SPUStandardUpdaterController and SUUpdater that defers starting the updater one cycle later, because that logic is now in SPUUpdater which they invoke.
It is too easy to start the updater "too soon" (if not using SPUStandardUpdaterController or SUUpdater) and I had some weird approach before that allowed the developer to check for updates before starting the updater and it would get deferred until the updater was started (without showing a permission prompt). Instead, defer the update cycle check allowing developer to check for updates immediately after starting the updater if needed (sparkle-cli needs to do this in one case).
Errors are now logged when checking for updates without having started the updater.
This fixes edge cases of UI being shown too early.
Sometimes when the app is re-activated, the window is ordered back behind other applications. Also it may be useful to eg read the release notes when browsing another application. We still preserve the logic that defers showing the update alert when the application isn't initially frontmost.
With these changes, it should not be possible for neither an old or new bundle to be at the destination.
We also perform temporary directory cleanup after final installation stage is and relaunching an app is performed because we can save some time (150 ms+ in one of my cases).
Only check and update tag in Package.swift when not running a CI build. As long as GitHub actions are reserved for tests, this should be ok as this is a "fake" update of Package.swift anyway. If you ever use GitHub actions for releases, you'll probably have to rethink the tagging logic once again
Improves prompt asking to force move tag (default is NO, but can be triggered after `make release`). Fixes issues with single quotes in make-release-package.sh.
In 2.x, updates can be downloaded automatically and presented later even if they can't be installed automatically without user intervention. Users need to in control and be able to disable automatic downloads regardless of developer's Info.plist intention.
The custom headers added in #489 only applied to the appcast download.
This makes them apply to the app download as well for the case when both are hosted behind authentication.
With these changes, modern pkg's should no longer need to be archived.
Only guided package installations are supported for flat packages. Specifying an interactive package installation type will result in a rejection. If the file URL has a ".pkg" suffix it is by default assumed to be a guided pkg installation now, which relieves the burden of needing to previously specify sparkle:installationType in the app cast item enclosure, in this case (for 2.x). Moreover, this relieves the burden of developers needing to archive their pkg for Sparkle.
If user opts-out of automatic downloads (eg via app pref), they should be able to skip.
This logic for detecting minimumAutoupdateVersion present isn't sufficient and consistent enough, chooses to have skip visible in cases updates aren't prevented.
Masked sysctl hw.cputype value when evaluating the CPU type.
Used macros from mach/machine.h instead of magic numbers.
Added support for ARM in evaluation of hw.cpusubtype.
When changing the name of an app, there's a couple things to do in order
to ensure auto-updates still work:
1. set SUBundle Name. This basically tells Sparkle "ey, expect an app
of {SUBundleName}.(app|pkg) instead of the normal name."
2. set `SPARKLE_NORMALIZE_INSTALLED_APPLICATION_NAME` in
commonConfig.xccconfig to reset the name of the app.
in (2), we always used the host's bundle name, instead of checking to
see if SUBundleName was set, which means normalization doesn't work as
expected during app name changes.
• Updated error dialog code in SUBasicUpdateDriver, and created a local variable to reuse `[aHost name]`.
• Updated content of Sparkle.strings files, splitting existing affected translations into 2 chunks each.
• Fixed the Catalan translation, which was using an old string key.
• Removed a few unnecessary comments in the Polish translation.
The install description currently fails to notify the user that they should install the git submodule(s) present in the repo.
This causes `make release` to fail.
We fallback to legacy WebView in two cases:
* On systems prior to macOS 10.11 (it may be possible to support WKWebView in 10.10, but due to an 10.11+ only API I didn't bother putting in the effort)
* For apps using the downloader XPC service which are most likely sandboxed apps without an outgoing network entitlement. WKWebView doesn't function in that case (FB6993802 - https://github.com/feedback-assistant/reports/issues/1)
Additional notes:
* Added an abstraction for using WebView or WKWebView
* Web view is created and inserted programmatically rather than from the nib which has previously caused issues (and is not allowed for WKWebView prior to 10.12 due to some NSCoding bug).
* We need to rely on WKWebView private API for drawing transparent background (FB7539179 - https://github.com/feedback-assistant/reports/issues/81). Additional notes in the code.
* We always inject a custom stylesheet for dark mode colors and default font family/size (for WKWebView).
* This should also improve the Catalyst support story (#1482)
This reduces friction in creating a SPUUserDriver. This assumption that the calls could be made from any thread is a relic of the past of separating the user driver into a different process from the updater/scheduler, which is no longer sane or supported.
This should speed up things very slightly too.
When archives are stored as symlinks e.g. due to storing binary files in a
git-annex repository, everything works file except file size in the generate
feed xml file. This patch makes generate_appcast correctly determine file size
by following the symlink
(cherry picked from commit 7233bb93e7)
Previously, generate_appcast could only add or remove the release notes element for an update. This was probably fine, because it was unlikely to change: the release notes URL was determined by the SUFeedURL.
However, now that —release-notes-url-prefix was added, the release notes element CAN change. So, with this commit, if the release notes element is present for an update, the URL will be set correctly.
(cherry picked from commit 7c7e924ed4)
This keeps it from running when nothing's changed, which keeps Xcode
from re-signing the framework when nothing's changed, which keeps
downstream clients from re-copying the framework when nothing's
changed.
Rather than using a valid-but-incorrect public key or signature to
make sure a failure to parse turns into a failure to validate, only
return a public key / signature when it is both present and at least
minimally valid. Syntactically invalid public keys / signatures are
also logged explicitly.
Avoids "Class SUCodeSigningVerifier is implemented in both
Sparkle.framework/Versions/A/Sparkle and
Sparkle Unit Tests.xctest/Contents/MacOS/Sparkle Unit Tests.
One of the two will be used. Which one is undefined."
This gets more complicated, since binaries can be just code-signed, or
use both code signing and DSA keys, or be rotating keys for one or the
other.
The code signing test cases emulate certificate rotation by changing
the "identifier" for the bundle; the script used to sign each bundle
(with ad hoc signing) is included to support future expansion of
testing.
The actual tests here are the same as pre-validation; things only get
complicated when validating with code signing. The setup's a little
more involved though, since we need a supposedly-downloaded bundle to
do anything.
Also test invalid signatures, which are not always the same as absent
signatures.
You have to remember to invoke prevalidation anyway, so it doesn't
gain much for post-validation to check whether prevalidation failed.
Also, remove a no-longer correct comment from the corresponding
header.
-cleanup is only called when the task has finished, so it's safe to do this.
This silences a spurious warning logged by NSURLSession (or somewhere else internal):
Task <BB2AE4EF-8E93-44D7-9AB3-6EE9A9E3ACF8>.<1> load failed with error Error Domain=NSURLErrorDomain Code=-999 "cancelled" UserInfo={NSErrorFailingURLStringKey=https://example.com/appcast.xml, NSErrorFailingURLKey=https://example.com/appcast.xml, _NSURLErrorRelatedURLSessionTaskErrorKey=(
"LocalDownloadTask <BB2AE4EF-8E93-44D7-9AB3-6EE9A9E3ACF8>.<1>"
), _NSURLErrorFailingURLSessionTaskErrorKey=LocalDownloadTask <BB2AE4EF-8E93-44D7-9AB3-6EE9A9E3ACF8>.<1>, NSLocalizedDescription=cancelled} [-999]
* tag '1.20.0': (28 commits)
Bump
Fix binary delta creation on network drives
New Spanish localisation
Fix compilation issues on Xcode 10 with new build system
Bump
Updated readme to indicate that the 10.11 SDK is required to compile Xcode 7 was released with 10.11, the reference to the 10.8 SDK is out of date.
Explicitly specify types to silence "Messaging unqualified id" warning that's new in Xcode 10. Removed __has_feature(objc_generics) check and use generisc to help silence the warnings.
Updated Finnish language resources
Remove executable bit on distributed source files.
Fix potential hang with dispatch_sync to main thread
Deliver SPUDownloaderSession delegate messages on the main queue
add tips for user to install doxygen
add delegate callbacks for fininshed download and extraction related events
Restored legacy CLI for backward compatibility
Fixed index out of bounds
More complex argument parsing to support both inputs
Function to load the private key directly from the keychain
Minor naming improvement
Bump
Explain why auth is requested
...
* tag '1.19.0': (44 commits)
Ensure cocoapods is installed before performing the release “sanity check” (#860)
Silence ‘This block declaration is not a prototype’ Xcode warning
Silence ‘decodeObjectOfClass:forKey: is only available on macOS 10.8’ Xcode warnings, similar to commit ea94969188
10.7 compatibility
Avoid invalid use of main thread
Update wording of read-only error
Improve 'read-only' error message (#1192)
"all" target
Hidden verbose flag
Outdated comment
Amend to avoid gender issue
Changelog
Bump
move Xcode 9.2 automatic changes from project to xcconfig files
Bring project up to Xcode 9.2 settings
silence 10.9 availability and other warnings and use modules when available
Ensure UI is changed only on the main thread
nil checks
Fix typo in expectation description
Finish tests for persistent download
...
* Quiet warnings from Swift compiler: "Using '!' here is deprecated and will be removed in a future release"
* Ignore diagnostics that yield 'messaging unqualified id' warnings when calling XCTAssertNotEqualObjects. I have filed a bug with Apple, Radar #45968630, requesting that they quiet the warning internally to the macro implementation.
* When setting the access time on a directory and its contents, set the access time on the directory last so that it will be guaranteed to match the expected value. There is a side-effect of calling getFileSystemRepresentation that it sets the access time of its container folder, presumably because of an implementatiton detail of how Foundation builds up the path. Note there is another problem here that the order of items from NSDirectoryEnumerator is undefined, so some of the interior items of a directory will undoubtedly end up getting slightly varying access times set upon them. However, for the purposes of Sparkle's use of this method to "keep things alive" in /tmp, I don't think there is an issue. This fix addresses a failing unit test testUpdateFileAccessTime, which was failing because of very slight differences in access time created by the problem described.
This is done by applying a user stylesheet, making the background of the WebView transparent, and using a NSBox to display the dynamic dark background color. The appearance of the release notes will unfortunately not adapt if the theme is changed while the release notes window is open.
* Improver read-only error message German
Updated the "read-only volume" error to reflect the real-world scenarios users run into.
It's almost never a CD, it's nearly always running from ~/Downloads or the .dmg if you still ship your app that way.
I personally have my projects on iCloud Drive which contains a space in the path (`~/Library/Mobile Documents/...`) and the build fails running these two scripts.
Amend to avoid gender issue
Victor committed
a01979c
1 changed file
Instead of addressing the user, which might cause gender issues, string has been adapted to include “app” (masculine, in accordance with Apple's terminology).
Would translate back as “The app is up-to-date!”
The SULastCheckTimeKey preference (a/k/a "default"), which is stored
in ~/Library/Preferences/….plist, was used to store the date of the
last update check.
That causes a problem if the storage is read-only (for example, if the
.plist file is “locked” (has the uchg or schg flag set) or if the
SULastCheckTimeKey key "exists in a domain that precedes the
application domain the search list"). The date would never be modified,
and the old date would cause a new update check to be queued at the end
of an update check. If application or bundle was up-to-date, or the
user had chosen to skip the update that was available, this would cause
update checks to happen as often as the computer and network would
allow, many times each second.
The new code uses an instance variable to store the value. The variable
is initially loaded from the “SULastCheckTimeKey” preference, and each
time the variable is modified its new value is stored to that
preference. However, the variable, not the preference, is used when
calculating whether enough time has passed since the last update check
to warrant another check. The variable will always (after the first
update check) have the "correct" value, and update checks will not be
done more frequently than desired.
10.11 SDK does not contain the os_log API yet. Code is modified
in such a way that it compiles with older SDKs, and falls back
to the old implementation even if it runs on 10.12.
* origin/master: (21 commits)
Bump
Update Xcode version for Travis CI
Fix for the timing issue of termination detection.
Add optional updaterDidRelaunchApplication: method on SUUpdaterDelegate (#1115)
Better error message
Warning
Update to Xcode 9/Swift 4
Revert "Ensure UI code always runs on the main thread"
Update German localization with some terminology changes
Update German localization for informal style
Update Dutch localization for informal style
Update Dutch localization with some style changes
Include bin files in CocoaPods installation
Simplified check
Rename OSX macOS
[BasicUpdateDriver] - extend hostSupportsItem method to also check the sparkle:os attribute from the enclosure element to decide if an update item is valid for the host
[AppcastItem] - parse and save the sparkle:os attribute of the enclosure element and add isOsxUpdate method to item class
Updated Japanese translation to reflect change on 55be13c
Updated translation to reflect change on “Update error message to mention temp folders rather than optical drives”.
Changelog
...
The scheduleNextUpdateCheckFiringImmediately: method includes an asynchronous callback. It invalidates the timer before invoking the method with the callback (retrieveNextUpdateCheckInterval:), but doesn’t not invalidate again inside the callback block.
The problem with this is that it is possible the timer is started during the delay. In release versions of an app, crashes have been seen due to an assertion that the NSTimer be nil when scheduling.
The proposed fix is to invalidate the timer in the callback, ensuring the NSTimer is nil before scheduling.
This updates the podspec to include the bin scripts in Pods directory
when using CocoaPods. This way users don't also have to download the
Sparkle repo out of band to sign releases.
* origin/master:
Don't assume that the progress block exists (the parameter is nullable)
Prepend app name to Autoupdate.app name
Error message tweak
Update error message to mention temp folders rather than optical drives
1.18.0
Log more errors
Unify handling of aborted updates
* commit '60727bffa53ebfbfaf701575904847827bc1656a':
Log key read failure
Formatting
Escape + as well
Escape profile URLs better
Special case for .tar.gz extension
Inline release notes if they don't look like a standalone HTML document
Simplify release notes link check
Feed formatting
* origin/master: (39 commits)
%s is deliberate in this format string
Unused
Make generate_appcast available as a shared scheme
Shush Xcode
Link straight to docs from the readme
ignore .html files when scanning for archives
Missing strings translation.
Updated swift
Warn against abusing installUpdatesIfAvailable
when generating the appcast, if an .html file exists of the same name as the archive, then it will be linked in as the releaseNotesLink
Revert "Fix pt_BR translations"
Revert "Fix pt_BR translations (#1039)"
Fix Japanse localization
Add more info to auth tool run failure
Fix pt_BR translations (#1039)
Fix pt_BR translations
Disable the keyboard shortcut for the install button for scheduled updates to avoid accidental installs.
added `sparkle:shortVersionString` to the enclosure, #1032
Changelog
percent encode the filename used in the delta url
...
Before our TerminationListener didn't handle a process that has already been terminated. In my fork this is unlikely to be an actual issue but in master, the application can very well be dead before the termination listener initiates.
I don't think I have a great justification anymore for waiting more than 'x' hours. This may just be an artifact when I was initially architecting Sparkle so that the entire framework could be stuffed into an XPC service.
We use the cached host bundle if the host bundle is equal to the main bundle.
Otherwise we read in the latest Info dictionary every time.
The cached case is the most common case. The odd case (updating other bundles) is less common. Thus we have better performance for the common case, and we retain correct code in both cases.
This will increase the chance of a user driver implementing being able to show informational only updates. Also it's better to use a new method rather than re-use another existing one inappropriately.
The automatic update driver defers the informational only update & aborts, allowing a scheduled UI driver to resume it. The automatic update driver aborts before the point an update would normally be downloaded.
This is better than the hack in the previous commit. Also, a user driver may very well want to act differently in showing UI if the user initiated the update check.
SPARKLE_NORMALIZE_INSTALLED_APPLICATION_NAME=1 now works properly again. In the progress agent, we don't use the path sent from the installer unless the normalized setting is enabled.
This allows us to remove SPUUserDriverUIComponent and remove a bunch of logic in the user driver regarding termination. The user drivers generally don't need to know about the application bundle anymore, and strictly now only show UI events.
This has another advantage of the agent being able to quit multiple instances of an application even if the application to update is sandboxed.
We enforce the logic that an application can only be relaunched if it was running initially.
We don't import SPUUserDriverUIComponent in SparkleCore because it is an exported class a part of Sparkle framework, which causes issues.
Instead, we import SPUApplicationInfo which is not exported from Sparkle.
This only affects updater delegates that return NO from -updaterShouldAllowInstallerInteraction:
This improves the user experience in sparkle-cli where now the checking can be aborted before even downloading the update feed, if it knows ahead of time that installation will fail.
This is triggered if the update is automatically downloaded and the installer is started in the background, and the updater's delegate decides to handle silent installation and installs the update invoking its immediate installation block. In this scenario, this fixes an issue where the application may not be terminated silently.
Switching between a sandboxed and non-sandboxed app with regards to user defaults has some bugs with saving user defaults.
Confirmed by an Apple engineer.
Until I find a good reason to have them there, they should not be publicly available.
I actually found a couple bugs from code that was accidently referencing them.
This may be useful if user defaults can't be relied on for the feed URL.
For example, if an app is sandboxed, its user defaults may differ from the defaults sparkle-cli looks up.
I think I used to have this when the remote XPC callbacks were in the user driver and I removed them at some point.
These callbacks are now part of the SPUUpdaterDelegate and the logic is simpler now than before.
The command line utility makes use of these callbacks.
This is more consistent with how the last update check logic works.
I changed the value of SUTimeIntervalAtFirstLaunchKey for backwards compatibility purposes.
Although it is interesting to separate the user driver and update scheduler in different processes, this has yet to prove useful. Further, this management should not exist in the user driver protocol since the protocol would be doing double duty. If this separation is useful in the future, it should be separated into another driver altogether. Note that it is also hard to write correct code that separates the user driver and updater. Removing this code should greatly reduce maintenance costs.
This fixes issues where the user driver may not be displaying release notes properly because it doesn't know what kind of data was downloaded (eg: html vs plain text).
New classes will soon be prefixed with "SPU"
I still need to look into adding a compatibility layer for -updater:willInstallUpdateOnQuit:immediateInstallationInvocation: and possibly deprecating no-DSA instead of outright rejecting it.
If we download a package type installation or a delta update, we should validate the update before trying to unarchive it.
We can't do this with ordinary updates because we handle changing of DSA keys for that particular case.
We first create a directory with respect to the app's bundle ID being updated, sparkle's bundle ID, and a directory inside for a specific purpose. Then we remove all old directories inside there, and create a new unique temporary directory.
This is to avoid conflicts with eg: multiple updaters running against each other around the same time, or files for one function interfering with files from another purpose, while still having a way to clean up old files.
Create distinct subdirectories in our cache directory so files for different purposes won't conflict.
For the installer, move the download archive to the installer's cache location. If the installer is running as root, this moves it to a place only root can access I believe. This is also to prevent other functionality from touching these files.
This is only for debug builds. Release products aren't signed. This allows the updater agent app to be placed in the installer launcher service's MacOS directory, which is more convenient for developers to sign.
The InstallerLauncher code now tries to locate these tools inside Contents/MacOS/ or inside the Resources directory. The installer launcher XPC service now has a copy of the tools included in its bundle.
This may seem like wasting space but it enables eg, the XPC service not trusting a sandboxed application. A developer could always remove the tools from the Sparkle framework if necessary (we can't because the XPC services are optional..)
Using the XPC service allows the developer to sign the installer executable (Autoupdate.app). The agent app can be moved and signed into the MacOS executables directory as well. We don't do that automatically because Xcode's tooling doesn't play nice with attempting that, although that could be looked at later.
We now distinguish between the updater delegate allowing interaction and the update driver allowing interaction. We also remove an interaction allowed flag from the AppInstaller, letting shouldShowUI flag suffice.
Assume that the updater will be run as a logged in user.
The command line driver and progress app aren't completely root safe anyway, and running the progress app under a different user could be quite awkward from root
Several reasons:
* The user may not look at the trash anyway, and it would bloat their HD space
* Other sofware updaters don't move old versions to the trash either. Can confuse the user or not be seemly transparent experience.
* Moving app to trash will not work if user has to authenticate anyway
* Unclear how long and expensive this operation *could* take in all scenarios
* App replacements in Apple's new file system can be atomic-safe, but that may only be the case if the old app is no longer needed
Cons:
* Few tech savvy users may not be able to restore an app without re-downloading it. This would still be rarely done even amongst them.
This is now necessary for package type installations so we can know whether or not we should authenticate ahead of time.
Of course, we also verify that the download contains the type of installation we expect (because the appcast is not very trusted).
We now present a better worded dialog (X wants to update. Please type your password to allow this. OK/Cancel)
We still need to set the icon for the dialog window.
I also fixed some issues with canceling the dialog still throwing an error.
This allows automatically downloading updates, and having them prompt up later, so the user can perform authorization later for starting up the installer
I need to at least look at:
* Automatic downloaded / silent updates
* Running updates as root user from beginning
* Status info query service
* Add guided flag in the appcast
This fixes an issue where relative external references could not be loaded from the release notes.
Note this just affects apps that have a 'com.apple.security.network.client' entitlement or apps that aren't sandboxed.
We now use XPC for communication between Sparkle.framework and Autoupdate.
Autoupdate is now ran as a launchd agaent/daemon. (Most of the time, it acts as an agent).
Using XPC can only be done from non-sandboxed processes, so a connection and status service had to be created.
Currently, the GUI progress tool doesn't work properly, but everything else should be behaving like before.
This fixes installation failing when we check for the wrong child and don't let the installer finish. However, this code now ignores the status from the child. I might see if there's a better way around fixing that..
I don't think this feature would be used much, and I don't want to deal with additional maintainability. As it is, the progress app should show up in rare cases.
This way we don't have to include an icon for the installer progress app. There is a minor issue where the dock icon changes back before termination. However, this app should show up in rare cases in the first place, so I still think this is a good trade off.
For most applications, it makes more sense to use the app's icon than Sparkle's. That and we can save some disk space usage.
This allows installation by requesting the user to enter a password when elevated privileges are necessary. This only works if the application is alive before installation begins.
If the file manager is used for authorization, we can now supply an authorization environment.
This allows us to specify a customized prompt message and an icon to use in the authorization dialog window. We no longer need to include an icon for Autoupdate app.
We now also see if we can get authorization rights access right away, rather than lazily when executing a tool.
1. Use Apple's logging system (ASL) - don't invent our own inefficient mechanism.
2. Logging is not dependent on a global file that any process and thread using Sparkle can write to now, which could also be cleared at any point before.
3. Don't write to stderr on non-debug builds. This is ideal for sparkle-cli utility.
We don't export an API for configuring this in SUUpdater.
Messing with the user defaults is not ideal, and we don't use hasLaunchedBefore anymore
For testing this, the user defaults should just be removed manually, and the test app should be relaunched.
This option never used to work for me that well before anyway.
The old behavior used to be to prompt on second launch.
However, applications can be re-launched in a short amount of time, and Sparkle can be loaded multiple times during a single app launch.
So prompting after a certain amount of time after first launch works better.
If an update permission request comes up, this alows us to make a decision.
Also I renamed the defer and checknow flags to defer-install and check-immediately
What is new is that we can now disable checking for updates immediately.
sparkle-cli is not intended to be run for a long time, so if the next update check is not soon, we exit.
A client can now launch sparkle-cli without having to necessarily check for updates, so that they don't check for updates too soon.
The installer can now inherit privileges from the updater, which inherits
privileges from the process that spawns the updater. As such, we can now
run the updater & installer as root, and no authorization dialog can prompt up.
The installer now must abort or install if the target app has terminated.
Zombie processes will no longer stay around.
Because the root user has no trash directory, we ignore logging the error if it was not found.
We also avoid invoking mdimport which fails as root on the installed app.
mdimport may have been used before for updating mdimporter files, however, it should be the developer's
responsibility to ensure their mdimporter files have an updated date stamp, which will work if a user updates an app manually.
Other than that, we already touch the app to register it with LaunchServices, so that should suffice.
For sparkle-cli and out-of-process updaters, I added a did finish installing event.
I also have logic dealing with whether an update can be silently installed or not.
I made closing status windows before app termination a reponsibility for the user driver now, not
the installer drivers.
I improved checking for updates before starting the updater, if Sparle didn't ask the user for permission yet.
Currently, Autoupdate can persist in the background even when the app is terminated,
if we don't have sufficient privilleges to install right away for example, or if an update isn't silent.
After much thinking, I need to ditch this strategy because:
1. An app can be manually replaced and so the installer would have to monitor that
2. We leave a zombie process running
I'm hoping this will ease some of the build configuration issues I've been running into.
Apps (eg: unsigned, not-sandboxed) don't need to (although they still can) use the XPC services.
Sandboxed apps naturally should use the XPC services. Although, you can for example, choose not to use the
downloader services if the host app already entitlements to allow network connections.
If you use the downloader services, you must configure ATS exceptions in them. And if you use those services,
you probably want to sign them with the required entitlements.
If you don't use the services, Sparkle will fall back on almost-identical code executed within the framework instead.
There may be other reasons to use the services or not other than for sandboxing, like fault tolerance.
Lastly, XPC services work within an application namespace. They are discoverable as long as they're in the app.
That's why we can have an app incorporate the services and let the framework use them.
Rename the XPC service products so that they start with 'Sparkle'
Make the bundle IDs of the services a part of the build configuration, so we can pass it to the preprocessor.
We have a custom codesign-after-copy script because Xcode's code sign on copy feature is bad when it
comes to frameworks including signable tools. In release build configurations, nothing we build uses
an ad-hoc code signature. This is logical because ad-hoc signatures are only meant to be used for testing purposes.
Only the XPC services need to be ad-hoc signed (else Xcode gets cranky),
or targets with entitlements like our Test Application.
Distributing ad-hoc binaries can be mixed with distributing unsigned apps,
and ad-hoc is no worse than unsigned when it comes to distributing, so we're all good.
Updating without DSA signing the download is simply not secure.
Before, we were keen on allowing no DSA signing as long as https is used.
However, under the separate process security model, the installer can't know or trust
if the download came over from https. We could move downloading into the installer, but
the installer may run with full privileges one day in the future, and this would
complicate the installer & updater interaction. Furthermore, this could disallow us from being able
to silently download the update in the future if the installer runs at full privileges.
An upside is that the validation and configuration checking code is simpler to read through now.
Even if we could validate that an update came over https, it is still not as secure as people may like to believe.
For example, a hijacked server can choose to manipulate the download (within restrictions), even if it's signed by a developer ID, but not with our DSA support.
Changing of DSA keys and Apple code signing identities is still allowed as long as one of these pairs match and are valid.
Hence requiring DSA signing is also safer when it comes to losing one of your keys. It's only a bit less convenient.
In debug mode we always build with arbitrary http loads, but in release mode we
only want to build sparkle-cli and SparkleTestApp with arbitrary http loads.
An ATS error was added back if arbitrary HTTP loads are not allowed and if the feed URL is http://
The "distribution" target/scheme is now not very up to date because it builds everything under Release configuration.
An app can contain a XPC service with restricted entitlements and own ATS exceptions.
Indeed, Sparkle now is a framework that embeds two XPC services that include download entitlements.
If ATS is disabled, it'd have to be disabled in those services, not within the root of the application.
So we can't keep this detection because it will generate false positives. And it's not really our responsibility anyway.
We really want to differentiate between apps and prefpanes/plug-ins.
Using the main bundle is not at all a reliable indicator because an updater could target
any kind of bundle anywhere.
This new method also takes an error object as output, which means we can now
read a bundle in Sparkle without having to abort. If a check for updates action is invoked
before the updater has been started, it becomes a pending scheduled operation.
I added an application target but it's really intended to be used as a command line tool. The reason being was that it was the easiest way to bundle the Sparkle framework, I've found.
Note this doesn't work perfectly yet, but it's a good start. Trying to update anything that's not Sparkle based will crash for instance. And it will use the installer progress tool which may be undesirable.
This created more complexity than it was worth and leads to subpar user experience because the user can see the icon switch back to the generic one when the updater terminates. So we now bundle the icon in the install progress tool. If a developer wants to use a custom icon, they can provide their own customized tool.
Following cases where after an update has been automatically downloaded, Sparkle may alert the user right away:
1) Critical updates
2) Insufficient write access to install without being root
3) Package type installations
In addition to alerting the user right away, if they dismiss the update, the schedule timer will be on regular intervals. We also no longer need to care about writability in the updater, only just in the installer.
Duplicated code from SUFileManager and SUGuidedPackageInstaller has been removed.
SUPlainInstaller now tests if it needs authorization rather than by trying to touch the old app.
SUGuidedPackageInstaller now tries to grab authorization during stage 2 of the installation.
This more accurately reflects its intended purpose. From the beginning,
the user cannot check for updates until the updater is ready;
however this doesn't mean that the update is in progress.
ATS exceptions now need to be included in the appcast & update downloader services - *shrugs*.
I've a run script configured to disable ATS for release builds.
This allows Sparkle to be used as-is in a sandboxed application,
without needing to place Sparkle into its own XPC service.
Currently the main app may need to set a global mach service lookup exception
and a client download exception, however this can be fixed by creating a couple more
services. Testing for disk writability will need be done in a service too.
If permissions are abnormal during cleanup or somewhere along the lines, it may be
possible to bring up authorization dialog that is not really needed. Prevent this from happening.
We would want to restrict authorization from being possible anyway when not needed.
Just do all installation in 3rd stage at the moment and reconsider this idea..
Doing any work prior to finishing the installation that requires keeping files in
a temporary directory for potentially a long time turns not to probably not be a great idea.
Unfortunately I don't think trying to keep the files up to date every some interval is a _great_ idea.
I will need to rethink this some more.
This is inevitable if we stick to a three stage installation.
The other direction to consider is to defer most installation until after the app terminated,
although that may have disadvantages of its own.
One important addition is touching the new app recursively before moving it in a temp directory.
This is important because archives can preserve modification & access times, but we don't want that.
This is convenient if the updater and app live in separate processes.
No need to use XPC to find out what certain settings are, and it may take too long to find out that way.
Before there were implicit dependencies and unarchivers were globally registered as their classes were loaded.
This flexibilty is unnecessary and comes with a safety (eg: forgetting to link in a class) and harder to read cost
Resumability works by asking the installer for its progress and for the appcast item we've given it before.
If an automatic silent download occurs, we abort it after the installer tool finishes with its basic steps.
Then, a user initiated or scheduled check can resume the update. The scheduled check fires during a longer-than-normal
span since usually the user can install by quitting the app, unless the app has been alive for a very long time.
One exception to this is when the update is marked critical; in that case, the scheduled check is fired immediately after
an automatic update download. Subsequent attempts will be fired using a normal update check interval.
Todo: delta updates probably don't work when they fail and fallback to a regular update
Copy the bytes manually using -[NSData dataWithBytes:length:]
If we use -[NSData copy] instead, we may be using already freed memory
(according to ASAN), which is no good. This may be because the bytes aren't
deep copied.
Also add some @autoreleasepool wrappers because why not.
This removes subclassing usage making the code harder to follow.
Todo: handle resuming an update already waiting to be installed,
adding impatience timer for automatic update scheduling
We now have a stage where authorization is allowed (when the user intiates a relaunch).
This stage occurs before the user application is terminated (if the operation succeeds).
An install attempt will always be made after the validation is finished now. However, if the
user doesn't explicitly relaunch the app, we don't bug the user about auth prompts which means
updates can fail in this kind of scenario.
This decreases coupling for the updater and updater drivers.
We still pass in the updater because we need it for invoking the updater delegate's methods,
but we now use type 'id' instead of SUUpdater* because we don't want to invoke anything on the object.
Furthermore, we never #import SUUpdater, only forward class declarations.
I added public DSA file, automatic update checking, disabled system profiling
in the unit test's info.plist so that SUUpdater won't complain that DSA is missing,
and it won't prompt for update permission the first time.
This is bad for a number of reasons.
1. Our SUUserDriver protocol wasn't quite the right protocol to pass in.
2. This made the UI/Core components to hold a depedency to the user driver, when it
really was not used for anything other than passing to the delegate. We can now
remove this bidirectional depedency between the components and the user driver.
3. This encourages that the client can handle multiple user drivers within the same class,
which encourages complexity. If they were able to set the delegate, they should have a reference
to the user driver.
Indeed, SUUpdater, SUUpdaterDelegate, and the update drivers all have the same problem.
An unfortunate design decision..
This is to minimize the amount of time the app is left terminated.
App restarts should always be near instantaneous.
More work needs to be done to make authenticated installs more friendly,
and not making installs abortable after validation is done.
The installer (Autoupdate.app) is now responsible for extracting & verifying the update.
It talks to the updater via mach ports. We can't afford to use a XPC service due to
lack of perfoming privileged tasks.
This adds delegate outlets to the updater and to the user driver, so a
developer can hook either of them up. Note we now initialize the updater and
user driver after being awoken from the nib.
We also took this chance to make the delegates to the updater and user driver read only.
This means that the delegates have to be available on initialization, which is good because
changing delegates or setting delegates too late (and missing messages) is bad.
For sandbox testing, we really have to use ad-hoc signing.
Which means we have to sign the "new" app after we alter its info.plist file,
so that our code signing verifier doesn't (rightfully) complain
We should terminate even if the update aborts.
We should also terminate even if the connection is invalidated or interrupted, if we've
already been told to quit
I decided it was less evil to allow SUUpdater to defer cycling and have
a mutable delegate, than it was for SUUpdateController to have a nullable SUUpdater
that could be instantiated an arbitrary time later
I have also changed the delay from 0 to 1, on the safer side.
Also move system shut off handling to the user driver.
Observing system shut off is difficult without AppKit, and
a client may want to observe for varying types of events.
I suppose this is consistent with application termination
notifications though.
This solves several problems:
1) we can't spawn a task reliably from a XPC process
2) we don't want to link to AppKit from SUBasicUpdateDriver
3) spawning a task to invoke open utility is poor with bad inputs
These operations also make incorrect assumptions when called from out of process,
so it makes sense to separate them out. Furthermore, SUHost can now only depend on
Foundation
Yeah, this isn't backwards compatible with older code that uses Sparkle
Few notes:
* Mostly everything from *.pch has been moved out for saner dependency tracking
* 10.7 compatibility has been removed out so I don't import Cocoa when I don't have to
* sharedUpdaters/SUUpdater singletons has been removed out so updaters can actually be deallocated properly
(and since singletons are generally horrible idea anyway)
* SUUpdater doesn't have UI/cocoa/bindings/menu validation code. Its new initializer method takes a user driver
(perhaps in the future I'll create another class that "binds" the UI and core)
In a XPC environment, a delegate may handle update checks by sending a message
to the XPC process that tells it to reset the sparkle updater's check cycle.
If the user driver delegate can do this, the XPC process will not need to wait
for a reply, allowing the system to kill the XPC process when it becomes idle.
These changes are to make XPC environment more friendly. Every reply block must
get a response and is not optional to respond to. For example we can no longer have
a reply block that is just "cancelUpdate()"; it must now take an option whether
we are done now or if we want to cancel, and the receiver should now be aware
when canceling doesn't make sense (i.e, if update already aborted). Furthermore,
a reply block must get exactly *one* response.
non-void/synchronous calls over XPC don't work properly, and
these methods don't seem very proper architecture wise anyway.
A proper solution will be needed for notifying the delegate of modal alerts
If an automatic update needs to be applied at termination,
the app delegate will need to hold responsibility of delaying
termination until Sparkle is ready to relaunch
Note that the protocol API for the user updater driver can still be improved.
applicationWillTerminate: is done from the user driver because that's the only way that will
function across different processes.
We support NSSecureCoding for SUAppcastItem and SUHost
Callbacks from XPC <-> Host app now async to main GCD queue.
This is needed for everything to be thread safe.
Todo: NSDate parsing sucks and is temporarily disabled.
In particular, we're using deprecated methods to read the dates,
which don't support NSSecureCoding. The other problem is that the dates are
really useless technically and we shouldn't sort by them.
Everything related to the protocol is intended for showing & dismissing progress,
as well as making UI actions such as canceling, installing, confirming update permissions
This is still incomplete and not perfect yet.
In particular, these delegate methods ought to perhaps be grouped in a separate class.
The UI code that is currently done should be treated the same manner as a custom UI
Relaunching Sparkle should give customization over showing the UI of the autoupdater app
[provide general summary to the issue or enhancement and its rationale]
## Possible Fix
[not obligatory, but suggest fixes or reasons for the bug]
## Version
[please specify versions of Sparkle this is applicable to; note the old 1.x (master) branch is only taking fixes to regressions and security fixes now.]
### Version of `Sparkle.framework` in the latest version of your app
### Version of `Sparkle.framework` in the old version of app that your users have (or N/A)
### Sparkle's output from Console.app
```
```
### Steps to reproduce the behavior
[The more information provided and pasted verbatim, the easier it will be to diagnose an issue. If you can provide the affected application/binary and XML feed to reproduce an issue, share them]
### Version of `Sparkle.framework` in the latest version of your app
### Version of `Sparkle.framework` in the old version of app that your users have (or N/A)
### Sparkle's output from Console.app
```
```
### Steps to reproduce the behavior
[The more information provided and pasted verbatim, the easier it will be to diagnose an issue. If you can provide the affected application/binary and XML feed to reproduce an issue, share them]
- [ ] My change requires a documentation update on [Sparkle's website repository](https://github.com/sparkle-project/sparkle-project.github.io)
- [ ] My change requires changes to generate_appcast, generate_keys, or sign_update
Only bug fixes to regressions or security fixes are being backported to the 1.x (master) branch now. If you believe your change is significant enough to backport, please also create a separate pull request against the master branch.
## Testing
I tested and verified my change by using one or multiple of these methods:
[strongSelfcleanupAndExitWithStatus:EXIT_FAILUREerror:[NSErrorerrorWithDomain:SUSparkleErrorDomaincode:SPUInstallerErroruserInfo:@{NSLocalizedDescriptionKey:@"Invalidation on remote port being called, and installation is not close enough to completion!"}]];
[selfcleanupAndExitWithStatus:EXIT_FAILUREerror:[NSErrorerrorWithDomain:SUSparkleErrorDomaincode:SPUInstallerErroruserInfo:@{NSLocalizedDescriptionKey:@"Timeout: installation data was never received"}]];
}
if(!self->_agentConnection.connected){
[selfcleanupAndExitWithStatus:EXIT_FAILUREerror:[NSErrorerrorWithDomain:SUSparkleErrorDomaincode:SPUInstallerErroruserInfo:@{NSLocalizedDescriptionKey:@"Timeout: agent connection was never initiated"}]];
unarchiverError=[NSErrorerrorWithDomain:SUSparkleErrorDomaincode:SUUnarchivingErroruserInfo:@{NSLocalizedDescriptionKey:[NSStringstringWithFormat:@"No valid unarchiver was found for %@",archivePath]}];
[selfunarchiverDidFailWithError:[NSErrorerrorWithDomain:SUSparkleErrorDomaincode:SUUnarchivingErroruserInfo:@{NSLocalizedDescriptionKey:[NSStringstringWithFormat:@"Failed to unarchive %@",archivePath],NSUnderlyingErrorKey:(NSError*_Nonnull)error}]];
[selfcleanupAndExitWithStatus:EXIT_FAILUREerror:[NSErrorerrorWithDomain:SUSparkleErrorDomaincode:SPUInstallerErroruserInfo:@{NSLocalizedDescriptionKey:@"Update validation was a failure",NSUnderlyingErrorKey:validationError}]];
[selfcleanupAndExitWithStatus:EXIT_FAILUREerror:[NSErrorerrorWithDomain:SUSparkleErrorDomaincode:SPUInstallerErroruserInfo:@{NSLocalizedDescriptionKey:@"Timeout error: failed to retreive process identifier from agent"}]];
[selfcleanupAndExitWithStatus:EXIT_FAILUREerror:[NSErrorerrorWithDomain:SUSparkleErrorDomaincode:SPUInstallerErroruserInfo:@{NSLocalizedDescriptionKey:[NSStringstringWithFormat:@"Error: Failed to match host bundle identifiers %@ and %@",self->_hostBundleIdentifier,bundleIdentifier]}]];
return;
}
// This will be important later
if(installationData.relaunchPath==nil){
[selfcleanupAndExitWithStatus:EXIT_FAILUREerror:[NSErrorerrorWithDomain:SUSparkleErrorDomaincode:SPUInstallerErroruserInfo:@{NSLocalizedDescriptionKey:@"Error: Failed to obtain relaunch path from installation data"}]];
return;
}
// This installation path is specific to sparkle and the bundle identifier
[selfcleanupAndExitWithStatus:EXIT_FAILUREerror:[NSErrorerrorWithDomain:SUSparkleErrorDomaincode:SPUInstallerErroruserInfo:@{NSLocalizedDescriptionKey:[NSStringstringWithFormat:@"Error: Failed to create installation cache directory in %@",rootCacheInstallationPath]}]];
return;
}
// Resolve the bookmark data for the downloaded update
[selfcleanupAndExitWithStatus:EXIT_FAILUREerror:[NSErrorerrorWithDomain:SUSparkleErrorDomaincode:SPUInstallerErroruserInfo:@{NSLocalizedDescriptionKey:@"Error: Failed to resolve bookmark data from downloaded update",NSUnderlyingErrorKey:bookmarkError}]];
return;
}
if(!isStale){
SULog(SULogLevelError,@"Error: bookmark data for update download is stale.. but still continuing.");
[selfcleanupAndExitWithStatus:EXIT_FAILUREerror:[NSErrorerrorWithDomain:SUSparkleErrorDomaincode:SPUInstallerErroruserInfo:@{NSLocalizedDescriptionKey:@"Error: Failed to retrieve download name from download URL"}]];
return;
}
// Move the download archive to somewhere where probably only we will be touching it
// This prevents eg: if a bug exists in the updater that removes files we are trying to install
// When this tool is ran as root, we are moving it into a directory that only root will have access to
[selfcleanupAndExitWithStatus:EXIT_FAILUREerror:[NSErrorerrorWithDomain:SUSparkleErrorDomaincode:SPUInstallerErroruserInfo:@{NSLocalizedDescriptionKey:@"Error: Failed to move download archive to new location",NSUnderlyingErrorKey:moveError}]];
return;
}
// Make sure the downloaded archive we moved over is a regular file and not a symbolic link placed by an attacker
[selfcleanupAndExitWithStatus:EXIT_FAILUREerror:[NSErrorerrorWithDomain:SUSparkleErrorDomaincode:SPUInstallerErroruserInfo:@{NSLocalizedDescriptionKey:[NSStringstringWithFormat:@"Error: Failed to retrieve download archive path from %@",downloadDestinationURL]}]];
[selfcleanupAndExitWithStatus:EXIT_FAILUREerror:[NSErrorerrorWithDomain:SUSparkleErrorDomaincode:SPUInstallerErroruserInfo:@{NSLocalizedDescriptionKey:[NSStringstringWithFormat:@"Error: Failed to retrieve download archive attributes from %@",downloadDestinationPath]}]];
[selfcleanupAndExitWithStatus:EXIT_FAILUREerror:[NSErrorerrorWithDomain:SUSparkleErrorDomaincode:SPUInstallerErroruserInfo:@{NSLocalizedDescriptionKey:[NSStringstringWithFormat:@"Error: Received bad archive file type: %@",archiveAttributes[NSFileType]]}]];
return;
}
// Carry these properities separately rather than using the SUInstallationInputData object
// Some of our properties may slightly differ than our input and we don't want to make the mistake of using one of those
[selfcleanupAndExitWithStatus:EXIT_FAILUREerror:[NSErrorerrorWithDomain:SUSparkleErrorDomaincode:SPUInstallerErroruserInfo:@{NSLocalizedDescriptionKey:@"Error: Failed to start installer",NSUnderlyingErrorKey:firstStageError}]];
[selfcleanupAndExitWithStatus:EXIT_FAILUREerror:[NSErrorerrorWithDomain:SUSparkleErrorDomaincode:SPUInstallerErroruserInfo:@{NSLocalizedDescriptionKey:@"Error: Failed to resume installer on stage 2 because installation cannot be installed silently"}]];
[selfcleanupAndExitWithStatus:EXIT_FAILUREerror:[NSErrorerrorWithDomain:SUSparkleErrorDomaincode:SPUInstallerErroruserInfo:@{NSLocalizedDescriptionKey:@"Failed to listen for application termination"}]];
return;
}
// Show our installer progress UI tool if only after a certain amount of time passes,
// and if our installer is silent (i.e, doesn't show progress on its own)
[selfcleanupAndExitWithStatus:EXIT_FAILUREerror:[NSErrorerrorWithDomain:SUSparkleErrorDomaincode:SPUInstallerErroruserInfo:@{NSLocalizedDescriptionKey:@"Failed to finalize installation",NSUnderlyingErrorKey:thirdStageError}]];
});
return;
}
self->_performedStage3Installation=YES;
dispatch_async(dispatch_get_main_queue(),^{
// Make sure to stop our displayed progress before we move onto cleanup & relaunch
// This will also stop the agent from broadcasting the status info service, which we want to do before
// we relaunch the app because the relaunched app could check the service upon launch..
// Closes file for reading/writing, called in -dealloc if it's not called manually
-(void)close;
// For reading
// Retrieves metadata for the archive including major/minor version and expected bundle hashes
-(nullableSPUDeltaArchiveHeader*)readHeader;
// Enumerate through items in the patch file and read the path, attributes, permissions (if permission attribute is available), and way to stop enumeration
Modern container format for binary delta archives.
Delta archive format has four sections which are the header, the relative file path table, the commands, and the data blobs.
The relative file path table records all the file paths the archive needs to know about.
The commands are the operations to be recorded (eg: extract, clone, binary diff, delete).
The commands may additionally have more metadata such as file permission modes, relative path indexes in the case of clones, or file sizes for the data blobs.
The data blobs contain all file data from extract and binary diff outputs.
The implementation design of this archive is such that we do not seek backwards or skip ahead to fetch data.
We go through the archive when writing or reading from it in a single pass.
-- UNCOMPRESSED --
[ HEADER (part 1) ]
magic (length: 4)
compression (length: 1)
metadata (See format below. length: 1)
-- METADATA --
compressionLevel (bits [0, 4])
(bits [5, 6] reserved)
fileSystemCompression (bit 7)
-- COMPRESSED --
[ HEADER (part 2)]
majorVersion (length: 2)
minorVersion (length: 2)
beforeTreeHash (length: 40)
afterTreeHash (length: 40)
[ RELATIVE_FILE_PATH_TABLE ]
sizeOfRelativeFilePathTable (length: 8 bytes)
List of null terminated path strings joined together (N paths)
[ COMMANDS ]
[ Command ]
Set of command types for entry (length: 1 byte)
Additional metadata for command (see below section)
(M commands where M <= N paths)
(Indexes for commands refer to indexes to relative file path table, excluding extraneous trailing entries in relative path table used for clones)
(Last command must be a ZERO COMMAND (a null terminating command))
[COMMAND METADATA]
[COMMAND: DELETE]
N/A: no additional data
[COMMAND: MODIFY_PERMISSIONS]
fileMode (length: 2)
[COMMAND: CLONE_FILE]
sourceRelativePathIndex (length: 4)
[COMMAND: EXTRACT_FILE]
dataLength (length: 8 for regular files, 2 for symbolic links, 0 for directories)
[COMMAND: BINARY_DIFF_FILE]
dataLength (length: 8)
Note: These command types may be OR'd or combined. In those cases, different commands
that have the same attribute (eg dataLength) are not repeated. This list of metadata is also
in order in what will be encoded/decoded first.
EXTRACT_FILE and BINARY_DIFF_FILE cannot be combined.
CLONE_FILE and EXTRACT_FILE cannot be combined.
MODIFY_PERMISSIONS can be combined with either CLONE_FILE, EXTRACT_FILE, BINARY_DIFF_FILE, or just by itself.
CLONE_FILE can be combined with BINARY_DIFF_FILE or just by itself.
DELETE can be combined with EXTRACT_FILE, or just by itself. It is only combined with EXTRACT_FILE when the file type (regular, directory, or symlink) changes.
[ DATA_BLOBS ]
All raw binary data joined together
(P number of blobs where P <= M commands)
(Indexes for data blobs correspond to indexes for a filtered list of applicable commands (EXTRACT_FILE, BINARY_DIFF_FILE) that have data content)
_error=[NSErrorerrorWithDomain:SPARKLE_DELTA_XAR_ARCHIVE_ERROR_DOMAINcode:SPARKLE_DELTA_XAR_ARCHIVE_ERROR_CODE_OPEN_FAILUREuserInfo:@{NSLocalizedDescriptionKey:[NSStringstringWithFormat:@"Failed to xar_open() file for reading: %@",patchFile]}];
_error=[NSErrorerrorWithDomain:SPARKLE_DELTA_XAR_ARCHIVE_ERROR_DOMAINcode:SPARKLE_DELTA_XAR_ARCHIVE_ERROR_CODE_OPEN_FAILUREuserInfo:@{NSLocalizedDescriptionKey:[NSStringstringWithFormat:@"Failed to xar_open() file for writing: %@",patchFile]}];
_error=[NSErrorerrorWithDomain:SPARKLE_DELTA_XAR_ARCHIVE_ERROR_DOMAINcode:SPARKLE_DELTA_XAR_ARCHIVE_ERROR_CODE_UNSUPPORTED_COMPRESSION_FAILUREuserInfo:@{NSLocalizedDescriptionKey:[NSStringstringWithFormat:@"Version 2 patches only support bzip2 compression."]}];
_error=[NSErrorerrorWithDomain:SPARKLE_DELTA_XAR_ARCHIVE_ERROR_DOMAINcode:SPARKLE_DELTA_XAR_ARCHIVE_ERROR_CODE_ADD_FAILUREuserInfo:@{NSLocalizedDescriptionKey:[NSStringstringWithFormat:@"Failed to add xar file entry: %@",relativeFilePath]}];
_error=[NSErrorerrorWithDomain:SPARKLE_DELTA_XAR_ARCHIVE_ERROR_DOMAINcode:SPARKLE_DELTA_XAR_ARCHIVE_ERROR_CODE_EXTRACT_FAILUREuserInfo:@{NSLocalizedDescriptionKey:[NSStringstringWithFormat:@"Failed to extract xar file entry to %@",item.itemFilePath]}];
*error=[NSErrorerrorWithDomain:NSCocoaErrorDomaincode:NSFileReadCorruptFileErroruserInfo:@{NSLocalizedDescriptionKey:[NSStringstringWithFormat:@"Unable to identify diff-version %u in delta. Giving up.",majorDiffVersion]}];
*error=[NSErrorerrorWithDomain:NSCocoaErrorDomaincode:NSFileReadCorruptFileErroruserInfo:@{NSLocalizedDescriptionKey:[NSStringstringWithFormat:@"Applying version %u patches is no longer supported.",majorDiffVersion]}];
*error=[NSErrorerrorWithDomain:NSCocoaErrorDomaincode:NSFileReadUnknownErroruserInfo:@{NSLocalizedDescriptionKey:[NSStringstringWithFormat:@"A later version is needed to apply this patch (on major version %u, but patch requests version %u).",SUBinaryDeltaMajorVersionLatest,majorDiffVersion]}];
}
returnNO;
}
// Reject patches that did not generate valid hierarchical xar container paths
// These will not succeed to patch using recent versions of BinaryDelta
*error=[NSErrorerrorWithDomain:NSCocoaErrorDomaincode:NSFileReadCorruptFileErroruserInfo:@{NSLocalizedDescriptionKey:[NSStringstringWithFormat:@"This patch version (%u.%u) is too old and potentially unsafe to apply. Please re-generate the patch using the latest version of BinaryDelta or generate_appcast. New version %u.%u patches will still be compatible with older versions of Sparkle.",majorDiffVersion,minorDiffVersion,majorDiffVersion,latestMinorVersionForMajorVersion(majorDiffVersion)]}];
*error=[NSErrorerrorWithDomain:NSCocoaErrorDomaincode:NSFileReadCorruptFileErroruserInfo:@{NSLocalizedDescriptionKey:@"Unable to find before-sha1 or after-sha1 metadata in delta. Giving up."}];
}
returnNO;
}
if(verbose){
fprintf(stderr,"Applying version %u.%u patch...\n",majorDiffVersion,minorDiffVersion);
*error=[NSErrorerrorWithDomain:NSCocoaErrorDomaincode:NSFileReadUnknownErroruserInfo:@{NSLocalizedDescriptionKey:[NSStringstringWithFormat:@"Unable to calculate hash of tree %@",source]}];
*error=[NSErrorerrorWithDomain:NSCocoaErrorDomaincode:NSFileWriteUnknownErroruserInfo:@{NSLocalizedDescriptionKey:[NSStringstringWithFormat:@"Failed to remove %@",destination]}];
}
returnNO;
}
progressCallback(3/7.0);
if(!copyTree(source,destination)){
if(verbose){
fprintf(stderr,"\n");
}
if(error!=NULL){
*error=[NSErrorerrorWithDomain:NSCocoaErrorDomaincode:NSFileWriteUnknownErroruserInfo:@{NSLocalizedDescriptionKey:[NSStringstringWithFormat:@"Failed to copy %@ to %@",source,destination]}];
*error=[NSErrorerrorWithDomain:NSCocoaErrorDomaincode:NSFileWriteUnknownErroruserInfo:@{NSLocalizedDescriptionKey:[NSStringstringWithFormat:@"Failed to create patch because '%@' cannot be a symbolic link.",destinationParentDirectory]}];
}
*stop=YES;
return;
}
}
}
// Don't use -[NSFileManager fileExistsAtPath:] because it will follow symbolic links
// Files that have no property set that we check for will get ignored
// This is important because they aren't part of the delta, just part of the directory structure
SPUDeltaItemCommandscommands=item.commands;
if((commands&SPUDeltaItemCommandDelete)!=0){
if(!removeTree(destinationFilePath)){
if(verbose){
fprintf(stderr,"\n");
}
if(error!=NULL){
*error=[NSErrorerrorWithDomain:NSCocoaErrorDomaincode:NSFileWriteUnknownErroruserInfo:@{NSLocalizedDescriptionKey:[NSStringstringWithFormat:@"delete: failed to remove %@",destination]}];
*error=[NSErrorerrorWithDomain:NSCocoaErrorDomaincode:NSFileWriteUnknownErroruserInfo:@{NSLocalizedDescriptionKey:[NSStringstringWithFormat:@"Unable to extract diffed file to %@",tempDiffFile],NSUnderlyingErrorKey:(NSError*_Nonnull)archive.error}];
*error=[NSErrorerrorWithDomain:NSCocoaErrorDomaincode:NSFileWriteUnknownErroruserInfo:@{NSLocalizedDescriptionKey:[NSStringstringWithFormat:@"Unable to patch %@ to destination %@",sourceFilePath,destinationFilePath]}];
*error=[NSErrorerrorWithDomain:NSCocoaErrorDomaincode:NSFileWriteUnknownErroruserInfo:@{NSLocalizedDescriptionKey:[NSStringstringWithFormat:@"Unable to retrieve stat info from %@",sourceFilePath]}];
*error=[NSErrorerrorWithDomain:NSCocoaErrorDomaincode:NSFileWriteNoPermissionErroruserInfo:@{NSLocalizedDescriptionKey:[NSStringstringWithFormat:@"Unable to modify permissions (%u) on file %@",sourceFileInfo.st_mode,destinationFilePath]}];
}elseif((commands&SPUDeltaItemCommandExtract)!=0){// extract and permission modifications don't coexist
item.itemFilePath=destinationFilePath;
if(![archiveextractItem:item]){
if(verbose){
fprintf(stderr,"\n");
}
if(error!=NULL){
*error=[NSErrorerrorWithDomain:NSCocoaErrorDomaincode:NSFileWriteUnknownErroruserInfo:@{NSLocalizedDescriptionKey:[NSStringstringWithFormat:@"Unable to extract file to %@",destinationFilePath],NSUnderlyingErrorKey:(NSError*_Nonnull)archive.error}];
*error=[NSErrorerrorWithDomain:NSCocoaErrorDomaincode:NSFileWriteNoPermissionErroruserInfo:@{NSLocalizedDescriptionKey:[NSStringstringWithFormat:@"Unable to modify permissions (%u) on file %@",mode,destinationFilePath]}];
*error=[NSErrorerrorWithDomain:NSCocoaErrorDomaincode:NSFileReadUnknownErroruserInfo:@{NSLocalizedDescriptionKey:[NSStringstringWithFormat:@"Unable to calculate hash of tree %@",finalDestination]}];
// Additional compression methods for version 3 patches that we have for debugging are zlib, bzip2, none
#define COMPRESSION_METHOD_ARGUMENT_DESCRIPTION @"The compression method to use for generating delta updates. Supported methods for version 3 delta files are 'lzma' (best compression, slowest), 'lzfse' (good compression, fast), 'lz4' (worse compression, fastest), and 'default'. Note that version 2 delta files only support 'bzip2', and 'default' so other methods will be ignored if version 2 files are being generated. The 'default' compression for version 3 delta files is currently lzma."
//#define COMPRESSION_LEVEL_ARGUMENT_DESCRIPTION @"The compression level to use for generating delta updates. This only applies if the compression method used is bzip2 which accepts values from 1 - 9. A special value of 0 will use the default compression level."
*error=[NSErrorerrorWithDomain:SUSparkleErrorDomaincode:SUInsufficientSigningErroruserInfo:@{NSLocalizedDescriptionKey:[NSStringstringWithFormat:@"Bundle is not code signed: %@",newBundleURL]}];
NSString*message=@"The host app is signed, but the new version of the app is not signed using Apple Code Signing. Please ensure that the new app is signed and that archiving did not corrupt the signature.";
initialMessage=[NSStringstringWithFormat:@"Code signature of the new version doesn't match the old version: %@. Please ensure that old and new app is signed using exactly the same certificate.",requirementString];
SULog(SULogLevelError,@"%@",initialMessage);
CFRelease(requirementString);
}else{
initialMessage=@"Code signature of new version doesn't match the old version. Please ensure that old and new app is signed using exactly the same certificate.";
SULog(SULogLevelError,@"Failed to get static code %d",result);
if(error!=NULL){
*error=[NSErrorerrorWithDomain:SUSparkleErrorDomaincode:SUInsufficientSigningErroruserInfo:@{NSLocalizedDescriptionKey:[NSStringstringWithFormat:@"Failed to get static code for verifying code signature: %d",result]}];
}
gotofinally;
}
// See in -codeSignatureIsValidAtBundleURL:andMatchesSignatureAtBundleURL:error: for why kSecCSCheckNestedCode is not always passed
[notifiernotifyFailureWithError:[NSErrorerrorWithDomain:SUSparkleErrorDomaincode:SUUnarchivingErroruserInfo:@{NSLocalizedDescriptionKey:[NSStringstringWithFormat:@"Flat package does not have guided installation type but %@ instead",_expectedInstallationType]}]];
[notifiernotifyFailureWithError:[NSErrorerrorWithDomain:SUSparkleErrorDomaincode:SUUnarchivingErroruserInfo:@{NSLocalizedDescriptionKey:[NSStringstringWithFormat:@"Flat package does not exist at %@",_flatPackagePath]}]];
// Copyright 2010 Dragon Systems Software Limited. All rights reserved.
//
/*!
/**
# Sparkle Guided Installations
A guided installation allows Sparkle to download and install a package (pkg) or multi-package (mpkg) without user interaction.
@@ -14,20 +14,17 @@ A guided installation allows Sparkle to download and install a package (pkg) or
The installer package is installed using macOS's built-in command line installer, `/usr/sbin/installer`. No installation interface is shown to the user.
A guided installation can be started by applications other than the application being replaced. This is particularly useful where helper applications or agents are used.
## To Do
- Replace the use of `AuthorizationExecuteWithPrivilegesAndWait`. This method remains because it is well supported and tested. Ideally a helper tool or XPC would be used.
*error=[NSErrorerrorWithDomain:SUSparkleErrorDomaincode:SUInstallationErroruserInfo:@{NSLocalizedDescriptionKey:[NSStringstringWithFormat:@"Guided package installer returned non-zero exit status (%d)",task.terminationStatus]}];
// If we have a normalized path, we'll install to "#{CFBundleName}.app", but only if that path doesn't already exist. If we're "Foo 4.2.app," and there's a "Foo.app" in this directory, we don't want to overwrite it! But if there's no "Foo.app," we'll take that name.
// Otherwise if there's no normalized path (the more likely case), we'll just use the host bundle's path
*error=[NSErrorerrorWithDomain:SUSparkleErrorDomaincode:SUInstallationErroruserInfo:@{NSLocalizedDescriptionKey:[NSStringstringWithFormat:@"Found guided package installer but '%@=%@' was probably missing in the appcast item enclosure",SUAppcastAttributeInstallationType,SPUInstallationTypeGuidedPackage]}];
*error=[NSErrorerrorWithDomain:SUSparkleErrorDomaincode:SUInstallationErroruserInfo:@{NSLocalizedDescriptionKey:[NSStringstringWithFormat:@"Found package installer but '%@=%@' was probably missing in the appcast item enclosure",SUAppcastAttributeInstallationType,SPUInstallationTypeInteractivePackage]}];
*error=[NSErrorerrorWithDomain:SUSparkleErrorDomaincode:SUInstallationErroruserInfo:@{NSLocalizedDescriptionKey:[NSStringstringWithFormat:@"Found regular application update but expected '%@=%@' from the appcast item enclosure instead",SUAppcastAttributeInstallationType,expectedInstallationType]}];
// If we have a normalized path, we'll install to "#{CFBundleName}.app", but only if that path doesn't already exist. If we're "Foo 4.2.app," and there's a "Foo.app" in this directory, we don't want to overwrite it! But if there's no "Foo.app," we'll take that name.
// Otherwise if there's no normalized path (the more likely case), we'll just use the host bundle's path
// Check progress agent app which computes normalized path too according to these rules
NSError*error=[NSErrorerrorWithDomain:SUSparkleErrorDomaincode:SUUnarchivingErroruserInfo:@{NSLocalizedDescriptionKey:[NSStringstringWithFormat:@"Extraction failed, command '%@' returned %d",command,[taskterminationStatus]]}];
[notifiernotifyFailureWithError:error];
return;
}
if(bytesWritten!=expectedLength){
NSError*error=[NSErrorerrorWithDomain:SUSparkleErrorDomaincode:SUUnarchivingErroruserInfo:@{NSLocalizedDescriptionKey:[NSStringstringWithFormat:@"Extraction failed, command '%@' got only %ld of %ld bytes",command,(long)bytesWritten,(long)expectedLength]}];
SULog(SULogLevelError,@"Failed to perform installation because either installation URL (%@) or new URL (%@) is nil",installationURL,newURL);
if(error!=NULL){
*error=[NSErrorerrorWithDomain:SUSparkleErrorDomaincode:SUInstallationErroruserInfo:@{NSLocalizedDescriptionKey:@"Failed to perform installation because the paths to install at and from are not valid"}];
NSMutableDictionary*userInfo=[NSMutableDictionarydictionaryWithDictionary:@{NSLocalizedDescriptionKey:@"Failed to recursively update new application's modification time before moving into temporary directory"}];
SULog(SULogLevelError,@"Failed to construct URL from bundle path: %@",host.bundlePath);
if(error!=NULL){
*error=[NSErrorerrorWithDomain:SUSparkleErrorDomaincode:SUInstallationErroruserInfo:@{NSLocalizedDescriptionKey:@"Failed to perform installation because a path could not be constructed for the old installation"}];
}
returnNO;
}
if(progress){
progress(2/10.0);
}
// Create a temporary directory for our new app that resides on our destination's volume
// We use oldURL here instead of installationURL because in the case of normalization, installationURL may not exist
// And we don't want to use either of the URL's parent directories because the parent directory could be on a different volume
NSMutableDictionary*userInfo=[NSMutableDictionarydictionaryWithDictionary:@{NSLocalizedDescriptionKey:[NSStringstringWithFormat:@"Failed to move the new app from %@ to its temp directory at %@",newURL.path,newTempURL.path]}];
SULog(SULogLevelError,@"Failed to retrieve last path component from old URL: %@",oldURL.path);
if(error!=NULL){
*error=[NSErrorerrorWithDomain:SUSparkleErrorDomaincode:SUInstallationErroruserInfo:@{NSLocalizedDescriptionKey:@"Failed to perform installation because the last path component of the old installation URL could not be constructed."}];
NSMutableDictionary*userInfo=[NSMutableDictionarydictionaryWithDictionary:@{NSLocalizedDescriptionKey:[NSStringstringWithFormat:@"Failed to move the old app at %@ to a temporary location at %@",oldURL.path,oldTempURL.path]}];
NSMutableDictionary*userInfo=[NSMutableDictionarydictionaryWithDictionary:@{NSLocalizedDescriptionKey:[NSStringstringWithFormat:@"Failed to move new app at %@ to final destination %@",newTempURL.path,installationURL.path]}];
NSString*errorMessage=[NSStringstringWithFormat:@"For security reasons, updates that downgrade version of the application are not allowed. Refusing to downgrade app from version %@ to %@. Aborting update.",hostVersion,updateVersion];
*error=[NSErrorerrorWithDomain:SUSparkleErrorDomaincode:SUValidationErroruserInfo:@{NSLocalizedDescriptionKey:@"Failed to create SUSignatureVerifier instance"}];
*error=[NSErrorerrorWithDomain:SUSparkleErrorDomaincode:SUValidationErroruserInfo:@{NSLocalizedDescriptionKey:@"Path passed to verify has zero length and is not valid"}];
}
returnNO;
}
if(!signatures){
if(error!=NULL){
*error=[NSErrorerrorWithDomain:SUSparkleErrorDomaincode:SUValidationErroruserInfo:@{NSLocalizedDescriptionKey:@"No signatures given to verifyFileAtPath"}];
NSString*message=@"EdDSA signature does not match. Data of the update file being checked is different than data that has been signed, or the public key and the private key are not from the same set.";
// We don't keep track of DSA signatures, so we will ignore this mistake and treat it as if it were absent
break;
caseSUSigningInputStatusPresent:
if(error!=NULL){
*error=[NSErrorerrorWithDomain:SUSparkleErrorDomaincode:SUValidationErroruserInfo:@{NSLocalizedDescriptionKey:@"The old app has a DSA public key but DSA support is disabled, and the old app does not have an EdDSA public key."}];
}
returnNO;
}
#endif
if(error!=NULL){
// Use generic failure
*error=[NSErrorerrorWithDomain:SUSparkleErrorDomaincode:SUValidationErroruserInfo:@{NSLocalizedDescriptionKey:@"EdDSA and DSA verification for the update has failed"}];
SULog(SULogLevelError,@"Invalid arguments to verifyStream");
if(outError!=NULL){
*outError=[NSErrorerrorWithDomain:SUSparkleErrorDomaincode:SUValidationErroruserInfo:@{NSLocalizedDescriptionKey:@"Invalid arguments to verifyStream"}];
}
returnNO;
}
SecKeyRefdsaPubKeySecKey=[selfdsaSecKeyRef];
if(!dsaPubKeySecKey){
if(outError!=NULL){
*outError=[NSErrorerrorWithDomain:SUSparkleErrorDomaincode:SUValidationErroruserInfo:@{NSLocalizedDescriptionKey:@"Failed to create DSA Sec Key Ref"}];
*outError=[NSErrorerrorWithDomain:SUSparkleErrorDomaincode:SUValidationErroruserInfo:@{NSLocalizedDescriptionKey:@"File containing update archive could not be read (failed to create SecTransform for input stream)"}];
*outError=[NSErrorerrorWithDomain:SUSparkleErrorDomaincode:SUValidationErroruserInfo:@{NSLocalizedDescriptionKey:@"File containing update archive could not be read (failed to create SecDigest for input stream)"}];
*outError=[NSErrorerrorWithDomain:SUSparkleErrorDomaincode:SUValidationErroruserInfo:@{NSLocalizedDescriptionKey:@"Failed to connect data read transform",NSUnderlyingErrorKey:(__bridgeNSError*)error}];
*outError=[NSErrorerrorWithDomain:SUSparkleErrorDomaincode:SUValidationErroruserInfo:@{NSLocalizedDescriptionKey:@"Failed to connect data digest transform",NSUnderlyingErrorKey:(__bridgeNSError*)error}];
*outError=[NSErrorerrorWithDomain:SUSparkleErrorDomaincode:SUValidationErroruserInfo:@{NSLocalizedDescriptionKey:@"DSA signature does not match. Data of the update file being checked is different than data that has been signed, or the public key and the private key are not from the same set"}];
NSMutableDictionary*userInfo=[NSMutableDictionarydictionaryWithObject:SULocalizedString(@"An error occurred while extracting the archive. Please try again later.",nil)forKey:NSLocalizedDescriptionKey];
NSMutableDictionary*userInfo=[NSMutableDictionarydictionaryWithObject:@"An error occurred while extracting the archive. Please try again later."forKey:NSLocalizedDescriptionKey];
@Option(name:.long,help:ArgumentHelp("The major version of the patch to generate. Defaults to the latest stable version. Older versions will need to be specified for updating from applications using older versions of Sparkle.",valueName:"version"))
fputs(" with level \(header.compressionLevel)",stdout)
}
}
fputs("\n",stdout)
}else{
fputs("Error: Failed to retrieve header due to unknown reason.\n",stderr)
throwExitCode(1)
}
}else{
//Printversionofprogram
fputs("BinaryDelta version \(SUBinaryDeltaMajorVersionLatest.rawValue).\(latestMinorVersionForMajorVersion(SUBinaryDeltaMajorVersionLatest))\n",stdout)
}
}
}
structBinaryDelta:ParsableCommand{
staticletconfiguration=CommandConfiguration(commandName:"BinaryDelta",abstract:"Create and apply small and efficient delta patches between an old and new version of a bundle.",subcommands:[Create.self,Apply.self,Info.self])
* Deprecate `-[SPUUpdater setFeedURL:]` API and add `-[SPUUpdater clearFeedURLFromUserDefaults]` for migrating away from `-[SPUUpdater setFeedURL:]` (#2295)
* Trigger a new update check in `-[SPUUpdater resetUpdateCycle]` if the updater's feed or allowed channels have changed (#2324) (Zorg)
* Exit with an error if generate_appcast cannot sign an update that must be signed (#2322) (Zorg)
* Remove a redundant Apple code signing check when verifying new updates (#2341) (Zorg)
* Turn off auto-linking for XPC targets to alleviate circular dependency issues (#2332) (Daniel Jalkut)
# 2.3.2
* Fix potential crash during download if appcast item includes invalid enclosure URL (#2317) (Zorg)
* Add delegate method to hide showing version history option (#2303) (Zorg)
* Fix update permission alert title text overlapping with question text in some languages (#2284) (Zorg)
* Log the URL that failed to download correctly (#2296) (Zorg)
* Update Czech translation (#2275) (Sam)
* Add zh_HK (Chinese, Hong Kong) localization (#2273) (Bing Zheung)
# 2.3.0
* Bump minimum deployment target to macOS 10.13 (#2196) (Zorg)
* Remove and preserve necessary updates in generate_appcast (#2218) (Zorg)
* Move old update files no longer needed to old_updates/ in archive directory in generate_appcast (#2228) (Zorg)
* Expose maximum-versions option (per branch) in generate_appcast to preserve in the feed (#2259) (Zorg)
* Add -p option to sign_update to only print the signed signature (#2268) (Zorg)
* Hide automatic install check box when allowsAutomaticUpdates is disabled (#2202) (Jie)
* Allow developer to always force allowing automatic updates (#2266) (Zorg)
* Fix update window going haywire during resize when release notes are hidden by disabling resizing (#2200) (Zorg)
* Allow user to re-try installing/relaunching application when quit is delayed/cancelled (#2234) (Zorg)
* Add delta update attributes for validating an app hasn't been stripped from removed localizations or architectures (#2219) (Zorg)
* Fix delta patches not applying edge case if files from source that need to be diffed are not writeable (#2211) (Zorg)
* Add delegate callback when user makes choice to install, dismiss, or skip an update (#2250) (Zorg)
* Reject serving updates with DSA only and no EdDSA (#2167) (Zorg)
* Find potential matching running apps that are translocated in the updater agent (#2233) (Zorg)
* Expose -[SPUStandardUserDriver activeUpdateAlert] as private API (#2255) (Zorg)
* Add zh_CN l10n for "Version History" (#2247) (kakaiikaka)
* Update zh_TW localization (#2271) (Chiahong)
* Remove ed25519 git submodule in favor of including the dependency directly (#2244) (Zorg)
* Clean up left-over code (#2243) (Eitot)
* Update Package.resolved (#2245) (Zorg)
* Remove model translation table for system profiling (#2188) (Zorg)
* Improve documentation usage for SPUUpdater properties (#2256) (Zorg)
This release improves generate_appcast by automatically removing updates that are no longer needed in the generated appcast, and moving old update files to old_updates/ in the archives directory. New delta update attributes are also added to let Sparkle know when to skip downloading delta updates if the application has been stripped.
macOS 10.13 or later is now required (due to Xcode 14 dropping support for deploying to older OS versions).
If you're not generating appcasts automatically, remember to add `<sparkle:minimumSystemVersion>10.13</sparkle:minimumSystemVersion>` element to `<item>`s in your appcast.
# 2.2.2
* Critical update alerts may not show up as promptly as they should when they are being automatically installed (#2230) (Zorg)
* Remove module imports from framework headers (#2217) (Zorg)
* Make scroll bar dark in dark theme for Release Notes by default (#2187) (Pavel Moiseenko)
* Fix memory leaks when using generate_appcast (#2193) (Zorg)
* Update Italian localization (#2192) (VinBoiSoft)
# 2.2.0
* Update Focus Improvements (#924)
* Present new scheduled updates in utmost focus only at opportune times (Zorg)
* For regular apps opportune times are: app launch, app re-activation, and system being idle (without a power assertion being held to prevent display sleep).
* For background (dockless) apps opportune time is just app launch. Otherwise, the update is now shown behind other applications and windows, instead of previously stealing focus from other active apps.
* Add APIs and documentation for adding gentle update reminders to compliment Sparkle's standard user interface (Zorg) (#2122)
* Allow status window to be minimizable for regular app installs (Zorg) (#2100)
* Center status window and inherit key focus from the previously shown update alert window (Zorg)
* Activate app when checking for updates if the app is not currently active (e.g, from a menu bar extra menu item) (Zorg)
* Fix issue where bringing status window to front made other active windows exit in macOS Ventura's Stage Manager (#2153) (Zorg)
* Fix showing update in focus not bringing the "checking for updates" window in focus (Zorg) (#2150)
* Rename XPC Service filenames for Sandboxing to show more friendly human-readable name in authorization dialog (Zorg) (#2096)
* Add support for running the framework and sparkle-cli as root (Zorg) (#2119)
* Fix issue where update cycle may not complete in unusual configuration if automatic checks are disabled + automatic downloading is enabled + install requires user interaction (Zorg) (#2133)
* Synchronize usage of XPC connections to main queue to fix potential race conditions (Zorg) (#2178)
* Update last update check time when choosing to install an update & relaunch (Zorg) (#2136)
* Improve error reporting in the framework and sparkle-cli when installation fails with no write permission (Zorg) (#2157)
* Use displayVersionString instead of versionString for OS version mismatch error message (samschott) (#2138)
* Make displayVersionString non-null and update fallback documentation (Zorg) (#2139)
* Ignore custom icons set via resource forks when applying delta updates (Zorg) (#2114)
* Fall back to regular update if delta update fails to download (Zorg) (#2118)
* Skip downloading delta updates when application has been moved to a file system (like FAT) that doesn't support regular permission modes (Zorg) (#2148)
* Bump initial installer message timeouts and declare daemon/agents processes as Interactive (Zorg) (#2162)
* Add and improve translation strings and update pt-BR (BR Lingo) (#2094)
* Deprecate -s flag and add --ed-key-file option to generate_appcast (Zorg) (#2170)
* Update text for external licenses (Zorg) (#2164)
This update renames the bundled XPC Services, brings improvements to notifying users of new updates without disrupting their focus, and adds [gentle update reminder APIs](https://sparkle-project.org/documentation/gentle-reminders/) to further customize how Sparkle's standard user interface delivers new update alerts.
The `-s` flag for passing a raw private EdDSA key to sign_update and generate_appcast is now deprecated. If you were using this option previously, please see the help pages of these tools for more information.
# 2.1.0
* New Binary Delta format (version 3)
* Features a custom and more efficient container format, migrating away from the deprecated xar format (Zorg) (#2051)
* Adds delta compression options for lzma, bzip2, zlib, lzfse, lz4, and no compression (Zorg) (#2051)
* Changes default delta format compression from bzip2 (in version 2) to lzma (in version 3) resulting in smaller deltas (Zorg) (#2051)
* Preserve file system (HFS+/apfs) level compression when applying delta updates (Zorg) (#2084)
* Tracks renames and binary diffs for files that have moved around to new locations using intelligent heuristics (Zorg) (#2051, #2053)
* Added more unit tests, UI tests, and generate_appcast/BinaryDelta tools support for the new format (Zorg) (#2052, #2054)
* Major upgrade improvements (#2070)
* Fix skipping a major version to not skip subsequent major versions (Zorg) (#2079)
* Add sparkle:belowVersion element for informational updates (Zorg) (#2080)
* Add option to allow developers to ignore/reset user skipped upgrades (Zorg) (#2081)
* Fix progress bar and button alignment for checking updates (Zorg) (#2066)
* This deprecates `-[SPUUserDriver showInstallingUpdate]` and `-[SPUUserDriver showSendingTerminationSignal]` in favor for `-[SPUUserDriver showInstallingUpdateWithApplicationTerminated:]`
* Fix unsteady progress when installing updates (Zorg) (#2072)
* Use strcoll_l() for locale-independent comparisons for delta updates (Dan Rigdon-Bel) (#2087)
* Fix version compare not treating '2.1.0' and '2.1' as being equal (Zorg) (#2065)
* Add verify and account options for signing updates (Zorg) (#2074)
* Add delta patch and Apple code signing verification in generate_appcast (Zorg) (#2076, #2077)
* Use more modern NSSecureCoding APIs when available (Zorg) (#2058)
* Use more modern FileManager APIs for copying files (Zorg) (#2059)
* Fix make release failing when customizing XPC_SERVICE_BUNDLE_ID_PREFIX (Zorg) (#2060)
* Preserve the Entitlements directory in podspec (digitalMoksha) (#2062)
* Add hidden option to generate_appcast to set max CDATA threshold (Zorg) (#2075)
This update introduces a new major format for [delta updates](https://sparkle-project.org/documentation/delta-updates/), which migrates away from deprecated APIs (xar) and creates smaller patches. If you don't use `generate_appcast`, please check the [compatibility notes for creating delta updates](https://sparkle-project.org/documentation/delta-updates/#compatibility).
# 2.0.0
* Support for Sandboxed Applications (Zorg)
* Support for writing custom user interfaces (Zorg)
* Support for updating external Sparkle-based bundles (Zorg)
* Added command line utility to update Sparkle-based bundles (Zorg)
* Modern architecture
* Moves extraction, validation, and installation into a submitted launchd agent/daemon with XPC communication (Zorg)
* Features faster installs with shorter update/relaunch times (#1802) (Zorg)
* Provides more robust installs when user authorization is needed (Zorg)
* Adoption of improved atomic-safe updates leveraging APFS (#1801) (Zorg)
* API Changes
* Introduced new SPUStandardUpdaterController, SPUUpdater, SPUUserDriver classes/protocols (Zorg)
* Decoupled AppKit and UI logic in the framework from core functionality (Zorg)
* Ensure (most) API compatibility with Sparkle 1; you can likely test Sparkle 2 in an existing app with little to no changes (Zorg)
* Deprecated SUUpdater, albeit it is still functional for testing and transitional purposes (Zorg)
* `-bestValidUpdateInAppcast:forUpdater:` delegate method behavior has been refined and discouraged for some cases. Please review its updated header documentation in `SPUUpdaterDelegate.h` if you use this method. (#1838, #1862, #1879, #1880) (Zorg)
* Delegation methods may have been removed or added to the newer updater API. Please review `SPUUpdaterDelegate` if using `SPUUpdater`. (Zorg)
* Updater Changes
* Automatic silent and manual update alert prompts are now merged together (Zorg)
* Updates will attempt to install even if the user quits the application without relaunching the application update explicitly (Zorg)
* Updates can be downloaded in the background automatically but later prompt the user to install them, particularly if Sparkle doesn't have sufficient permission to install them without the user's permission (Zorg)
* Authorization now occurs before launching the installer and before terminating the application, which can be canceled by the user cleanly (Zorg)
* Sparkle uses the icon of the bundle to update for its authorization dialog. A 32x32 image representation of the icon is needed. (Zorg)
* Non-bare package based updates that are zipped or archived must add sparkle:installationType="package" to the appcast item enclosure (this doesn't apply to bare packages which aren't archived) (Zorg)
* We now recommend using sparkle:version and sparkle:shortVersionString top level elements instead of enclosure attributes (#1878) (Zorg)
* The link element in an appcast item is now used for directing users to the product's website if they don't meet minimum system requirements (#1877) (Zorg)
* Expose why a new update is unavailable and direct user to prior release notes or website info (#1877, #1886) (Zorg)
* Add <sparkle:fullReleaseNotesLink> element allowing Sparkle to show a better stylized and full changelog to the user (#2001) (aONe)
* Add delegate API allowing applications to show full in-app or offline version history to the user (#1989) (Billy Gray)
* Major/Paid Upgrades Enhancements
* Latest minor updates are preferred over major updates (specified by sparkle:minimumAutoupdateVersion) (#1850) (Zorg)
* Major updates can be skipped with a user confirmation (#1853) (Zorg)
* Informational only and critical updates can be specified selectively by app version (#1862)
* Add support for posting updates only on specific channels (eg for supporting beta updates) (#1879) (Zorg)
* System profiler privacy and transparency (#1690) (Martin Pilkington)
* Support getting app icon from asset catalog (#1694) (Charles Srstka)
* Don't bring up authorization just because group ID doesn't match (#1830) (Zorg)
* Raise minimum system version to macOS 10.11 (Zorg)
* Special thanks to developers using early builds of this release in production and contributors for keeping this running (Kornel, Jonas Zaugg, Gwynne Raskind, Jordan Rose, Tony Arnold, Bryan Jones, Christian Tietze, Jakob Egger, and many more)
Please visit [Sparkle's website](http://sparkle-project.org) for more information on documentation and migration.
If you are migrating from earlier beta versions of Sparkle 2 and use sandboxing, please re-familiarize yourself with the [Sandboxing guide](https://sparkle-project.org/documentation/sandboxing/). Some of the XPC Services are now optional and integration with XPC Services and code signing have been simplified. The SPUUserDriver protocol for custom user interfaces has been greatly simplified too.
# 1.27.1
* Use px instead of pt when specifying font size to fix default font size in WebView from #1962 (regressed in 1.25.0 with WKWebView adoption) (Daniel Jalkut)
* Fix to prevent Sparkle manipulating the host app's high level WebView defaults from #1961 (affecting only macOS versions before 10.11 in 1.x branch) (Daniel Jalkut)
* Add safer handling of applying binary delta files from #1990 (Zorg)
* Don't use current date unless necessary when scheduling next update from #1991 (Zorg)
* Whitelist about:srcdoc as a safe web URL from #1938, #2007 (Louis Pontoise, Zorg)
* Backport not hiding update window on deactivation from #2008 (Zorg)
# 1.27.0
* Deprecate not using EdDSA and skip DSA verification when possible in #1892 (Zorg)
* Pass http headers and user agent when downloading release notes from #1873 (Zorg)
* Fix project warnings from #1893 (Zorg)
* Update sample appcast from #1895 (Zorg)
* Fix appcast pubDate tag generation in different locales from #1898 (Sungbin Jo)
* Create valid xar archives for generating binary delta files from #1906 (Zorg)
* Fix a few issues with German localization from #1931 (J-rg)
* Fix issues with Russian localizations from #1947 (Konstantin Zamyakin)
* Fix issues with Czech localizations from #1943 (Vojtěch Koňařík)
* Add an automated workflow that builds and publishes official Sparkle releases (Tony Arnold, Zorg)
# 1.26.0
* Flat package support from #1745 (Zorg)
* Correct generate_appcast -s command line argument usage help (Lance Lovette)
* Fix -f command line argument handling (Lance Lovette)
* Fix progress for guided pkg install (Zorg)
* Fix XQuartz update failing because NSLog caused issues (Zorg)
* Update localization (Vojtěch Koňařík)
* Various fixes to SPM logic (Jonas Zaugg)
# 1.25.0
* Raise minimum system version to 10.9 (Kornel)
* Allow an appcast to prevent the new version from being installed automatically (#1688) (pierswalter)
* UI fixes
* Show check for updates button only when automatic updates are enabled (Lorena Rangel)
* Don't initialize the webview if we don't show release notes (Tobias Fonfara)
* Keep skip button available if there is a minimum autoupdate version (Zorg)
* Fix automatic updates checkbox state when not showing release notes (Zorg)
* Fix edge cases with hiding alert buttons and using "Install Later" (Zorg)
* Re-add setting WebUIDelegate fix for legacy web view (Zorg)
* Adopt WKWebView for 1.x (Zorg)
* Add auto layout constraints to SUAutomaticUpdateAlert window (Zorg)
* Made buttons wide enough to display the full text. Made window wide enough to display the widened buttons (el, fi, ru, uk) (Piers Uso Walter)
* Remove max size from update alert. (George Nachman)
* Integrate generate_keys export/import options changes from #1730 (Zorg)
* Add `—release-notes-url-prefix` support to localized release notes (Adam Tharani)
* Translations
* Enable base internalization for alert xibs (Zorg)
* Capitalizes french translation of "Vous utilisez actuellement..." ("You are currently running...") (Micah Moore)
* Fix and cleanup Hebrew, Catalan, Finnish localizations (Zorg)
* Remove non-english localizations from TestApplication (Zorg)
* Fix catch-22 Swift Package Manager binary target (Jonas Zaugg)
* Add explicit dependencies to fix Xcode linking errors (Kornel)
* Add phased rollouts feature to automatic update driver too (Zorg)
* Remove hiding skip button and retitling later button (Zorg)
* Deprecate installUpdatesIfAvailable (Zorg)
* Apply custom headers to app download (Geraint White)
# 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)
* 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)
* Add delegate callbacks for fininshed download and extraction related events (Csaba Horony)
* Don't check for updates if Do Not Disturb is on (Kornel)
* Expose `CodesigningVerifier`, add codesign info API (sunuslee)
* Threading fixes:
* Fix potential hang with `dispatch_sync` to main thread (Brian Bergstrand)
* Fix closeCheckingWindow called from background thread (Alexey Martemyanov)
* Updated Finnish language resources (Jason Pollack)
* Hungarian localization (Csaba Horony)
* Log more information about authentication requests (Kornel)
* Explicitly specify types to silence "Messaging unqualified id" warning that's new in Xcode 10. Removed __has_feature(objc_generics) check and use generisc to help silence the warnings. (Kent Sutherland)
* Fix binary delta creation on network drives (sagecook)
* Fix compilation issues on Xcode 10 with new build system (Leo Natan)
# 1.19.0
* Refactoring of downloader code to avoid deprecated methods (Deadpikle)
* Changes to which methods run on the main thread.
Note: some delegate methods may be called on non-main thread now. (Kornel)
* Update Japanese localization (1024jp)
* Update Sparkle.strings (Stefan Paychère)
* Fix Sparkle clients polling too frequently (Jonathan Bullard)
* Handle SecTransformExecute errors (Kornel)
* Silence Touch Bar availability warnings on Xcode 9 by using API_AVAILABLE. Disable gnu-zero-variadic-macro-arguments to prevent warnings from use of API_AVAILABLE. (Kent Sutherland)
* 10.11 SDK compatibility (David Fuhrmann)
# 1.18.1
* Add optional updaterDidRelaunchApplication: method on SUUpdaterDelegate (#1115) (App Tyrant)
* Implemented sparkle:os attribute as documented (Memphiz)
* Additional termination detection in case kpoll fails. (fujisoft)
* Included bin files in CocoaPods installation (Keith Smiley)
* Updated Dutch localization (Eitot)
* Updated German localization (Eitot)
* Updated Japanese translation (1024jp)
* Updated Portuguese translation (Victor)
* Updated to Xcode 9/Swift 4
# 1.18.0
* Name of the host app is used in authorization prompt (the `SPARKLE_RELAUNCH_TOOL_NAME` setting is now obsolete)
* More detailed progress bar for package installers (Kornel Lesiński)
* Disabled the keyboard shortcut for the install button for scheduled updates to avoid accidental installs. (George Nachman)
* generate_appcast tool adds release notes if there's an .html file with the same base name as the archive (Brett Walker)
* Added `sparkle:shortVersionString` to the enclosure, #1032 (Brett Walker)
* Fixed Japanese localization (1024jp)
* Fixed escaping of system profile URLs
* Added more logging in various failure cases (Kornel Lesiński)
* Better error message for quarantined apps that can't be updated
Loaded 100 of 797 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.