fixing bugs #19391 and #18704. The .xpi files now check for errors and

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:
ssu%netscape.com 1999-11-22 22:50:30 +00:00
Родитель 6e6ff3d1d0
Коммит 956963a788
5 изменённых файлов: 126 добавлений и 54 удалений

Просмотреть файл

@ -269,11 +269,11 @@ Message=Preparing SmartUpdate, please wait...
;Destination=[SETUP PATH]\program ;Destination=[SETUP PATH]\program
;Copy FileX sections ;Copy FileX sections
;[Copy File0] [Copy File0]
;Timing=post launchapp Timing=post launchapp
;Source=[WINDISK]\Progra~1\JavaSoft\JRE\1.2.2\bin\npjava*.dll Source=[JRE BIN PATH]\npjava*.dll
;Destination=[SETUP PATH]\components Destination=[SETUP PATH]\Plugins
;Fail If Exists=FALSE Fail If Exists=FALSE
;[Copy File1] ;[Copy File1]
;Timing=post launchapp ;Timing=post launchapp

Просмотреть файл

@ -1,21 +1,35 @@
var err = StartInstall("Mozilla Seamonkey", "Seamonkey", "$Version$"); // main
LogComment("StartInstall: " + err); var srDest;
var err;
var communicatorFolder;
var communicatorFolder = Install.GetFolder("Communicator"); srDest = $SpaceRequired$:bin;
LogComment("communicatorFolder: " + communicatorFolder); err = startInstall("Mozilla Seamonkey", "", "$Version$");
logComment("startInstall: " + err);
err = AddDirectory("Program", communicatorFolder = getFolder("Communicator");
logComment("communicatorFolder: " + communicatorFolder);
if(verifyDiskSpace(communicatorFolder, srDest) == true)
{
err = addDirectory("Program",
"$Version$", "$Version$",
"bin", // fileName in jar, "bin", // dir name in jar to extract
communicatorFolder, // Where to put this file (Returned from GetFolder) communicatorFolder, // Where to put this file (Returned from GetFolder)
"", // fileName in jar, "", // subdir name to create relative to communicatorFolder
false); // Force Flag false); // Force Flag
LogComment("AddDirectory() returned: " + err); logComment("addDirectory() returned: " + err);
var fileComponentReg = communicatorFolder + "\\component.reg"; // check return value
err = Install.FileDelete(fileComponentReg); if(!checkError(err))
LogComment("FileDelete() returned: " + err); {
var fileComponentReg = communicatorFolder + "component.reg";
err = fileDelete(fileComponentReg);
logComment("fileDelete() returned: " + err);
err = FinalizeInstall(); err = finalizeInstall();
LogComment("FinalizeInstall() returned: " + err); logComment("finalizeInstall() returned: " + err);
}
}
// end main

Просмотреть файл

@ -1,18 +1,33 @@
var err = StartInstall("Mozilla Mail", "Seamonkey", "$Version$"); // main
LogComment("StartInstall: " + err); var srDest;
var err;
var communicatorFolder;
var communicatorFolder = Install.GetFolder("Communicator"); srDest = $SpaceRequired$:bin;
LogComment("communicatorFolder: " + communicatorFolder); err = startInstall("Mozilla Mail", "", "$Version$");
logComment("startInstall: " + err);
// check return value
checkError(err);
err = AddDirectory("Program", communicatorFolder = getFolder("Communicator");
logComment("communicatorFolder: " + communicatorFolder);
if(verifyDiskSpace(communicatorFolder, srDest) == true)
{
err = addDirectory("Program",
"$Version$", "$Version$",
"bin", // fileName in jar, "bin", // dir name in jar to extract
communicatorFolder, // Where to put this file (Returned from GetFolder) communicatorFolder, // Where to put this file (Returned from GetFolder)
"", // fileName in jar, "", // subdir name to create relative to communicatorFolder
false); // Force Flag false); // Force Flag
logComment("addDirectory() returned: " + err);
LogComment("AddDirectory() returned: " + err); // check return value
if(!checkError(err))
err = FinalizeInstall(); {
LogComment("FinalizeInstall() returned: " + err); err = finalizeInstall();
logComment("finalizeInstall() returned: " + err);
}
}
// end main

Просмотреть файл

@ -61,9 +61,11 @@ if(!(-e "$inDistPath"))
system("mkdir $inDestPath"); system("mkdir $inDestPath");
} }
MakeJsFile(); # Make .js files
MakeJsFile("core");
MakeJsFile("mail");
# Make all xpi files # Make .xpi files
MakeXpiFile("core"); MakeXpiFile("core");
MakeXpiFile("mail"); MakeXpiFile("mail");
@ -104,15 +106,13 @@ sub MakeConfigFile
sub MakeJsFile sub MakeJsFile
{ {
# Make .js files my($componentName) = @_;
@jstFiles = <*.jst>;
foreach $jst (@jstFiles) # 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);
} }
}
} }
sub MakeXpiFile sub MakeXpiFile

Просмотреть файл

@ -31,42 +31,85 @@
# default version - a julian date in the form of: # default version - a julian date in the form of:
# major.minor.release.yydoy # major.minor.release.yydoy
# ie: 5.0.0.99256 # 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 # ie: perl makejs.pl core.jst 5.0.0.99256
# #
# Make sure there are at least two arguments # 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 .jst file : .js template input file
default version : default julian base version number to use in the default version : default julian base version number to use in the
form of: major.minor.release.yydoy form of: major.minor.release.yydoy
ie: 5.0.0.99256 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"; \n";
} }
$inJstFile = $ARGV[0]; $inJstFile = $ARGV[0];
$inVersion = $ARGV[1]; $inVersion = $ARGV[1];
$inStagePath = $ARGV[2];
# Get the name of the file replacing the .jst extension with a .js extension # Get the name of the file replacing the .jst extension with a .js extension
@inJstFileSplit = split(/\./,$inJstFile); @inJstFileSplit = split(/\./,$inJstFile);
$outJsFile = $inJstFileSplit[0]; $outJsFile = $inJstFileSplit[0];
$outJsFile .= ".js"; $outJsFile .= ".js";
$outTempFile = $inJstFileSplit[0];
$outTempFile .= ".template";
# Open the input .jst file system("copy ..\\common\\share.t $outTempFile");
open(fpInJst, $inJstFile) || die "\ncould not open $ARGV[0]: $!\n"; system("cat $inJstFile >> $outTempFile");
# Open the input .template file
open(fpInTemplate, $outTempFile) || die "\ncould not open $outTempFile: $!\n";
# Open the output .js file # Open the output .js file
open(fpOutJs, ">$outJsFile") || die "\nCould not open $outJsFile: $!\n"; open(fpOutJs, ">$outJsFile") || die "\nCould not open $outJsFile: $!\n";
# While loop to read each line from input file # 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 # For each line read, search and replace $Version$ with the version passed in
if($line =~ /\$Version\$/i)
{
$line =~ s/\$Version\$/$inVersion/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; 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);
}