[Adium-devl] Sparkle for plugins

Ofri Wolfus ofri.wolfus at gmail.com
Sat Apr 26 12:26:59 UTC 2008


NSBundle *bndl = [NSBundle bundleForClass:[pluginInstance class]];
NSString *pluginPath = [bndl bundlePath];

// Do some fancy stuff with the plugin's bundle
// Hot new feature - update plugins without quitting! (10.5 only)
[[bndl principalClass] unloadPlugin]; // Kills all instances of the  
plugin's classes, unregisters with adium, etc
[bndl unload]; // objc2++;

// Now load the updated version of the plugin

On 26/04/2008, at 14:28, Thibault Martin-Lagardette wrote:

> The [[NSBundle bundleWithIdentifier:@"..."] bundlePath]; works pretty
> good, hence the "pluginBundleIdentifier" method :)
> Or maybe there's a way to get the bundleIdentifier without having to
> do it manually? I'm not sure about it, but it would be better to use
> that if it exists
>
> I didn't dig enough at the moment to say what I am exactly going to
> do, but yes, an array seems a pretty simple solution :)
>
> -- 
> Thibault Martin-Lagardette
>
>
>
> On Apr 26 , 2008, at 13:20, Peter Hosey wrote:
>
>> On Apr 26, 2008, at 04:07:11, Thibault Martin-Lagardette wrote:
>>> The idea would be to implement sparkle directly into Adium's API so
>>> that plugins only have to implement methods like
>>> "pluginAppcastFeedUrl", "pluginBundleIdentifier" (for sparkle to
>>> get the bundle path), and use the already available "pluginVersion"
>>> method.
>>
>> So you'd add an array property to SUUpdater to hold plug-in
>> instances which it would query for this information and attempt to
>> update?
>>
>> You'd also need a way for Sparkle to determine the path to the plug-
>> in bundle that originated an instance, in order to replace it. I
>> think you can do this with dladdr.
>>
>> _______________________________________________
>> Adium-devl mailing list
>> Adium-devl at adiumx.com
>> http://adiumx.com/mailman/listinfo/adium-devl_adiumx.com
>
>
> _______________________________________________
> Adium-devl mailing list
> Adium-devl at adiumx.com
> http://adiumx.com/mailman/listinfo/adium-devl_adiumx.com





More information about the devel mailing list