71 Commits
Author SHA1 Message Date
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
Zorg 27ea7ca2f5 Implement new allow installer interaction methods in sparkle-cli 2016-08-21 18:58:11 -04:00
Zorg f9c87d76db Fix SparkleCore build issues in Release configuration
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.
2016-08-21 02:07:04 -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 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 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 8eb61afe53 Use SPUUserDriverUIComponent for command line user driver 2016-08-13 10:49:45 -04:00
Zorg b8ccc5d079 Fix compiler error 2016-08-13 10:35:38 -04:00
Zorg 6dddbcc353 Add acknowledgement handler to installation did finish 2016-08-13 09:50:19 -04:00
Zorg f18d410c6a Add SPUUpdaterDelegate and deprecate SUUpdaterDelegate 2016-08-12 23:02:23 -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 1a0e169e7f Improve displaying release notes in sparkle-cli (safer & less code) 2016-08-11 20:58:53 -04:00
Zorg f7d1cab4a0 Make sure we have a valid IANA charset name 2016-08-10 22:44:34 -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 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
Zorg 4f285d2245 Rename SUUpdater -> SPUUpdater & add SUUpdater for backwards compatibility
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.
2016-08-03 23:30:55 -04:00
Zorg 097710e27a Update sparkle-cli help usage and interactive flag 2016-07-29 00:16:24 -04:00
Zorg 0ca688073b Disable root support & checking
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
2016-07-26 19:16:38 -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 e00d303c08 Don't log that we're terminating the app
This way if installation takes a long time, it may not look like it is because of termination.
2016-07-16 12:11:52 -04:00
Zorg 8563a40cd2 Use XPC for IPC to the installer instead of CFMessagePort
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.
2016-07-12 19:59:24 -04:00
Zorg 80bc8353ed Handle defer installation when resuming updates in sparkle-cli 2016-07-12 19:50:00 -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
Zorg c117837785 Add resumable update handler & fix normal update handler in sparkle-cli 2016-06-27 23:29:45 -04:00
Zorg 34ce18c44f Add private function for disabling stderr logging
This is useful for releasing sparkle-cli
2016-06-27 23:15:51 -04:00
Zorg dc5298ce54 Make method for finding running appliction to reduce duped code 2016-06-24 23:42:31 -04:00
Zorg 4482e2b736 Fix unsigned cast warning 2016-05-29 20:20:42 -04:00
Zorg f62285ff3b Use Appcast's content length when downloader doesn't retrieve an expected length 2016-05-29 13:17:56 -04:00
Zorg da145b2100 Log terminating target application in sparkle-cli 2016-05-29 11:28:11 -04:00
Zorg b4f1f67ddb Prevent using wrong combination of flags 2016-05-28 23:15:54 -04:00
Zorg a113ce49bd Add interactive option to sparkle-cli
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.
2016-05-28 23:04:43 -04:00
Zorg 0cf1aee693 Add -updaterShouldDownloadReleaseNotes: delegate method 2016-05-28 10:13:18 -04:00
Zorg 0a53d51d89 Don't send NSURLResponse objects over XPC or to the user driver
This class doesn't support NSSecureCoding in OS X 10.8, so this fixes a crash there.
2016-05-19 21:52:50 -04:00
Zorg 72d63f3992 Print friendly error messages in sparkle-cli 2016-05-18 18:51:47 -04:00
Zorg fbb9fbf535 Add showing release notes from sparkle-cli 2016-05-14 21:56:35 -04:00