Sparkle Plus Bug / Workaround

For those who may not know, Sparkle is a very cool framework that will let you add an in-app software updater to your application very easily. Once upon a time some people thought it would be a good idea if Sparkle would append some system information to the web call looking for the current version. This would allow developers to track which OS version their users we running, hardware specs, and so on. At the time Andy (the main guy behind Sparkle) thought it was a bit out of scope and so Sparkle+ was born.

Billable eventually starting using Sparkle+ and all was well, until one day a bug appeared. To the best of my knowledge from limited testing this bug seems limited to Leopard. It’s not a crash or anything but if a user had asked to check for updates on application launch it silently fails and does nothing. (Of all the things to break! This is the main reason we have the framework. LOL.)

The good news, Sparkle’s main branch, has actually grown to now include the ability to add profile info to the web request amongst a bunch of other goodies. If you have the time, moving to it seems to be the way to go. Best I can tell Sparkle+ is retired (last svn commit about a year ago).

If you don’t have the ability to upgrade from Sparkle+ at the moment you can workaround this bug with a simple bit of code. Assuming you have both SUUpdater and your AppDelegate instanciated in the same NIB, create an outlet in the AppDelegate and point it to the SUUpdater instance via Interface Builder. Then in your AppDelegate add some code to applicationDidFinishLaunching.

1
2
3
4
5
6
7
8
9
- (void)applicationDidFinishLaunching:(NSNotification *)aNotification {
    ...
    NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
    NSNumber *shouldCheckAtStartup = [defaults objectForKey:@"SUCheckAtStartup"];
    if ([shouldCheckAtStartup boolValue]) {
        [theUpdater checkForUpdatesInBackground];
    }
    ...
}

For the record the manual process of checking for updates still works fine, so if you find out your app out in the wild is borked you can push your users to do the manual check after you’ve got your next update ready.

For Billable this will be fixed in 1.2.4, which is coming out soonish. :)

Thanks to Adam Bell for heads up on this issue.

Posted on: January 20, 2009 – 3:10 AM

Post a Comment | Comment RSS feed

(used for gravatar), address not displayed on site)