2002-08-27 08:02:27 +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.
|
|
|
|
#
|
|
|
|
|
|
|
|
use Cwd;
|
2003-01-22 10:59:52 +03:00
|
|
|
use File::Copy;
|
|
|
|
use File::Path;
|
|
|
|
use File::Basename;
|
2002-08-27 08:02:27 +04:00
|
|
|
|
2003-01-22 10:59:52 +03:00
|
|
|
$DEPTH = "../../..";
|
|
|
|
$topsrcdir = GetTopSrcDir();
|
|
|
|
|
2003-03-13 00:40:19 +03:00
|
|
|
push(@INC, "$topsrcdir/xpinstall/packager");
|
|
|
|
require StageUtils;
|
2003-01-22 10:59:52 +03:00
|
|
|
require "$topsrcdir/config/zipcfunc.pl";
|
2002-08-27 08:02:27 +04:00
|
|
|
|
2003-03-13 00:40:19 +03:00
|
|
|
ParseArgv(@ARGV);
|
|
|
|
|
2003-07-01 01:47:55 +04:00
|
|
|
$topobjdir = "$topsrcdir" if !defined($topobjdir);
|
|
|
|
$inStagePath = "$topobjdir/stage" if !defined($inStagePath);
|
|
|
|
$inDistPath = "$topobjdir/dist" if !defined($inDistPath);
|
|
|
|
$inXpiURL = "ftp://not.supplied.invalid" if !defined($inXpiURL);
|
|
|
|
$inRedirIniURL = $inXpiURL if !defined($inRedirIniURL);
|
|
|
|
|
|
|
|
if(defined($ENV{DEBUG_INSTALLER_BUILD}))
|
|
|
|
{
|
|
|
|
print " win_mfcembed/makeall.pl\n";
|
|
|
|
print " topobjdir : $topobjdir\n";
|
|
|
|
print " topsrcdir : $topsrcdir\n";
|
|
|
|
print " inStagePath: $inStagePath\n";
|
|
|
|
print " inDistPath : $inDistPath\n";
|
|
|
|
}
|
|
|
|
|
|
|
|
$gDefaultProductVersion = StageUtils::GetProductY2KVersion($topobjdir, $topsrcdir, $topsrcdir);
|
|
|
|
|
2003-03-13 00:40:19 +03:00
|
|
|
print "\n";
|
|
|
|
print " Building MfcEmbed\n";
|
2003-07-01 01:47:55 +04:00
|
|
|
print " Raw version id : $gDefaultProductVersion\n";
|
2003-03-13 00:40:19 +03:00
|
|
|
|
2003-07-01 01:47:55 +04:00
|
|
|
# $gDefaultProductVersion has the form maj.min.release.bld where maj, min, release
|
2002-08-27 08:02:27 +04:00
|
|
|
# and bld are numerics representing version information.
|
|
|
|
# Other variables need to use parts of the version info also so we'll
|
2003-03-24 07:15:34 +03:00
|
|
|
# split out the dot separated values into the array @versionParts
|
2002-08-27 08:02:27 +04:00
|
|
|
# such that:
|
|
|
|
#
|
|
|
|
# $versionParts[0] = maj
|
|
|
|
# $versionParts[1] = min
|
|
|
|
# $versionParts[2] = release
|
|
|
|
# $versionParts[3] = bld
|
2003-07-01 01:47:55 +04:00
|
|
|
@versionParts = split /\./, $gDefaultProductVersion;
|
2002-08-27 08:02:27 +04:00
|
|
|
|
|
|
|
# We allow non-numeric characters to be included as the last
|
2003-07-01 01:47:55 +04:00
|
|
|
# characters in fields of $gDefaultProductVersion for display purposes (mostly to
|
2002-08-27 08:02:27 +04:00
|
|
|
# show that we have moved past a certain version by adding a '+'
|
2003-07-01 01:47:55 +04:00
|
|
|
# character). Non-numerics must be stripped out of $gDefaultProductVersion,
|
2002-08-27 08:02:27 +04:00
|
|
|
# however, since this variable is used to identify the the product
|
|
|
|
# for comparison with other installations, so the values in each field
|
|
|
|
# must be numeric only:
|
2003-07-01 01:47:55 +04:00
|
|
|
$gDefaultProductVersion =~ s/[^0-9.][^.]*//g;
|
2002-08-27 08:02:27 +04:00
|
|
|
|
2003-03-13 00:40:19 +03:00
|
|
|
# set environment vars for use by other .pl scripts called from this script.
|
|
|
|
if($versionParts[2] eq "0")
|
|
|
|
{
|
|
|
|
$versionMain = "$versionParts[0].$versionParts[1]";
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
$versionMain = "$versionParts[0].$versionParts[1].$versionParts[2]";
|
|
|
|
}
|
2002-08-27 08:02:27 +04:00
|
|
|
|
2003-03-13 00:40:19 +03:00
|
|
|
print " Display version : $versionMain\n";
|
2003-07-01 01:47:55 +04:00
|
|
|
print " Xpinstall version: $gDefaultProductVersion\n";
|
2003-03-13 00:40:19 +03:00
|
|
|
print "\n";
|
2002-08-27 08:02:27 +04:00
|
|
|
|
2003-01-22 10:59:52 +03:00
|
|
|
$gDirPackager = "$topsrcdir/xpinstall/packager";
|
|
|
|
$gDirDistInstall = "$inDistPath/inst_mfcembed";
|
2003-02-20 03:31:54 +03:00
|
|
|
$gDirDistInstGre = "$inDistPath/inst_gre";
|
|
|
|
$gDirStageProduct = "$inStagePath/mfcembed";
|
|
|
|
$seiFileNameGeneric = "nsinstall.exe";
|
|
|
|
$seiFileNameSpecific = "mfcembed-win32-installer.exe";
|
|
|
|
$seiStubRootName = "mfcembed-win32-stub-installer";
|
|
|
|
$seiFileNameSpecificStub = "$seiStubRootName.exe";
|
|
|
|
$seuFileNameSpecific = "MfcEmbedUninstall.exe";
|
|
|
|
$seuzFileNameSpecific = "mfcembeduninstall.zip";
|
|
|
|
$seiGreFileNameSpecific = "gre-win32-installer.exe";
|
|
|
|
$seizGreFileNameSpecific = "gre-win32-installer.zip";
|
|
|
|
|
2003-01-22 10:59:52 +03:00
|
|
|
# Build GRE installer package first before building Mozilla! GRE installer is required by the mozilla installer.
|
2003-07-01 01:47:55 +04:00
|
|
|
if(system("perl \"$gDirPackager/win_gre/makeall.pl\" -objDir \"$topobjdir\" -stagePath \"$inStagePath\" -distPath \"$inDistPath\" -aurl $inXpiURL -rurl $inRedirIniURL"))
|
|
|
|
{
|
|
|
|
die "\n Error: perl \"$gDirPackager/win_gre/makeall.pl\" -objDir \"$topobjdir\" -stagePath \"$inStagePath\" -distPath \"$inDistPath\" -aurl $inXpiURL -rurl $inRedirIniURL\n";
|
|
|
|
}
|
|
|
|
|
|
|
|
if(defined($ENV{DEBUG_INSTALLER_BUILD}))
|
2002-08-27 08:02:27 +04:00
|
|
|
{
|
2003-07-01 01:47:55 +04:00
|
|
|
print " back in win_mfcembed/makeall.pl\n";
|
|
|
|
print " inStagePath: $inStagePath\n";
|
|
|
|
print " inDistPath : $inDistPath\n";
|
2002-08-27 08:02:27 +04:00
|
|
|
}
|
2003-01-22 10:59:52 +03:00
|
|
|
|
|
|
|
# Create the stage area here.
|
|
|
|
# If -sd is not used, the default stage dir will be: $topsrcdir/stage
|
|
|
|
if(system("perl \"$gDirPackager/make_stage.pl\" -pn mfcembed -os win -sd \"$inStagePath\" -dd \"$inDistPath\""))
|
2002-08-27 08:02:27 +04:00
|
|
|
{
|
2003-01-22 10:59:52 +03:00
|
|
|
die "\n Error: perl \"$gDirPackager/make_stage.pl\" -pn mfcembed -os win -sd \"$inStagePath\" -dd \"$inDistPath\"\n";
|
2002-08-27 08:02:27 +04:00
|
|
|
}
|
|
|
|
|
2003-02-20 03:31:54 +03:00
|
|
|
# Copy the GRE installer to the Ns' stage area
|
|
|
|
if(!(-e "$gDirDistInstGre/$seiGreFileNameSpecific"))
|
|
|
|
{
|
|
|
|
die "\"$gDirDistInstGre/$seiGreFileNameSpecific\": file missing\n";
|
|
|
|
}
|
|
|
|
mkdir "$gDirStageProduct/gre";
|
|
|
|
copy("$gDirDistInstGre/$seiGreFileNameSpecific", "$gDirStageProduct/gre") ||
|
|
|
|
die "copy(\"$gDirDistInstGre/$seiGreFileNameSpecific\", \"$gDirStageProduct/gre\"): $!\n";
|
|
|
|
|
2003-01-22 10:59:52 +03:00
|
|
|
# Until we really figure out what to do with this batch file, this will get it
|
|
|
|
# into the installer, at least
|
|
|
|
print "\n Copying runapp.bat $gDirStageProduct/mfcembed/gre_app_support\n";
|
|
|
|
copy("runapp.bat", "$gDirStageProduct/mfcembed/gre_app_support") ||
|
|
|
|
die "copy runapp.bat $gDirStageProduct/mfcembed/gre_app_support: $!\n";
|
|
|
|
|
2002-09-18 23:46:03 +04:00
|
|
|
$ENV{WIZ_nameCompany} = "mozilla.org";
|
2002-09-04 10:53:28 +04:00
|
|
|
$ENV{WIZ_nameProduct} = "MfcEmbed";
|
2003-02-04 11:09:07 +03:00
|
|
|
$ENV{WIZ_nameProductInternal} = "MfcEmbed"; # product name without any version string
|
2002-09-18 23:46:03 +04:00
|
|
|
$ENV{WIZ_fileMainExe} = "mfcembed.exe";
|
2002-08-27 08:02:27 +04:00
|
|
|
$ENV{WIZ_fileUninstall} = $seuFileNameSpecific;
|
|
|
|
$ENV{WIZ_fileUninstallZip} = $seuzFileNameSpecific;
|
|
|
|
# The following variables are for displaying version info in the
|
|
|
|
# the installer.
|
|
|
|
$ENV{WIZ_userAgent} = "$versionMain";
|
|
|
|
$ENV{WIZ_userAgentShort} = "$versionMain";
|
2003-07-01 01:47:55 +04:00
|
|
|
$ENV{WIZ_xpinstallVersion} = "$gDefaultProductVersion";
|
2003-01-22 10:59:52 +03:00
|
|
|
$ENV{WIZ_distInstallPath} = "$gDirDistInstall";
|
2002-08-27 08:02:27 +04:00
|
|
|
|
2003-03-13 03:28:18 +03:00
|
|
|
# GetProductBuildID() will return the build id for GRE located here:
|
|
|
|
# NS_BUILD_ID in nsBuildID.h: 2003030610
|
2003-07-01 01:47:55 +04:00
|
|
|
$ENV{WIZ_greBuildID} = StageUtils::GetProductBuildID("$topobjdir/dist/include/nsBuildID.h", "NS_BUILD_ID");
|
2003-03-13 03:28:18 +03:00
|
|
|
|
2003-03-13 00:40:19 +03:00
|
|
|
# GetGreFileVersion() will return the actual version of xpcom.dll used by GRE.
|
|
|
|
# ie:
|
|
|
|
# given milestone.txt : 1.4a
|
|
|
|
# given nsBuildID.h : 2003030610
|
|
|
|
# gre version would be: 1.4.20030.30610
|
2003-07-01 01:47:55 +04:00
|
|
|
$ENV{WIZ_greFileVersion} = StageUtils::GetGreFileVersion($topobjdir, $topsrcdir);
|
2003-03-13 00:40:19 +03:00
|
|
|
|
|
|
|
# GetGreSpecialID() will return the GRE ID to be used in the windows registry.
|
|
|
|
# This ID is also the same one being querried for by the mozilla glue code.
|
|
|
|
# ie:
|
|
|
|
# given milestone.txt : 1.4a
|
|
|
|
# given nsBuildID.h : 2003030610
|
|
|
|
# gre special ID would be: 1.4a_2003030610
|
2003-07-01 01:47:55 +04:00
|
|
|
$ENV{WIZ_greUniqueID} = StageUtils::GetGreSpecialID($topobjdir);
|
2003-03-13 00:40:19 +03:00
|
|
|
|
2003-01-22 10:59:52 +03:00
|
|
|
print "\n";
|
2003-03-13 00:40:19 +03:00
|
|
|
print " GRE file version : $ENV{WIZ_greFileVersion}\n";
|
|
|
|
print " GRE special version: $ENV{WIZ_greUniqueID}\n";
|
2003-01-22 10:59:52 +03:00
|
|
|
print "\n";
|
|
|
|
print " Building $ENV{WIZ_nameProduct} $ENV{WIZ_userAgent}...\n";
|
|
|
|
print "\n";
|
2002-08-27 08:02:27 +04:00
|
|
|
|
|
|
|
# Check for existence of staging path
|
2003-01-22 10:59:52 +03:00
|
|
|
if(!(-d "$gDirStageProduct"))
|
2002-08-27 08:02:27 +04:00
|
|
|
{
|
2003-01-22 10:59:52 +03:00
|
|
|
die "\n Invalid path: $gDirStageProduct\n";
|
2002-08-27 08:02:27 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
# List of components for to create xpi files from
|
2003-02-20 03:31:54 +03:00
|
|
|
@gComponentList = ("xpcom",
|
|
|
|
"mfcembed");
|
2002-08-27 08:02:27 +04:00
|
|
|
|
|
|
|
if(VerifyComponents()) # return value of 0 means no errors encountered
|
|
|
|
{
|
|
|
|
exit(1);
|
|
|
|
}
|
|
|
|
|
2003-01-22 10:59:52 +03:00
|
|
|
# Make sure gDirDistInstall exists
|
|
|
|
if(!(-d "$gDirDistInstall"))
|
2002-08-27 08:02:27 +04:00
|
|
|
{
|
2003-01-22 10:59:52 +03:00
|
|
|
mkdir ("$gDirDistInstall",0775);
|
2002-08-27 08:02:27 +04:00
|
|
|
}
|
|
|
|
|
2003-01-22 10:59:52 +03:00
|
|
|
if(-d "$gDirDistInstall/xpi")
|
2002-08-27 08:02:27 +04:00
|
|
|
{
|
2003-01-22 10:59:52 +03:00
|
|
|
unlink <$gDirDistInstall/xpi/*>;
|
2002-08-27 08:02:27 +04:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2003-01-22 10:59:52 +03:00
|
|
|
mkdir ("$gDirDistInstall/xpi",0775);
|
2002-08-27 08:02:27 +04:00
|
|
|
}
|
|
|
|
|
2003-01-22 10:59:52 +03:00
|
|
|
if(-d "$gDirDistInstall/uninstall")
|
2002-08-27 08:02:27 +04:00
|
|
|
{
|
2003-01-22 10:59:52 +03:00
|
|
|
unlink <$gDirDistInstall/uninstall/*>;
|
2002-08-27 08:02:27 +04:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2003-01-22 10:59:52 +03:00
|
|
|
mkdir ("$gDirDistInstall/uninstall",0775);
|
2002-08-27 08:02:27 +04:00
|
|
|
}
|
|
|
|
|
2003-01-22 10:59:52 +03:00
|
|
|
if(-d "$gDirDistInstall/setup")
|
2002-08-27 08:02:27 +04:00
|
|
|
{
|
2003-01-22 10:59:52 +03:00
|
|
|
unlink <$gDirDistInstall/setup/*>;
|
2002-08-27 08:02:27 +04:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2003-01-22 10:59:52 +03:00
|
|
|
mkdir ("$gDirDistInstall/setup",0775);
|
2002-08-27 08:02:27 +04:00
|
|
|
}
|
|
|
|
|
2003-02-20 03:31:54 +03:00
|
|
|
if(!(-e "$inDistPath/inst_gre/$seiGreFileNameSpecific"))
|
|
|
|
{
|
|
|
|
die "\"$inDistPath/inst_gre/$seiGreFileNameSpecific\": file missing\n";
|
|
|
|
}
|
|
|
|
MakeExeZip("$inDistPath/inst_gre", $seiGreFileNameSpecific, $seizGreFileNameSpecific);
|
2002-08-27 08:02:27 +04:00
|
|
|
|
|
|
|
if(MakeXpiFile())
|
|
|
|
{
|
|
|
|
exit(1);
|
|
|
|
}
|
|
|
|
|
|
|
|
if(MakeUninstall())
|
|
|
|
{
|
|
|
|
exit(1);
|
|
|
|
}
|
|
|
|
print "Before config";
|
|
|
|
if(MakeConfigFile())
|
|
|
|
{
|
|
|
|
exit(1);
|
|
|
|
}
|
|
|
|
|
|
|
|
# Copy the setup files to the dist setup directory.
|
2003-01-22 10:59:52 +03:00
|
|
|
copy("install.ini", "$gDirDistInstall") ||
|
|
|
|
die "copy install.ini $gDirDistInstall: $!\n";
|
|
|
|
|
2002-08-27 08:02:27 +04:00
|
|
|
#Get setup.exe from mozilla install
|
2003-01-22 10:59:52 +03:00
|
|
|
copy("$gDirDistInstall/../install/setup.exe", "$gDirDistInstall") ||
|
|
|
|
die "copy $gDirDistInstall/../install/setup.exe $gDirDistInstall: $!\n";
|
|
|
|
|
2002-08-27 08:02:27 +04:00
|
|
|
# Get resource file from mozilla install
|
2003-01-22 10:59:52 +03:00
|
|
|
copy("$gDirDistInstall/../install/setuprsc.dll", "$gDirDistInstall") ||
|
|
|
|
die "copy $gDirDistInstall/../install/setuprsc.dll $gDirDistInstall: $!\n";
|
|
|
|
|
2002-10-21 23:01:01 +04:00
|
|
|
# Copy GRE blob installer
|
2003-01-22 10:59:52 +03:00
|
|
|
copy("$gDirDistInstall/../inst_gre/gre-win32-installer.exe", "$gDirDistInstall") ||
|
|
|
|
die "copy $gDirDistInstall/../inst_gre/gre-win32-installer.exe $gDirDistInstall: $!\n";
|
|
|
|
|
|
|
|
copy("install.ini", "$gDirDistInstall/setup") ||
|
|
|
|
die "copy install.ini $gDirDistInstall/setup: $!\n";
|
|
|
|
|
|
|
|
copy("config.ini", "$gDirDistInstall") ||
|
|
|
|
die "copy config.ini $gDirDistInstall: $!\n";
|
|
|
|
|
|
|
|
copy("config.ini", "$gDirDistInstall/setup") ||
|
|
|
|
die "copy config.ini $gDirDistInstall/setup: $!\n";
|
|
|
|
|
|
|
|
copy("$gDirDistInstall/setup.exe", "$gDirDistInstall/setup") ||
|
|
|
|
die "copy $gDirDistInstall/setup.exe $gDirDistInstall/setup: $!\n";
|
|
|
|
|
|
|
|
copy("$gDirDistInstall/setuprsc.dll", "$gDirDistInstall/setup") ||
|
|
|
|
die "copy $gDirDistInstall/setuprsc.dll $gDirDistInstall/setup: $!\n";
|
2002-08-27 08:02:27 +04:00
|
|
|
|
|
|
|
# copy license file for the installer
|
2003-01-22 10:59:52 +03:00
|
|
|
copy("$topsrcdir/LICENSE", "$gDirDistInstall/license.txt") ||
|
|
|
|
die "copy $topsrcdir/LICENSE $gDirDistInstall/license.txt: $!\n";
|
|
|
|
|
|
|
|
copy("$topsrcdir/LICENSE", "$gDirDistInstall/setup/license.txt") ||
|
|
|
|
die "copy $topsrcdir/LICENSE $gDirDistInstall/setup/license.txt: $!\n";
|
2002-08-27 08:02:27 +04:00
|
|
|
|
|
|
|
# create the self extracting stub installer
|
|
|
|
print "\n**************************************************************\n";
|
|
|
|
print "* *\n";
|
2003-01-22 10:59:52 +03:00
|
|
|
print "* creating Self Extracting Executable Stub Install file: *\n";
|
2002-08-27 08:02:27 +04:00
|
|
|
print "* *\n";
|
|
|
|
print "**************************************************************\n";
|
2003-01-22 10:59:52 +03:00
|
|
|
print "\n $gDirDistInstall/$seiFileNameSpecificStub\n";
|
|
|
|
|
|
|
|
copy("$gDirDistInstall/../install/$seiFileNameGeneric", "$gDirDistInstall/$seiFileNameSpecificStub") ||
|
|
|
|
die "copy $gDirDistInstall/../install/$seiFileNameGeneric $gDirDistInstall/$seiFileNameSpecificStub: $!\n";
|
|
|
|
|
2002-08-27 08:02:27 +04:00
|
|
|
# build the self-extracting .exe (installer) file.
|
2003-01-22 10:59:52 +03:00
|
|
|
if(system("$gDirDistInstall/../install/nsztool.exe $gDirDistInstall/$seiFileNameSpecificStub $gDirDistInstall/setup/*.*"))
|
2002-08-27 08:02:27 +04:00
|
|
|
{
|
2003-01-22 10:59:52 +03:00
|
|
|
die "\n Error: gDirDistInstall/../install/nsztool.exe $gDirDistInstall/$seiFileNameSpecificStub $gDirDistInstall/setup/*.*\n";
|
2002-08-27 08:02:27 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
# copy the lean installer to stub\ dir
|
|
|
|
print "\n****************************\n";
|
|
|
|
print "* *\n";
|
|
|
|
print "* copying Stub files... *\n";
|
|
|
|
print "* *\n";
|
|
|
|
print "****************************\n";
|
2003-01-22 10:59:52 +03:00
|
|
|
print "\n $gDirDistInstall/stub/$seiFileNameSpecificStub\n";
|
|
|
|
if(-d "$gDirDistInstall/stub")
|
2002-08-27 08:02:27 +04:00
|
|
|
{
|
2003-01-22 10:59:52 +03:00
|
|
|
unlink <$gDirDistInstall/stub/*>;
|
2002-08-27 08:02:27 +04:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2003-01-22 10:59:52 +03:00
|
|
|
mkdir ("$gDirDistInstall/stub",0775);
|
2002-08-27 08:02:27 +04:00
|
|
|
}
|
2003-01-22 10:59:52 +03:00
|
|
|
copy("$gDirDistInstall/$seiFileNameSpecificStub", "$gDirDistInstall/stub") ||
|
|
|
|
die "\n Error: copy $gDirDistInstall/$seiFileNameSpecificStub $gDirDistInstall/stub\n";
|
2002-08-27 08:02:27 +04:00
|
|
|
|
|
|
|
# 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";
|
2003-01-22 10:59:52 +03:00
|
|
|
print "\n $gDirDistInstall/$seiFileNameSpecific\n";
|
|
|
|
if(-d "$gDirDistInstall/sea")
|
2002-08-27 08:02:27 +04:00
|
|
|
{
|
2003-01-22 10:59:52 +03:00
|
|
|
unlink <$gDirDistInstall/sea/*>;
|
2002-08-27 08:02:27 +04:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2003-01-22 10:59:52 +03:00
|
|
|
mkdir ("$gDirDistInstall/sea",0775);
|
2002-08-27 08:02:27 +04:00
|
|
|
}
|
|
|
|
|
2003-01-22 10:59:52 +03:00
|
|
|
copy("$gDirDistInstall/../install/$seiFileNameGeneric", "$gDirDistInstall/$seiFileNameSpecific") ||
|
|
|
|
die "copy $gDirDistInstall/../install/$seiFileNameGeneric $gDirDistInstall/$seiFileNameSpecific: $!\n";
|
2002-08-27 08:02:27 +04:00
|
|
|
|
2003-01-22 10:59:52 +03:00
|
|
|
if(system("$gDirDistInstall/../install/nsztool.exe $gDirDistInstall/$seiFileNameSpecific $gDirDistInstall/setup/*.* $gDirDistInstall/xpi/*.* $gDirDistInstall/gre-win32-installer.exe"))
|
2002-08-27 08:02:27 +04:00
|
|
|
{
|
2003-01-22 10:59:52 +03:00
|
|
|
die "\n Error: $gDirDistInstall/../install/nsztool.exe $gDirDistInstall/$seiFileNameSpecific $gDirDistInstall/setup/*.* $gDirDistInstall/xpi/*.*\n";
|
2002-08-27 08:02:27 +04:00
|
|
|
}
|
|
|
|
|
2003-01-22 10:59:52 +03:00
|
|
|
copy("$gDirDistInstall/$seiFileNameSpecific", "$gDirDistInstall/sea") ||
|
|
|
|
die "copy $gDirDistInstall/$seiFileNameSpecific $gDirDistInstall/sea: $!\n";
|
2002-08-27 08:02:27 +04:00
|
|
|
|
2003-01-22 10:59:52 +03:00
|
|
|
unlink <$gDirDistInstall/$seiFileNameSpecificStub>;
|
2002-08-27 08:02:27 +04:00
|
|
|
|
2003-01-22 10:59:52 +03:00
|
|
|
print " done!\n\n";
|
2002-08-27 08:02:27 +04:00
|
|
|
|
|
|
|
exit(0);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
sub MakeExeZip
|
|
|
|
{
|
|
|
|
my($aSrcDir, $aExeFile, $aZipFile) = @_;
|
|
|
|
my($saveCwdir);
|
|
|
|
|
|
|
|
$saveCwdir = cwd();
|
|
|
|
chdir($aSrcDir);
|
2003-01-22 10:59:52 +03:00
|
|
|
if(system("zip $gDirDistInstall/xpi/$aZipFile $aExeFile"))
|
2002-08-27 08:02:27 +04:00
|
|
|
{
|
|
|
|
chdir($saveCwdir);
|
2003-01-22 10:59:52 +03:00
|
|
|
die "\n Error: zip $gDirDistInstall/xpi/$aZipFile $aExeFile";
|
2002-08-27 08:02:27 +04:00
|
|
|
}
|
|
|
|
chdir($saveCwdir);
|
|
|
|
}
|
|
|
|
|
|
|
|
sub PrintUsage
|
|
|
|
{
|
2003-01-22 10:59:52 +03:00
|
|
|
die "usage: $0 <mfc embed version> <gre version> [options]
|
2002-08-27 08:02:27 +04:00
|
|
|
|
|
|
|
default version : y2k compliant based date version.
|
|
|
|
ie: 5.0.0.2000040413
|
|
|
|
|
2003-01-22 10:59:52 +03:00
|
|
|
default GRE version: version to be used to build GRE.
|
|
|
|
ie: 1.3b.0.0
|
2002-08-27 08:02:27 +04:00
|
|
|
|
|
|
|
options include:
|
|
|
|
|
2003-07-01 01:47:55 +04:00
|
|
|
-objDir <path> : path to the objdir. default is topsrcdir
|
2003-03-13 00:40:19 +03:00
|
|
|
|
2003-01-22 10:59:52 +03:00
|
|
|
-stagePath <staging path> : full path to where the mfc embed components are staged at
|
|
|
|
Default stage path, if this is not set, is:
|
|
|
|
[mozilla]/stage
|
|
|
|
|
|
|
|
-distPath <dist path> : full path to where the mozilla/mfcembed dist dir is at.
|
|
|
|
Default stage path, if this is not set, is:
|
|
|
|
[mozilla]/dist
|
|
|
|
|
|
|
|
-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.
|
2002-08-27 08:02:27 +04:00
|
|
|
\n";
|
|
|
|
}
|
|
|
|
|
|
|
|
sub ParseArgv
|
|
|
|
{
|
|
|
|
my(@myArgv) = @_;
|
|
|
|
my($counter);
|
|
|
|
|
2003-03-13 00:40:19 +03:00
|
|
|
for($counter = 0; $counter <= $#myArgv; $counter++)
|
2002-08-27 08:02:27 +04:00
|
|
|
{
|
|
|
|
if($myArgv[$counter] =~ /^[-,\/]h$/i)
|
|
|
|
{
|
|
|
|
PrintUsage();
|
|
|
|
}
|
2003-07-01 01:47:55 +04:00
|
|
|
elsif($myArgv[$counter] =~ /^[-,\/]objDir$/i)
|
2003-03-13 00:40:19 +03:00
|
|
|
{
|
|
|
|
if($#myArgv >= ($counter + 1))
|
|
|
|
{
|
|
|
|
++$counter;
|
2003-07-01 01:47:55 +04:00
|
|
|
$topobjdir = $myArgv[$counter];
|
|
|
|
$topobjdir =~ s/\\/\//g;
|
2003-03-13 00:40:19 +03:00
|
|
|
}
|
|
|
|
}
|
2003-01-22 10:59:52 +03:00
|
|
|
elsif($myArgv[$counter] =~ /^[-,\/]stagePath$/i)
|
|
|
|
{
|
|
|
|
if($#myArgv >= ($counter + 1))
|
|
|
|
{
|
|
|
|
++$counter;
|
|
|
|
$inStagePath = $myArgv[$counter];
|
|
|
|
$inStagePath =~ s/\\/\//g;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
elsif($myArgv[$counter] =~ /^[-,\/]distPath$/i)
|
|
|
|
{
|
|
|
|
if($#myArgv >= ($counter + 1))
|
|
|
|
{
|
|
|
|
++$counter;
|
|
|
|
$inDistPath = $myArgv[$counter];
|
|
|
|
$inDistPath =~ s/\\/\//g;
|
|
|
|
}
|
|
|
|
}
|
2002-08-27 08:02:27 +04:00
|
|
|
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];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
sub MakeConfigFile
|
|
|
|
{
|
2003-01-22 10:59:52 +03:00
|
|
|
chdir("$gDirPackager/win_mfcembed");
|
2002-08-27 08:02:27 +04:00
|
|
|
# Make config.ini file
|
2003-07-01 01:47:55 +04:00
|
|
|
if(system("perl makecfgini.pl config.it $gDefaultProductVersion $gDirStageProduct $gDirDistInstall/xpi $inRedirIniURL $inXpiURL"))
|
2002-08-27 08:02:27 +04:00
|
|
|
{
|
2003-07-01 01:47:55 +04:00
|
|
|
print "\n Error: perl makecfgini.pl config.it $gDefaultProductVersion $gDirStageProduct $gDirDistInstall/xpi $inRedirIniURL $inXpiURL\n";
|
2002-08-27 08:02:27 +04:00
|
|
|
return(1);
|
|
|
|
}
|
|
|
|
|
|
|
|
# Make install.ini file
|
2003-07-01 01:47:55 +04:00
|
|
|
if(system("perl makecfgini.pl install.it $gDefaultProductVersion $gDirStageProduct $gDirDistInstall/xpi $inRedirIniURL $inXpiURL"))
|
2002-08-27 08:02:27 +04:00
|
|
|
{
|
2003-07-01 01:47:55 +04:00
|
|
|
print "\n Error: perl makecfgini.pl install.it $gDefaultProductVersion $gDirStageProduct $gDirDistInstall/xpi $inRedirIniURL $inXpiURL\n";
|
2002-08-27 08:02:27 +04:00
|
|
|
return(1);
|
|
|
|
}
|
|
|
|
return(0);
|
|
|
|
}
|
|
|
|
|
|
|
|
sub MakeUninstall
|
|
|
|
{
|
2003-01-22 10:59:52 +03:00
|
|
|
chdir("$gDirPackager/win_mfcembed");
|
2002-08-27 08:02:27 +04:00
|
|
|
if(MakeUninstallIniFile())
|
|
|
|
{
|
|
|
|
return(1);
|
|
|
|
}
|
|
|
|
|
|
|
|
# Copy the uninstall files to the dist uninstall directory.
|
2003-01-22 10:59:52 +03:00
|
|
|
copy("uninstall.ini", "$gDirDistInstall") ||
|
|
|
|
die "copy uninstall.ini $gDirDistInstall: $!\n";
|
|
|
|
|
|
|
|
copy("uninstall.ini", "$gDirDistInstall/uninstall") ||
|
|
|
|
die "copy uninstall.ini $gDirDistInstall/uninstall: $!\n";
|
|
|
|
|
|
|
|
copy("defaults_info.ini", "$gDirDistInstall") ||
|
|
|
|
die "copy defaults_info.ini $gDirDistInstall: $!\n";
|
|
|
|
|
|
|
|
copy("defaults_info.ini", "$gDirDistInstall/uninstall") ||
|
|
|
|
die "copy defaults_info.ini $gDirDistInstall/uninstall: $!\n";
|
|
|
|
|
2002-08-27 08:02:27 +04:00
|
|
|
# Get uninstaller from mozilla install
|
2003-01-22 10:59:52 +03:00
|
|
|
copy("$gDirDistInstall/../install/uninstall.exe", "$gDirDistInstall") ||
|
|
|
|
die "copy $gDirDistInstall/../install/uninstall.exe $gDirDistInstall: $!\n";
|
|
|
|
|
|
|
|
copy("$gDirDistInstall/uninstall.exe", "$gDirDistInstall/uninstall") ||
|
|
|
|
die "copy $gDirDistInstall/uninstall.exe $gDirDistInstall/uninstall: $!\n";
|
2002-08-27 08:02:27 +04:00
|
|
|
|
|
|
|
# build the self-extracting .exe (uninstaller) file.
|
|
|
|
print "\nbuilding self-extracting uninstaller ($seuFileNameSpecific)...\n";
|
2003-01-22 10:59:52 +03:00
|
|
|
copy("$gDirDistInstall/../install/$seiFileNameGeneric", "$gDirDistInstall/$seuFileNameSpecific") ||
|
|
|
|
die "copy $gDirDistInstall/../install/$seiFileNameGeneric $gDirDistInstall/$seuFileNameSpecific: $!\n";
|
2002-08-27 08:02:27 +04:00
|
|
|
|
2003-01-22 10:59:52 +03:00
|
|
|
if(system("$gDirDistInstall/../install/nsztool.exe $gDirDistInstall/$seuFileNameSpecific $gDirDistInstall/uninstall/*.*"))
|
2002-08-27 08:02:27 +04:00
|
|
|
{
|
2003-01-22 10:59:52 +03:00
|
|
|
print "\n Error: $gDirDistInstall/../install/nsztool.exe $gDirDistInstall/$seuFileNameSpecific $gDirDistInstall/uninstall/*.*\n";
|
2002-08-27 08:02:27 +04:00
|
|
|
return(1);
|
|
|
|
}
|
|
|
|
|
2003-01-22 10:59:52 +03:00
|
|
|
MakeExeZip($gDirDistInstall, $seuFileNameSpecific, $seuzFileNameSpecific);
|
|
|
|
unlink <$gDirDistInstall/$seuFileNameSpecific>;
|
2002-08-27 08:02:27 +04:00
|
|
|
return(0);
|
|
|
|
}
|
|
|
|
|
|
|
|
sub MakeUninstallIniFile
|
|
|
|
{
|
2003-01-22 10:59:52 +03:00
|
|
|
chdir("$gDirPackager/win_mfcembed");
|
2002-08-27 08:02:27 +04:00
|
|
|
# Make config.ini file
|
2003-07-01 01:47:55 +04:00
|
|
|
if(system("perl makeuninstallini.pl uninstall.it $gDefaultProductVersion"))
|
2002-08-27 08:02:27 +04:00
|
|
|
{
|
2003-07-01 01:47:55 +04:00
|
|
|
print "\n Error: perl makeuninstallini.pl uninstall.it $gDefaultProductVersion\n";
|
2002-08-27 08:02:27 +04:00
|
|
|
return(1);
|
|
|
|
}
|
|
|
|
return(0);
|
|
|
|
}
|
|
|
|
|
|
|
|
sub MakeJsFile
|
|
|
|
{
|
|
|
|
my($mComponent) = @_;
|
|
|
|
|
2003-01-22 10:59:52 +03:00
|
|
|
chdir("$gDirPackager/win_mfcembed");
|
2002-08-27 08:02:27 +04:00
|
|
|
# Make .js file
|
2003-07-01 01:47:55 +04:00
|
|
|
if(system("perl makejs.pl $mComponent.jst $gDefaultProductVersion $gDirStageProduct/$mComponent"))
|
2002-08-27 08:02:27 +04:00
|
|
|
{
|
2003-07-01 01:47:55 +04:00
|
|
|
print "\n Error: perl makejs.pl $mComponent.jst $gDefaultProductVersion $gDirStageProduct/$mComponent\n";
|
2002-08-27 08:02:27 +04:00
|
|
|
return(1);
|
|
|
|
}
|
|
|
|
return(0);
|
|
|
|
}
|
|
|
|
|
|
|
|
sub MakeXpiFile
|
|
|
|
{
|
|
|
|
my($mComponent);
|
2003-01-22 10:59:52 +03:00
|
|
|
|
|
|
|
chdir("$gDirPackager/win_mfcembed");
|
2002-08-27 08:02:27 +04:00
|
|
|
foreach $mComponent (@gComponentList)
|
|
|
|
{
|
|
|
|
# Make .js files
|
|
|
|
if(MakeJsFile($mComponent))
|
|
|
|
{
|
|
|
|
return(1);
|
|
|
|
}
|
|
|
|
|
|
|
|
# Make .xpi file
|
2003-01-22 10:59:52 +03:00
|
|
|
if(system("perl makexpi.pl $mComponent $gDirStageProduct $gDirDistInstall/xpi"))
|
2002-08-27 08:02:27 +04:00
|
|
|
{
|
2003-01-22 10:59:52 +03:00
|
|
|
print "\n Error: perl makexpi.pl $mComponent $gDirStageProduct $gDirDistInstall/xpi\n";
|
2002-08-27 08:02:27 +04:00
|
|
|
return(1);
|
|
|
|
}
|
|
|
|
|
|
|
|
# Put a copy of the xpi with he installer itself
|
2003-01-22 10:59:52 +03:00
|
|
|
copy("$gDirDistInstall/xpi/$mComponent.xpi", "$gDirDistInstall") ||
|
|
|
|
die "copy $gDirDistInstall/xpi/$mComponent.xpi $gDirDistInstall: $!\n";
|
2002-08-27 08:02:27 +04:00
|
|
|
}
|
|
|
|
return(0);
|
|
|
|
}
|
|
|
|
|
|
|
|
sub VerifyComponents()
|
|
|
|
{
|
|
|
|
my($mComponent);
|
|
|
|
my($mError) = 0;
|
|
|
|
|
|
|
|
print "\n Verifying existence of required components...\n";
|
|
|
|
foreach $mComponent (@gComponentList)
|
|
|
|
{
|
|
|
|
if($mComponent =~ /talkback/i)
|
|
|
|
{
|
2003-01-22 10:59:52 +03:00
|
|
|
print " place holder: $gDirStageProduct/$mComponent\n";
|
|
|
|
mkdir("$gDirStageProduct/$mComponent", 775);
|
2002-08-27 08:02:27 +04:00
|
|
|
}
|
2003-01-22 10:59:52 +03:00
|
|
|
elsif(-d "$gDirStageProduct/$mComponent")
|
2002-08-27 08:02:27 +04:00
|
|
|
{
|
2003-01-22 10:59:52 +03:00
|
|
|
print " ok: $gDirStageProduct/$mComponent\n";
|
2002-08-27 08:02:27 +04:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2003-01-22 10:59:52 +03:00
|
|
|
print " Error: $gDirStageProduct/$mComponent does not exist!\n";
|
2002-08-27 08:02:27 +04:00
|
|
|
$mError = 1;
|
|
|
|
}
|
|
|
|
}
|
2003-01-22 10:59:52 +03:00
|
|
|
print "\n";
|
2002-08-27 08:02:27 +04:00
|
|
|
return($mError);
|
|
|
|
}
|
|
|
|
|
2003-01-22 10:59:52 +03:00
|
|
|
sub GetTopSrcDir
|
|
|
|
{
|
|
|
|
my($rootDir) = dirname($0) . "/$DEPTH";
|
|
|
|
my($savedCwdDir) = cwd();
|
|
|
|
|
|
|
|
chdir($rootDir);
|
|
|
|
$rootDir = cwd();
|
|
|
|
chdir($savedCwdDir);
|
|
|
|
return($rootDir);
|
|
|
|
}
|
|
|
|
|