rem: key.open(key.ROOT_KEY_LOCAL_MACHINE, "SOFTWARE", key.ACCESS_READ); 
add: key.open(rootKey, "SOFTWARE", key.ACCESS_READ); 
context: function updateRegistry() {  LOG("updateRegistry");  var ourInstallDir = getFile(KEY_APPDIR);  var app =    Components.classes["@mozilla.org/xre/app-info;1"].    getService(Components.interfaces.nsIXULAppInfo).    QueryInterface(Components.interfaces.nsIXULRuntime);  var sbs =      Components.classes["@mozilla.org/intl/stringbundle;1"].      getService(Components.interfaces.nsIStringBundleService);  var brandBundle = sbs.createBundle(URI_BRAND_PROPERTIES);  var brandFullName = brandBundle.GetStringFromName("brandFullName");  var vendorShortName = brandBundle.GetStringFromName("vendorShortName");  var key = new RegKey();  var oldInstall;  try {    key.open(key.ROOT_KEY_LOCAL_MACHINE, "SOFTWARE\\" + vendorShortName,             key.ACCESS_READ);    oldInstall = locateOldInstall(key, ourInstallDir);  } finally {    key.close();  }  if (!oldInstall) {    LOG("no existing registry keys found");    return;  }  // Maybe nothing needs to be changed...  if (oldInstall.fullName == brandFullName &&      oldInstall.version == app.version) {    LOG("registry is up-to-date");    return;  }  // Delete the old keys:  try {    key.open(key.ROOT_KEY_LOCAL_MACHINE, "SOFTWARE\\" + vendorShortName,             key.ACCESS_READ);    deleteOldRegKeys(key, oldInstall);  } finally {    key.close();  }  // Create the new keys:  var versionWithLocale = app.version + " (" + getLocale() + ")";  var installPath = ourInstallDir.path + "\\";  var pathToExe = getFile(KEY_EXECUTABLE_FILE).path;  var Key_bin = {    name: "bin",    values: [      "PathToExe", pathToExe    ]  };  var Key_extensions = {    name: "Extensions",    values: [      "Components", getFile(KEY_COMPONENTS_DIR).path + "\\",      "Plugins", getFile(KEY_PLUGINS_DIR).path + "\\"    ]  };  var Key_nameWithVersion = {    name: brandFullName + " " + app.version,    values: [      "GeckoVer", app.platformVersion    ],    children: [      Key_bin,      Key_extensions    ]  };  var Key_main = {    name: "Main",    values: [      "Install Directory", installPath,      "PathToExe", pathToExe,      "Program Folder Path", oldInstall.menuPath    ]  };  var Key_uninstall = {    name: "Uninstall",    values: [      "Description", brandFullName + " (" + app.version + ")",      "Uninstall Log Folder", installPath + "uninstall"    ]  };  var Key_versionWithLocale = {    name: versionWithLocale,    children: [      Key_main,      Key_uninstall    ]  };  var Key_name = {    name: brandFullName,    values: [      "CurrentVersion", versionWithLocale    ],    children: [      Key_versionWithLocale    ]  };  var Key_brand = {    name: vendorShortName,    children: [      Key_name,      Key_nameWithVersion    ]  };  try {    key.open(key.ROOT_KEY_LOCAL_MACHINE, "SOFTWARE", key.ACCESS_READ);    createRegistryKeys(key, Key_brand);  } finally {    key.close();  }  // Now, do the same thing for the Add/Remove Programs control panel:  const uninstallRoot =      "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall";  try {    key.open(key.ROOT_KEY_LOCAL_MACHINE, uninstallRoot, key.ACCESS_READ);    var oldName = oldInstall.fullName + " (" + oldInstall.version + ")";    deleteRegistryKey(key, oldName, false);  } finally {    key.close();  }  var uninstallBundle = sbs.createBundle(URI_UNINSTALL_PROPERTIES);  var nameWithVersion = brandFullName + " (" + app.version + ")";  var uninstaller = getFile(KEY_WINDIR);  uninstaller.append(uninstallBundle.GetStringFromName("fileUninstall"));  // XXX copy latest uninstaller to this location  var uninstallString =      uninstaller.path + " /ua \"" + versionWithLocale + "\"";  Key_uninstall = {    name: nameWithVersion,    values: [      "Comment", brandFullName,      "DisplayIcon", pathToExe + ",0",        // XXX don't hardcode me!      "DisplayName", nameWithVersion,      "DisplayVersion", versionWithLocale,       "InstallLocation", ourInstallDir.path,  // no trailing slash      "Publisher", vendorShortName,      "UninstallString", uninstallString,      "URLInfoAbout", uninstallBundle.GetStringFromName("URLInfoAbout"),      "URLUpdateInfo", uninstallBundle.GetStringFromName("URLUpdateInfo")     ]  };  var child;  try {    key.open(key.ROOT_KEY_LOCAL_MACHINE, uninstallRoot, key.ACCESS_READ);    createRegistryKeys(key, Key_uninstall);    // Create additional DWORD keys for NoModify and NoRepair:    child = key.openChild(nameWithVersion, key.ACCESS_WRITE);    child.writeIntValue("NoModify", 1);    child.writeIntValue("NoRepair", 1);  } finally {    if (child)      child.close();    key.close();  }}
meta: 10234	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/10234/fb1ff7a770f3422165b4470d5f188d077b72d85c/nsPostUpdateWin.js/buggy/toolkit/mozapps/update/src/nsPostUpdateWin.js