browser/installer/unix/xpcom.jst
author hg@mozilla.com
Thu, 22 Mar 2007 10:30:00 -0700
changeset 1 9b2a99adc05e53cd4010de512f50118594756650
permissions -rw-r--r--
Free the (distributed) Lizard! Automatic merge from CVS: Module mozilla: tag HG_REPO_INITIAL_IMPORT at 22 Mar 2007 10:30 PDT,

function upgradeCleanup()
{
  // Obsolete files from Netscape 6.0 and Netscape 6.01 that
  // need to be cleaned up.
  deleteThisFile("Program",    "component.reg");
  deleteThisFile("Program",    "libjsdom.so");
  deleteThisFile("Program",    "libz.so");
  deleteThisFile("Components", "compreg.dat");
  deleteThisFile("Components", "xpti.dat");
  deleteThisFile("Components", "xptitemp.dat");
}

var srDest = $SpaceRequired$;

var err = initInstall("Mozilla XPCOM", "XPCOM", "$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);

    if (err==SUCCESS)
    {
	    err = performInstall(); 
	    logComment("performInstall() returned: " + err);
    }
    else
    {
	    cancelInstall(err);
	    logComment("cancelInstall() returned: " + err);
    }
}
else
    cancelInstall(INSUFFICIENT_DISK_SPACE);