зеркало из https://github.com/mozilla/pjs.git
disk space availability before installation begins. It also copies npjava*.dll from wherever JRE is to its Plugins folder. Affects only Windows platforms, but not part of tinderbox. r=dbragg
This commit is contained in:
Родитель
6e6ff3d1d0
Коммит
956963a788
|
@ -269,11 +269,11 @@ Message=Preparing SmartUpdate, please wait...
|
|||
;Destination=[SETUP PATH]\program
|
||||
|
||||
;Copy FileX sections
|
||||
;[Copy File0]
|
||||
;Timing=post launchapp
|
||||
;Source=[WINDISK]\Progra~1\JavaSoft\JRE\1.2.2\bin\npjava*.dll
|
||||
;Destination=[SETUP PATH]\components
|
||||
;Fail If Exists=FALSE
|
||||
[Copy File0]
|
||||
Timing=post launchapp
|
||||
Source=[JRE BIN PATH]\npjava*.dll
|
||||
Destination=[SETUP PATH]\Plugins
|
||||
Fail If Exists=FALSE
|
||||
|
||||
;[Copy File1]
|
||||
;Timing=post launchapp
|
||||
|
|
|
@ -1,21 +1,35 @@
|
|||
var err = StartInstall("Mozilla Seamonkey", "Seamonkey", "$Version$");
|
||||
LogComment("StartInstall: " + err);
|
||||
// main
|
||||
var srDest;
|
||||
var err;
|
||||
var communicatorFolder;
|
||||
|
||||
var communicatorFolder = Install.GetFolder("Communicator");
|
||||
LogComment("communicatorFolder: " + communicatorFolder);
|
||||
srDest = $SpaceRequired$:bin;
|
||||
err = startInstall("Mozilla Seamonkey", "", "$Version$");
|
||||
logComment("startInstall: " + err);
|
||||
|
||||
err = AddDirectory("Program",
|
||||
"$Version$",
|
||||
"bin", // fileName in jar,
|
||||
communicatorFolder, // Where to put this file (Returned from GetFolder)
|
||||
"", // fileName in jar,
|
||||
false); // Force Flag
|
||||
LogComment("AddDirectory() returned: " + err);
|
||||
communicatorFolder = getFolder("Communicator");
|
||||
logComment("communicatorFolder: " + communicatorFolder);
|
||||
|
||||
var fileComponentReg = communicatorFolder + "\\component.reg";
|
||||
err = Install.FileDelete(fileComponentReg);
|
||||
LogComment("FileDelete() returned: " + err);
|
||||
if(verifyDiskSpace(communicatorFolder, srDest) == true)
|
||||
{
|
||||
err = addDirectory("Program",
|
||||
"$Version$",
|
||||
"bin", // dir name in jar to extract
|
||||
communicatorFolder, // Where to put this file (Returned from GetFolder)
|
||||
"", // subdir name to create relative to communicatorFolder
|
||||
false); // Force Flag
|
||||
logComment("addDirectory() returned: " + err);
|
||||
|
||||
err = FinalizeInstall();
|
||||
LogComment("FinalizeInstall() returned: " + err);
|
||||
// check return value
|
||||
if(!checkError(err))
|
||||
{
|
||||
var fileComponentReg = communicatorFolder + "component.reg";
|
||||
err = fileDelete(fileComponentReg);
|
||||
logComment("fileDelete() returned: " + err);
|
||||
|
||||
err = finalizeInstall();
|
||||
logComment("finalizeInstall() returned: " + err);
|
||||
}
|
||||
}
|
||||
|
||||
// end main
|
||||
|
|
|
@ -1,18 +1,33 @@
|
|||
var err = StartInstall("Mozilla Mail", "Seamonkey", "$Version$");
|
||||
LogComment("StartInstall: " + err);
|
||||
// main
|
||||
var srDest;
|
||||
var err;
|
||||
var communicatorFolder;
|
||||
|
||||
var communicatorFolder = Install.GetFolder("Communicator");
|
||||
LogComment("communicatorFolder: " + communicatorFolder);
|
||||
srDest = $SpaceRequired$:bin;
|
||||
err = startInstall("Mozilla Mail", "", "$Version$");
|
||||
logComment("startInstall: " + err);
|
||||
// check return value
|
||||
checkError(err);
|
||||
|
||||
err = AddDirectory("Program",
|
||||
"$Version$",
|
||||
"bin", // fileName in jar,
|
||||
communicatorFolder, // Where to put this file (Returned from GetFolder)
|
||||
"", // fileName in jar,
|
||||
false); // Force Flag
|
||||
communicatorFolder = getFolder("Communicator");
|
||||
logComment("communicatorFolder: " + communicatorFolder);
|
||||
|
||||
LogComment("AddDirectory() returned: " + err);
|
||||
if(verifyDiskSpace(communicatorFolder, srDest) == true)
|
||||
{
|
||||
err = addDirectory("Program",
|
||||
"$Version$",
|
||||
"bin", // dir name in jar to extract
|
||||
communicatorFolder, // Where to put this file (Returned from GetFolder)
|
||||
"", // subdir name to create relative to communicatorFolder
|
||||
false); // Force Flag
|
||||
logComment("addDirectory() returned: " + err);
|
||||
|
||||
err = FinalizeInstall();
|
||||
LogComment("FinalizeInstall() returned: " + err);
|
||||
// check return value
|
||||
if(!checkError(err))
|
||||
{
|
||||
err = finalizeInstall();
|
||||
logComment("finalizeInstall() returned: " + err);
|
||||
}
|
||||
}
|
||||
|
||||
// end main
|
||||
|
|
|
@ -61,9 +61,11 @@ if(!(-e "$inDistPath"))
|
|||
system("mkdir $inDestPath");
|
||||
}
|
||||
|
||||
MakeJsFile();
|
||||
# Make .js files
|
||||
MakeJsFile("core");
|
||||
MakeJsFile("mail");
|
||||
|
||||
# Make all xpi files
|
||||
# Make .xpi files
|
||||
MakeXpiFile("core");
|
||||
MakeXpiFile("mail");
|
||||
|
||||
|
@ -104,14 +106,12 @@ sub MakeConfigFile
|
|||
|
||||
sub MakeJsFile
|
||||
{
|
||||
# Make .js files
|
||||
@jstFiles = <*.jst>;
|
||||
foreach $jst (@jstFiles)
|
||||
my($componentName) = @_;
|
||||
|
||||
# Make .js file
|
||||
if(system("perl makejs.pl $componentName.jst $inDefaultVersion $inStagePath\\$componentName") != 0)
|
||||
{
|
||||
if(system("perl makejs.pl $jst $inDefaultVersion") != 0)
|
||||
{
|
||||
exit(1);
|
||||
}
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -31,42 +31,85 @@
|
|||
# default version - a julian date in the form of:
|
||||
# major.minor.release.yydoy
|
||||
# ie: 5.0.0.99256
|
||||
# staging path - path to where the components are staged at
|
||||
#
|
||||
# ie: perl makejs.pl core.jst 5.0.0.99256
|
||||
#
|
||||
|
||||
# Make sure there are at least two arguments
|
||||
if($#ARGV < 1)
|
||||
if($#ARGV < 2)
|
||||
{
|
||||
die "usage: $0 <.jst file> <default version>
|
||||
die "usage: $0 <.jst file> <default version> <staging path>
|
||||
|
||||
.jst file : .js template input file
|
||||
default version : default julian base version number to use in the
|
||||
form of: major.minor.release.yydoy
|
||||
ie: 5.0.0.99256
|
||||
.jst file : .js template input file
|
||||
default version : default julian base version number to use in the
|
||||
form of: major.minor.release.yydoy
|
||||
ie: 5.0.0.99256
|
||||
component staging path : path to where this component is staged at
|
||||
ie: z:\\stage\\windows\\32bit\\en\\5.0\\core
|
||||
\n";
|
||||
}
|
||||
|
||||
$inJstFile = $ARGV[0];
|
||||
$inVersion = $ARGV[1];
|
||||
$inStagePath = $ARGV[2];
|
||||
|
||||
# Get the name of the file replacing the .jst extension with a .js extension
|
||||
@inJstFileSplit = split(/\./,$inJstFile);
|
||||
$outJsFile = $inJstFileSplit[0];
|
||||
$outJsFile .= ".js";
|
||||
$outTempFile = $inJstFileSplit[0];
|
||||
$outTempFile .= ".template";
|
||||
|
||||
# Open the input .jst file
|
||||
open(fpInJst, $inJstFile) || die "\ncould not open $ARGV[0]: $!\n";
|
||||
system("copy ..\\common\\share.t $outTempFile");
|
||||
system("cat $inJstFile >> $outTempFile");
|
||||
|
||||
# Open the input .template file
|
||||
open(fpInTemplate, $outTempFile) || die "\ncould not open $outTempFile: $!\n";
|
||||
|
||||
# Open the output .js file
|
||||
open(fpOutJs, ">$outJsFile") || die "\nCould not open $outJsFile: $!\n";
|
||||
|
||||
|
||||
# While loop to read each line from input file
|
||||
while($line = <fpInJst>)
|
||||
while($line = <fpInTemplate>)
|
||||
{
|
||||
# For each line read, search and replace $Version$ with the version passed in
|
||||
$line =~ s/\$Version\$/$inVersion/i;
|
||||
if($line =~ /\$Version\$/i)
|
||||
{
|
||||
$line =~ s/\$Version\$/$inVersion/i;
|
||||
}
|
||||
elsif($line =~ /\$SpaceRequired\$/i) # For each line read, search and replace $InstallSize$ with the calculated size
|
||||
{
|
||||
$spaceRequired = 0;
|
||||
|
||||
# split read line by ":" deliminator
|
||||
@colonSplit = split(/:/, $line);
|
||||
if($#colonSplit > 0)
|
||||
{
|
||||
@semiColonSplit = split(/;/, $colonSplit[1]);
|
||||
$subDir = $semiColonSplit[0];
|
||||
$spaceRequired = GetSpaceRequired("$inStagePath\\$subDir");
|
||||
$line =~ s/\$SpaceRequired\$:$subDir/$spaceRequired/i;
|
||||
}
|
||||
else
|
||||
{
|
||||
$spaceRequired = GetSpaceRequired("$inStagePath");
|
||||
$line =~ s/\$SpaceRequired\$/$spaceRequired/i;
|
||||
}
|
||||
}
|
||||
|
||||
print fpOutJs $line;
|
||||
}
|
||||
|
||||
sub GetSpaceRequired()
|
||||
{
|
||||
my($inPath) = @_;
|
||||
my($spaceRequired);
|
||||
|
||||
print " calulating size for $inPath\n";
|
||||
$spaceRequired = `ds32.exe /L0 /A /S /C 32768 $inPath`;
|
||||
$spaceRequired = int($spaceRequired / 1024);
|
||||
$spaceRequired += 1;
|
||||
return($spaceRequired);
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче