Confused about using sparkle for non-app

Asked by JoshWeinberg

I'm trying to add sparkle to a bundle that is loaded into another Sparkle enabled app. I'm kind of confused about how to start the updater on the bundle rather then the app. The documentation on this was slightly...lacking. I have linked the bundle with Sparkle.framework and the framework exists within the bundle. But I'm at a loss on what to do next.

Any help would be great.

Thanks much!

 - Josh

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
Andy Matuschak (andymatuschak) said :
#1

You should use [[SUUpdater updaterForBundle:yourBundleHere] resetUpdateCycle]. Sorry that the documentation isn't very clear.

Revision history for this message
JoshWeinberg (daemoncollector) said :
#2

I have that in already. Is there something else I have to set up on the bundle side? The only things I did were add the URL and Public key in. Do I not have to somehow create an instance within the bundle?
 - Josh

Revision history for this message
Andy Matuschak (andymatuschak) said :
#3

Actually, that line will create an instance within the bundle! Implicitly, since SUUpdater is a singleton and updaterForBundle lazily instantiates them. Your confusion reminds me, though, that this is a janky design. Maybe I'll clarify it for a future version.

Revision history for this message
JoshWeinberg (daemoncollector) said :
#4

In that case I'm even more confused, because I seem to have everything set up. :) Is it a problem because its a singleton and I'm doing this all from a Sparkle enable app? Is it the updater for the app that is stoping this from working?

Revision history for this message
Andy Matuschak (andymatuschak) said :
#5

Oh! Mayyyybe. Anything in the console? What happens if you explicitly ask the SUUpdater to checkForUpdates:?

Revision history for this message
JoshWeinberg (daemoncollector) said :
#6

Well, I tried that and got back "You must specify the URL of the appcast as the SUFeedURLKey in either the Info.plist or the user defaults!"

That key is specified in both the bundle and the app that was calling the bundle (different values, but still).

  [[SUUpdater updaterForBundle:bundle] resetUpdateCycle];
  [[SUUpdater updaterForBundle:bundle] checkForUpdates:self];

that is the code that I'm calling with.

Thanks again,
 - Josh

Revision history for this message
JoshWeinberg (daemoncollector) said :
#7

Ok, I take that back, I had run it on the wrong bundle :) I have a few of them loaded. manually calling checkForUpdates worked. Is it possible to get the autoupdate to check these as well?

 - Josh

Revision history for this message
Best Andy Matuschak (andymatuschak) said :
#8

Oh. Crap. You just exposed something that's really poorly designed.

So unfortunately, right now, Sparkle doesn't support asking for permission to update for bundles. And resetUpdateCycle uses whatever settings the user has to set an appropriate schedule. But if the user is never asked for permission, then there are no settings, and so no update will be scheduled.

This sucks, and I'll fix it someday. In the meantime, set SUEnableAutomaticChecks to YES in your Info.plist. Sorry about that.

Revision history for this message
JoshWeinberg (daemoncollector) said :
#9

Thanks Andy Matuschak, that solved my question.

Revision history for this message
JoshWeinberg (daemoncollector) said :
#10

Look forward to the fix whenever you get around to it. In the meantime it works great now.

Thanks again,
 - Josh