Commit Graph
4099 Commits
Author SHA1 Message Date
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 9bb87b2018 Move installationPath out from SUHost
It's not too relevant to SUHost, and mostly relevant to the installer.
Plus its output can depend on whether a certain file exists on the system.
2016-03-27 17:54:38 -04:00
Zorg 6de75413e8 Don't show user initiated progress when resuming an update
Retrieving the data to resume an update happens very quickly.
2016-03-27 16:36:24 -04:00
Zorg b27255468a Update cycle should only be reset if update is not in progress 2016-03-27 16:11:17 -04:00
Zorg b0963583ba Remove unused header 2016-03-27 16:03:55 -04:00
Zorg 46387097c1 These resets are not necessary 2016-03-27 16:03:23 -04:00
Zorg c58eaa205e Remove -[SUUpdater updateInProgress]
This method is not used anymore internally. Outside, the user driver should
be used instead.
2016-03-27 15:56:17 -04:00
Zorg ac0aaddefa Use -resetUpdateCycleAfterShortDelay internally but don't expose it publicly 2016-03-27 15:51:52 -04:00
Zorg 528c6f25ed Remove user defaults observing in standard updater controller
If these settings are changed, they should be changed through SUUpdater, honestly.
Morever, this user defaults code retains the controller.
2016-03-27 15:46:40 -04:00
Zorg a8252cbe20 This is supposed to be main bundle actually 2016-03-27 14:51:36 -04:00
Zorg 7fc6896170 Move automatic updates property from SUHost into SUUpdater
SUHost cannot properly detect if automatic updates are allowed due to write permissions,
thus it should not be a property of SUHost at all.
2016-03-27 13:33:28 -04:00
Zorg 9c7d41dd90 Updating SUUserDriver docs 2016-03-27 00:08:01 -04:00
Zorg eddf611ede Decryption password should now be supported 2016-03-26 23:46:27 -04:00
Zorg 8184838835 Explain reasoning on re-assigning updateItem here 2016-03-26 23:16:17 -04:00
Zorg 301f3bf4e3 Move appCachePath out of SUHost for process independence
The behavior depends on what kind of process is invoking is, which is no good.
2016-03-26 22:54:08 -04:00
Zorg fb32c8e18a Fix unarchiving unit tests 2016-03-26 02:20:34 -04:00
Zorg 8e4498adaf Refactor unarchivers to use protocols and less dynamism/global state
Before there were implicit dependencies and unarchivers were globally registered as their classes were loaded.
This flexibilty is unnecessary and comes with a safety (eg: forgetting to link in a class) and harder to read cost
2016-03-26 01:54:15 -04:00
Zorg 9d6f196111 Dismiss user initiated update check progress after appcast is loaded
Fixes bug where the update check progress window could still be visible after the appcast loaded successfully
2016-03-26 00:12:28 -04:00
Zorg 06c2f47024 Make delta updates & multiple download attempts work. 2016-03-25 23:58:05 -04:00
Zorg 1e9292acf4 Merge branch 'master' into ui-separation-and-xpc 2016-03-23 22:37:11 -04:00
Kornel cc332de4d1 Merge pull request #786 from zorgiepoo/fix-warnings
Fix warnings
2016-03-23 09:32:50 +00:00
Zorg d6b1c7de54 Fix another place where I accidently swapped key & object value 2016-03-22 23:51:20 -04:00
Zorg 3a3f46f2c1 Fix one place where I accidently swapped key & object value 2016-03-22 22:52:40 -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 5d1d2291a0 Don't see why handledResumeInstallationToStage2 is needed actually 2016-03-21 21:17:18 -04:00
Zorg 65a6d41147 Merge branch 'master' into ui-separation-and-xpc 2016-03-21 01:12:34 -04:00
Zorg 4042068c82 Fix Appcast unit tests 2016-03-21 01:09:25 -04:00
Zorg a3c950f480 Remove unused function 2016-03-21 00:57:31 -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 615f71474b Fix retain cycle by making these references weak 2016-03-20 13:16:36 -04:00
Zorg 4e8a39267d Fix memory corruption issue when copying CFDataRef bytes
Copy the bytes manually using -[NSData dataWithBytes:length:]
If we use -[NSData copy] instead, we may be using already freed memory
(according to ASAN), which is no good. This may be because the bytes aren't
deep copied.

Also add some @autoreleasepool wrappers because why not.
2016-03-19 22:06:33 -04:00
Kornel 2faf8ccdd2 Merge pull request #783 from sebcode/l10n-fixes
Fix german l10n.
2016-03-20 00:45:14 +00:00
Zorg 56a75bd4b6 Fix update scheduling not always firing 2016-03-19 15:25:44 -04:00
Sebastian Volland 2f724659a7 Fix german l10n.
Update german translation.
Update german version of SUAutomaticUpdateAlert.xib (Button widths).
Update CheckLocalizations.swift for Swift 2.
2016-03-19 18:40:41 +01:00
Zorg 87275b23c8 Refactor update drivers
This removes subclassing usage making the code harder to follow.
Todo: handle resuming an update already waiting to be installed,
adding impatience timer for automatic update scheduling
2016-03-19 12:09:11 -04:00
Kornel Lesiński 8cca51d08b Merge remote-tracking branch 'origin/master' into nsparse 2016-03-14 12:32:15 +00:00
Kornel Lesiński c9fa1142c9 Formatting/comments 2016-03-14 12:22:35 +00:00
Kornel 445cc55794 Merge pull request #781 from zorgiepoo/subscripting
Don't use subscripting where it may potentially be risky on 10.7
2016-03-14 12:16:43 +00:00
Zorg 013e60204d Don't use subscripting where it may potentially be risky on 10.7 2016-03-13 23:40:23 -04:00
Zorg b8fecf1f36 Fix issues with unit tests
I added public DSA file, automatic update checking, disabled system profiling
in the unit test's info.plist so that SUUpdater won't complain that DSA is missing,
and it won't prompt for update permission the first time.

I also made SUUpdater use the correct bundle in SUUpdaterTest
2016-03-13 22:27:57 -04:00
Zorg 1e645e8bd7 Remove resources/source files Autoupdate doesn't use anymore 2016-03-13 19:50:28 -04:00
Zorg d44094a692 Fix installer tests and add comment about running them 2016-03-13 19:32:58 -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 af126d9c82 Update automatic update driver to reflect AutoUpdate changes 2016-03-13 18:56:02 -04:00
Zorg f918368c72 Change SUCancelUpdateInstallation to SUDismissUpdateInstallation
Since this is not really canceling the installation anymore.
2016-03-13 16:52:25 -04:00
Zorg 85517dd0dd Don't think I need to handle this 2016-03-13 16:19:28 -04:00
Zorg d78f487596 Remove tempDir deletion warning 2016-03-13 16:17:51 -04:00
Zorg e7fdfb9dc9 Don't handle out of order messages 2016-03-13 16:17:24 -04:00
Zorg 64c17df1e6 Improve TerminationListener by observing NSRunningApplication instance
Listening for app termination doesn't require polling anymore.
2016-03-13 14:26:12 -04:00