[Jslib] JSLib Uninstall Problems

pickel jones pickel80209 at gmail.com
Tue Aug 7 11:25:07 PDT 2007

Greetings all,

Thanks for all the great work on JSLib; it provides a much needed JS
scripting layer overtop FF/etc.

I'm having a slight issue related to the "jslibUninstall" function:

I'm using this function with a notification callback, eg:

jslibUninstall('packageName', Package_UninstallDone);

This works (callback is indeed executed), however when I attempt to perform
post-uninstall cleanup within the notification callback, things go wrong.

Specifically, I'm attempting to modify some preferences settings on the
*second* execution of the callback function (stage == true).  When I attempt
this, the uninstall throws an exception and fails.

It seems to be related to the fact that the global variable 'Components' is
no longer available on the second execution of this callback handler.
"Components" *is* available on the first execution of the callback.  See my
callback code below:

function AlchemyTB_UninstallDone(filesList, stage)
    if (stage == true)
            var prefs = Components.classes["@
        catch (e)

Note, if i change the above to "if (stage == false)", it's able to retrieve
the Preferences service.  Stage == true, no dice.

Is there something I need to do to access/reinitialize global objects like
"Components" so they can be used within the second callback execution?
Otherwise, I don't see how it's possible to remove preferences after an
uninstall has occurred.

Any help would be appreciated, many thanks !
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mozdev.org/pipermail/jslib/attachments/20070807/4058013c/attachment.html 

More information about the Jslib mailing list