OS/2 only - not part of build - uninstall support

This commit is contained in:
mkaply%us.ibm.com 2002-09-23 22:16:17 +00:00
Родитель 6044b743ac
Коммит 2833da1704
3 изменённых файлов: 169 добавлений и 21 удалений

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

@ -88,10 +88,14 @@ $seiFileNameGeneric = "nsinstall.exe";
$seiFileNameGenericRes = "nsinstall.res"; $seiFileNameGenericRes = "nsinstall.res";
$seiFileNameSpecific = "mozilla-os2-installer.exe"; $seiFileNameSpecific = "mozilla-os2-installer.exe";
$seiFileNameSpecificRes = "mozilla-os2-installer.res"; $seiFileNameSpecificRes = "mozilla-os2-installer.res";
$seiFileNameSpecificRC = "mozilla-os2-installer.rc";
$seiStubRootName = "mozilla-os2-stub-installer"; $seiStubRootName = "mozilla-os2-stub-installer";
$seiFileNameSpecificStub = "$seiStubRootName.exe"; $seiFileNameSpecificStub = "$seiStubRootName.exe";
$seiFileNameSpecificStubRes = "$seiStubRootName.res"; $seiFileNameSpecificStubRes = "$seiStubRootName.res";
$seiFileNameSpecificStubRC = "$seiStubRootName.rc";
$seuFileNameSpecific = "MozillaUninstall.exe"; $seuFileNameSpecific = "MozillaUninstall.exe";
$seuFileNameSpecificRes = "MozillaUninstall.res";
$seuFileNameSpecificRC = "MozillaUninstall.rc";
$seuzFileNameSpecific = "mozillauninstall.zip"; $seuzFileNameSpecific = "mozillauninstall.zip";
# set environment vars for use by other .pl scripts called from this script. # set environment vars for use by other .pl scripts called from this script.
@ -182,10 +186,10 @@ if(MakeXpiFile())
{ {
exit(1); exit(1);
} }
#if(MakeUninstall()) if(MakeUninstall())
#{ {
# exit(1); exit(1);
#} }
if(MakeConfigFile()) if(MakeConfigFile())
{ {
exit(1); exit(1);
@ -259,7 +263,7 @@ if(system("cp $inDistPath\\$seiFileNameGenericRes $inDistPath\\$seiFileNameSpeci
$size = (-s "$inDistPath\\$seiFileNameSpecificStubRes"); $size = (-s "$inDistPath\\$seiFileNameSpecificStubRes");
truncate("$inDistPath\\$seiFileNameSpecificStubRes", "$size-1"); truncate("$inDistPath\\$seiFileNameSpecificStubRes", "$size-1");
open(OUTPUTFILE, ">$inDistPath\\temp.rc"); open(OUTPUTFILE, ">$inDistPath\\$seiFileNameSpecificStubRC");
print OUTPUTFILE "#include <os2.h>\n"; print OUTPUTFILE "#include <os2.h>\n";
print OUTPUTFILE "STRINGTABLE DISCARDABLE\n"; print OUTPUTFILE "STRINGTABLE DISCARDABLE\n";
print OUTPUTFILE "BEGIN\n"; print OUTPUTFILE "BEGIN\n";
@ -278,12 +282,11 @@ foreach $entry ( @stubFiles )
$currentResourceID++; $currentResourceID++;
} }
close(OUTPUTFILE); close(OUTPUTFILE);
system("rc -r $inDistPath\\temp.rc"); system("rc -r $inDistPath\\$seiFileNameSpecificStubRC $inDistPath\\temp.res");
system("cat $inDistPath\\$seiFileNameSpecificStubRes $inDistPath\\temp.res > $inDistPath\\new.res"); system("cat $inDistPath\\$seiFileNameSpecificStubRes $inDistPath\\temp.res > $inDistPath\\new.res");
unlink("$inDistPath\\$seiFileNameSpecificStubRes"); unlink("$inDistPath\\$seiFileNameSpecificStubRes");
rename("$inDistPath\\new.res", "$inDistPath\\$seiFileNameSpecificStubRes"); rename("$inDistPath\\new.res", "$inDistPath\\$seiFileNameSpecificStubRes");
unlink("$inDistPath\\temp.res"); unlink("$inDistPath\\temp.res");
#unlink("$inDistPath\\temp.rc");
system("rc $inDistPath\\$seiFileNameSpecificStubRes $inDistPath\\$seiFileNameSpecificStub"); system("rc $inDistPath\\$seiFileNameSpecificStubRes $inDistPath\\$seiFileNameSpecificStub");
# copy the lean installer to stub\ dir # copy the lean installer to stub\ dir
@ -389,7 +392,7 @@ if(system("cp $inDistPath\\$seiFileNameGenericRes $inDistPath\\$seiFileNameSpeci
$size = (-s "$inDistPath\\$seiFileNameSpecificRes"); $size = (-s "$inDistPath\\$seiFileNameSpecificRes");
truncate("$inDistPath\\$seiFileNameSpecificRes", "$size-1"); truncate("$inDistPath\\$seiFileNameSpecificRes", "$size-1");
open(OUTPUTFILE, ">$inDistPath\\temp.rc"); open(OUTPUTFILE, ">$inDistPath\\$seiFileNameSpecificRC");
print OUTPUTFILE "#include <os2.h>\n"; print OUTPUTFILE "#include <os2.h>\n";
print OUTPUTFILE "STRINGTABLE DISCARDABLE\n"; print OUTPUTFILE "STRINGTABLE DISCARDABLE\n";
print OUTPUTFILE "BEGIN\n"; print OUTPUTFILE "BEGIN\n";
@ -419,12 +422,11 @@ foreach $entry ( @xpiFiles )
$currentResourceID++; $currentResourceID++;
} }
close(OUTPUTFILE); close(OUTPUTFILE);
system("rc -r $inDistPath\\temp.rc"); system("rc -r $inDistPath\\$seiFileNameSpecificRC $inDistPath\\temp.res");
system("cat $inDistPath\\$seiFileNameSpecificRes $inDistPath\\temp.res > $inDistPath\\new.res"); system("cat $inDistPath\\$seiFileNameSpecificRes $inDistPath\\temp.res > $inDistPath\\new.res");
unlink("$inDistPath\\$seiFileNameSpecificRes"); unlink("$inDistPath\\$seiFileNameSpecificRes");
rename("$inDistPath\\new.res", "$inDistPath\\$seiFileNameSpecificRes"); rename("$inDistPath\\new.res", "$inDistPath\\$seiFileNameSpecificRes");
unlink("$inDistPath\\temp.res"); unlink("$inDistPath\\temp.res");
#unlink("$inDistPath\\temp.rc");
system("rc $inDistPath\\$seiFileNameSpecificRes $inDistPath\\$seiFileNameSpecific"); system("rc $inDistPath\\$seiFileNameSpecificRes $inDistPath\\$seiFileNameSpecific");
if(system("cp $inDistPath\\$seiFileNameSpecific $inDistPath\\sea")) if(system("cp $inDistPath\\$seiFileNameSpecific $inDistPath\\sea"))
@ -534,27 +536,27 @@ sub MakeUninstall
} }
# Copy the uninstall files to the dist uninstall directory. # Copy the uninstall files to the dist uninstall directory.
if(system("copy uninstall.ini $inDistPath")) if(system("cp uninstall.ini $inDistPath"))
{ {
print "\n Error: copy uninstall.ini $inDistPath\n"; print "\n Error: copy uninstall.ini $inDistPath\n";
return(1); return(1);
} }
if(system("copy uninstall.ini $inDistPath\\uninstall")) if(system("cp uninstall.ini $inDistPath\\uninstall"))
{ {
print "\n Error: copy uninstall.ini $inDistPath\\uninstall\n"; print "\n Error: copy uninstall.ini $inDistPath\\uninstall\n";
return(1); return(1);
} }
if(system("copy defaults_info.ini $inDistPath")) if(system("cp defaults_info.ini $inDistPath"))
{ {
print "\n Error: copy defaults_info.ini $inDistPath\n"; print "\n Error: copy defaults_info.ini $inDistPath\n";
return(1); return(1);
} }
if(system("copy defaults_info.ini $inDistPath\\uninstall")) if(system("cp defaults_info.ini $inDistPath\\uninstall"))
{ {
print "\n Error: copy defaults_info.ini $inDistPath\\uninstall\n"; print "\n Error: copy defaults_info.ini $inDistPath\\uninstall\n";
return(1); return(1);
} }
if(system("copy $inDistPath\\uninstall.exe $inDistPath\\uninstall")) if(system("cp $inDistPath\\uninstall.exe $inDistPath\\uninstall"))
{ {
print "\n Error: copy $inDistPath\\uninstall.exe $inDistPath\\uninstall\n"; print "\n Error: copy $inDistPath\\uninstall.exe $inDistPath\\uninstall\n";
return(1); return(1);
@ -562,17 +564,47 @@ sub MakeUninstall
# build the self-extracting .exe (uninstaller) file. # build the self-extracting .exe (uninstaller) file.
print "\nbuilding self-extracting uninstaller ($seuFileNameSpecific)...\n"; print "\nbuilding self-extracting uninstaller ($seuFileNameSpecific)...\n";
if(system("copy $inDistPath\\$seiFileNameGeneric $inDistPath\\$seuFileNameSpecific")) if(system("cp $inDistPath\\$seiFileNameGeneric $inDistPath\\$seuFileNameSpecific"))
{ {
print "\n Error: copy $inDistPath\\$seiFileNameGeneric $inDistPath\\$seuFileNameSpecific\n"; print "\n Error: copy $inDistPath\\$seiFileNameGeneric $inDistPath\\$seuFileNameSpecific\n";
return(1); return(1);
} }
if(system("$inDistPath\\nsztool.exe $inDistPath\\$seuFileNameSpecific $inDistPath\\uninstall\\*.*"))
if(system("cp $inDistPath\\$seiFileNameGenericRes $inDistPath\\$seuFileNameSpecificRes"))
{ {
print "\n Error: $inDistPath\\nsztool.exe $inDistPath\\$seuFileNameSpecific $inDistPath\\uninstall\\*.*\n"; die "\n Error: copy $inDistPath\\$seiFileNameGenericRes $inDistPath\\$seuFileNameSpecificRes\n";
return(1);
} }
@stubFiles = <$inDistPath/uninstall/*.*>;
$size = (-s "$inDistPath\\$seuFileNameSpecificRes");
truncate("$inDistPath\\$seuFileNameSpecificRes", "$size-1");
open(OUTPUTFILE, ">$inDistPath\\$seuFileNameSpecificRC");
print OUTPUTFILE "#include <os2.h>\n";
print OUTPUTFILE "STRINGTABLE DISCARDABLE\n";
print OUTPUTFILE "BEGIN\n";
$currentResourceID = 10000+1;
foreach $entry ( @stubFiles )
{
$filename = basename($entry);
print OUTPUTFILE "$currentResourceID \"$filename\"\n";
$currentResourceID++;
}
print OUTPUTFILE "END\n";
$currentResourceID = 10000+1;
foreach $entry ( @stubFiles )
{
print OUTPUTFILE "RESOURCE RT_RCDATA $currentResourceID \"$entry\"\n";
$currentResourceID++;
}
close(OUTPUTFILE);
system("rc -r $inDistPath\\$seuFileNameSpecificRC $inDistPath\\temp.res");
system("cat $inDistPath\\$seuFileNameSpecificRes $inDistPath\\temp.res > $inDistPath\\new.res");
unlink("$inDistPath\\$seuFileNameSpecificRes");
rename("$inDistPath\\new.res", "$inDistPath\\$seuFileNameSpecificStubRes");
unlink("$inDistPath\\temp.res");
system("rc $inDistPath\\$seuFileNameSpecificRes $inDistPath\\$seuFileNameSpecific");
MakeExeZip($inDistPath, $seuFileNameSpecific, $seuzFileNameSpecific); MakeExeZip($inDistPath, $seuFileNameSpecific, $seuzFileNameSpecific);
unlink <$inDistPath\\$seuFileNameSpecific>; unlink <$inDistPath\\$seuFileNameSpecific>;
return(0); return(0);

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

@ -0,0 +1,113 @@
#!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 parses the input file for special variables
# in the format of $Variable$ and replace it with the appropriate
# value(s).
#
# Input: .it file
# - which is a .ini template
#
# version
# - version to display on the blue background
#
# ie: perl makeuninstallini.pl uninstall.it 6.0.0.1999120608
#
#
if($#ARGV < 1)
{
die "usage: $0 <.it file> <version>
.it file : input ini template file
version : version to be shown in setup. Typically the same version
as show in mozilla.exe. This version string will be shown
on the title of the main dialog.
ie: perl makeuninstallini.pl uninstall.it 6.0.0.1999120608
or perl makeuninstallini.pl uninstall.it 6.0b2
\n";
}
$inItFile = $ARGV[0];
$inVersion = $ARGV[1];
# get environment vars
$userAgent = $ENV{WIZ_userAgent};
$userAgentShort = $ENV{WIZ_userAgentShort};
$xpinstallVersion = $ENV{WIZ_xpinstallVersion};
$nameCompany = $ENV{WIZ_nameCompany};
$nameProduct = $ENV{WIZ_nameProduct};
$fileMainExe = $ENV{WIZ_fileMainExe};
$fileUninstall = $ENV{WIZ_fileUninstall};
# Get the name of the file replacing the .it extension with a .ini extension
@inItFileSplit = split(/\./,$inItFile);
$outIniFile = $inItFileSplit[0];
$outIniFile .= ".ini";
# Open the input file
open(fpInIt, $inItFile) || die "\ncould not open $ARGV[0]: $!\n";
# Open the output file
open(fpOutIni, ">$outIniFile") || die "\nCould not open $outIniFile: $!\n";
print "\n Making $outIniFile...\n";
# While loop to read each line from input file
while($line = <fpInIt>)
{
# For each line read, search and replace $Version$ with the version passed in
$line =~ s/\$Version\$/$inVersion/gi;
$line =~ s/\$UserAgent\$/$userAgent/gi;
$line =~ s/\$UserAgentShort\$/$userAgentShort/gi;
$line =~ s/\$XPInstallVersion\$/$xpinstallVersion/gi;
$line =~ s/\$CompanyName\$/$nameCompany/gi;
$line =~ s/\$ProductName\$/$nameProduct/gi;
$line =~ s/\$MainExeFile\$/$fileMainExe/gi;
$line =~ s/\$UninstallFile\$/$fileUninstall/gi;
print fpOutIni $line;
}
print " done!\n";
# end of script
exit(0);
sub ParseUserAgentShort()
{
my($aUserAgent) = @_;
my($aUserAgentShort);
@spaceSplit = split(/ /, $aUserAgent);
if($#spaceSplit >= 0)
{
$aUserAgentShort = $spaceSplit[0];
}
return($aUserAgentShort);
}

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

@ -19,8 +19,8 @@ Product Name=$ProductName$
Main App=[Product OS2INIKey] Main App=[Product OS2INIKey]
Decrypt Main App=TRUE Decrypt Main App=TRUE
Key=[Product CurrentVersion]\Uninstall App=[Product CurrentVersion]
Decrypt Key=TRUE Decrypt App=TRUE
Uninstall Filename=$UninstallFile$ Uninstall Filename=$UninstallFile$
Defaults Info Filename=defaults_info.ini Defaults Info Filename=defaults_info.ini
@ -35,6 +35,9 @@ Message=$ProductName$ is detected to be currently running. Please quit $Product
; set here because Mozilla requires a way to shut down it's turbo mode. ; set here because Mozilla requires a way to shut down it's turbo mode.
Extra Cmd Parameter=-kill Extra Cmd Parameter=-kill
[Check Instance1]
Process Name=mozturbo.exe
Extra Cmd Parameter=-u
[Dialog Uninstall] [Dialog Uninstall]
FONTNAME=WarpSans FONTNAME=WarpSans