Sparkle for a custom bundle associated with a System Preferences Pane?

Asked by SnowClic

I am trying to use the Sparkle framework for the first time. It looks easy to install and to use indeed.
My problem is that it works too well: it tries to update the System Preferences app itself!
I've read carefully the other questions/answers about using Sparkle and bundles, but none helped me to find out what I am doing wrong.

I have a QuickLook plugin for which I wrote a separated Preference pane which is installed in ~/PreferencePanes.
I did not read the Sparkle headers inside the xib of my PrefPane, and it has no NSObject set to SUUpdater.
I have added the Sparkle framework in my linked framework, and I have added the following at the very beginning of - (void) mainViewDidLoad:

<code>
updater = [SUUpdater updaterForBundle:[NSBundle bundleWithIdentifier:@"nameOfMyQuickLookBundle"]];
[updater setAutomaticallyChecksForUpdates:YES];
[updater resetUpdateCycle];
</code>

("updater" is an instance variable of my PrefPane controller).

If I set SUFeedURLKey in the Info.plist of my PrefPane to my appcast xml file, it is not recognized, somehow, and the Console.app tells me I need to include it either in Info.plist or in NSUserDefault. I wanted to avoid using NSUserDefault because for other options in my PrefPane, these user defaults cannot be shared with the QuickLook plugin. I need to use CoreFoundation preferences for that, with a specific bundle identifier. But either CoreFoundation preferences or NSUserDefault gives the same result with Sparkle. So I have included in my code:

<code>
[self savePreferenceKey:@"SUFeedURL" withValue:@"URLofMyAppcast"];
</code>

where savePreferenceForKey is a custom working method to save CoreFoundation preferences. Then, I have associated an "update" button in my PrefPane to an IBAction that calls [updater checkForUpdates:sender];.

Result? Sparkle does the work well, very quickly, and tells me that... "System Preferences 7.0 is currently the newest version available."! Nice, but I wanted to update my custom PrefPane bundle. :-) Any idea?

Thank you very much in advance.

Question information

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

Huh! Looks like you're doing the right thing. So, you don't allocate an SUUpdater in your XIB, right? Just making sure.

"If I set SUFeedURLKey in the Info.plist of my PrefPane to my appcast xml file"

Now, this wouldn't work because in the code provided, you're asking Sparkle to update your quick look plugin. So it'd have to be in *that* bundle. Try that and let me know what happens.

If that's still not working, break at that SUUpdater initialization line and make sure the NSBundle is what you expect it to be.

If you want to update both the quick look plugin and your prefpane, you'll need to either provide a .pkg that does the work or change SUInstaller to fit your needs.

Revision history for this message
SnowClic (k-postmaster-softtenebraslux-com) said :
#2

Dear Andy,

Thanks very much for your help. Yes, I also think I'm close to be completely right, but still...

If I understand well, it is not right to ask Sparkle to update my QuickLook plugin by specifying the bundle identifier. I mean, I do want my quicklook plugin and prefpane to be updated together, always, and I prepare a .pkg for that, containing both bundles. Hence I have changed the line in my viewDidLoad method to:

<code>
updater = [SUUpdater updaterForBundle:[NSBundle bundleForClass:[self class]]];
</code>

It should mean that I ask Sparkle to update the present bundle, i.e. the PrefPane itself, right? Whatever install package I provide, this should be more correct to tells Sparkle to update the PrefPane from within the PrefPane. OK. But...

Oh, wait, it works now! But I need to specify the appcast URL inside the Info.plist file. Which is what the Console says... Or I can set it inside my code. A wonderful morning! Time for me to make a little donation I guess. Thanks for your excellent software!