The relaunch tool sadly now polls for the host app being closed, rather than registering for notifications. But there was some race condition which had problems with the latter.
Refactored Sparkle's unarchiving system into SUUnarchiver, a factory for SUPipedUnarchiver and SUDiskImageUnarchiver. I removed that nasty cleanUp call by now copying out the contents of the DMG into the /tmp directory and unmounting. Nice!
This changed a fair amount so please test with your build and let me know if it explodes things. Works in my tests, though.
Basically, because I foolishly don't "[self abortUpdate]" on failure in the UI-based update driver, the SUUpdater instance thought an update was still in progress when it wasn't. This only affected user-initiated updates (SUScheduledUpdateDriver overrides that method), but it still was a serious issue.
Finally adding real delegate support. The following methods are implemented; the comments document them.
If you have suggestions for other methods that would be useful, feel free to suggest them.
// Use this to override the default behavior for Sparkle prompting the user about automatic update checks.
- (BOOL)shouldPromptForPermissionToCheckForUpdates;
// Implement this if you want to do some special handling with the appcast once it finishes loading.
- (void)appcastDidFinishLoading:(SUAppcast *)appcast;
// If you're using special logic or extensions in your appcast, implement this to use your own logic for finding
// a valid update, if any, in the given appcast.
- (SUAppcastItem *)bestValidUpdateInAppcast:(SUAppcast *)appcast;
// Sent when a valid update is found by the update driver.
- (void)didFindValidUpdate:(SUAppcastItem *)update;
// Sent when the user makes a choice in the update alert dialog (install now / remind me later / skip this version).
- (void)userChoseAction:(SUUpdateAlertChoice)action forUpdate:(SUAppcastItem *)update;
// Sent immediately before installing the specified update.
- (void)updateWillInstall:(SUAppcastItem *)update;
// Return YES to delay the relaunch until you do some processing; invoke the given NSInvocation to continue.
- (BOOL)shouldPostponeRelaunchForUpdate:(SUAppcastItem *)update untilInvoking:(NSInvocation *)invocation;
// Called immediately before relaunching.
- (void)updaterWillRelaunchApplication;
Sparkle now gies visual indication that it's checking for updates when hte update's user initiated. ie: it pops up a status controller saying "checking for updates..."
What was SUUserInitiatedUpdateDriver is now SUUIBasedUpdateDriver; SUUserInitiatedUpdateDriver now is a subclass of that, along with SUScheduledUpdateDriver. This is a happy little refactoring that let me remove some redundant code.
Added support for a SUPublicDSAKeyFile, so people don't have to copy/paste their entire DSA public key into their Info.plist.
Basically: specify a filename in your Info.plist under the key SUPublicDSAKeyFile, and Sparkle will look for a file of that name in the app's resources directory and load its contents to use as the DSA public key.
Now if the developer sets a value for SUEnableAutomaticChecks in Info.plist, we assume that's a good default value to take, and we don't ask the user what he wants to do on startup. If he doesn't specify any preference of his own, we take the Info.plist value to be the canonical one.