Commit Graph
66 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 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
Eitot 180f8975cf Replace deprecated code with newer APIs (#2112)
* 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
2022-04-24 16:51:48 -07: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 29e7ad4495 Merge branch '2.x' into selective-critical 2021-06-12 22:33:21 -07:00
Zorg cbd1503c06 Add configuration option to not build UI bits 2021-06-06 19:09:19 -07:00
Zorg 88f678ebe6 Remove SPUUserUpdateStageInformational 2021-05-31 11:24:32 -07:00
Zorg ee5e98d3dd Rename SPUUpdateState back to SPUUserUpdateState 2021-05-31 11:13:05 -07:00
Zorg b7f9b76dd9 Rename SPUUserUpdateState -> SPUUpdateState 2021-05-31 00:00:38 -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 cc4c02f467 Add showUpdateInFocus implementation to Test App user driver 2021-04-17 16:36:28 -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 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 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 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 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
Zorg a6a2da7a69 Add silent termination method to user driver
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.
2016-08-16 18:59:13 -04:00
Zorg 55e906ba3e Show or dismiss installation progress after sending termination request
Whether we show or dismiss progress depends on whether the current application (from the user driver) is being terminated or not.
2016-08-14 14:32:44 -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 5114cd9d83 Distinguish between application and host bundle in user drivers 2016-08-13 11:21:15 -04:00
Zorg d8ce7cb48b Add external releasenote support to popup titlebar user driver 2016-08-13 10:23:54 -04:00
Zorg 6dddbcc353 Add acknowledgement handler to installation did finish 2016-08-13 09:50:19 -04:00
Zorg f65f4beda8 Fix download progress for popup title user driver 2016-08-13 09:30:40 -04:00
Zorg 3c2875602e Add SPUUserDriverUIComponent and don't export SPUApplicationInfo 2016-08-13 09:19:48 -04:00
Zorg 92b94343f4 Remove delegate property from SPUStandardUserDriverProtocol
Also remove delegate from user driver core component and popup titlebar user driver.
2016-08-13 09:00:51 -04:00
Zorg b58773cb5e Allow popup titlebar user driver to update other bundles 2016-08-13 08:49:47 -04:00
Zorg 878c30d17c More SU -> SPU renaming for status completion results 2016-08-12 20:45:24 -04:00
Zorg f5afdc1cd8 Group download data, text encoding name, and MIME type into one class 2016-08-12 20:26:56 -04:00
Zorg a523621b71 Remove support for remotely using user driver from updater
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.
2016-08-12 18:48:54 -04:00
Zorg 65d78d5129 Pass text encoding and MIME type to user driver for release notes
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).
2016-08-10 22:11:19 -04:00
Zorg c9f673cda8 Use SPU prefix in many places 2016-08-05 19:10:21 -04:00
Zorg ec7766022d Add callback for showing downloaded updates that haven't started 2016-07-24 14:24:04 -04:00
Zorg 5c0ee2d74a Rename did finish downloaading callbacks to did start extracting 2016-07-24 13:29:03 -04:00
Zorg 9acfe7f180 Don't pass allowsAutomaticUpdates to user driver
Let the user driver read from updater settings to know if automatic updates are allowed
2016-06-28 00:28:21 -04:00