RetroZilla/browser/installer/unix/browser.jst
2015-10-20 23:03:22 -04:00

119 lines
4.7 KiB
Plaintext

function upgradeCleanup()
{
// Get rid of Chrome directory cruft.
deleteThisFolder("Chrome", "classic");
deleteThisFolder("Chrome", "comm");
deleteThisFolder("Chrome", "en-mac");
deleteThisFile("Chrome", "en-mac.jar");
deleteThisFolder("Chrome", "en-unix");
deleteThisFile("Chrome", "en-unix.jar");
deleteThisFolder("Chrome", "en-US");
deleteThisFolder("Chrome", "en-win");
deleteThisFile("Chrome", "en-win.jar");
deleteThisFolder("Chrome", "US");
deleteThisFile("Chrome", "help.jar");
deleteThisFile("Chrome", "chrome.rdf");
deleteThisFile("Chrome", "installed-chrome.txt");
deleteThisFile("Chrome", "app-chrome.manifest");
deleteThisFolder("Chrome", "overlayinfo");
// Remove defunct components and type libraries
deleteThisFile("Components", "typeaheadfind.xpt");
deleteThisFile("Components", "chrome.xpt");
deleteThisFile("Components", "ipcd.xpt");
deleteThisFile("Components", "nsUpdateNotifier.js");
deleteThisFile("Components", "nsBackgroundUpdateService.js");
deleteThisFile("Components", "p3p.xpt");
deleteThisFile("Components", "prefmigr.xpt");
deleteThisFile("Components", "profilesharingsetup.xpt");
deleteThisFile("Components", "related.xpt");
deleteThisFile("Components", "ucnative.xpt");
deleteThisFile("Components", "util.xpt");
deleteThisFile("Components", "compreg.dat");
deleteThisFile("Components", "xpti.dat");
// Remove non-linked xpt files for rev'd interfaces; this prevents a
// conflict if you had previously installed a zip build in the app directory.
deleteThisFile("Components", "autocomplete.xpt");
// Remove defunct defaults files.
deleteThisFile("Program", "defaults/pref/all.js");
deleteThisFile("Program", "defaults/pref/editor.js");
deleteThisFile("Program", "defaults/pref/mailnews.js");
deleteThisFile("Program", "defaults/pref/non-shared.txt");
deleteThisFile("Program", "defaults/pref/security-prefs.js");
deleteThisFile("Program", "defaults/pref/unix.js");
deleteThisFile("Program", "defaults/pref/xpinstall.js");
deleteThisFile("Program", "defaults/pref/bug307259.js");
deleteThisFile("Program", "defaults/profile/panels.rdf");
deleteThisFolder("Program", "defaults/profile/US");
// Delete dictionary.com search plugin
deleteThisFile("Program", "searchplugins/dictionary.src");
deleteThisFile("Program", "searchplugins/dictionary.png");
// These files are related to app patches and will interfere with the
// UA/app version strings if we do not remove them.
deleteThisFile("Program", "defaults/pref/bug259708.js");
// Remove defunct miscellany
deleteThisFolder("Program", "ipc");
deleteThisFile("Program", "mangle");
deleteThisFile("Program", "mozipcd");
deleteThisFile("Program", "regchrome");
deleteThisFile("Program", "regxpcom");
deleteThisFile("Program", "shlibsign");
}
var srDest = $SpaceRequired$;
var err = initInstall("$ProductName$", "Browser", "$Version$");
logComment("initInstall: " + err);
var communicatorFolder = getFolder("Program");
logComment("communicatorFolder: " + communicatorFolder);
if (verifyDiskSpace(communicatorFolder, srDest))
{
// Call upgradeCleanup() before addDirectory() in case we accidentaly
// delete files that we happen to be also installing. This way, if we do,
// it will just get reinstalled. This is for safety measure.
upgradeCleanup();
err = addDirectory("Program",
"$Version$",
"bin", // jar source folder
communicatorFolder, // target folder
"", // target subdir
true ); // force flag
logComment("addDirectory() returned: " + err);
// create the plugins folder next to mozilla
var pluginsFolder = getFolder("Plugins");
var ignoreErr = dirCreate(pluginsFolder);
logComment("dirCreate() returned: " + ignoreErr);
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(communicatorFolder, "xpicleanup");
err = File.execute(cleanupUtility);
logComment("execute() returned: " + err);
err = performInstall();
}
}
else
{
cancelInstall(err);
logComment("cancelInstall() due to error: " + err);
}
}
else
cancelInstall(INSUFFICIENT_DISK_SPACE);