1999-09-15 23:26:18 +04:00
|
|
|
#!c:\perl\bin\perl
|
|
|
|
#
|
|
|
|
# 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.
|
|
|
|
#
|
|
|
|
|
|
|
|
# Make sure there are at least four arguments
|
2000-04-05 06:05:31 +04:00
|
|
|
if($#ARGV < 2)
|
1999-09-15 23:26:18 +04:00
|
|
|
{
|
2000-04-05 06:05:31 +04:00
|
|
|
die "usage: $0 <default version> <staging path> <dist install path>
|
1999-09-15 23:26:18 +04:00
|
|
|
|
2000-04-05 06:05:31 +04:00
|
|
|
default version : y2k compliant based date version.
|
|
|
|
ie: 5.0.0.2000040413
|
1999-09-15 23:26:18 +04:00
|
|
|
|
|
|
|
staging path : full path to where the components are staged at
|
|
|
|
|
2000-04-05 06:05:31 +04:00
|
|
|
dist install path : full path to where the dist install dir is at.
|
|
|
|
ie: d:\\builds\\mozilla\\dist\\win32_o.obj\\install
|
1999-09-15 23:26:18 +04:00
|
|
|
\n";
|
|
|
|
}
|
|
|
|
|
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];
|
|
|
|
|
|
|
|
$inRedirIniUrl = "ftp://not.needed.com/because/the/xpi/files/will/be/located/in/the/same/dir/as/the/installer";
|
|
|
|
$inXpiUrl = "ftp://not.needed.com/because/the/xpi/files/will/be/located/in/the/same/dir/as/the/installer";
|
|
|
|
|
1999-12-03 03:12:27 +03:00
|
|
|
$seiFileNameGeneric = "nsinstall.exe";
|
|
|
|
$seiFileNameSpecific = "mozilla-win32-installer.exe";
|
2000-04-17 03:07:11 +04:00
|
|
|
$seuFileNameSpecific = "MozillaUninstall.exe";
|
|
|
|
|
|
|
|
# set environment vars for use by other .pl scripts called from this script.
|
|
|
|
$ENV{WIZ_userAgent} = "5.0b2 (en)";
|
|
|
|
$ENV{WIZ_nameCompany} = "Mozilla";
|
|
|
|
$ENV{WIZ_nameProduct} = "Mozilla Seamonkey";
|
|
|
|
$ENV{WIZ_fileMainExe} = "Mozilla.exe";
|
|
|
|
$ENV{WIZ_fileUninstall} = $seuFileNameSpecific;
|
1999-09-15 23:26:18 +04:00
|
|
|
|
|
|
|
# Check for existance of staging path
|
|
|
|
if(!(-e "$inStagePath"))
|
|
|
|
{
|
|
|
|
die "invalid path: $inStagePath\n";
|
|
|
|
}
|
|
|
|
|
2000-04-17 03:07:11 +04:00
|
|
|
# Make sure inDistPath exists
|
1999-09-15 23:26:18 +04:00
|
|
|
if(!(-e "$inDistPath"))
|
|
|
|
{
|
2000-04-17 03:07:11 +04:00
|
|
|
mkdir ("$inDistPath",0775);
|
1999-09-15 23:26:18 +04:00
|
|
|
}
|
|
|
|
|
2000-04-26 09:04:21 +04:00
|
|
|
if(-e "$inDistPath\\xpi")
|
|
|
|
{
|
|
|
|
unlink <$inDistPath\\xpi\\*>;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
mkdir ("$inDistPath\\xpi",0775);
|
|
|
|
}
|
|
|
|
|
1999-11-23 01:50:30 +03:00
|
|
|
# Make .js files
|
2000-04-19 04:51:00 +04:00
|
|
|
MakeJsFile("xpcom");
|
2000-02-10 10:11:36 +03:00
|
|
|
MakeJsFile("browser");
|
1999-11-23 01:50:30 +03:00
|
|
|
MakeJsFile("mail");
|
1999-09-15 23:26:18 +04:00
|
|
|
|
1999-11-23 01:50:30 +03:00
|
|
|
# Make .xpi files
|
2000-04-19 04:51:00 +04:00
|
|
|
MakeXpiFile("xpcom");
|
2000-02-10 10:11:36 +03:00
|
|
|
MakeXpiFile("browser");
|
1999-09-15 23:26:18 +04:00
|
|
|
MakeXpiFile("mail");
|
|
|
|
|
1999-11-11 04:54:58 +03:00
|
|
|
MakeConfigFile();
|
2000-04-17 03:07:11 +04:00
|
|
|
MakeUninstallIniFile();
|
|
|
|
|
|
|
|
if(-e "$inDistPath\\uninstall")
|
|
|
|
{
|
|
|
|
unlink <$inDistPath\\uninstall\\*>;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
mkdir ("$inDistPath\\uninstall",0775);
|
|
|
|
}
|
1999-11-11 04:54:58 +03:00
|
|
|
|
1999-09-15 23:26:18 +04:00
|
|
|
if(-e "$inDistPath\\setup")
|
|
|
|
{
|
|
|
|
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-04-17 03:07:11 +04:00
|
|
|
# Copy the uninstall files to the dist uninstall directory.
|
2000-04-26 09:04:21 +04:00
|
|
|
system("copy uninstall.ini $inDistPath");
|
|
|
|
system("copy uninstall.ini $inDistPath\\uninstall");
|
|
|
|
system("copy $inDistPath\\uninstall.exe $inDistPath\\uninstall");
|
2000-04-17 03:07:11 +04:00
|
|
|
|
1999-09-15 23:26:18 +04:00
|
|
|
# Copy the setup files to the dist setup directory.
|
2000-04-26 09:04:21 +04:00
|
|
|
system("copy config.ini $inDistPath");
|
|
|
|
system("copy config.ini $inDistPath\\setup");
|
|
|
|
system("copy $inDistPath\\setup.exe $inDistPath\\setup");
|
|
|
|
system("copy $inDistPath\\setuprsc.dll $inDistPath\\setup");
|
1999-09-15 23:26:18 +04:00
|
|
|
|
2000-04-17 03:07:11 +04:00
|
|
|
# build the self-extracting .exe (uninstaller) file.
|
|
|
|
print "\nbuilding self-extracting uninstaller ($seuFileNameSpecific)...\n";
|
|
|
|
system("copy $inDistPath\\$seiFileNameGeneric $inDistPath\\$seuFileNameSpecific");
|
|
|
|
system("$inDistPath\\nszip.exe $inDistPath\\$seuFileNameSpecific $inDistPath\\uninstall\\*.*");
|
2000-04-26 09:04:21 +04:00
|
|
|
system("copy $inDistPath\\$seuFileNameSpecific $inDistPath\\xpi");
|
2000-04-17 03:07:11 +04:00
|
|
|
|
|
|
|
# build the self-extracting .exe (installer) file.
|
1999-12-03 03:12:27 +03:00
|
|
|
print "\nbuilding self-extracting installer ($seiFileNameSpecific)...\n";
|
1999-12-06 03:13:30 +03:00
|
|
|
system("copy $inDistPath\\$seiFileNameGeneric $inDistPath\\$seiFileNameSpecific");
|
1999-12-03 03:12:27 +03:00
|
|
|
system("$inDistPath\\nszip.exe $inDistPath\\$seiFileNameSpecific $inDistPath\\setup\\*.* $inDistPath\\xpi\\*.*");
|
1999-09-15 23:26:18 +04:00
|
|
|
|
|
|
|
print " done!\n";
|
|
|
|
|
|
|
|
# end of script
|
|
|
|
exit(0);
|
|
|
|
|
|
|
|
sub MakeConfigFile
|
|
|
|
{
|
|
|
|
# Make config.ini file
|
2000-04-17 03:07:11 +04:00
|
|
|
if(system("perl makecfgini.pl config.it $inDefaultVersion $inStagePath $inDistPath\\xpi $inRedirIniUrl $inXpiUrl") != 0)
|
|
|
|
{
|
|
|
|
exit(1);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
sub MakeUninstallIniFile
|
|
|
|
{
|
|
|
|
# Make config.ini file
|
|
|
|
if(system("perl makeuninstallini.pl uninstall.it $inDefaultVersion") != 0)
|
1999-09-15 23:26:18 +04:00
|
|
|
{
|
|
|
|
exit(1);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
sub MakeJsFile
|
|
|
|
{
|
1999-11-23 01:50:30 +03:00
|
|
|
my($componentName) = @_;
|
|
|
|
|
|
|
|
# Make .js file
|
2000-04-17 03:07:11 +04:00
|
|
|
if(system("perl makejs.pl $componentName.jst $inDefaultVersion $inStagePath\\$componentName") != 0)
|
1999-09-15 23:26:18 +04:00
|
|
|
{
|
1999-11-23 01:50:30 +03:00
|
|
|
exit(1);
|
1999-09-15 23:26:18 +04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
sub MakeXpiFile
|
|
|
|
{
|
|
|
|
my($componentName) = @_;
|
|
|
|
|
|
|
|
# Make .xpi file
|
|
|
|
if(system("perl makexpi.pl $componentName $inStagePath $inDistPath\\xpi") != 0)
|
|
|
|
{
|
|
|
|
exit(1);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|