Commit Graph

27 Commits

Author SHA1 Message Date
Zorg be7f6952c2 Reduce code size and make codebase more consistent (#2305) 2022-12-27 12:03:03 -08: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 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
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 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 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 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 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 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
Zorg 27ea7ca2f5 Implement new allow installer interaction methods in sparkle-cli 2016-08-21 18:58:11 -04:00
Zorg 3547cb1239 Create SparkleCore target that only includes Core related files
Some build issues still need to be resolved.
2016-08-20 21:44:16 -04:00
Zorg 57325c7507 Add update permission request and response classes
We now pass these to and from the user driver.
2016-08-14 12:51:37 -04:00
Zorg 3f7c3933e7 Fix order of delegation events by dispatching async to main queue
This synchronizes more with the user driver handling events.
2016-08-14 00:55:17 -04:00
Zorg 32d9fd6526 Add flag for custom feed URL to sparkle-cli
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.
2016-08-13 20:55:11 -04:00
Zorg 4ec5652a0d Add callbacks for scheduled updates occurring after a delay and being idled
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.
2016-08-13 20:35:14 -04:00
Zorg 29d790c63c Pass application bundle into SPUUpdater instead of relying on delegate method 2016-08-13 12:57:26 -04:00
Zorg f18d410c6a Add SPUUpdaterDelegate and deprecate SUUpdaterDelegate 2016-08-12 23:02:23 -04:00
Zorg 085724322f Use id type for updater 2016-08-10 21:44:12 -04:00
Zorg c9f673cda8 Use SPU prefix in many places 2016-08-05 19:10:21 -04:00