Using sparkle for automatic, silent updates.

Asked by Sidney San Martín

I'm working on a small application (it's just going to be sitting up in the menu bar) that I want to be able to update itself silently and automatically. I'm trying to get a feel for the Sparkle code so I can hack that functionality in (or cut all the other functionality out, I suppose), but I was wondering… is there already a way to do it?

There are other applications (Dropbox comes to mind, and Mozy) that have implemented this functionality from scratch (you'll periodically see them quit for a few seconds and come back as a new version), but being able to use Sparkle would save a lot of work.

Question information

Language:
English Edit question
Status:
Solved
For:
Sparkle Edit question
Assignee:
No assignee Edit question
Solved by:
Andy Matuschak
Solved:
Last query:
Last reply:
Revision history for this message
Best Andy Matuschak (andymatuschak) said :
#1

This support doesn't exist in Sparkle already, but it'd be easy to add.

First, set SUEnableAutomaticChecks to YES in your Info.plist.

Change - (void)setAutomaticallyDownloadsUpdates:(BOOL)automaticallyUpdates in SUUpdater to let Info.plist values for SUAutomaticallyUpdate be used if there's no user default (or just to return YES, I suppose).

Change - (void)unarchiverDidFinish:(SUUnarchiver *)ua in SUAutomaticUpdateDriver to just run [self installUpdate].

I might implement this in a more general way at some point.

Revision history for this message
Sidney San Martín (s-sidneysm) said :
#2

Thanks Andy Matuschak, that solved my question.

Revision history for this message
Sidney San Martín (s-sidneysm) said :
#3

Aaah, I don't remember saying that.

It WOULD be nice to some day have a key in Info.plist — like SUEnableSilentUpdates — that could be used by anyone to get this functionality.

This solution'll work nicely, though. Thanks.