Commit Graph
1831 Commits
Author SHA1 Message Date
Zorg cfd462002c Let AutoUpdater relaunch itself through LaunchServices
This solves several problems:
1) we can't spawn a task reliably from a XPC process
2) we don't want to link to AppKit from SUBasicUpdateDriver
3) spawning a task to invoke open utility is poor with bad inputs
2016-02-28 17:46:29 -05:00
Zorg caf5e01643 Merge branch 'best-update-by-version' into ui-separation-core 2016-02-28 15:52:00 -05:00
Zorg 196bb64483 Be extra careful the updater is passed as a weak reference 2016-02-28 15:40:33 -05:00
Zorg 30abbb238a Fix AutoUpdate activation issues
Forcing the app to activate after we show the status window in AutoUpdate seems to work better
2016-02-28 15:34:11 -05:00
Zorg dccce32beb Temporary fix for running the test application 2016-02-28 15:18:09 -05:00
Zorg 680484f7c2 SUWindowController can be removed; it doesn't do anything 2016-02-28 15:09:09 -05:00
Zorg 030725ff2d Replace Cocoa imports with Foundation in unit tests 2016-02-28 14:52:39 -05:00
Zorg cd83dd3769 Removing NTSynchronousTask for good 2016-02-28 14:45:16 -05:00
Zorg f88eec8105 Remove NTSynchronousTask from SUCodeSigningVerifierTest 2016-02-28 14:11:54 -05:00
Zorg c6df59c7b0 Fix code signing verifier tests for me 2016-02-28 14:06:05 -05:00
Zorg 876c7af538 Move finding active host pid into Autoupdate
Also use 'open' instead of NSWorkspace to remove our dependency on AppKit
2016-02-28 13:38:51 -05:00
Zorg 513d7f39a1 Use SUFileManager to move the temp item to the trash 2016-02-28 12:27:53 -05:00
Zorg 3e64da75b6 Replace Cocoa import with Foundation wherever possible 2016-02-28 11:59:27 -05:00
Zorg 6041d68db6 Add note about .pch usually being a bad idea 2016-02-28 11:41:09 -05:00
Zorg d216f30f47 More secure coding implementation forgot to remove 2016-02-28 11:37:35 -05:00
Zorg 8af18843ef Move AppKit functionality from SUHost to SUApplicationInfo
These operations also make incorrect assumptions when called from out of process,
so it makes sense to separate them out. Furthermore, SUHost can now only depend on
Foundation
2016-02-28 11:36:11 -05:00
Zorg 2a13d62838 Forgot to remove this secure coding implmentation 2016-02-28 11:09:48 -05:00
Zorg 1fc1d3598a No need for SUSystemProfiler singleton, and SUHost doesn't need to know about it 2016-02-28 11:09:11 -05:00
Zorg 0d7b0037a1 Remove unneeded deps from SUHost 2016-02-28 10:51:31 -05:00
Zorg 4a3f0ad984 Pass the SUHost into the driver's constructor 2016-02-28 02:00:57 -05:00
Zorg f630188255 Remove/modernize a bunch of cruft
Yeah, this isn't backwards compatible with older code that uses Sparkle

Few notes:
* Mostly everything from *.pch has been moved out for saner dependency tracking
* 10.7 compatibility has been removed out so I don't import Cocoa when I don't have to
* sharedUpdaters/SUUpdater singletons has been removed out so updaters can actually be deallocated properly
 (and since singletons are generally horrible idea anyway)
* SUUpdater doesn't have UI/cocoa/bindings/menu validation code. Its new initializer method takes a user driver
 (perhaps in the future I'll create another class that "binds" the UI and core)
2016-02-28 01:39:15 -05:00
Zorg b5a1826a47 finishTermination property is no longer used 2016-02-27 21:47:27 -05:00
Zorg 717f741977 Simplify sending termination signal from the user driver 2016-02-27 21:13:26 -05:00
Zorg 3d2958326c Looks like standard Foundation classes (NSNumber, NSString) are safe 2016-02-27 20:30:18 -05:00
Zorg 3bf91e795e Move delegate protocol to SUUserUpdaterDriver protocol 2016-02-27 19:59:39 -05:00
Zorg cdea8015d3 Merge branch 'master' into ui-separation 2016-02-27 19:41:27 -05:00
Zorg bea00a99e8 Update SULoggerUpdateDriver example 2016-02-27 19:40:09 -05:00
Zorg 0e7eba5ae9 Add note about not dispatching to main queue again 2016-02-27 19:31:53 -05:00
Kornel a52cbc38a1 Merge pull request #769 from zorgiepoo/update-last-check-date
Update last update check date when the update driver finishes
2016-02-28 00:04:45 +00:00
Zorg 530a90cb73 Update last update check date when the update driver finishes
This fixes the issue where if an update alert is present for a long time,
and the user dismisses it, they may be prompted with another update alert
immediately after.
2016-02-27 18:39:18 -05:00
Zorg aee0b6f7d8 Allow user driver's delegate to handle initiating update checks
In a XPC environment, a delegate may handle update checks by sending a message
to the XPC process that tells it to reset the sparkle updater's check cycle.
If the user driver delegate can do this, the XPC process will not need to wait
for a reply, allowing the system to kill the XPC process when it becomes idle.
2016-02-27 17:54:19 -05:00
Zorg dec088b9ad Dispatch reply blocks to main queue 2016-02-27 16:41:05 -05:00
Zorg fbfcbbdf2d Move check update timer into the user driver
In an XPC environment, XPC processes may be killed if they are considered idle.
Thus, we must do the update checking in the user driver.
2016-02-27 16:28:25 -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 b6d1726d77 Cleanup showing update alerts and use weak references 2016-02-26 20:28:35 -05:00
Zorg 582381a5df Add note about permission dialog being modal 2016-02-26 20:06:11 -05:00
Zorg beae77136b Preserve & deprecate SUUpdater show modal alert methdods
Just to keep backwards compatibility as an option
2016-02-23 22:29:25 -05:00
Zorg e20ecce343 Make sure delegate responds to methods 2016-02-23 21:58:58 -05:00
Zorg 14f56c519b Move modal alert delegation to user updater driver 2016-02-23 21:56:14 -05:00
Zorg cd66b1013a Modal alert methods no longer needed for SUSparkleUserUpdaterDriver 2016-02-22 23:27:23 -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 308cfe36cf Don't assume the host is our original application for code signing verification
Tested to make sure this the verification didn't break
2016-02-22 22:50:37 -05:00
Zorg b6e558d82e Timeout if target app takes too long to terminate
This makes the AutoUpdate app less trusting for the target app
2016-02-21 23:42:03 -05:00
Zorg a9df54eb98 Replace critical Sparkle error alerts with raised exceptions
Alert UI does not belong here. And since these are critical errors,
they should not be recoverable (i.e, user can't just hit 'OK')
2016-02-21 17:30:45 -05:00
Zorg f00978c87b Move -dismissUpdateInstallation call into basic update driver 2016-02-21 16:57:54 -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 5a60ddaf8c activeUpdateAlert needs to be a strong reference 2016-02-21 00:48:49 -05:00
Zorg c3824b4c20 Making dismissUpdateInstallation independent of installation type
Also clean up warnings/temporary comments
2016-02-21 00:26:51 -05:00
Zorg 6b5a3547e7 Cleaning up SUUserUpdateDriver protocol 2016-02-20 23:52:24 -05:00
Zorg 1ebb150a1b Null out applicationWillTerminate block reference 2016-02-20 21:44:30 -05:00