Commit Graph
112 Commits
Author SHA1 Message Date
Zorg 3a99b31f37 Add plain-text embedded release notes support for sparkle-cli (#2344) 2023-03-18 22:20:30 -07:00
Zorg be7f6952c2 Reduce code size and make codebase more consistent (#2305) 2022-12-27 12:03:03 -08:00
Zorg f5d4ad52ca Allow user to re-try installing/relaunching application (#2234)
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.
2022-08-21 08:54:03 -07:00
Zorg d2fd9a50e0 Use recovery suggestion key for update permission error (#2180) 2022-06-26 18:41:55 -07:00
Zorg 5343305e3f Report friendly error if installation fails with no write permission (#2157)
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.
2022-06-12 18:50:40 -07:00
Zorg 339e26984e Add support for running framework and CLI as root (#2119)
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.
2022-05-07 09:33:27 -04:00
Zorg fa9bfc1fc4 Fix unsteady progress when installing updates (#2072)
Also add -showInstallingUpdateWithApplicationTerminated: to SPUUserDriver which replaces -showInstallingUpdate and -showSendingTerminationSignal
2022-01-22 12:07:45 -08:00
Zorg 18fe269949 Update issue templates and minor capitalization issue (#2024) 2021-11-15 18:36:53 -08:00
Zorg 3fcc87086c Use user agent of updater bundle instead of the host bundle (#2020) 2021-11-12 21:09:31 -08:00
Mayur Pawashe cce5edd78d Remove installer interaction delegate API / refactor finishing update cycle (#1925) 2021-09-02 23:12:26 -07:00
Tony Arnold ee679586cf Add a workflow that builds and publishes a release via GitHub Actions (#1908)
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
2021-08-26 22:42:38 -07:00
Mayur Pawashe c6f1cd4e3c Improve API header docs (#1918)
* 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
2021-08-21 11:24:23 -07:00
Mayur Pawashe ac1bb7036c Make installing major upgrades opt-in (#1881) 2021-07-04 08:58:26 -07:00
Zorg 78a66c7dda Add channels support to sparkle-cli 2021-06-27 22:40:16 -07:00
Zorg 29e7ad4495 Merge branch '2.x' into selective-critical 2021-06-12 22:33:21 -07:00
Zorg 9fd2e72913 Fix missing implementation method in sparkle-cli 2021-06-06 19:38:00 -07:00
Zorg eda1b4bdaa Remove SparkleCore target and use <> imports
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.
2021-06-06 18:38:49 -07:00
Zorg 88f678ebe6 Remove SPUUserUpdateStageInformational 2021-05-31 11:24:32 -07:00
Zorg 90bdd84832 Move SPUUserUpdateChoice into its own header 2021-05-31 00:13:07 -07:00
Zorg d193f2e28b Pass majorUpdate information to user driver
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.
2021-05-09 22:42:42 -07:00
Mayur Pawashe 7247803fea Merge pull request #1831 from sparkle-project/deprecate-dismiss-check
Deprecate -dismissUserInitiatedUpdateCheck user driver method
2021-04-18 18:29:39 -07:00
Zorg ba11897345 Deprecate -dismissUserInitiatedUpdateCheck user driver method
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.
2021-04-17 22:21:22 -07:00
Zorg f58cc9e9b5 Merge branch '2.x' into show-update-focus 2021-04-17 16:25:36 -07:00
Zorg 188a893174 Rename new state back to not downloaded 2021-04-16 19:07:48 -07:00
Zorg ab9ffdb901 Rename SPUUserUpdateStateNotDownloaded to SPUUserUpdateStateNew
Update documentation too.

Fix test app trying to make installable update skippable.
2021-04-16 16:40:33 -07:00
Zorg e64253be0b Merge showUpdateFount: methods into single one
Handling the different variations with different completion blocks is a pain when ultimately clients want to display a mostly unified user interface.
2021-04-16 16:34:01 -07:00
Zorg 3593157e3d Merge branch '2.x' into show-update-focus 2021-04-16 12:04:05 -07:00
Zorg 2f783e01f0 Show the present update in focus when checkForUpdates is invoked
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).
2021-04-15 22:56:41 -07:00
Zorg ed89783a0e Merge branch '2.x' into user-driver-relaunch 2021-04-13 00:05:39 -07:00
Zorg 2d9bf07b18 Add new user driver methods to cancel update checks / downloads
Remove SPUUserDriverCoreComponent dependency from sparkle-cli and the Test App too, which really wasn't helping at all.
2021-04-11 23:15:02 -07:00
Zorg e909c0d988 Show alert that non-relaunched application was installed
This only applies when the updater outlives the application it is updating and the application is not relaunched (i.e, an external/remote updater).
2021-04-11 14:01:03 -07:00
Zorg 9b6e7ba828 Fix interactive flag being ignored in sparkle-cli 2021-04-04 16:57:37 -07:00
Zorg 2614af86ff Don't defer some of sparkle-cli delegate callbacks 2021-03-28 16:35:21 -07:00
Zorg f2986ef090 Start updater one runloop cycle later
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.
2021-03-28 13:21:20 -07:00
Zorg c5def52133 Update user driver methods for passing error to updates not found 2021-02-06 23:31:29 -08:00
Zorg 6308b262a0 Preserve showCanCheckForUpdates: method on user driver 2021-01-17 17:17:49 -08:00
Zorg 2066cd7232 Migrate canCheckForUpdates property from user driver -> updater 2021-01-17 17:01:48 -08:00
Zorg 3bc20cb096 Add noreturn attributes to command line user driver methods 2020-12-31 11:17:55 -08:00
Zorg 80cecd37b5 Fix compile error with missing '[' 2020-12-31 11:16:11 -08:00
Zorg 7951b81b69 Eliminate assumption that user driver calls are invoked in any thread
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.
2020-12-31 11:00:59 -08:00
Zorg d38fd92668 Use double quote includes in a bunch of other places I missed 2020-10-03 00:41:59 -07:00
Daniel Jalkut ee64dc7574 Update imports to use framework-style imports to avoid warnings when CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES. Add CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER to xcconfig file to protect against any changes that would introduce such warnings for clients who have the waring enabled. 2019-02-04 13:39:48 -05:00
Zorg af0a88dab3 Remove private _SULogDisableStandardErrorStream() function
When using ASL, don't log to stderr if a terminal is attached. This behavior closely matches os_log()
2017-01-05 23:09:58 -05:00
Zorg dca2114934 Add user driver method to show informational only updates
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.
2017-01-02 18:00:17 -05:00
Zorg 27a24a5413 Make sure downloader progress doesn't exceed expected max progress 2016-12-29 11:46:17 -05:00
Zorg e3f68b70bf Prefer using HTTP expected content length over appcast item length
Also use (u)int64_t instead of NS(U)Integer
2016-12-29 11:11:05 -05:00
Zorg e3a467b126 Rename update permission prompt & nib to use SU prefix 2016-12-27 10:06:41 -05:00
Zorg 17277b1f77 Merge updater delegate installer interaction allowed methods 2016-09-04 22:57:59 -04:00
Zorg cc38a3d7a6 Pass user initiated flag when update is found to the user driver
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.
2016-08-29 00:31:29 -04:00
Zorg 46a75cde97 Terminate application in the progress agent instead of user driver
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.
2016-08-25 23:46:42 -04:00