Re: winreg.setRootKey is not a function

Daniel Veditz <[email protected]>
Newsgroups gmane.comp.mozilla.devel.xpinstall
Organization Another Netscape Collabra Server User
Message-ID <[email protected]>
The code looks ok AFAICT, we use exactly the same stuff in the Mozilla
installer. For example
http://lxr.mozilla.org/mozilla/source/xpinstall/packager/windows/mail.jst#295

-Dan Veditz

Jonathan Morris wrote:
> The following code is giving the above error. This is Mozilla 1.1 on Win2K. The code is a clone of the
> example at http://developer.netscape.com/docs/manuals/xpinstall/example9.html#998204
> 
> Help, please? Thanks.
> 
> <><><>
> 
> // figure out if/where tomcat is installed based on version
> // returns the path or null
> 
> function getTomcatBaseline(version){
> 
>    // can't use a double backslash before subkey - windows already puts it in.
>    var subkey;        // the name of the subkey you are poking around in
>    var winreg = getWinRegistry();
> 
>    if (winreg != null) {
>      // where in the registry to look
>      winreg.setRootKey(winreg.HKEY_LOCAL_MACHINE);
>      if (version == "4.0")
>        subkey  = "SOFTWARE\\Apache\\Apache Tomcat 4.0";
>      else
>        subkey  = "SOFTWARE\\Apache Group\\Tomcat\\4.1";
> 
>      // see what we can find
>      return winreg.getValueString(subkey, ""); // chris says this will work for default
>    } else {
>      alert("Only works on windows for starters... sorry.");
>      return null;
>    }
> }
>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.