Commit Graph
190 Commits
Author SHA1 Message Date
Zorg f62285ff3b Use Appcast's content length when downloader doesn't retrieve an expected length 2016-05-29 13:17:56 -04:00
Zorg 87903c0d97 Fix unit tests from not compiling
SUFileManager fileManager method had to be renamed to satisfy Swift
2016-05-27 22:23:04 -04:00
Zorg 64a7624744 Add authorization environment when using file manager
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.
2016-05-27 12:36:44 -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 1a952227a7 Replace assert(false/NO) with abort() 2016-05-18 19:15:01 -04:00
Zorg 8b19b0e1b4 Adding todo to implement showing linked release notes from popup user driver 2016-05-14 21:57:41 -04:00
Zorg 1446acf519 Add methods onto user driver show showing linked release notes
These release notes are downloaded while showing that the new update is found
2016-05-14 21:45:25 -04:00
Zorg 4b75564b5f Remove has launched before check box from Test App
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.
2016-05-01 16:54:17 -04:00
Zorg 350eba452c s/SUUpdatePermissionPromptResult/SUUpdatePermission/ && s/shouldSendProfile/sendProfile/ 2016-05-01 14:54:17 -04:00
Zorg 11c79b7b2a Add command line argument parsing to sparkle-cli
Also add defer installation option, which will not terminate the application right away.
Rename "relaunch" option as "application" instead.
2016-05-01 00:39:28 -04:00
Zorg fdee19ec69 Add installation did finish event. This is not complete.
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
2016-04-29 00:37:21 -04:00
Zorg 7183d9ebc5 Merge branch 'master' into ui-separation-and-xpc 2016-04-20 00:05:45 -04:00
Zorg 99be33d83b Move Test App server directory data into subdirectory inside Caches
We want to wipe the caches directory we create for the test app data on launch,
and want to make sure no other data is being inserted into the same directory.
Before, Sparkle was inserting data into the same directory when downloading an update.
2016-04-19 02:31:02 -04:00
Zorg 98f07419aa Remove ATS exception from TestApplication
The XPC services (under debug mode) now handle this.
2016-04-16 01:56:50 -04:00
Zorg e1b13f9c67 Add sparkle-cli tool that can update any arbitrary app
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.
2016-04-11 01:29:08 -04:00
Zorg 1bb301e82a Change updateInProgress to canCheckForUpdates
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.
2016-04-09 11:39:02 -04:00
Zorg 97a8568491 Add service for remote message port
This allows the updater to communicate to the installer without an additional entitlement
2016-04-04 01:18:15 -04:00
Zorg b22d2c2568 Make menu item validation work in the test app 2016-04-03 20:06:56 -04:00
Zorg e03607a2d6 Only use SUFileManager in debug mode for the test app
This way we don't have to export it in release mode
2016-04-02 00:10:20 -04:00
Zorg e74a397152 Add downloader XPC services for sandboxed apps
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.
2016-04-01 22:41:12 -04:00
Zorg 5c08e0a1d1 Add InstallerLauncher XPC Service
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.
2016-04-01 17:54:12 -04:00
Zorg 0b94f56f7f Rename some user driver delegate methods 2016-03-27 19:03:28 -04:00
Zorg d12121a265 Add SUUpdaterSettings class, allowing to read default settings.
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.
2016-03-27 18:44:36 -04:00
Zorg 1e9292acf4 Merge branch 'master' into ui-separation-and-xpc 2016-03-23 22:37:11 -04:00
Zorg 1ae0999082 Fix nullability warnings 2016-03-22 22:08:14 -04:00
Zorg c265e3f7bf Fix warnings caused by -Wpartial-availability
Most of this is removing Obj-C subscripting usage
Some bits are adding pragma ignores to places where we are careful to not use the API at runtime on older OS's

Note that for NSMutableDictionary:
x[y] = z is not the same as [x setObject:z forKey:y]

In particular, z can be nil for subscripting (removing the element if it exists) where it cannot for setObject:forKey:
Personally I like the non-subscripting semantics better. Most cases we were using this we were checking if the object was non-nil anyway
2016-03-22 22:07:49 -04:00
Zorg a1d08a354d Add updater resumability, merge automatic & regular update prompts
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
2016-03-21 00:46:34 -04:00
Zorg cb0b7c8cfe Remove all termination logic from the user driver
Autoupdate is now responsible for all of this. The user driver implementation is shorter and less complex now.
2016-03-13 19:18:51 -04:00
Zorg 46256b297b Do not pass the user driver in delegate methods
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..
2016-03-12 15:53:00 -05:00
Zorg 96f016a790 Add acknowledgement handlers to no update found / errors
This way, if the errors are not presented modally, they won't be dismissed
until we tell the updater we are finished acknowledging them
2016-03-05 14:42:17 -05:00
Zorg 337f39e8b9 Just log an error instead of changing update button
Because the update installation will be aborted soon anyway..
2016-03-05 13:33:32 -05:00
Zorg 53719cc8b7 Fix termination being delayed when connection is invalidated 2016-03-05 13:12:52 -05:00
Zorg 5dca54d904 Add custom user driver in the test app 2016-03-05 12:59:11 -05:00
Zorg ed72d25eaa Re-sign the altered/new test app
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
2016-03-04 20:05:33 -05:00
Zorg db4e8a9946 s/SUUpdaterController/SUStandardUpdaterController.m/ 2016-03-04 19:25:25 -05:00
Zorg f2e485df87 Add proper remote updater idling support
Meaning that we don't send a message or re-establish the XPC connection
immediately when something goes wrong
2016-03-04 19:00:47 -05:00
Zorg af8e195cd9 Handle app termination better with regards to automatic updates
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
2016-03-03 22:28:38 -05:00
Zorg 045de30926 Clean up last bit of warnings 2016-03-03 19:59:16 -05:00
Zorg ada2688b86 Set up invalidation and interruption XPC handlers 2016-03-03 19:20:01 -05:00
Zorg f5a9cf14de s/SUSparkleUserDriver/SUStandardUserDriver/ 2016-03-03 18:29:15 -05:00
Zorg 8a42975dc2 Add test application code for Sparkle over XPC 2016-03-03 03:03:56 -05:00
Zorg 15b4d1adf3 Add a "Updater NIB" object for standard sparkle UI
I may consider  extending SUUpdater instead of another controller..
2016-02-28 20:18:06 -05:00
Zorg dccce32beb Temporary fix for running the test application 2016-02-28 15:18:09 -05:00
Zorg 3bf91e795e Move delegate protocol to SUUserUpdaterDriver protocol 2016-02-27 19:59:39 -05:00
Zorg bea00a99e8 Update SULoggerUpdateDriver example 2016-02-27 19:40:09 -05:00
Zorg 3230fd982b Change SUUserUpdaterDriver so that every reply block must get a response
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.
2016-02-27 14:00:28 -05:00
Zorg 14f56c519b Move modal alert delegation to user updater driver 2016-02-23 21:56:14 -05:00
Zorg a6d6e31b2c Remove asking user updater driver if it's showing alerts modally
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
2016-02-22 23:21:27 -05:00
Zorg 0e97f0b4b6 Handle app termination in the user driver
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
2016-02-21 13:24:54 -05:00
Zorg c3824b4c20 Making dismissUpdateInstallation independent of installation type
Also clean up warnings/temporary comments
2016-02-21 00:26:51 -05:00