2000-09-13 09:39:19 +04:00
|
|
|
#!c:\perl\bin\perl
|
1999-09-15 23:26:18 +04:00
|
|
|
#
|
|
|
|
# The contents of this file are subject to the Netscape Public
|
|
|
|
# License Version 1.1 (the "License"); you may not use this file
|
|
|
|
# except in compliance with the License. You may obtain a copy of
|
|
|
|
# the License at http://www.mozilla.org/NPL/
|
|
|
|
#
|
|
|
|
# Software distributed under the License is distributed on an "AS
|
|
|
|
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
|
|
|
# implied. See the License for the specific language governing
|
|
|
|
# rights and limitations under the License.
|
|
|
|
#
|
|
|
|
# The Original Code is Mozilla Communicator client code, released
|
|
|
|
# March 31, 1998.
|
|
|
|
#
|
|
|
|
# The Initial Developer of the Original Code is Netscape
|
|
|
|
# Communications Corporation. Portions created by Netscape are
|
|
|
|
# Copyright (C) 1998-1999 Netscape Communications Corporation. All
|
|
|
|
# Rights Reserved.
|
|
|
|
#
|
|
|
|
# Contributor(s):
|
|
|
|
# Sean Su <ssu@netscape.com>
|
|
|
|
#
|
|
|
|
|
|
|
|
#
|
|
|
|
# This perl script builds the xpi, config.ini, and js files.
|
|
|
|
#
|
|
|
|
|
2001-08-03 02:02:48 +04:00
|
|
|
use Cwd;
|
|
|
|
|
2000-09-13 09:39:19 +04:00
|
|
|
# Make sure MOZ_SRC is set.
|
|
|
|
if($ENV{MOZ_SRC} eq "")
|
|
|
|
{
|
|
|
|
print "Error: MOZ_SRC not set!";
|
|
|
|
exit(1);
|
|
|
|
}
|
|
|
|
|
|
|
|
# Make sure there are at least three arguments
|
2000-04-05 06:05:31 +04:00
|
|
|
if($#ARGV < 2)
|
1999-09-15 23:26:18 +04:00
|
|
|
{
|
2001-02-06 10:43:25 +03:00
|
|
|
PrintUsage();
|
1999-09-15 23:26:18 +04:00
|
|
|
}
|
|
|
|
|
2000-09-07 13:34:29 +04:00
|
|
|
require "$ENV{MOZ_SRC}\\mozilla\\config\\zipcfunc.pl";
|
|
|
|
|
1999-12-03 03:12:27 +03:00
|
|
|
$inDefaultVersion = $ARGV[0];
|
2000-04-05 06:05:31 +04:00
|
|
|
$inStagePath = $ARGV[1];
|
|
|
|
$inDistPath = $ARGV[2];
|
|
|
|
|
2001-02-06 10:43:25 +03:00
|
|
|
$inXpiURL = "";
|
|
|
|
$inRedirIniURL = "";
|
|
|
|
|
|
|
|
ParseArgv(@ARGV);
|
|
|
|
if($inXpiURL eq "")
|
|
|
|
{
|
|
|
|
# archive url not supplied, set it to default values
|
|
|
|
$inXpiURL = "ftp://not.supplied.com";
|
|
|
|
}
|
|
|
|
if($inRedirIniURL eq "")
|
|
|
|
{
|
|
|
|
# redirect url not supplied, set it to default value.
|
|
|
|
$inRedirIniURL = $inXpiURL;
|
|
|
|
}
|
2000-04-05 06:05:31 +04:00
|
|
|
|
1999-12-03 03:12:27 +03:00
|
|
|
$seiFileNameGeneric = "nsinstall.exe";
|
|
|
|
$seiFileNameSpecific = "mozilla-win32-installer.exe";
|
2001-01-27 04:49:57 +03:00
|
|
|
$seiFileNameSpecificStub = "mozilla-win32-stub-installer.exe";
|
2000-04-17 03:07:11 +04:00
|
|
|
$seuFileNameSpecific = "MozillaUninstall.exe";
|
2001-08-03 02:02:48 +04:00
|
|
|
$seuzFileNameSpecific = "mozillauninstall.zip";
|
2000-04-17 03:07:11 +04:00
|
|
|
|
|
|
|
# set environment vars for use by other .pl scripts called from this script.
|
2001-09-11 04:33:23 +04:00
|
|
|
$ENV{WIZ_userAgent} = "0.9.4+ (en)"; # ie: "0.9 (en)"
|
|
|
|
$ENV{WIZ_userAgentShort} = "0.9.4+"; # ie: "0.9"
|
|
|
|
$ENV{WIZ_xpinstallVersion} = "0.9.4+"; # ie: "0.9.0"
|
2001-05-10 11:33:40 +04:00
|
|
|
$ENV{WIZ_nameCompany} = "mozilla.org";
|
2001-01-27 04:49:57 +03:00
|
|
|
$ENV{WIZ_nameProduct} = "Mozilla";
|
2000-04-17 03:07:11 +04:00
|
|
|
$ENV{WIZ_fileMainExe} = "Mozilla.exe";
|
|
|
|
$ENV{WIZ_fileUninstall} = $seuFileNameSpecific;
|
2001-08-03 02:02:48 +04:00
|
|
|
$ENV{WIZ_fileUninstallZip} = $seuzFileNameSpecific;
|
1999-09-15 23:26:18 +04:00
|
|
|
|
2000-09-13 09:39:19 +04:00
|
|
|
# Set the location of the local tmp stage directory
|
2001-06-09 03:48:29 +04:00
|
|
|
$gLocalTmpStage = $inStagePath;
|
2000-09-13 09:39:19 +04:00
|
|
|
|
2001-01-27 04:49:57 +03:00
|
|
|
# Check for existence of staging path
|
2000-09-13 09:39:19 +04:00
|
|
|
if(!(-d "$inStagePath"))
|
|
|
|
{
|
|
|
|
die "\n Invalid path: $inStagePath\n";
|
|
|
|
}
|
|
|
|
|
|
|
|
# List of components for to create xpi files from
|
|
|
|
@gComponentList = ("xpcom",
|
|
|
|
"browser",
|
|
|
|
"mail",
|
2000-12-22 05:49:33 +03:00
|
|
|
"psm",
|
2001-03-14 03:24:23 +03:00
|
|
|
"talkback",
|
2000-09-13 09:39:19 +04:00
|
|
|
"chatzilla",
|
|
|
|
"deflenus",
|
2001-02-23 11:34:10 +03:00
|
|
|
"langenus",
|
|
|
|
"regus");
|
2000-09-13 09:39:19 +04:00
|
|
|
|
|
|
|
if(VerifyComponents()) # return value of 0 means no errors encountered
|
1999-09-15 23:26:18 +04:00
|
|
|
{
|
2000-09-13 09:39:19 +04:00
|
|
|
exit(1);
|
1999-09-15 23:26:18 +04:00
|
|
|
}
|
|
|
|
|
2000-04-17 03:07:11 +04:00
|
|
|
# Make sure inDistPath exists
|
2000-09-13 09:39:19 +04:00
|
|
|
if(!(-d "$inDistPath"))
|
1999-09-15 23:26:18 +04:00
|
|
|
{
|
2000-04-17 03:07:11 +04:00
|
|
|
mkdir ("$inDistPath",0775);
|
1999-09-15 23:26:18 +04:00
|
|
|
}
|
|
|
|
|
2000-09-13 09:39:19 +04:00
|
|
|
if(-d "$inDistPath\\xpi")
|
2000-04-26 09:04:21 +04:00
|
|
|
{
|
|
|
|
unlink <$inDistPath\\xpi\\*>;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
mkdir ("$inDistPath\\xpi",0775);
|
|
|
|
}
|
|
|
|
|
2000-09-13 09:39:19 +04:00
|
|
|
if(-d "$inDistPath\\uninstall")
|
2000-04-17 03:07:11 +04:00
|
|
|
{
|
|
|
|
unlink <$inDistPath\\uninstall\\*>;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
mkdir ("$inDistPath\\uninstall",0775);
|
|
|
|
}
|
1999-11-11 04:54:58 +03:00
|
|
|
|
2000-09-13 09:39:19 +04:00
|
|
|
if(-d "$inDistPath\\setup")
|
1999-09-15 23:26:18 +04:00
|
|
|
{
|
|
|
|
unlink <$inDistPath\\setup\\*>;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2000-01-24 16:54:29 +03:00
|
|
|
mkdir ("$inDistPath\\setup",0775);
|
1999-09-15 23:26:18 +04:00
|
|
|
}
|
|
|
|
|
2000-09-13 09:39:19 +04:00
|
|
|
if(MakeXpiFile())
|
|
|
|
{
|
|
|
|
exit(1);
|
|
|
|
}
|
|
|
|
if(MakeUninstall())
|
|
|
|
{
|
|
|
|
exit(1);
|
|
|
|
}
|
|
|
|
if(MakeConfigFile())
|
|
|
|
{
|
|
|
|
exit(1);
|
|
|
|
}
|
2000-04-27 06:25:50 +04:00
|
|
|
|
1999-09-15 23:26:18 +04:00
|
|
|
# Copy the setup files to the dist setup directory.
|
2001-05-04 01:47:18 +04:00
|
|
|
if(system("copy install.ini $inDistPath"))
|
2001-01-27 04:49:57 +03:00
|
|
|
{
|
2001-05-04 01:47:18 +04:00
|
|
|
die "\n Error: copy install.ini $inDistPath\n";
|
|
|
|
}
|
|
|
|
if(system("copy install.ini $inDistPath\\setup"))
|
|
|
|
{
|
|
|
|
die "\n Error: copy install.ini $inDistPath\\setup\n";
|
2001-01-27 04:49:57 +03:00
|
|
|
}
|
2000-09-13 09:39:19 +04:00
|
|
|
if(system("copy config.ini $inDistPath"))
|
2000-09-07 13:34:29 +04:00
|
|
|
{
|
|
|
|
die "\n Error: copy config.ini $inDistPath\n";
|
|
|
|
}
|
2000-09-13 09:39:19 +04:00
|
|
|
if(system("copy config.ini $inDistPath\\setup"))
|
2000-09-07 13:34:29 +04:00
|
|
|
{
|
|
|
|
die "\n Error: copy config.ini $inDistPath\\setup\n";
|
|
|
|
}
|
2000-09-13 09:39:19 +04:00
|
|
|
if(system("copy $inDistPath\\setup.exe $inDistPath\\setup"))
|
2000-09-07 13:34:29 +04:00
|
|
|
{
|
|
|
|
die "\n Error: copy $inDistPath\\setup.exe $inDistPath\\setup\n";
|
|
|
|
}
|
2000-09-13 09:39:19 +04:00
|
|
|
if(system("copy $inDistPath\\setuprsc.dll $inDistPath\\setup"))
|
2000-09-07 13:34:29 +04:00
|
|
|
{
|
|
|
|
die "\n Error: copy $inDistPath\\setuprsc.dll $inDistPath\\setup\n";
|
|
|
|
}
|
1999-09-15 23:26:18 +04:00
|
|
|
|
2001-03-14 03:24:23 +03:00
|
|
|
# copy license file for the installer
|
|
|
|
if(system("copy $ENV{MOZ_SRC}\\mozilla\\LICENSE $inDistPath\\license.txt"))
|
|
|
|
{
|
|
|
|
die "\n Error: copy $ENV{MOZ_SRC}\\mozilla\\LICENSE $inDistPath\\license.txt\n";
|
|
|
|
}
|
|
|
|
if(system("copy $ENV{MOZ_SRC}\\mozilla\\LICENSE $inDistPath\\setup\\license.txt"))
|
|
|
|
{
|
|
|
|
die "\n Error: copy $ENV{MOZ_SRC}\\mozilla\\LICENSE $inDistPath\\setup\\license.txt\n";
|
|
|
|
}
|
|
|
|
|
2000-04-17 03:07:11 +04:00
|
|
|
# build the self-extracting .exe (installer) file.
|
2001-01-27 04:49:57 +03:00
|
|
|
print "\nbuilding self-extracting stub installer ($seiFileNameSpecificStub)...\n";
|
|
|
|
if(system("copy $inDistPath\\$seiFileNameGeneric $inDistPath\\$seiFileNameSpecificStub"))
|
|
|
|
{
|
|
|
|
die "\n Error: copy $inDistPath\\$seiFileNameGeneric $inDistPath\\$seiFileNameSpecificStub\n";
|
|
|
|
}
|
|
|
|
if(system("$inDistPath\\nsztool.exe $inDistPath\\$seiFileNameSpecificStub $inDistPath\\setup\\*.*"))
|
|
|
|
{
|
|
|
|
die "\n Error: inDistPath\\nsztool.exe $inDistPath\\$seiFileNameSpecificStub $inDistPath\\setup\\*.*\n";
|
|
|
|
}
|
|
|
|
|
|
|
|
# copy the lean installer to stub\ dir
|
|
|
|
print "\n****************************\n";
|
|
|
|
print "* *\n";
|
|
|
|
print "* creating Stub files... *\n";
|
|
|
|
print "* *\n";
|
|
|
|
print "****************************\n";
|
|
|
|
if(-d "$inDistPath\\stub")
|
|
|
|
{
|
|
|
|
unlink <$inDistPath\\stub\\*>;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
mkdir ("$inDistPath\\stub",0775);
|
|
|
|
}
|
|
|
|
if(system("copy $inDistPath\\$seiFileNameSpecificStub $inDistPath\\stub"))
|
|
|
|
{
|
|
|
|
die "\n Error: copy $inDistPath\\$seiFileNameSpecificStub $inDistPath\\stub\n";
|
|
|
|
}
|
|
|
|
|
|
|
|
# group files for CD
|
|
|
|
print "\n************************************\n";
|
|
|
|
print "* *\n";
|
|
|
|
print "* creating Compact Disk files... *\n";
|
|
|
|
print "* *\n";
|
|
|
|
print "************************************\n";
|
|
|
|
if(-d "$inDistPath\\cd")
|
|
|
|
{
|
|
|
|
unlink <$inDistPath\\cd\\*>;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
mkdir ("$inDistPath\\cd",0775);
|
|
|
|
}
|
|
|
|
if(system("copy $inDistPath\\$seiFileNameSpecificStub $inDistPath\\cd"))
|
|
|
|
{
|
|
|
|
die "\n Error: copy $inDistPath\\$seiFileNameSpecificStub $inDistPath\\cd\n";
|
|
|
|
}
|
|
|
|
if(system("copy $inDistPath\\xpi $inDistPath\\cd"))
|
|
|
|
{
|
|
|
|
die "\n Error: copy $inDistPath\\xpi $inDistPath\\cd\n";
|
|
|
|
}
|
|
|
|
|
|
|
|
# create the big self extracting .exe installer
|
|
|
|
print "\n**************************************************************\n";
|
|
|
|
print "* *\n";
|
|
|
|
print "* creating Self Extracting Executable Full Install file... *\n";
|
|
|
|
print "* *\n";
|
|
|
|
print "**************************************************************\n";
|
|
|
|
if(-d "$inDistPath\\sea")
|
|
|
|
{
|
|
|
|
unlink <$inDistPath\\sea\\*>;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
mkdir ("$inDistPath\\sea",0775);
|
|
|
|
}
|
2000-09-13 09:39:19 +04:00
|
|
|
if(system("copy $inDistPath\\$seiFileNameGeneric $inDistPath\\$seiFileNameSpecific"))
|
2000-09-07 13:34:29 +04:00
|
|
|
{
|
|
|
|
die "\n Error: copy $inDistPath\\$seiFileNameGeneric $inDistPath\\$seiFileNameSpecific\n";
|
|
|
|
}
|
2000-09-13 09:39:19 +04:00
|
|
|
if(system("$inDistPath\\nsztool.exe $inDistPath\\$seiFileNameSpecific $inDistPath\\setup\\*.* $inDistPath\\xpi\\*.*"))
|
2000-09-07 13:34:29 +04:00
|
|
|
{
|
|
|
|
die "\n Error: $inDistPath\\nsztool.exe $inDistPath\\$seiFileNameSpecific $inDistPath\\setup\\*.* $inDistPath\\xpi\\*.*\n";
|
|
|
|
}
|
2001-01-27 04:49:57 +03:00
|
|
|
if(system("copy $inDistPath\\$seiFileNameSpecific $inDistPath\\sea"))
|
|
|
|
{
|
|
|
|
die "\n Error: copy $inDistPath\\$seiFileNameSpecific $inDistPath\\sea\n";
|
|
|
|
}
|
|
|
|
unlink <$inDistPath\\$seiFileNameSpecificStub>;
|
1999-09-15 23:26:18 +04:00
|
|
|
|
2000-05-08 09:09:35 +04:00
|
|
|
print " done!\n\n";
|
|
|
|
|
|
|
|
if((!(-e "$ENV{MOZ_SRC}\\redist\\microsoft\\system\\msvcrt.dll")) ||
|
|
|
|
(!(-e "$ENV{MOZ_SRC}\\redist\\microsoft\\system\\msvcirt.dll")))
|
|
|
|
{
|
|
|
|
print "***\n";
|
|
|
|
print "**\n";
|
|
|
|
print "** The following required Microsoft redistributable system files were not found\n";
|
|
|
|
print "** in $ENV{MOZ_SRC}\\redist\\microsoft\\system:\n";
|
|
|
|
print "**\n";
|
|
|
|
if(!(-e "$ENV{MOZ_SRC}\\redist\\microsoft\\system\\msvcrt.dll"))
|
|
|
|
{
|
|
|
|
print "** msvcrt.dll\n";
|
|
|
|
}
|
|
|
|
if(!(-e "$ENV{MOZ_SRC}\\redist\\microsoft\\system\\msvcirt.dll"))
|
|
|
|
{
|
|
|
|
print "** msvcirt.dll\n";
|
|
|
|
}
|
|
|
|
print "**\n";
|
|
|
|
print "** The above files are required by the installer and the browser. If you attempt\n";
|
|
|
|
print "** to run the installer, you may encounter the following bug:\n";
|
|
|
|
print "**\n";
|
|
|
|
print "** http://bugzilla.mozilla.org/show_bug.cgi?id=27601\n";
|
|
|
|
print "**\n";
|
|
|
|
print "***\n\n";
|
|
|
|
}
|
1999-09-15 23:26:18 +04:00
|
|
|
|
|
|
|
# end of script
|
|
|
|
exit(0);
|
|
|
|
|
2001-08-03 02:02:48 +04:00
|
|
|
sub MakeExeZip
|
|
|
|
{
|
|
|
|
my($aSrcDir, $aExeFile, $aZipFile) = @_;
|
|
|
|
my($saveCwdir);
|
|
|
|
|
|
|
|
$saveCwdir = cwd();
|
|
|
|
chdir($aSrcDir);
|
|
|
|
if(system("$ENV{MOZ_TOOLS}\\bin\\zip $inDistPath\\xpi\\$aZipFile $aExeFile"))
|
|
|
|
{
|
|
|
|
chdir($saveCwdir);
|
|
|
|
die "\n Error: $ENV{MOZ_TOOLS}\\bin\\zip $inDistPath\\xpi\\$aZipFile $aExeFile";
|
|
|
|
}
|
|
|
|
chdir($saveCwdir);
|
|
|
|
}
|
|
|
|
|
2001-02-06 10:43:25 +03:00
|
|
|
sub PrintUsage
|
|
|
|
{
|
|
|
|
die "usage: $0 <default version> <staging path> <dist install path> [options]
|
|
|
|
|
|
|
|
default version : y2k compliant based date version.
|
|
|
|
ie: 5.0.0.2000040413
|
|
|
|
|
|
|
|
staging path : full path to where the components are staged at
|
|
|
|
|
|
|
|
dist install path : full path to where the dist install dir is at.
|
|
|
|
ie: d:\\builds\\mozilla\\dist\\win32_o.obj\\install
|
|
|
|
|
|
|
|
options include:
|
|
|
|
-aurl <archive url> : either ftp:// or http:// url to where the
|
|
|
|
archives (.xpi, .exe, .zip, etc...) reside
|
|
|
|
|
|
|
|
-rurl <redirect.ini url> : either ftp:// or http:// url to where the
|
|
|
|
redirec.ini resides. If not supplied, it
|
|
|
|
will be assumed to be the same as archive
|
|
|
|
url.
|
|
|
|
\n";
|
|
|
|
}
|
|
|
|
|
|
|
|
sub ParseArgv
|
|
|
|
{
|
|
|
|
my(@myArgv) = @_;
|
|
|
|
my($counter);
|
|
|
|
|
|
|
|
# The first 3 arguments are required, so start on the 4th.
|
|
|
|
for($counter = 3; $counter <= $#myArgv; $counter++)
|
|
|
|
{
|
|
|
|
if($myArgv[$counter] =~ /^[-,\/]h$/i)
|
|
|
|
{
|
|
|
|
PrintUsage();
|
|
|
|
}
|
|
|
|
elsif($myArgv[$counter] =~ /^[-,\/]aurl$/i)
|
|
|
|
{
|
|
|
|
if($#myArgv >= ($counter + 1))
|
|
|
|
{
|
|
|
|
++$counter;
|
|
|
|
$inXpiURL = $myArgv[$counter];
|
|
|
|
$inRedirIniURL = $inXpiURL;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
elsif($myArgv[$counter] =~ /^[-,\/]rurl$/i)
|
|
|
|
{
|
|
|
|
if($#myArgv >= ($counter + 1))
|
|
|
|
{
|
|
|
|
++$counter;
|
|
|
|
$inRedirIniURL = $myArgv[$counter];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
1999-09-15 23:26:18 +04:00
|
|
|
sub MakeConfigFile
|
|
|
|
{
|
|
|
|
# Make config.ini file
|
2001-02-06 10:43:25 +03:00
|
|
|
if(system("perl makecfgini.pl config.it $inDefaultVersion $gLocalTmpStage $inDistPath\\xpi $inRedirIniURL $inXpiURL"))
|
2001-01-27 04:49:57 +03:00
|
|
|
{
|
2001-02-06 10:43:25 +03:00
|
|
|
print "\n Error: perl makecfgini.pl config.it $inDefaultVersion $gLocalTmpStage $inDistPath\\xpi $inRedirIniURL $inXpiURL\n";
|
2001-01-27 04:49:57 +03:00
|
|
|
return(1);
|
|
|
|
}
|
|
|
|
|
2001-05-04 01:47:18 +04:00
|
|
|
# Make install.ini file
|
|
|
|
if(system("perl makecfgini.pl install.it $inDefaultVersion $gLocalTmpStage $inDistPath\\xpi $inRedirIniURL $inXpiURL"))
|
2000-04-17 03:07:11 +04:00
|
|
|
{
|
2001-05-04 01:47:18 +04:00
|
|
|
print "\n Error: perl makecfgini.pl install.it $inDefaultVersion $gLocalTmpStage $inDistPath\\xpi $inRedirIniURL $inXpiURL\n";
|
2000-09-13 09:39:19 +04:00
|
|
|
return(1);
|
2000-04-17 03:07:11 +04:00
|
|
|
}
|
2000-09-13 09:39:19 +04:00
|
|
|
return(0);
|
2000-04-17 03:07:11 +04:00
|
|
|
}
|
|
|
|
|
2000-04-27 06:25:50 +04:00
|
|
|
sub MakeUninstall
|
|
|
|
{
|
2000-09-13 09:39:19 +04:00
|
|
|
if(MakeUninstallIniFile())
|
|
|
|
{
|
|
|
|
return(1);
|
|
|
|
}
|
2000-04-27 06:25:50 +04:00
|
|
|
|
|
|
|
# Copy the uninstall files to the dist uninstall directory.
|
2000-09-13 09:39:19 +04:00
|
|
|
if(system("copy uninstall.ini $inDistPath"))
|
2000-09-07 13:34:29 +04:00
|
|
|
{
|
2000-09-13 09:39:19 +04:00
|
|
|
print "\n Error: copy uninstall.ini $inDistPath\n";
|
|
|
|
return(1);
|
2000-09-07 13:34:29 +04:00
|
|
|
}
|
2000-09-13 09:39:19 +04:00
|
|
|
if(system("copy uninstall.ini $inDistPath\\uninstall"))
|
2000-09-07 13:34:29 +04:00
|
|
|
{
|
2000-09-13 09:39:19 +04:00
|
|
|
print "\n Error: copy uninstall.ini $inDistPath\\uninstall\n";
|
|
|
|
return(1);
|
2000-09-07 13:34:29 +04:00
|
|
|
}
|
2000-09-13 09:39:19 +04:00
|
|
|
if(system("copy $inDistPath\\uninstall.exe $inDistPath\\uninstall"))
|
2000-09-07 13:34:29 +04:00
|
|
|
{
|
2000-09-13 09:39:19 +04:00
|
|
|
print "\n Error: copy $inDistPath\\uninstall.exe $inDistPath\\uninstall\n";
|
|
|
|
return(1);
|
2000-09-07 13:34:29 +04:00
|
|
|
}
|
2000-04-27 06:25:50 +04:00
|
|
|
|
|
|
|
# build the self-extracting .exe (uninstaller) file.
|
|
|
|
print "\nbuilding self-extracting uninstaller ($seuFileNameSpecific)...\n";
|
2000-09-13 09:39:19 +04:00
|
|
|
if(system("copy $inDistPath\\$seiFileNameGeneric $inDistPath\\$seuFileNameSpecific"))
|
2000-09-07 13:34:29 +04:00
|
|
|
{
|
2000-09-13 09:39:19 +04:00
|
|
|
print "\n Error: copy $inDistPath\\$seiFileNameGeneric $inDistPath\\$seuFileNameSpecific\n";
|
|
|
|
return(1);
|
2000-09-07 13:34:29 +04:00
|
|
|
}
|
2000-09-13 09:39:19 +04:00
|
|
|
if(system("$inDistPath\\nsztool.exe $inDistPath\\$seuFileNameSpecific $inDistPath\\uninstall\\*.*"))
|
2000-09-07 13:34:29 +04:00
|
|
|
{
|
2000-09-13 09:39:19 +04:00
|
|
|
print "\n Error: $inDistPath\\nsztool.exe $inDistPath\\$seuFileNameSpecific $inDistPath\\uninstall\\*.*\n";
|
|
|
|
return(1);
|
2000-09-07 13:34:29 +04:00
|
|
|
}
|
2001-08-03 02:02:48 +04:00
|
|
|
|
|
|
|
MakeExeZip($inDistPath, $seuFileNameSpecific, $seuzFileNameSpecific);
|
|
|
|
unlink <$inDistPath\\$seuFileNameSpecific>;
|
2000-09-13 09:39:19 +04:00
|
|
|
return(0);
|
2000-04-27 06:25:50 +04:00
|
|
|
}
|
|
|
|
|
2000-04-17 03:07:11 +04:00
|
|
|
sub MakeUninstallIniFile
|
|
|
|
{
|
|
|
|
# Make config.ini file
|
2000-09-13 09:39:19 +04:00
|
|
|
if(system("perl makeuninstallini.pl uninstall.it $inDefaultVersion"))
|
1999-09-15 23:26:18 +04:00
|
|
|
{
|
2000-09-13 09:39:19 +04:00
|
|
|
print "\n Error: perl makeuninstallini.pl uninstall.it $inDefaultVersion\n";
|
|
|
|
return(1);
|
1999-09-15 23:26:18 +04:00
|
|
|
}
|
2000-09-13 09:39:19 +04:00
|
|
|
return(0);
|
1999-09-15 23:26:18 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
sub MakeJsFile
|
|
|
|
{
|
2000-09-13 09:39:19 +04:00
|
|
|
my($mComponent) = @_;
|
1999-11-23 01:50:30 +03:00
|
|
|
|
|
|
|
# Make .js file
|
2000-09-13 09:39:19 +04:00
|
|
|
if(system("perl makejs.pl $mComponent.jst $inDefaultVersion $gLocalTmpStage\\$mComponent"))
|
1999-09-15 23:26:18 +04:00
|
|
|
{
|
2000-09-13 09:39:19 +04:00
|
|
|
print "\n Error: perl makejs.pl $mComponent.jst $inDefaultVersion $gLocalTmpStage\\$mComponent\n";
|
|
|
|
return(1);
|
1999-09-15 23:26:18 +04:00
|
|
|
}
|
2000-09-13 09:39:19 +04:00
|
|
|
return(0);
|
1999-09-15 23:26:18 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
sub MakeXpiFile
|
|
|
|
{
|
2000-09-13 09:39:19 +04:00
|
|
|
my($mComponent);
|
|
|
|
|
|
|
|
foreach $mComponent (@gComponentList)
|
|
|
|
{
|
|
|
|
# Make .js files
|
|
|
|
if(MakeJsFile($mComponent))
|
|
|
|
{
|
|
|
|
return(1);
|
|
|
|
}
|
|
|
|
|
|
|
|
# Make .xpi file
|
|
|
|
if(system("perl makexpi.pl $mComponent $gLocalTmpStage $inDistPath\\xpi"))
|
|
|
|
{
|
|
|
|
print "\n Error: perl makexpi.pl $mComponent $gLocalTmpStage $inDistPath\\xpi\n";
|
|
|
|
return(1);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return(0);
|
|
|
|
}
|
|
|
|
|
|
|
|
sub RemoveLocalTmpStage()
|
|
|
|
{
|
|
|
|
# Remove tmpstage area
|
|
|
|
if(-d "$gLocalTmpStage")
|
|
|
|
{
|
|
|
|
system("perl rdir.pl $gLocalTmpStage");
|
|
|
|
}
|
|
|
|
return(0);
|
|
|
|
}
|
1999-09-15 23:26:18 +04:00
|
|
|
|
2000-09-13 09:39:19 +04:00
|
|
|
sub CreateTmpStage()
|
|
|
|
{
|
|
|
|
my($mComponent);
|
2000-09-07 13:34:29 +04:00
|
|
|
|
2000-09-13 09:39:19 +04:00
|
|
|
# Remove previous tmpstage area if one was left around
|
|
|
|
if(-d "$gLocalTmpStage")
|
|
|
|
{
|
|
|
|
system("perl rdir.pl $gLocalTmpStage");
|
|
|
|
}
|
|
|
|
|
|
|
|
print "\n Creating the local TmpStage directory:\n";
|
|
|
|
print " $gLocalTmpStage\n";
|
|
|
|
|
|
|
|
# Copy the component's staging dir locally so that the chrome packages, locales, and skins dirs can be
|
|
|
|
# removed prior to creating the .xpi file.
|
|
|
|
mkdir("$gLocalTmpStage", 775);
|
|
|
|
|
|
|
|
foreach $mComponent (@gComponentList)
|
|
|
|
{
|
|
|
|
print "\n Copying $mComponent:\n";
|
|
|
|
print " From: $inStagePath\\$mComponent\n";
|
|
|
|
print " To: $gLocalTmpStage\\$mComponent\n\n";
|
|
|
|
mkdir("$gLocalTmpStage\\$mComponent", 775);
|
2001-03-14 03:24:23 +03:00
|
|
|
|
|
|
|
# If it's not talkback then copy the component over to the local tmp stage.
|
|
|
|
# If it is, then skip the copy because there will be nothing at the source.
|
|
|
|
# Talkback is a dummy place holder .xpi right now. Mozilla release team
|
|
|
|
# replaces this place holder .xpi with a real talkback when delivering the
|
|
|
|
# build to mozilla.org.
|
|
|
|
if(!($mComponent =~ /talkback/i))
|
2000-09-13 09:39:19 +04:00
|
|
|
{
|
2001-03-14 03:24:23 +03:00
|
|
|
if(system("xcopy /s/e $inStagePath\\$mComponent $gLocalTmpStage\\$mComponent\\"))
|
|
|
|
{
|
|
|
|
print "\n Error: xcopy /s/e $inStagePath\\$mComponent $gLocalTmpStage\\$mComponent\\\n";
|
|
|
|
return(1);
|
|
|
|
}
|
2000-09-13 09:39:19 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
if(-d "$gLocalTmpStage\\$mComponent\\bin\\chrome")
|
|
|
|
{
|
|
|
|
# Make chrome archive files
|
|
|
|
if(&ZipChrome("win32", "noupdate", "$gLocalTmpStage\\$mComponent\\bin\\chrome", "$gLocalTmpStage\\$mComponent\\bin\\chrome"))
|
|
|
|
{
|
|
|
|
return(1);
|
|
|
|
}
|
|
|
|
|
|
|
|
# Remove the locales, packages, and skins dirs if they exist.
|
2000-09-20 23:35:24 +04:00
|
|
|
my @dirs = <$gLocalTmpStage\\$mComponent\\bin\\chrome\\*>;
|
|
|
|
foreach $d (@dirs) {
|
|
|
|
if(-d "$d")
|
|
|
|
{
|
|
|
|
system("perl rdir.pl $d");
|
|
|
|
}
|
2000-09-13 09:39:19 +04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return(0);
|
|
|
|
}
|
|
|
|
|
|
|
|
sub VerifyComponents()
|
|
|
|
{
|
|
|
|
my($mComponent);
|
|
|
|
my($mError) = 0;
|
2000-06-24 02:57:34 +04:00
|
|
|
|
2001-01-27 04:49:57 +03:00
|
|
|
print "\n Verifying existence of required components...\n";
|
2000-09-13 09:39:19 +04:00
|
|
|
foreach $mComponent (@gComponentList)
|
1999-09-15 23:26:18 +04:00
|
|
|
{
|
2001-03-14 03:24:23 +03:00
|
|
|
if($mComponent =~ /talkback/i)
|
|
|
|
{
|
|
|
|
print " place holder: $inStagePath\\$mComponent\n";
|
2001-06-09 03:48:29 +04:00
|
|
|
mkdir("$inStagePath\\$mComponent", 775);
|
2001-03-14 03:24:23 +03:00
|
|
|
}
|
|
|
|
elsif(-d "$inStagePath\\$mComponent")
|
2000-09-13 09:39:19 +04:00
|
|
|
{
|
2001-03-14 03:24:23 +03:00
|
|
|
print " ok: $inStagePath\\$mComponent\n";
|
2000-09-13 09:39:19 +04:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2001-03-14 03:24:23 +03:00
|
|
|
print " Error: $inStagePath\\$mComponent does not exist!\n";
|
2000-09-13 09:39:19 +04:00
|
|
|
$mError = 1;
|
|
|
|
}
|
1999-09-15 23:26:18 +04:00
|
|
|
}
|
2000-09-13 09:39:19 +04:00
|
|
|
return($mError);
|
1999-09-15 23:26:18 +04:00
|
|
|
}
|
|
|
|
|