[Jslib] General Purpose Uninstall Wizard in jslib v0.1.114

Karsten Düsterloh mnenhy at tprac.de
Mon Dec 8 21:31:35 EST 2003


Henrik Gemal aber hob zu reden an und schrieb:
> Perhaps it should default to "packagename.jar"
> 
> at creation time I dont know if the user installs into user or global 
> chrome so can I just have:
> <RDF:li>UChrom:tdccms.jar</RDF:li>
> <RDF:li>AChrom:tdccms.jar</RDF:li>
> 
> Or shouldn't the uninstall just detect that automaticlly?

Autodetection is rather easy:

- Create a chrome URI for the package, e.g.
chrome://packagename/content/contents.rdf (the actual doesn't matter,
we're only interested in the first part)

- Get the real path via nsIChromeRegistry::convertChromeURL:
if it's a resource URI, it's in the application chrome; if it's file
URI, it's in the user profile. If we're paranoid, we could convert it
into a file URI and compare with the file URIs of both chrome directories.

(This method (of course) only works if the package isn't deinstalled
yet, because it makes use of the chrome.rdf information.)


Karsten


More information about the Jslib mailing list