Re: install.js????

Daniel Veditz <[email protected]> Wed, 16 Mar 2005 09:19:03 -0800
Newsgroups gmane.comp.mozilla.devel.xpinstall
Organization Another Netscape Collabra Server User
Message-ID <[email protected]>
Iceman wrote:
> Thanks Dan
> Is there a standardized way to read or write into windows registry. I
> tried hard to get details but was not successful
> 
> this is what i know
> 
> var wine=
> Components.classes["@mozilla.org/browser/shell-service;1"].getService(Components.interfaces.nsIWindowsShellService);
> 
> var registryentry=wine.getRegistryEntry()
> 
> do you where i can find the exact list of parameters i need to pass to
> getRegistryEntry and what those mean?

"Use the Source, Luke"

http://lxr.mozilla.org/mozilla/source/browser/components/shell/public/nsIWindowsShellService.idl

That interface apparently only reads from the registry, and strings only 
at that.

> Is this the standard way? 

This thread started out about install.js, is that still involved here? 
Components.classes is not available in the install script. On the 
positive side install.js has a much more robust set of windows registry 
manipulations.

http://www.mozilla.org/projects/xpinstall/xpinstall.pdf

That documentation is old, roughly Netscape 6.x era. There are 
additional functions keyExists, valueExists, isKeyWritable, enumKeys, 
and enumValueNames. If you need them you can work out the arguments from 
the source: 
http://lxr.mozilla.org/mozilla/source/xpinstall/src/nsJSWinReg.cpp#740

Remember, this is only for install.js scripts, chrome apps themselves 
apparently don't support all this. (Probably wasn't needed, so no one 
wrote it.)

-Dan Veditz