winreg.setRootKey is not a function

Jonathan Morris <[email protected]>
Newsgroups gmane.comp.mozilla.devel.xpinstall
Organization Natural Messaging, Inc.
Message-ID <[email protected]>
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.