function copyFlashXPT() { /* * Check if Netscape Navigator (pre 6.0) is installed and if the * flash player is installed in Netscape's plugin folder. If it is, * try to copy the flashplayer.xpt file into our plugins folder to * make ensure that flash is scriptable if we're using it from * Netscape's plugins folder. */ var winreg = getWinRegistry(); winreg.setRootKey(winreg.HKEY_LOCAL_MACHINE); var subkey = "Software\\Netscape\\Netscape Navigator"; var nsver = winreg.getValueString(subkey, "CurrentVersion"); if (!nsver) return; subkey += "\\" + nsver + "\\Main"; var navPluginsDir = winreg.getValueString(subkey, "Plugins Directory"); if (!navPluginsDir) return; var navFlashXPT = getFolder("file:///", navPluginsDir + "\\flashplayer.xpt"); if (!File.exists(navFlashXPT)) return; var target = getFolder("file:///", fProgram + "\\plugins\\flashplayer.xpt"); // Copy the file flashplayer.xpt from Netscape's plugin directory to // Firefox's plugin directory. File.copy(navFlashXPT, target); logComment("Copied Flash xpt file from '" + navFlashXPT + "' to '" + target + "'"); } function copyQuickTimeXPT() { /* * Check if QuickTime is installed and copy * nsIQTScriptablePlugin.xpt from its plugins directory into our * plugins directory. If we don't do this, QuickTime will load in * Firefox, but it won't be scriptable. */ var winreg = getWinRegistry(); winreg.setRootKey(winreg.HKEY_LOCAL_MACHINE); var subkey = "Software\\Apple Computer, Inc.\\QuickTime"; var qtdir = winreg.getValueString(subkey, "InstallDir"); if (!qtdir) return; var qtXPT = getFolder("file:///", qtdir + "\\Plugins\\nsIQTScriptablePlugin.xpt"); if (!File.exists(qtXPT)) return; var target = getFolder("file:///", fProgram + "\\plugins\\nsIQTScriptablePlugin.xpt"); // Copy the file nsIQTScriptablePlugin.xpt from the QuickTime // installation directory to Firefox's plugin directory. File.copy(qtXPT, target); logComment("Copied QuickTime xpt file from '" + qtXPT + "' to '" + target + "'"); } // main var srDest; var err; var err2; var fProgram; var fWindowsSystem; var fileComponentRegStr; var fileComponentReg; var fileToRegister; var args; args = new String(Install.arguments); logComment("args: " + args); srDest = $SpaceRequired$:bin; err = initInstall("$ProductName$", "Firefox", "$Version$"); logComment("initInstall: " + err); fProgram = getFolder("Program"); fWindowsSystem = getFolder("Win System"); logComment("fProgram: " + fProgram); if(verifyDiskSpace(fProgram, srDest)) { setPackageFolder(fProgram); removeOldFiles(); err = addDirectory("", "$Version$", "bin", // dir name in jar to extract fProgram, // Where to put this file (Returned from GetFolder) "", // subdir name to create relative to fProgram true); // Force Flag logComment("addDirectory() of Program returned: " + err); // check return value if( err == SUCCESS ) { fileToRegister = getFolder(fProgram, "AccessibleMarshal.dll"); err2 = File.windowsRegisterServer(fileToRegister); logComment("windowsRegisterServer() returned: " + err2); // we don't want to fail on errors for the above two resetError(); // Create the uninstall folder. err = File.dirCreate(getFolder("Program", "uninstall")); logComment("dirCreate() of Program/uninstall returned: " + err); copyFlashXPT(); copyQuickTimeXPT(); /* Log files that are created after the installer is done, so they can be uninstalled */ logComment("Installing: " + fProgram + ".autoreg"); logComment("Installing: " + fProgram + "Xpcs Registry.dat"); logComment("Installing: " + fProgram + "xpcom.log"); logComment("Create Folder: " + fProgram + "components"); logComment("Installing: " + fProgram + "components\\xpti.dat"); logComment("Installing: " + fProgram + "components\\xptitemp.dat"); logComment("Installing: " + fProgram + "components\\compreg.dat"); logComment("Create Folder: " + fProgram + "components\\Netscape"); logComment("Create Folder: " + fProgram + "components\\Netscape\\MozillaTrunk"); logComment("Installing: " + fProgram + "components\\Netscape\\MozillaTrunk\\manifest.ini"); logComment("Installing: " + fProgram + "components\\Netscape\\MozillaTrunk\\permdata.box"); logComment("Installing: " + fProgram + "components\\Netscape\\MozillaTrunk\\Talkback.ini"); logComment("Create Folder: " + fProgram + "chrome"); logComment("Create Folder: " + fProgram + "uninstall"); logComment("Installing: " + fProgram + "active-update.xml"); logComment("Installing: " + fProgram + "updates.xml"); logComment("Installing: " + fProgram + "last-update.log"); logComment("Create Folder: " + fProgram + "updates"); err = getLastError(); if (err == SUCCESS) { err = performInstall(); logComment("performInstall() returned: " + err); if (! ('buildID' in Install)) { logComment("Running Pre-Mozilla 0.9.1"); initInstall("Post-install Cleanup Utility", "Browser/xpicleanup", "$Version$"); cleanupUtility = getFolder(fProgram, "xpicleanup.exe"); err = File.execute(cleanupUtility); logComment("execute() returned: " + err); err = performInstall(); } } else cancelInstall(err); } else cancelInstall(err); } else cancelInstall(INSUFFICIENT_DISK_SPACE); // end main