зеркало из https://github.com/mozilla/pjs.git
fixing bug 7874 (on going).
Affects windows platforms only.
This commit is contained in:
Родитель
caf9a86a29
Коммит
eb9534f9f9
|
@ -25,12 +25,12 @@ function createShortcuts()
|
|||
winreg = getWinRegistry();
|
||||
fWindows = getFolder("Windows");
|
||||
fCommunicator = getFolder("Communicator");
|
||||
fTemp = fCommunicator + "\\mozilla.exe";
|
||||
fTemp = fCommunicator + "\\$MainExeFile$";
|
||||
fileExe = getFolder("file:///", fTemp);
|
||||
scExeDesc = "Mozilla Seamonkey";
|
||||
scExeDesc = "$ProductName$";
|
||||
scProfileDesc = "Profile Manager";
|
||||
scProfileDescParam = "-ProfileManager";
|
||||
scFolderName = "Mozilla Seamonkey";
|
||||
scFolderName = "$ProductName$";
|
||||
if(winreg != null)
|
||||
{
|
||||
/* determine if the script is running under NT or not */
|
||||
|
@ -85,13 +85,13 @@ function createShortcuts()
|
|||
szFolderQuickLaunch = winreg.getValueString(subkey, valname);
|
||||
|
||||
winreg.setRootKey(winreg.HKEY_LOCAL_MACHINE);
|
||||
subkey = "SOFTWARE\\Mozilla\\Mozilla Seamonkey\\$UserAgent$\\Main";
|
||||
subkey = "SOFTWARE\\$CompanyName$\\$ProductName$\\$UserAgent$\\Main";
|
||||
valname = "Program Folder Path";
|
||||
fFolderPathStr = winreg.getValueString(subkey, valname);
|
||||
if((fFolderPathStr == "") || (fFolderPathStr == null))
|
||||
{
|
||||
fTemp = szStartMenuPrograms + "\\" + scFolderName;
|
||||
fFolderPath = getFolder("file:///", fTemp);
|
||||
fTemp = szStartMenuPrograms + "\\" + scFolderName;
|
||||
fFolderPath = getFolder("file:///", fTemp);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -122,21 +122,21 @@ function createShortcuts()
|
|||
|
||||
/* set the Program Folder Path in the Mozilla key in the Windows Registry */
|
||||
winreg.setRootKey(winreg.HKEY_LOCAL_MACHINE);
|
||||
subkey = "SOFTWARE\\Mozilla";
|
||||
subkey = "SOFTWARE\\$CompanyName$";
|
||||
winreg.createKey(subkey,"");
|
||||
|
||||
valname = "CurrentVersion";
|
||||
subkey = "SOFTWARE\\Mozilla\\Mozilla Seamonkey";
|
||||
subkey = "SOFTWARE\\$CompanyName$\\$ProductName$";
|
||||
winreg.createKey(subkey,"");
|
||||
|
||||
valname = "CurrentVersion";
|
||||
value = "$UserAgent$";
|
||||
err = winreg.setValueString(subkey, valname, value);
|
||||
|
||||
subkey = "SOFTWARE\\Mozilla\\Mozilla Seamonkey\\$UserAgent$";
|
||||
subkey = "SOFTWARE\\$CompanyName$\\$ProductName$\\$UserAgent$";
|
||||
winreg.createKey(subkey,"");
|
||||
|
||||
subkey = "SOFTWARE\\Mozilla\\Mozilla Seamonkey\\$UserAgent$\\Main";
|
||||
subkey = "SOFTWARE\\$CompanyName$\\$ProductName$\\$UserAgent$\\Main";
|
||||
winreg.createKey(subkey,"");
|
||||
|
||||
valname = "Program Folder Path";
|
||||
|
@ -163,20 +163,20 @@ function updateWinReg()
|
|||
if(winreg != null)
|
||||
{
|
||||
winreg.setRootKey(winreg.HKEY_LOCAL_MACHINE);
|
||||
subkey = "SOFTWARE\\Mozilla";
|
||||
subkey = "SOFTWARE\\$CompanyName$";
|
||||
winreg.createKey(subkey,"");
|
||||
|
||||
subkey = "SOFTWARE\\Mozilla\\Mozilla Seamonkey";
|
||||
subkey = "SOFTWARE\\$CompanyName$\\$ProductName$";
|
||||
winreg.createKey(subkey,"");
|
||||
|
||||
valname = "CurrentVersion";
|
||||
value = "$UserAgent$";
|
||||
err = winreg.setValueString(subkey, valname, value);
|
||||
|
||||
subkey = "SOFTWARE\\Mozilla\\Mozilla Seamonkey\\$UserAgent$";
|
||||
subkey = "SOFTWARE\\$CompanyName$\\$ProductName$\\$UserAgent$";
|
||||
winreg.createKey(subkey,"");
|
||||
|
||||
subkey = "SOFTWARE\\Mozilla\\Mozilla Seamonkey\\$UserAgent$\\Main";
|
||||
subkey = "SOFTWARE\\$CompanyName$\\$ProductName$\\$UserAgent$\\Main";
|
||||
winreg.createKey(subkey,"");
|
||||
|
||||
valname = "Install Directory";
|
||||
|
@ -184,10 +184,10 @@ function updateWinReg()
|
|||
err = winreg.setValueString(subkey, valname, value);
|
||||
|
||||
// set the App Paths key here
|
||||
subkey = "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\App Paths\\mozilla.exe";
|
||||
subkey = "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\App Paths\\$MainExeFile$";
|
||||
winreg.createKey(subkey,"");
|
||||
valname = "";
|
||||
value = fCommunicator + "\\mozilla.exe";
|
||||
value = fCommunicator + "\\$MainExeFile$";
|
||||
err = winreg.setValueString(subkey, valname, value);
|
||||
|
||||
valname = "Path";
|
||||
|
@ -205,11 +205,11 @@ var fileComponentRegStr;
|
|||
var fileComponentReg;
|
||||
|
||||
srDest = $SpaceRequired$:bin;
|
||||
err = startInstall("Mozilla Seamonkey", "Browser", "$Version$");
|
||||
err = startInstall("$ProductName$", "Browser", "$Version$");
|
||||
logComment("startInstall: " + err);
|
||||
|
||||
fCommunicator = getFolder("Communicator");
|
||||
fWindowsSystem = getFolder("Win System");
|
||||
fCommunicator = getFolder("Communicator");
|
||||
fWindowsSystem = getFolder("Win System");
|
||||
logComment("fCommunicator: " + fCommunicator);
|
||||
|
||||
if(verifyDiskSpace(fCommunicator, srDest) == true)
|
||||
|
|
|
@ -7,14 +7,14 @@
|
|||
; values.
|
||||
Run Mode=Normal
|
||||
|
||||
Product Name=Mozilla Seamonkey
|
||||
Product Name=$ProductName$
|
||||
|
||||
; Destination Path values:
|
||||
; PROGRAMFILESDIR
|
||||
; WINDISK
|
||||
; WINDIR
|
||||
; WINSYSDIR
|
||||
Path=[PROGRAMFILESDIR]\Mozilla\Seamonkey
|
||||
Path=[PROGRAMFILESDIR]\$CompanyName$\Seamonkey
|
||||
|
||||
; Program Folder Path values:
|
||||
; COMMON_STARTUP
|
||||
|
@ -45,7 +45,7 @@ Path=[PROGRAMFILESDIR]\Mozilla\Seamonkey
|
|||
; MEDIAPATH
|
||||
; CONFIGPATH (supported only under Windows95 and Windows98)
|
||||
; DEVICEPATH
|
||||
Program Folder Name=Mozilla Seamonkey
|
||||
Program Folder Name=$ProductName$
|
||||
Program Folder Path=[COMMON_PROGRAMS]
|
||||
|
||||
; Default Setup Type values:
|
||||
|
@ -58,7 +58,7 @@ Default Setup Type=Setup Type 0
|
|||
; Default Font Size is 32
|
||||
; Default Font Color is WHITE (of BLACK and GREEN)
|
||||
; Default Font Shadow is TRUE
|
||||
Setup Title0=Mozilla Seamonkey Pr2 Setup
|
||||
Setup Title0=$ProductName$ Pr2 Setup
|
||||
Setup Title0 Font Size=
|
||||
Setup Title0 Font Color=
|
||||
Setup Title0 Font Shadow=TRUE
|
||||
|
@ -90,7 +90,7 @@ Verify Existance=
|
|||
; If the file(s), indicated by the Filename= key, is found to have a version of less than the value
|
||||
; indicated by the Version= key, then display the string in the Message= key.
|
||||
[Legacy Check0]
|
||||
Filename=[SETUP PATH]\mozilla.exe
|
||||
Filename=[SETUP PATH]\$MainExeFile$
|
||||
Version=6.0.0.0
|
||||
Message=Setup has detected an old version of Mozilla in the chosen destination directory that may pose compatibility issues. It is highly recommended that a different destination directory be used. Would you like to choose a different directory?
|
||||
|
||||
|
@ -284,7 +284,6 @@ Attributes=SELECTED|DISABLED
|
|||
; using the url keys and the Archive key.
|
||||
Domain0=$Domain$
|
||||
Server Path0=$ServerPath$
|
||||
;url0=$URLPath$
|
||||
|
||||
[Component2]
|
||||
Description Short=Mail & News
|
||||
|
@ -305,7 +304,6 @@ Parameter=
|
|||
; using the url keys and the Archive key.
|
||||
Domain0=$Domain$
|
||||
Server Path0=$ServerPath$
|
||||
;url0=$URLPath$
|
||||
|
||||
[Core]
|
||||
Source=[XPI PATH]\core.xpi
|
||||
|
@ -364,49 +362,56 @@ Source=[JRE BIN PATH]\npjava*.dll
|
|||
Destination=[SETUP PATH]\Plugins
|
||||
Fail If Exists=FALSE
|
||||
|
||||
;[Copy File1]
|
||||
;Timing=post launchapp
|
||||
;Source=[TEMP]\xtratest\bin\*.*
|
||||
;Destination=[SETUP PATH]
|
||||
;Fail If Exists=FALSE
|
||||
[Copy File1]
|
||||
Timing=post smartupdate
|
||||
Source=[SETUP STARTUP PATH]\$UninstallFile$
|
||||
Destination=[WINDIR]
|
||||
Fail If Exists=FALSE
|
||||
|
||||
|
||||
;Copy File SequentialX sections
|
||||
[Copy File Sequential0]
|
||||
Timing=post launchapp
|
||||
Filename=install.log
|
||||
Source=[SETUP STARTUP PATH]
|
||||
Destination=[SETUP PATH]\Uninstall
|
||||
|
||||
;[Copy File1]
|
||||
;Timing=post download
|
||||
;Source=[SETUP PATH]\bin\*.exe
|
||||
;Destination=[TEMP]
|
||||
;Fail If Exists=
|
||||
|
||||
;Create DirectoryX sections
|
||||
[Create Directory0]
|
||||
Timing=post download
|
||||
Destination=[SETUP PATH]\Plugins
|
||||
|
||||
;[Create Directory1]
|
||||
;Timing=post download
|
||||
;Destination=[TEMP]\Test\temp
|
||||
|
||||
;Delete FileX sections
|
||||
[Delete File0]
|
||||
Timing=post download
|
||||
Destination=[COMMON_PROGRAMS]\Mozilla Seamonkey\Mozilla AppRunner.lnk
|
||||
|
||||
[Delete File1]
|
||||
Timing=post launchapp
|
||||
Destination=[SETUP STARTUP PATH]\install.log
|
||||
|
||||
|
||||
;Remove DirectoryX sections
|
||||
;[Remove Directory0]
|
||||
;Timing=post launchapp
|
||||
;Destination=[TEMP]\xtratest
|
||||
;Remove subdirs=TRUE
|
||||
|
||||
|
||||
;RunAppX sections
|
||||
[RunApp0]
|
||||
Timing=depend reboot
|
||||
Wait=FALSE
|
||||
Target=[SETUP PATH]\mozilla.exe
|
||||
Target=[SETUP PATH]\$MainExeFile$
|
||||
Parameters=-installer
|
||||
WorkingDir=[SETUP PATH]
|
||||
|
||||
|
||||
[Windows Registry0]
|
||||
Root Key=HKEY_LOCAL_MACHINE
|
||||
Key=Software\Mozilla\Mozilla Seamonkey\$UserAgent$\Main
|
||||
Key=Software\$CompanyName$\$ProductName$\$UserAgent$\Main
|
||||
Name=Program Folder Path
|
||||
Name Value=[Default Folder]
|
||||
Type=REG_SZ
|
||||
|
@ -417,6 +422,32 @@ Overwrite Key=TRUE
|
|||
Overwrite Name=TRUE
|
||||
Timing=pre smartupdate
|
||||
|
||||
[Windows Registry1]
|
||||
Root Key=HKEY_LOCAL_MACHINE
|
||||
Key=Software\Microsoft\Windows\CurrentVersion\Uninstall\$ProductName$ $UserAgentShort$
|
||||
Name=DisplayName
|
||||
Name Value=$ProductName$ $UserAgentShort$
|
||||
Type=REG_SZ
|
||||
Decrypt Key=FALSE
|
||||
Decrypt Name=FALSE
|
||||
Decrypt Name Value=FALSE
|
||||
Overwrite Key=TRUE
|
||||
Overwrite Name=TRUE
|
||||
Timing=post smartupdate
|
||||
|
||||
[Windows Registry2]
|
||||
Root Key=HKEY_LOCAL_MACHINE
|
||||
Key=Software\Microsoft\Windows\CurrentVersion\Uninstall\$ProductName$ $UserAgentShort$
|
||||
Name=UninstallString
|
||||
Name Value=[WINDIR]\$UninstallFile$ /ua "$UserAgent$"
|
||||
Type=REG_SZ
|
||||
Decrypt Key=FALSE
|
||||
Decrypt Name=FALSE
|
||||
Decrypt Name Value=TRUE
|
||||
Overwrite Key=TRUE
|
||||
Overwrite Name=TRUE
|
||||
Timing=post smartupdate
|
||||
|
||||
; Values for Show Folder:
|
||||
; HIDE Hides the window and activates another window.
|
||||
; MAXIMIZE Maximizes the specified window.
|
||||
|
@ -448,19 +479,19 @@ Show Folder=SHOW
|
|||
Program Folder=[Default Folder]
|
||||
|
||||
;[Program Folder0-Shortcut0]
|
||||
;File=[SETUP PATH]\mozilla.exe
|
||||
;File=[SETUP PATH]\$MainExeFile$
|
||||
;Arguments=
|
||||
;Working Dir=[SETUP PATH]
|
||||
;Description=Mozilla Seamonkey
|
||||
;Icon Path=[SETUP PATH]\mozilla.exe
|
||||
;Description=$ProductName$
|
||||
;Icon Path=[SETUP PATH]\$MainExeFile$
|
||||
;Icon Id=0
|
||||
|
||||
;[Program Folder0-Shortcut1]
|
||||
;File=[SETUP PATH]\mozilla.exe
|
||||
;File=[SETUP PATH]\$MainExeFile$
|
||||
;Arguments=-ProfileManager
|
||||
;Working Dir=[SETUP PATH]
|
||||
;Description=Profile Manager
|
||||
;Icon Path=[SETUP PATH]\mozilla.exe
|
||||
;Icon Path=[SETUP PATH]\$MainExeFile$
|
||||
;Icon Id=0
|
||||
|
||||
;[Program Folder0-Shortcut2]
|
||||
|
|
|
@ -1,41 +1,97 @@
|
|||
function updateWinReg()
|
||||
{
|
||||
//Notes:
|
||||
// can't use a double backslash before subkey - Windows already puts it in.
|
||||
// subkeys have to exist before values can be put in.
|
||||
var winreg = getWinRegistry();
|
||||
var subkey; //the name of the subkey you are poking around in
|
||||
var valname; // the name of the value you want to look at
|
||||
var value; //the data in the value you want to look at.
|
||||
|
||||
if(winreg != null)
|
||||
{
|
||||
winreg.setRootKey(winreg.HKEY_LOCAL_MACHINE);
|
||||
subkey = "SOFTWARE\\$CompanyName$";
|
||||
winreg.createKey(subkey,"");
|
||||
|
||||
subkey = "SOFTWARE\\$CompanyName$\\$ProductName$";
|
||||
winreg.createKey(subkey,"");
|
||||
|
||||
valname = "CurrentVersion";
|
||||
value = "$UserAgent$";
|
||||
err = winreg.setValueString(subkey, valname, value);
|
||||
|
||||
subkey = "SOFTWARE\\$CompanyName$\\$ProductName$\\$UserAgent$";
|
||||
winreg.createKey(subkey,"");
|
||||
|
||||
subkey = "SOFTWARE\\$CompanyName$\\$ProductName$\\$UserAgent$\\Main";
|
||||
winreg.createKey(subkey,"");
|
||||
|
||||
valname = "Install Directory";
|
||||
value = fCommunicator;
|
||||
err = winreg.setValueString(subkey, valname, value);
|
||||
|
||||
subkey = "SOFTWARE\\$CompanyName$\\$ProductName$\\$UserAgent$\\Uninstall";
|
||||
winreg.createKey(subkey,"");
|
||||
|
||||
valname = "Uninstall Log Folder";
|
||||
value = szUninstall;
|
||||
err = winreg.setValueString(subkey, valname, value);
|
||||
|
||||
valname = "Description";
|
||||
value = "$ProductName$ $UserAgentShort$";
|
||||
err = winreg.setValueString(subkey, valname, value);
|
||||
}
|
||||
}
|
||||
|
||||
// main
|
||||
var srDest;
|
||||
var err;
|
||||
var communicatorFolder;
|
||||
var szUninstall;
|
||||
var fUninstall;
|
||||
var fCommunicator;
|
||||
var fWindowsSystem;
|
||||
var fileComponentRegStr;
|
||||
var fileComponentReg;
|
||||
var fileComponentRegStr;
|
||||
|
||||
srDest = $SpaceRequired$:bin;
|
||||
err = startInstall("Mozilla XPCom", "XPCom", "$Version$");
|
||||
logComment("startInstall: " + err);
|
||||
|
||||
communicatorFolder = getFolder("Communicator");
|
||||
fWindowsSystem = getFolder("Win System");
|
||||
logComment("communicatorFolder: " + communicatorFolder);
|
||||
fCommunicator = getFolder("Communicator");
|
||||
fWindowsSystem = getFolder("Win System");
|
||||
logComment("fCommunicator: " + fCommunicator);
|
||||
|
||||
if(verifyDiskSpace(communicatorFolder, srDest) == true)
|
||||
// build the uninstall folder path
|
||||
szUninstall = fCommunicator + "\\Uninstall";
|
||||
fUninstall = getFolder("file:///", szUninstall);
|
||||
File.dirCreate(fUninstall);
|
||||
|
||||
if(verifyDiskSpace(fCommunicator, srDest) == true)
|
||||
{
|
||||
setPackageFolder(communicatorFolder);
|
||||
setPackageFolder(fCommunicator);
|
||||
err = addDirectory("",
|
||||
"$Version$",
|
||||
"bin", // dir name in jar to extract
|
||||
communicatorFolder, // Where to put this file (Returned from GetFolder)
|
||||
"", // subdir name to create relative to communicatorFolder
|
||||
fCommunicator, // Where to put this file (Returned from GetFolder)
|
||||
"", // subdir name to create relative to fCommunicator
|
||||
true); // Force Flag
|
||||
logComment("addDirectory() of Program returned: " + err);
|
||||
|
||||
// check return value
|
||||
if(!checkError(err))
|
||||
{
|
||||
fileComponentRegStr = communicatorFolder + "\\component.reg";
|
||||
fileComponentRegStr = fCommunicator + "\\component.reg";
|
||||
fileComponentReg = getFolder("file:///", fileComponentRegStr);
|
||||
err = fileDelete(fileComponentReg);
|
||||
logComment("fileDelete() returned: " + err);
|
||||
|
||||
updateWinReg();
|
||||
|
||||
err = finalizeInstall();
|
||||
logComment("finalizeInstall() returned: " + err);
|
||||
}
|
||||
}
|
||||
|
||||
// end main
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
// main
|
||||
var srDest;
|
||||
var err;
|
||||
var communicatorFolder;
|
||||
var fCommunicator;
|
||||
|
||||
srDest = $SpaceRequired$:bin;
|
||||
err = startInstall("Mozilla Mail", "Mail", "$Version$");
|
||||
|
@ -9,17 +9,17 @@ logComment("startInstall: " + err);
|
|||
// check return value
|
||||
checkError(err);
|
||||
|
||||
communicatorFolder = getFolder("Communicator");
|
||||
logComment("communicatorFolder: " + communicatorFolder);
|
||||
fCommunicator = getFolder("Communicator");
|
||||
logComment("fCommunicator: " + fCommunicator);
|
||||
|
||||
if(verifyDiskSpace(communicatorFolder, srDest) == true)
|
||||
if(verifyDiskSpace(fCommunicator, srDest) == true)
|
||||
{
|
||||
setPackageFolder(communicatorFolder);
|
||||
setPackageFolder(fCommunicator);
|
||||
err = addDirectory("",
|
||||
"$Version$",
|
||||
"bin", // dir name in jar to extract
|
||||
communicatorFolder, // Where to put this file (Returned from GetFolder)
|
||||
"", // subdir name to create relative to communicatorFolder
|
||||
fCommunicator, // Where to put this file (Returned from GetFolder)
|
||||
"", // subdir name to create relative to fCommunicator
|
||||
true); // Force Flag
|
||||
logComment("addDirectory() returned: " + err);
|
||||
|
||||
|
|
|
@ -50,7 +50,14 @@ $inXpiUrl = "ftp://not.needed.com/because/the/xpi/files/will/be/loca
|
|||
|
||||
$seiFileNameGeneric = "nsinstall.exe";
|
||||
$seiFileNameSpecific = "mozilla-win32-installer.exe";
|
||||
$userAgent = "5.0b2 (en)";
|
||||
$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;
|
||||
|
||||
# Check for existance of staging path
|
||||
if(!(-e "$inStagePath"))
|
||||
|
@ -58,10 +65,10 @@ if(!(-e "$inStagePath"))
|
|||
die "invalid path: $inStagePath\n";
|
||||
}
|
||||
|
||||
# Make sure inDestPath exists
|
||||
# Make sure inDistPath exists
|
||||
if(!(-e "$inDistPath"))
|
||||
{
|
||||
mkdir ("$inDestPath",0775);
|
||||
mkdir ("$inDistPath",0775);
|
||||
}
|
||||
|
||||
# Make .js files
|
||||
|
@ -75,6 +82,16 @@ MakeXpiFile("browser");
|
|||
MakeXpiFile("mail");
|
||||
|
||||
MakeConfigFile();
|
||||
MakeUninstallIniFile();
|
||||
|
||||
if(-e "$inDistPath\\uninstall")
|
||||
{
|
||||
unlink <$inDistPath\\uninstall\\*>;
|
||||
}
|
||||
else
|
||||
{
|
||||
mkdir ("$inDistPath\\uninstall",0775);
|
||||
}
|
||||
|
||||
if(-e "$inDistPath\\setup")
|
||||
{
|
||||
|
@ -85,13 +102,24 @@ else
|
|||
mkdir ("$inDistPath\\setup",0775);
|
||||
}
|
||||
|
||||
# Copy the uninstall files to the dist uninstall directory.
|
||||
system("xcopy /f uninstall.ini $inDistPath\\");
|
||||
system("xcopy /f uninstall.ini $inDistPath\\uninstall\\");
|
||||
system("xcopy /f $inDistPath\\uninstall.exe $inDistPath\\uninstall\\");
|
||||
|
||||
# Copy the setup files to the dist setup directory.
|
||||
system("xcopy /f config.ini $inDistPath\\");
|
||||
system("xcopy /f config.ini $inDistPath\\setup\\");
|
||||
system("xcopy /f $inDistPath\\setup.exe $inDistPath\\setup\\");
|
||||
system("xcopy /f $inDistPath\\setuprsc.dll $inDistPath\\setup\\");
|
||||
|
||||
# build the self-extracting .exe file.
|
||||
# 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\\*.*");
|
||||
system("xcopy /f $inDistPath\\$seuFileNameSpecific $inDistPath\\setup\\");
|
||||
|
||||
# build the self-extracting .exe (installer) file.
|
||||
print "\nbuilding self-extracting installer ($seiFileNameSpecific)...\n";
|
||||
system("copy $inDistPath\\$seiFileNameGeneric $inDistPath\\$seiFileNameSpecific");
|
||||
system("$inDistPath\\nszip.exe $inDistPath\\$seiFileNameSpecific $inDistPath\\setup\\*.* $inDistPath\\xpi\\*.*");
|
||||
|
@ -104,7 +132,16 @@ exit(0);
|
|||
sub MakeConfigFile
|
||||
{
|
||||
# Make config.ini file
|
||||
if(system("perl makecfgini.pl config.it $inDefaultVersion \"$userAgent\" $inStagePath $inDistPath\\xpi $inRedirIniUrl $inXpiUrl") != 0)
|
||||
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)
|
||||
{
|
||||
exit(1);
|
||||
}
|
||||
|
@ -115,7 +152,7 @@ sub MakeJsFile
|
|||
my($componentName) = @_;
|
||||
|
||||
# Make .js file
|
||||
if(system("perl makejs.pl $componentName.jst $inDefaultVersion \"$userAgent\" $inStagePath\\$componentName") != 0)
|
||||
if(system("perl makejs.pl $componentName.jst $inDefaultVersion $inStagePath\\$componentName") != 0)
|
||||
{
|
||||
exit(1);
|
||||
}
|
||||
|
|
|
@ -33,10 +33,6 @@
|
|||
# version
|
||||
# - version to display on the blue background
|
||||
#
|
||||
# UserAgent
|
||||
# - user agent to use in the windows registry. should be the same as the one
|
||||
# built into the browser (ie "6.0b2 (en)")
|
||||
#
|
||||
# Path to staging area
|
||||
# - path on where the seamonkey built bits are staged to
|
||||
#
|
||||
|
@ -53,31 +49,27 @@
|
|||
# Either ftp:// or http:// can be used
|
||||
# ie: ftp://ftp.netscape.com/pub/seamonkey/xpi
|
||||
#
|
||||
# ie: perl makecfgini.pl config.it 5.0.0.1999120608 "5.0b1 (en)" k:\windows\32bit\5.0 d:\builds\mozilla\dist\win32_o.obj\install\xpi ftp://ftp.netscape.com/pub/seamonkey/windows/32bit/x86/1999-09-13-10-M10 ftp://ftp.netscape.com/pub/seamonkey/windows/32bit/x86/1999-09-13-10-M10/xpi
|
||||
# ie: perl makecfgini.pl config.it 5.0.0.1999120608 k:\windows\32bit\5.0 d:\builds\mozilla\dist\win32_o.obj\install\xpi ftp://ftp.netscape.com/pub/seamonkey/windows/32bit/x86/1999-09-13-10-M10 ftp://ftp.netscape.com/pub/seamonkey/windows/32bit/x86/1999-09-13-10-M10/xpi
|
||||
#
|
||||
#
|
||||
|
||||
# Make sure there are at least two arguments
|
||||
if($#ARGV < 6)
|
||||
if($#ARGV < 5)
|
||||
{
|
||||
die "usage: $0 <.it file> <version> <UserAgent> <staging path> <.xpi path> <redirect file url> <xpi url>
|
||||
die "usage: $0 <.it file> <version> <staging path> <.xpi path> <redirect file url> <xpi url>
|
||||
|
||||
.it file : input ini template file
|
||||
|
||||
version : version to be shown in setup. Typically the same version
|
||||
as show in mozilla.exe.
|
||||
|
||||
UserAgent : user agent to use in the windows registry. should be the same as the one
|
||||
built into the browser (ie \"6.0b2 (en)\")
|
||||
|
||||
staging path : path to where the components are staged at
|
||||
|
||||
.xpi path : path to where the .xpi files have been built to
|
||||
ie: d:\\builds\\mozilla\\dist\\win32_o.obj\\install\\xpi
|
||||
|
||||
redirect file : url to where the redirect.ini file will be staged at.
|
||||
url Either ftp:// or http:// can be used
|
||||
ie: ftp://ftp.netscape.com/pub/seamonkey
|
||||
|
||||
xpi url : url to where the .xpi files will be staged at.
|
||||
Either ftp:// or http:// can be used
|
||||
ie: ftp://ftp.netscape.com/pub/seamonkey/xpi
|
||||
|
@ -86,11 +78,19 @@ if($#ARGV < 6)
|
|||
|
||||
$inItFile = $ARGV[0];
|
||||
$inVersion = $ARGV[1];
|
||||
$inUserAgent = $ARGV[2];
|
||||
$inStagePath = $ARGV[3];
|
||||
$inXpiPath = $ARGV[4];
|
||||
$inRedirIniUrl = $ARGV[5];
|
||||
$inUrl = $ARGV[6];
|
||||
$inStagePath = $ARGV[2];
|
||||
$inXpiPath = $ARGV[3];
|
||||
$inRedirIniUrl = $ARGV[4];
|
||||
$inUrl = $ARGV[5];
|
||||
|
||||
# get environment vars
|
||||
$userAgent = $ENV{WIZ_userAgent};
|
||||
$nameCompany = $ENV{WIZ_nameCompany};
|
||||
$nameProduct = $ENV{WIZ_nameProduct};
|
||||
$fileMainExe = $ENV{WIZ_fileMainExe};
|
||||
$fileUninstall = $ENV{WIZ_fileUninstall};
|
||||
|
||||
$userAgentShort = ParseUserAgentShort($userAgent);
|
||||
|
||||
$inDomain;
|
||||
$inServerPath;
|
||||
|
@ -173,7 +173,12 @@ while($line = <fpInIt>)
|
|||
$line =~ s/\$Domain\$/$inDomain/i;
|
||||
$line =~ s/\$ServerPath\$/$inServerPath/i;
|
||||
$line =~ s/\$RedirIniUrl\$/$inRedirIniUrl/i;
|
||||
$line =~ s/\$UserAgent\$/$inUserAgent/i;
|
||||
$line =~ s/\$UserAgent\$/$userAgent/i;
|
||||
$line =~ s/\$UserAgentShort\$/$userAgentShort/i;
|
||||
$line =~ s/\$CompanyName\$/$nameCompany/i;
|
||||
$line =~ s/\$ProductName\$/$nameProduct/i;
|
||||
$line =~ s/\$MainExeFile\$/$fileMainExe/i;
|
||||
$line =~ s/\$UninstallFile\$/$fileUninstall/i;
|
||||
print fpOutIni $line;
|
||||
}
|
||||
}
|
||||
|
@ -227,7 +232,7 @@ sub OutputInstallSize()
|
|||
my($installSize);
|
||||
|
||||
print " calculating size for $inPath\n";
|
||||
$installSize = `ds32.exe /D /L0 /A /S /C 32768 $inPath`;
|
||||
$installSize = `$ENV{MOZ_TOOLS}\\bin\\ds32.exe /D /L0 /A /S /C 32768 $inPath`;
|
||||
$installSize += 32768; # take into account install.js
|
||||
$installSize = int($installSize / 1024);
|
||||
$installSize += 1;
|
||||
|
@ -265,7 +270,7 @@ sub OutputInstallSizeSystem()
|
|||
{
|
||||
# calculate the size of component installed using ds32.exe in Kbytes
|
||||
print " calculating size for $inPath\\$_";
|
||||
$installSizeSystem += `ds32.exe /D /L0 /A /S /C 32768 $inPath\\$_`;
|
||||
$installSizeSystem += `$ENV{MOZ_TOOLS}\\bin\\ds32.exe /D /L0 /A /S /C 32768 $inPath\\$_`;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -275,3 +280,17 @@ sub OutputInstallSizeSystem()
|
|||
return($installSizeSystem);
|
||||
}
|
||||
|
||||
sub ParseUserAgentShort()
|
||||
{
|
||||
my($aUserAgent) = @_;
|
||||
my($aUserAgentShort);
|
||||
|
||||
@spaceSplit = split(/ /, $aUserAgent);
|
||||
if($#spaceSplit >= 0)
|
||||
{
|
||||
$aUserAgentShort = $spaceSplit[0];
|
||||
}
|
||||
|
||||
return($aUserAgentShort);
|
||||
}
|
||||
|
||||
|
|
|
@ -31,22 +31,20 @@
|
|||
# default version - a julian date in the form of:
|
||||
# major.minor.release.yydoy
|
||||
# ie: 5.0.0.99256
|
||||
# user agent - user agent of product
|
||||
# component 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 < 3)
|
||||
if($#ARGV < 2)
|
||||
{
|
||||
die "usage: $0 <.jst file> <default version> <UserAgent> <staging path>
|
||||
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
|
||||
user agent : user agent of product (5.0b1 [en])
|
||||
component staging path : path to where this component is staged at
|
||||
ie: z:\\stage\\windows\\32bit\\en\\5.0\\core
|
||||
\n";
|
||||
|
@ -54,8 +52,16 @@ if($#ARGV < 3)
|
|||
|
||||
$inJstFile = $ARGV[0];
|
||||
$inVersion = $ARGV[1];
|
||||
$inUserAgent = $ARGV[2];
|
||||
$inStagePath = $ARGV[3];
|
||||
$inStagePath = $ARGV[2];
|
||||
|
||||
# get environment vars
|
||||
$userAgent = $ENV{WIZ_userAgent};
|
||||
$nameCompany = $ENV{WIZ_nameCompany};
|
||||
$nameProduct = $ENV{WIZ_nameProduct};
|
||||
$fileMainExe = $ENV{WIZ_fileMainExe};
|
||||
$fileUninstall = $ENV{WIZ_fileUninstall};
|
||||
|
||||
$userAgentShort = ParseUserAgentShort($userAgent);
|
||||
|
||||
# Get the name of the file replacing the .jst extension with a .js extension
|
||||
@inJstFileSplit = split(/\./,$inJstFile);
|
||||
|
@ -76,16 +82,7 @@ open(fpOutJs, ">$outJsFile") || die "\nCould not open $outJsFile: $!\n";
|
|||
# While loop to read each line from input file
|
||||
while($line = <fpInTemplate>)
|
||||
{
|
||||
# For each line read, search and replace $Version$ with the version passed in
|
||||
if($line =~ /\$Version\$/i)
|
||||
{
|
||||
$line =~ s/\$Version\$/$inVersion/i;
|
||||
}
|
||||
elsif($line =~ /\$UserAgent\$/i)
|
||||
{
|
||||
$line =~ s/\$UserAgent\$/$inUserAgent/i;
|
||||
}
|
||||
elsif($line =~ /\$SpaceRequired\$/i) # For each line read, search and replace $InstallSize$ with the calculated size
|
||||
if($line =~ /\$SpaceRequired\$/i) # For each line read, search and replace $InstallSize$ with the calculated size
|
||||
{
|
||||
$spaceRequired = 0;
|
||||
|
||||
|
@ -104,6 +101,16 @@ while($line = <fpInTemplate>)
|
|||
$line =~ s/\$SpaceRequired\$/$spaceRequired/i;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$line =~ s/\$Version\$/$inVersion/i;
|
||||
$line =~ s/\$UserAgent\$/$userAgent/i;
|
||||
$line =~ s/\$UserAgentShort\$/$userAgentShort/i;
|
||||
$line =~ s/\$CompanyName\$/$nameCompany/i;
|
||||
$line =~ s/\$ProductName\$/$nameProduct/i;
|
||||
$line =~ s/\$MainExeFile\$/$fileMainExe/i;
|
||||
$line =~ s/\$UninstallFile\$/$fileUninstall/i;
|
||||
}
|
||||
|
||||
print fpOutJs $line;
|
||||
}
|
||||
|
@ -114,9 +121,23 @@ sub GetSpaceRequired()
|
|||
my($spaceRequired);
|
||||
|
||||
print " calulating size for $inPath\n";
|
||||
$spaceRequired = `ds32.exe /D /L0 /A /S /C 32768 $inPath`;
|
||||
$spaceRequired = `$ENV{MOZ_TOOLS}\\bin\\ds32.exe /D /L0 /A /S /C 32768 $inPath`;
|
||||
$spaceRequired = int($spaceRequired / 1024);
|
||||
$spaceRequired += 1;
|
||||
return($spaceRequired);
|
||||
}
|
||||
|
||||
sub ParseUserAgentShort()
|
||||
{
|
||||
my($aUserAgent) = @_;
|
||||
my($aUserAgentShort);
|
||||
|
||||
@spaceSplit = split(/ /, $aUserAgent);
|
||||
if($#spaceSplit >= 0)
|
||||
{
|
||||
$aUserAgentShort = $spaceSplit[0];
|
||||
}
|
||||
|
||||
return($aUserAgentShort);
|
||||
}
|
||||
|
||||
|
|
|
@ -33,34 +33,36 @@
|
|||
# version
|
||||
# - version to display on the blue background
|
||||
#
|
||||
# UserAgent
|
||||
# - user agent to use in the windows registry. should be the same as the one
|
||||
# built into the browser (ie "6.0b2 (en)")
|
||||
#
|
||||
# ie: perl makecfgini.pl uninstall.it 6.0.0.1999120608 "6.0b2 (en)"
|
||||
# ie: perl makeuninstallini.pl uninstall.it 6.0.0.1999120608
|
||||
#
|
||||
#
|
||||
|
||||
print "argc: $#ARGV\n";
|
||||
|
||||
if($#ARGV < 2)
|
||||
if($#ARGV < 1)
|
||||
{
|
||||
die "usage: $0 <.it file> <version> <UserAgent>
|
||||
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.
|
||||
as show in mozilla.exe. This version string will be shown
|
||||
on the title of the main dialog.
|
||||
|
||||
UserAgent : user agent to use in the windows registry. should be the same as the one
|
||||
built into the browser (ie \"6.0b2 (en)\")
|
||||
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];
|
||||
$inUserAgent = $ARGV[2];
|
||||
$uaShort = ParseUserAgentShort($inUserAgent);
|
||||
|
||||
# get environment vars
|
||||
$userAgent = $ENV{WIZ_userAgent};
|
||||
$nameCompany = $ENV{WIZ_nameCompany};
|
||||
$nameProduct = $ENV{WIZ_nameProduct};
|
||||
$fileMainExe = $ENV{WIZ_fileMainExe};
|
||||
$fileUninstall = $ENV{WIZ_fileUninstall};
|
||||
|
||||
$userAgentShort = ParseUserAgentShort($userAgent);
|
||||
|
||||
# Get the name of the file replacing the .it extension with a .ini extension
|
||||
@inItFileSplit = split(/\./,$inItFile);
|
||||
|
@ -80,8 +82,12 @@ while($line = <fpInIt>)
|
|||
{
|
||||
# For each line read, search and replace $Version$ with the version passed in
|
||||
$line =~ s/\$Version\$/$inVersion/i;
|
||||
$line =~ s/\$UserAgentShort\$/$uaShort/i;
|
||||
$line =~ s/\$UserAgent\$/$inUserAgent/i;
|
||||
$line =~ s/\$UserAgent\$/$userAgent/i;
|
||||
$line =~ s/\$UserAgentShort\$/$userAgentShort/i;
|
||||
$line =~ s/\$CompanyName\$/$nameCompany/i;
|
||||
$line =~ s/\$ProductName\$/$nameProduct/i;
|
||||
$line =~ s/\$MainExeFile\$/$fileMainExe/i;
|
||||
$line =~ s/\$UninstallFile\$/$fileUninstall/i;
|
||||
print fpOutIni $line;
|
||||
}
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
; values.
|
||||
Run Mode=Normal
|
||||
|
||||
Product Name=Mozilla Seamonkey
|
||||
Product Name=$ProductName$
|
||||
|
||||
; Valid Path values:
|
||||
; PROGRAMFILESDIR
|
||||
|
@ -56,8 +56,8 @@ Decrypt Key=TRUE
|
|||
|
||||
[Dialog Uninstall]
|
||||
Show Dialog=FALSE
|
||||
Title=Mozilla Seamonkey $UserAgentShort$ Uninstaller
|
||||
Message0=This will uninstall Mozilla Seamonkey from you system. Click Uninstall to begin.
|
||||
Title=$ProductName$ $UserAgentShort$ Uninstaller
|
||||
Message0=This will uninstall %s from your system. Click Uninstall to begin uninstallation.
|
||||
|
||||
;[Check Instance0]
|
||||
;Class Name=NetscapeWindowClass
|
||||
|
@ -151,13 +151,13 @@ Message0=This will uninstall Mozilla Seamonkey from you system. Click Uninstall
|
|||
;[RunApp0]
|
||||
;Timing=depend reboot
|
||||
;Wait=FALSE
|
||||
;Target=[SETUP PATH]\mozilla.exe
|
||||
;Target=[SETUP PATH]\$MainExeFile$
|
||||
;Parameters=-installer
|
||||
;WorkingDir=[SETUP PATH]
|
||||
|
||||
;[Windows Registry0]
|
||||
;Root Key=HKEY_LOCAL_MACHINE
|
||||
;Key=Software\Mozilla\Mozilla Seamonkey\$UserAgent$\Main
|
||||
;Key=Software\$CompanyName$\$ProductName$\$UserAgent$\Main
|
||||
;Name=Program Folder Path
|
||||
;Name Value=[Default Folder]
|
||||
;Type=REG_SZ
|
||||
|
|
|
@ -1,3 +1,27 @@
|
|||
/* -*- Mode: C; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/*
|
||||
* 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 Netscape Communications Corporation. All
|
||||
* Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Sean Su <ssu@netscape.com>
|
||||
*/
|
||||
|
||||
#include <windows.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
@ -480,12 +504,9 @@ int main(int argc, char *argv[])
|
|||
char UNCPath[MAX_BUF];
|
||||
char szBuf[MAX_BUF];
|
||||
struct Params ArgList;
|
||||
// ULONGLONG ullTest = 2000032400;
|
||||
|
||||
memset(UNCPath, 0, sizeof(UNCPath));
|
||||
|
||||
//printf("\nTesting: %20.0I64u\n\n", ullTest);
|
||||
|
||||
if(ParseArgumentList(&ArgList, argc, argv))
|
||||
return(1);
|
||||
else
|
||||
|
|
|
@ -27,15 +27,16 @@ USE_NON_MT_LIBS = 1
|
|||
MODULE = ds32
|
||||
PROGRAM = .\$(OBJDIR)\$(MODULE).exe
|
||||
|
||||
OBJS = \
|
||||
OBJS = \
|
||||
.\$(OBJDIR)\ds32.obj \
|
||||
$(NULL)
|
||||
|
||||
include <$(DEPTH)\config\rules.mak>
|
||||
|
||||
install:: $(PROGRAM)
|
||||
$(MAKE_INSTALL) $(PROGRAM) $(DIST)\install
|
||||
if not exist $(MOZ_TOOLS)\bin\nul mkdir $(MOZ_TOOLS)\bin
|
||||
copy $(PROGRAM) $(MOZ_TOOLS)\bin
|
||||
|
||||
clobber_all::
|
||||
$(RM) $(DIST)\install\$(MODULE).exe
|
||||
$(RM) $(MOZ_TOOLS)\bin\$(MODULE).exe
|
||||
|
||||
|
|
|
@ -28,6 +28,8 @@ DIRS=$(DIRS) nsinstall \
|
|||
!endif
|
||||
setup \
|
||||
setuprsc \
|
||||
ren8dot3
|
||||
ren8dot3 \
|
||||
uninstall \
|
||||
ds32
|
||||
|
||||
include <$(DEPTH)\config\rules.mak>
|
||||
|
|
|
@ -350,11 +350,13 @@ void ParseCommandLine(LPSTR lpszCmdLine)
|
|||
if((lstrcmpi(szArgVBuf, "-ms") == 0) || (lstrcmpi(szArgVBuf, "/ms") == 0))
|
||||
{
|
||||
dwMode = SILENT;
|
||||
lstrcat(szCmdLineToSetup, " /ms");
|
||||
}
|
||||
|
||||
++i;
|
||||
}
|
||||
|
||||
lstrcpy(szCmdLineToSetup, " ");
|
||||
lstrcat(szCmdLineToSetup, lpszCmdLine);
|
||||
}
|
||||
|
||||
// Centers the specified window over the desktop. Assumes the window is
|
||||
|
@ -685,6 +687,20 @@ GaugeWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
|
|||
return DefWindowProc(hWnd, msg, wParam, lParam);
|
||||
}
|
||||
|
||||
HRESULT FileExists(LPSTR szFile)
|
||||
{
|
||||
DWORD rv;
|
||||
|
||||
if((rv = GetFileAttributes(szFile)) == -1)
|
||||
{
|
||||
return(FALSE);
|
||||
}
|
||||
else
|
||||
{
|
||||
return(rv);
|
||||
}
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// WinMain
|
||||
|
||||
|
@ -693,7 +709,10 @@ RunInstaller()
|
|||
{
|
||||
PROCESS_INFORMATION pi;
|
||||
STARTUPINFO sti;
|
||||
char szCmdLine[MAX_PATH];
|
||||
char szCmdLine[MAX_BUF];
|
||||
char szSetupFile[MAX_BUF];
|
||||
char szUninstallFile[MAX_BUF];
|
||||
char szArcLstFile[MAX_BUF];
|
||||
BOOL bRet;
|
||||
char szText[256];
|
||||
char szTempPath[4096];
|
||||
|
@ -710,19 +729,30 @@ RunInstaller()
|
|||
memset(&sti,0,sizeof(sti));
|
||||
sti.cb = sizeof(STARTUPINFO);
|
||||
|
||||
// Setup program is in the directory specified for temporary files
|
||||
GetFullTempPathName("SETUP.EXE", sizeof(szCmdLine), szCmdLine);
|
||||
|
||||
dwLen = GetTempPath(4096, szTempPath);
|
||||
if (szTempPath[dwLen - 1] != '\\')
|
||||
strcat(szTempPath, "\\");
|
||||
strcat(szTempPath, WIZ_TEMP_DIR);
|
||||
|
||||
GetCurrentDirectory(MAX_PATH, szCurrentDirectory);
|
||||
GetShortPathName(szCurrentDirectory, szBuf, MAX_PATH);
|
||||
// Setup program is in the directory specified for temporary files
|
||||
GetFullTempPathName("Archive.lst", sizeof(szArcLstFile), szArcLstFile);
|
||||
GetFullTempPathName("SETUP.EXE", sizeof(szSetupFile), szSetupFile);
|
||||
GetFullTempPathName("uninstall.exe", sizeof(szUninstallFile), szUninstallFile);
|
||||
|
||||
lstrcat(szCmdLine, " -a ");
|
||||
lstrcat(szCmdLine, szBuf);
|
||||
GetPrivateProfileString("Archives", "uninstall.exe", "", szBuf, (MAX_BUF * 2), szArcLstFile);
|
||||
if((FileExists(szUninstallFile) != FALSE) && (*szBuf != '\0'))
|
||||
{
|
||||
lstrcpy(szCmdLine, szUninstallFile);
|
||||
}
|
||||
else
|
||||
{
|
||||
lstrcpy(szCmdLine, szSetupFile);
|
||||
GetCurrentDirectory(MAX_PATH, szCurrentDirectory);
|
||||
GetShortPathName(szCurrentDirectory, szBuf, MAX_PATH);
|
||||
|
||||
lstrcat(szCmdLine, " -a ");
|
||||
lstrcat(szCmdLine, szBuf);
|
||||
}
|
||||
|
||||
if(szCmdLine != NULL)
|
||||
lstrcat(szCmdLine, szCmdLineToSetup);
|
||||
|
|
|
@ -1793,11 +1793,15 @@ void ProcessWindowsMessages()
|
|||
}
|
||||
void ShowMessage(LPSTR szMessage, BOOL bShow)
|
||||
{
|
||||
char szBuf[MAX_BUF];
|
||||
|
||||
if(sgProduct.dwMode != SILENT)
|
||||
{
|
||||
if((bShow) && (hDlgMessage == NULL))
|
||||
{
|
||||
InstantiateDialog(DLG_MESSAGE, "Message", DlgProcMessage);
|
||||
ZeroMemory(szBuf, sizeof(szBuf));
|
||||
NS_LoadString(hSetupRscInst, IDS_MB_MESSAGE_STR, szBuf, MAX_BUF);
|
||||
InstantiateDialog(DLG_MESSAGE, szBuf, DlgProcMessage);
|
||||
SendMessage(hDlgMessage, WM_COMMAND, IDC_MESSAGE, (LPARAM)szMessage);
|
||||
}
|
||||
else if(!bShow && hDlgMessage)
|
||||
|
|
|
@ -4825,7 +4825,7 @@ HRESULT DecryptVariable(LPSTR szVariable, DWORD dwVariableSize)
|
|||
|
||||
wsprintf(szVariable, "Software\\Netscape\\Netscape Seamonkey\\%s", szBuf);
|
||||
}
|
||||
else if(lstrcmpi(szVariable, "Netscape6 CurrentVersion") == 0)
|
||||
else if(lstrcmpi(szVariable, "Netscape 6 CurrentVersion") == 0)
|
||||
{
|
||||
/* parse for the current Netscape WinReg key */
|
||||
GetWinReg(HKEY_LOCAL_MACHINE, "Software\\Netscape\\Netscape 6", "CurrentVersion", szBuf, sizeof(szBuf));
|
||||
|
|
|
@ -92,6 +92,7 @@ void ProcessFileOps(DWORD dwTiming)
|
|||
ProcessCreateDirectory(dwTiming);
|
||||
ProcessMoveFile(dwTiming);
|
||||
ProcessCopyFile(dwTiming);
|
||||
ProcessCopyFileSequential(dwTiming);
|
||||
ProcessDeleteFile(dwTiming);
|
||||
ProcessRemoveDirectory(dwTiming);
|
||||
ProcessRunApp(dwTiming);
|
||||
|
@ -370,6 +371,100 @@ HRESULT FileCopy(LPSTR szFrom, LPSTR szTo, BOOL bFailIfExists)
|
|||
return(FO_SUCCESS);
|
||||
}
|
||||
|
||||
HRESULT FileCopySequential(LPSTR szSourcePath, LPSTR szDestPath, LPSTR szFilename)
|
||||
{
|
||||
int iFilenameOnlyLen;
|
||||
char szDestFullFilename[MAX_BUF];
|
||||
char szSourceFullFilename[MAX_BUF];
|
||||
char szSearchFilename[MAX_BUF];
|
||||
char szSearchDestFullFilename[MAX_BUF];
|
||||
char szFilenameOnly[MAX_BUF];
|
||||
char szFilenameExtensionOnly[MAX_BUF];
|
||||
char szNumber[MAX_BUF];
|
||||
long dwNumber;
|
||||
long dwMaxNumber;
|
||||
LPSTR szDotPtr;
|
||||
HANDLE hFile;
|
||||
WIN32_FIND_DATA fdFile;
|
||||
BOOL bFound;
|
||||
|
||||
|
||||
lstrcpy(szSourceFullFilename, szSourcePath);
|
||||
AppendBackSlash(szSourceFullFilename, sizeof(szSourceFullFilename));
|
||||
lstrcat(szSourceFullFilename, szFilename);
|
||||
|
||||
if(FileExists(szSourceFullFilename))
|
||||
{
|
||||
/* zero out the memory */
|
||||
ZeroMemory(szSearchFilename, sizeof(szSearchFilename));
|
||||
ZeroMemory(szFilenameOnly, sizeof(szFilenameOnly));
|
||||
ZeroMemory(szFilenameExtensionOnly, sizeof(szFilenameExtensionOnly));
|
||||
|
||||
/* parse for the filename w/o extention and also only the extension */
|
||||
if((szDotPtr = strstr(szFilename, ".")) != NULL)
|
||||
{
|
||||
*szDotPtr = '\0';
|
||||
lstrcpy(szSearchFilename, szFilename);
|
||||
lstrcpy(szFilenameOnly, szFilename);
|
||||
lstrcpy(szFilenameExtensionOnly, &szDotPtr[1]);
|
||||
*szDotPtr = '.';
|
||||
}
|
||||
else
|
||||
{
|
||||
lstrcpy(szFilenameOnly, szFilename);
|
||||
lstrcpy(szSearchFilename, szFilename);
|
||||
}
|
||||
|
||||
/* create the wild arg filename to search for in the szDestPath */
|
||||
lstrcat(szSearchFilename, "*.*");
|
||||
lstrcpy(szSearchDestFullFilename, szDestPath);
|
||||
AppendBackSlash(szSearchDestFullFilename, sizeof(szSearchDestFullFilename));
|
||||
lstrcat(szSearchDestFullFilename, szSearchFilename);
|
||||
|
||||
iFilenameOnlyLen = lstrlen(szFilenameOnly);
|
||||
dwNumber = 0;
|
||||
dwMaxNumber = 0;
|
||||
|
||||
/* find the largest numbered filename in the szDestPath */
|
||||
if((hFile = FindFirstFile(szSearchDestFullFilename, &fdFile)) == INVALID_HANDLE_VALUE)
|
||||
bFound = FALSE;
|
||||
else
|
||||
bFound = TRUE;
|
||||
|
||||
while(bFound)
|
||||
{
|
||||
ZeroMemory(szNumber, sizeof(szNumber));
|
||||
if((lstrcmpi(fdFile.cFileName, ".") != 0) && (lstrcmpi(fdFile.cFileName, "..") != 0))
|
||||
{
|
||||
lstrcpy(szNumber, &fdFile.cFileName[iFilenameOnlyLen]);
|
||||
dwNumber = atoi(szNumber);
|
||||
if(dwNumber > dwMaxNumber)
|
||||
dwMaxNumber = dwNumber;
|
||||
}
|
||||
|
||||
bFound = FindNextFile(hFile, &fdFile);
|
||||
}
|
||||
|
||||
FindClose(hFile);
|
||||
|
||||
lstrcpy(szDestFullFilename, szDestPath);
|
||||
AppendBackSlash(szDestFullFilename, sizeof(szDestFullFilename));
|
||||
lstrcat(szDestFullFilename, szFilenameOnly);
|
||||
itoa(dwMaxNumber + 1, szNumber, 10);
|
||||
lstrcat(szDestFullFilename, szNumber);
|
||||
|
||||
if(*szFilenameExtensionOnly != '\0')
|
||||
{
|
||||
lstrcat(szDestFullFilename, ".");
|
||||
lstrcat(szDestFullFilename, szFilenameExtensionOnly);
|
||||
}
|
||||
|
||||
CopyFile(szSourceFullFilename, szDestFullFilename, TRUE);
|
||||
}
|
||||
|
||||
return(FO_SUCCESS);
|
||||
}
|
||||
|
||||
HRESULT ProcessCopyFile(DWORD dwTiming)
|
||||
{
|
||||
DWORD dwIndex;
|
||||
|
@ -411,6 +506,43 @@ HRESULT ProcessCopyFile(DWORD dwTiming)
|
|||
return(FO_SUCCESS);
|
||||
}
|
||||
|
||||
HRESULT ProcessCopyFileSequential(DWORD dwTiming)
|
||||
{
|
||||
DWORD dwIndex;
|
||||
char szIndex[MAX_BUF];
|
||||
char szBuf[MAX_BUF];
|
||||
char szSection[MAX_BUF];
|
||||
char szSource[MAX_BUF];
|
||||
char szDestination[MAX_BUF];
|
||||
char szFilename[MAX_BUF];
|
||||
|
||||
dwIndex = 0;
|
||||
itoa(dwIndex, szIndex, 10);
|
||||
lstrcpy(szSection, "Copy File Sequential");
|
||||
lstrcat(szSection, szIndex);
|
||||
GetPrivateProfileString(szSection, "Filename", "", szFilename, MAX_BUF, szFileIniConfig);
|
||||
while(*szFilename != '\0')
|
||||
{
|
||||
if(TimingCheck(dwTiming, szSection, szFileIniConfig))
|
||||
{
|
||||
GetPrivateProfileString(szSection, "Source", "", szBuf, MAX_BUF, szFileIniConfig);
|
||||
DecryptString(szSource, szBuf);
|
||||
|
||||
GetPrivateProfileString(szSection, "Destination", "", szBuf, MAX_BUF, szFileIniConfig);
|
||||
DecryptString(szDestination, szBuf);
|
||||
|
||||
FileCopySequential(szSource, szDestination, szFilename);
|
||||
}
|
||||
|
||||
++dwIndex;
|
||||
itoa(dwIndex, szIndex, 10);
|
||||
lstrcpy(szSection, "Copy File Sequential");
|
||||
lstrcat(szSection, szIndex);
|
||||
GetPrivateProfileString(szSection, "Filename", "", szFilename, MAX_BUF, szFileIniConfig);
|
||||
}
|
||||
return(FO_SUCCESS);
|
||||
}
|
||||
|
||||
HRESULT CreateDirectoriesAll(char* szPath)
|
||||
{
|
||||
int i;
|
||||
|
|
|
@ -58,5 +58,7 @@ HKEY ParseRootKey(LPSTR szRootKey);
|
|||
DWORD ParseRegType(LPSTR szType);
|
||||
BOOL WinRegKeyExists(HKEY hkRootKey, LPSTR szKey);
|
||||
BOOL WinRegNameExists(HKEY hkRootKey, LPSTR szKey, LPSTR szName);
|
||||
HRESULT FileCopySequential(LPSTR szSourcePath, LPSTR szDestPath, LPSTR szFilename);
|
||||
HRESULT ProcessCopyFileSequential(DWORD dwTiming);
|
||||
|
||||
#endif
|
||||
|
|
|
@ -35,6 +35,7 @@
|
|||
#define IDS_STR_INSTALLING 27
|
||||
#define IDS_STR_COPYINGFILE 28
|
||||
#define IDS_MB_WARNING_STR 29
|
||||
#define IDS_MB_MESSAGE_STR 30
|
||||
#define IDI_ICON1 105
|
||||
#define IDI_SETUP 105
|
||||
#define IDB_BITMAP_WELCOME 108
|
||||
|
|
|
@ -379,6 +379,7 @@ BEGIN
|
|||
IDS_STR_INSTALLING "Currently installing %s"
|
||||
IDS_STR_COPYINGFILE "Copying file: %s"
|
||||
IDS_MB_WARNING_STR "Warning"
|
||||
IDS_MB_MESSAGE_STR "Message"
|
||||
END
|
||||
|
||||
STRINGTABLE DISCARDABLE
|
||||
|
|
|
@ -26,21 +26,23 @@
|
|||
#include "extra.h"
|
||||
#include "dialogs.h"
|
||||
#include "ifuncns.h"
|
||||
#include <shlobj.h>
|
||||
|
||||
static WNDPROC OldListBoxWndProc;
|
||||
static BOOL gbProcessingXpnstallFiles;
|
||||
static DWORD gdwACFlag;
|
||||
#include "parser.h"
|
||||
|
||||
LRESULT CALLBACK DlgProcUninstall(HWND hDlg, UINT msg, WPARAM wParam, LONG lParam)
|
||||
{
|
||||
RECT rDlg;
|
||||
char szBuf[MAX_BUF];
|
||||
char szFileInstallLog[MAX_BUF];
|
||||
char szKey[MAX_BUF];
|
||||
sil *silFile;
|
||||
RECT rDlg;
|
||||
DWORD dwFileFound;
|
||||
|
||||
switch(msg)
|
||||
{
|
||||
case WM_INITDIALOG:
|
||||
SetWindowText(hDlg, diUninstall.szTitle);
|
||||
SetDlgItemText(hDlg, IDC_MESSAGE0, diUninstall.szMessage0);
|
||||
wsprintf(szBuf, diUninstall.szMessage0, ugUninstall.szDescription);
|
||||
SetDlgItemText(hDlg, IDC_MESSAGE0, szBuf);
|
||||
|
||||
if(GetClientRect(hDlg, &rDlg))
|
||||
SetWindowPos(hDlg, HWND_TOP, (dwScreenX/2)-(rDlg.right/2), (dwScreenY/2)-(rDlg.bottom/2), 0, 0, SWP_NOSIZE);
|
||||
|
@ -51,6 +53,37 @@ LRESULT CALLBACK DlgProcUninstall(HWND hDlg, UINT msg, WPARAM wParam, LONG lPara
|
|||
switch(LOWORD(wParam))
|
||||
{
|
||||
case IDWIZNEXT:
|
||||
dwFileFound = GetLogFile(ugUninstall.szLogPath, ugUninstall.szLogFilename, szFileInstallLog, sizeof(szFileInstallLog));
|
||||
while(dwFileFound)
|
||||
{
|
||||
if((silFile = InitSilNodes(szFileInstallLog)) != NULL)
|
||||
{
|
||||
FileDelete(szFileInstallLog);
|
||||
Uninstall(silFile);
|
||||
DeInitSilNodes(&silFile);
|
||||
}
|
||||
|
||||
dwFileFound = GetLogFile(ugUninstall.szLogPath, ugUninstall.szLogFilename, szFileInstallLog, sizeof(szFileInstallLog));
|
||||
}
|
||||
|
||||
lstrcpy(szFileInstallLog, ugUninstall.szLogPath);
|
||||
AppendBackSlash(szFileInstallLog, MAX_BUF);
|
||||
lstrcat(szFileInstallLog, ugUninstall.szLogFilename);
|
||||
if(FileExists(szFileInstallLog))
|
||||
{
|
||||
if((silFile = InitSilNodes(szFileInstallLog)) != NULL)
|
||||
{
|
||||
FileDelete(szFileInstallLog);
|
||||
Uninstall(silFile);
|
||||
DeInitSilNodes(&silFile);
|
||||
}
|
||||
}
|
||||
|
||||
/* clean up the uninstall windows registry key */
|
||||
lstrcpy(szKey, "Software\\Microsoft\\Windows\\CurrentVersion\\uninstall\\");
|
||||
lstrcat(szKey, ugUninstall.szUninstallKeyDescription);
|
||||
RegDeleteKey(HKEY_LOCAL_MACHINE, szKey);
|
||||
|
||||
DestroyWindow(hDlg);
|
||||
PostQuitMessage(0);
|
||||
break;
|
||||
|
|
|
@ -26,11 +26,11 @@
|
|||
#include "extra.h"
|
||||
#include "dialogs.h"
|
||||
#include "ifuncns.h"
|
||||
#include "time.h"
|
||||
#include <winnls.h>
|
||||
//#include "time.h"
|
||||
//#include <winnls.h>
|
||||
#include <winver.h>
|
||||
#include <tlhelp32.h>
|
||||
#include <winperf.h>
|
||||
//#include <tlhelp32.h>
|
||||
//#include <winperf.h>
|
||||
|
||||
#define HIDWORD(l) ((DWORD) (((ULONG) (l) >> 32) & 0xFFFF))
|
||||
#define LODWORD(l) ((DWORD) (l))
|
||||
|
@ -688,17 +688,21 @@ HRESULT InitUninstallGeneral()
|
|||
{
|
||||
ugUninstall.dwMode = NORMAL;
|
||||
|
||||
if((ugUninstall.szLogPath = NS_GlobalAlloc(MAX_BUF)) == NULL)
|
||||
if((ugUninstall.szLogPath = NS_GlobalAlloc(MAX_BUF)) == NULL)
|
||||
return(1);
|
||||
if((ugUninstall.szProductName = NS_GlobalAlloc(MAX_BUF)) == NULL)
|
||||
if((ugUninstall.szLogFilename = NS_GlobalAlloc(MAX_BUF)) == NULL)
|
||||
return(1);
|
||||
if((ugUninstall.szWrKey = NS_GlobalAlloc(MAX_BUF)) == NULL)
|
||||
if((ugUninstall.szProductName = NS_GlobalAlloc(MAX_BUF)) == NULL)
|
||||
return(1);
|
||||
if((ugUninstall.szUserAgent = NS_GlobalAlloc(MAX_BUF)) == NULL)
|
||||
if((ugUninstall.szWrKey = NS_GlobalAlloc(MAX_BUF)) == NULL)
|
||||
return(1);
|
||||
if((ugUninstall.szWrMainKey = NS_GlobalAlloc(MAX_BUF)) == NULL)
|
||||
if((ugUninstall.szUserAgent = NS_GlobalAlloc(MAX_BUF)) == NULL)
|
||||
return(1);
|
||||
if((ugUninstall.szDescription = NS_GlobalAlloc(MAX_BUF)) == NULL)
|
||||
if((ugUninstall.szWrMainKey = NS_GlobalAlloc(MAX_BUF)) == NULL)
|
||||
return(1);
|
||||
if((ugUninstall.szDescription = NS_GlobalAlloc(MAX_BUF)) == NULL)
|
||||
return(1);
|
||||
if((ugUninstall.szUninstallKeyDescription = NS_GlobalAlloc(MAX_BUF)) == NULL)
|
||||
return(1);
|
||||
|
||||
return(0);
|
||||
|
@ -707,7 +711,9 @@ HRESULT InitUninstallGeneral()
|
|||
void DeInitUninstallGeneral()
|
||||
{
|
||||
FreeMemory(&(ugUninstall.szLogPath));
|
||||
FreeMemory(&(ugUninstall.szLogFilename));
|
||||
FreeMemory(&(ugUninstall.szDescription));
|
||||
FreeMemory(&(ugUninstall.szUninstallKeyDescription));
|
||||
FreeMemory(&(ugUninstall.szUserAgent));
|
||||
FreeMemory(&(ugUninstall.szWrKey));
|
||||
FreeMemory(&(ugUninstall.szProductName));
|
||||
|
@ -1053,8 +1059,10 @@ BOOL CheckLegacy(HWND hDlg)
|
|||
HRESULT GetUninstallLogPath()
|
||||
{
|
||||
char szBuf[MAX_BUF];
|
||||
char szTempDescription[MAX_BUF];
|
||||
char szLogFolder[MAX_BUF];
|
||||
char szKey[MAX_BUF];
|
||||
char szWindowsUninstallKey[MAX_BUF];
|
||||
char szErrorMsg[MAX_BUF];
|
||||
char szEUninstallLogFolder[MAX_BUF];
|
||||
|
||||
|
@ -1066,15 +1074,19 @@ HRESULT GetUninstallLogPath()
|
|||
AppendBackSlash(szKey, sizeof(szKey));
|
||||
lstrcat(szKey, "Uninstall");
|
||||
|
||||
GetWinReg(ugUninstall.hWrMainRoot, szKey, "Uninstall Log Folder", szLogFolder, sizeof(szLogFolder));
|
||||
GetWinReg(ugUninstall.hWrMainRoot, szKey, "Description", ugUninstall.szDescription, sizeof(szLogFolder));
|
||||
GetWinReg(ugUninstall.hWrMainRoot, szKey, "Uninstall Log Folder", szLogFolder, sizeof(szLogFolder));
|
||||
GetWinReg(ugUninstall.hWrMainRoot, szKey, "Description", ugUninstall.szUninstallKeyDescription, sizeof(szLogFolder));
|
||||
}
|
||||
else
|
||||
{
|
||||
GetWinReg(ugUninstall.hWrRoot, ugUninstall.szWrKey, "Uninstall Log Folder", szLogFolder, sizeof(szLogFolder));
|
||||
GetWinReg(ugUninstall.hWrRoot, ugUninstall.szWrKey, "Description", ugUninstall.szDescription, sizeof(szLogFolder));
|
||||
GetWinReg(ugUninstall.hWrRoot, ugUninstall.szWrKey, "Uninstall Log Folder", szLogFolder, sizeof(szLogFolder));
|
||||
GetWinReg(ugUninstall.hWrRoot, ugUninstall.szWrKey, "Description", ugUninstall.szUninstallKeyDescription, sizeof(szLogFolder));
|
||||
}
|
||||
|
||||
lstrcpy(szWindowsUninstallKey, "Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\");
|
||||
lstrcat(szWindowsUninstallKey, ugUninstall.szUninstallKeyDescription);
|
||||
GetWinReg(HKEY_LOCAL_MACHINE, szWindowsUninstallKey, "DisplayName", ugUninstall.szDescription, sizeof(szLogFolder));
|
||||
|
||||
if(FileExists(szLogFolder) == FALSE)
|
||||
{
|
||||
if(NS_LoadString(hInst, IDS_ERROR_UNINSTALL_LOG_FOLDER, szEUninstallLogFolder, MAX_BUF) == WIZ_OK)
|
||||
|
@ -1088,6 +1100,7 @@ HRESULT GetUninstallLogPath()
|
|||
|
||||
return(1);
|
||||
}
|
||||
lstrcpy(ugUninstall.szLogPath, szLogFolder);
|
||||
|
||||
return(0);
|
||||
}
|
||||
|
@ -1105,6 +1118,8 @@ HRESULT ParseUninstallIni(LPSTR lpszCmdLine)
|
|||
if(InitDlgUninstall(&diUninstall))
|
||||
return(1);
|
||||
|
||||
lstrcpy(ugUninstall.szLogFilename, FILE_LOG_INSTALL);
|
||||
|
||||
/* get install Mode information */
|
||||
GetPrivateProfileString("General", "Run Mode", "", szBuf, MAX_BUF, szFileIniUninstall);
|
||||
SetUninstallRunMode(szBuf);
|
||||
|
@ -1464,11 +1479,11 @@ HRESULT DecryptVariable(LPSTR szVariable, DWORD dwVariableSize)
|
|||
|
||||
wsprintf(szVariable, "Software\\Netscape\\Netscape Seamonkey\\%s", szBuf);
|
||||
}
|
||||
else if(lstrcmpi(szVariable, "WinRegKey Netscape6") == 0)
|
||||
else if(lstrcmpi(szVariable, "WinRegKey Netscape 6") == 0)
|
||||
{
|
||||
lstrcpy(szVariable, "Software\\Netscape\\Netscape 6");
|
||||
}
|
||||
else if(lstrcmpi(szVariable, "Netscape6 CurrentVersion") == 0)
|
||||
else if(lstrcmpi(szVariable, "Netscape 6 CurrentVersion") == 0)
|
||||
{
|
||||
/* parse for the current Netscape WinReg key */
|
||||
GetWinReg(HKEY_LOCAL_MACHINE, "Software\\Netscape\\Netscape 6", "CurrentVersion", szBuf, sizeof(szBuf));
|
||||
|
|
|
@ -38,8 +38,6 @@ OBJS = \
|
|||
$(NULL)
|
||||
|
||||
WIN_LIBS= \
|
||||
ole32.lib \
|
||||
comdlg32.lib \
|
||||
shell32.lib \
|
||||
version.lib \
|
||||
$(NULL)
|
||||
|
|
|
@ -26,6 +26,7 @@
|
|||
#include "parser.h"
|
||||
#include "extra.h"
|
||||
#include "ifuncns.h"
|
||||
#include "dialogs.h"
|
||||
|
||||
sil *InitSilNodes(char *szInFile)
|
||||
{
|
||||
|
@ -58,6 +59,7 @@ sil *InitSilNodes(char *szInFile)
|
|||
SilNodeInsert(silHead, silTemp);
|
||||
}
|
||||
|
||||
ProcessWindowsMessages();
|
||||
}
|
||||
fclose(ifp);
|
||||
return(silHead);
|
||||
|
@ -85,6 +87,8 @@ void DeInitSilNodes(sil **silHead)
|
|||
{
|
||||
SilNodeDelete(silTemp);
|
||||
silTemp = (*silHead)->Prev;
|
||||
|
||||
ProcessWindowsMessages();
|
||||
}
|
||||
SilNodeDelete(silTemp);
|
||||
}
|
||||
|
@ -126,11 +130,6 @@ void DeleteWinRegValue(HKEY hkRootKey, LPSTR szKey, LPSTR szName)
|
|||
}
|
||||
}
|
||||
|
||||
void DeInitializeParser(sil **silHead)
|
||||
{
|
||||
DeInitSilNodes(silHead);
|
||||
}
|
||||
|
||||
void ParseForFile(LPSTR szString, LPSTR szKeyStr, LPSTR szShortFilename, DWORD dwShortFilenameBufSize)
|
||||
{
|
||||
int iLen;
|
||||
|
@ -225,7 +224,7 @@ void ParseForWinRegInfo(LPSTR szString, LPSTR szKeyStr, LPSTR szRootKey, DWORD d
|
|||
}
|
||||
}
|
||||
|
||||
void DebugPrintFileNodes(sil* silFile)
|
||||
void Uninstall(sil* silFile)
|
||||
{
|
||||
sil *silTemp;
|
||||
LPSTR szSubStr;
|
||||
|
@ -300,7 +299,96 @@ void DebugPrintFileNodes(sil* silFile)
|
|||
FileDelete(szShortFilename);
|
||||
}
|
||||
|
||||
ProcessWindowsMessages();
|
||||
}while(silTemp != silFile);
|
||||
}
|
||||
}
|
||||
|
||||
DWORD GetLogFile(LPSTR szTargetPath, LPSTR szInFilename, LPSTR szOutBuf, DWORD dwOutBufSize)
|
||||
{
|
||||
int iFilenameOnlyLen;
|
||||
char szSearchFilename[MAX_BUF];
|
||||
char szSearchTargetFullFilename[MAX_BUF];
|
||||
char szFilenameOnly[MAX_BUF];
|
||||
char szFilenameExtensionOnly[MAX_BUF];
|
||||
char szNumber[MAX_BUF];
|
||||
long dwNumber;
|
||||
long dwMaxNumber;
|
||||
LPSTR szDotPtr;
|
||||
HANDLE hFile;
|
||||
WIN32_FIND_DATA fdFile;
|
||||
BOOL bFound;
|
||||
|
||||
if(FileExists(szTargetPath))
|
||||
{
|
||||
/* zero out the memory */
|
||||
ZeroMemory(szOutBuf, dwOutBufSize);
|
||||
ZeroMemory(szSearchFilename, sizeof(szSearchFilename));
|
||||
ZeroMemory(szFilenameOnly, sizeof(szFilenameOnly));
|
||||
ZeroMemory(szFilenameExtensionOnly, sizeof(szFilenameExtensionOnly));
|
||||
|
||||
/* parse for the filename w/o extention and also only the extension */
|
||||
if((szDotPtr = strstr(szInFilename, ".")) != NULL)
|
||||
{
|
||||
*szDotPtr = '\0';
|
||||
lstrcpy(szSearchFilename, szInFilename);
|
||||
lstrcpy(szFilenameOnly, szInFilename);
|
||||
lstrcpy(szFilenameExtensionOnly, &szDotPtr[1]);
|
||||
*szDotPtr = '.';
|
||||
}
|
||||
else
|
||||
{
|
||||
lstrcpy(szFilenameOnly, szInFilename);
|
||||
lstrcpy(szSearchFilename, szInFilename);
|
||||
}
|
||||
|
||||
/* create the wild arg filename to search for in the szTargetPath */
|
||||
lstrcat(szSearchFilename, "*.*");
|
||||
lstrcpy(szSearchTargetFullFilename, szTargetPath);
|
||||
AppendBackSlash(szSearchTargetFullFilename, sizeof(szSearchTargetFullFilename));
|
||||
lstrcat(szSearchTargetFullFilename, szSearchFilename);
|
||||
|
||||
iFilenameOnlyLen = lstrlen(szFilenameOnly);
|
||||
dwNumber = 0;
|
||||
dwMaxNumber = -1;
|
||||
|
||||
/* find the largest numbered filename in the szTargetPath */
|
||||
if((hFile = FindFirstFile(szSearchTargetFullFilename, &fdFile)) == INVALID_HANDLE_VALUE)
|
||||
bFound = FALSE;
|
||||
else
|
||||
bFound = TRUE;
|
||||
|
||||
while(bFound)
|
||||
{
|
||||
ZeroMemory(szNumber, sizeof(szNumber));
|
||||
if((lstrcmpi(fdFile.cFileName, ".") != 0) && (lstrcmpi(fdFile.cFileName, "..") != 0))
|
||||
{
|
||||
lstrcpy(szNumber, &fdFile.cFileName[iFilenameOnlyLen]);
|
||||
dwNumber = atoi(szNumber);
|
||||
if(dwNumber > dwMaxNumber)
|
||||
dwMaxNumber = dwNumber;
|
||||
}
|
||||
|
||||
bFound = FindNextFile(hFile, &fdFile);
|
||||
}
|
||||
|
||||
FindClose(hFile);
|
||||
|
||||
lstrcpy(szOutBuf, szTargetPath);
|
||||
AppendBackSlash(szOutBuf, dwOutBufSize);
|
||||
lstrcat(szOutBuf, szFilenameOnly);
|
||||
itoa(dwMaxNumber, szNumber, 10);
|
||||
lstrcat(szOutBuf, szNumber);
|
||||
|
||||
if(*szFilenameExtensionOnly != '\0')
|
||||
{
|
||||
lstrcat(szOutBuf, ".");
|
||||
lstrcat(szOutBuf, szFilenameExtensionOnly);
|
||||
}
|
||||
}
|
||||
else
|
||||
return(0);
|
||||
|
||||
return(FileExists(szOutBuf));
|
||||
}
|
||||
|
||||
|
|
|
@ -37,16 +37,16 @@
|
|||
#define KEY_RENAME_DIR "rename dir: "
|
||||
#define KEY_WINDOWS_SHORTCUT "windows shortcut: "
|
||||
|
||||
sil *InitSilNodes(char *szFileIni);
|
||||
void DeInitSilNodes(sil **silHead);
|
||||
void ParseCommandLine(LPSTR lpszCmdLine);
|
||||
HRESULT FileExists(LPSTR szFile);
|
||||
void DeInitializeParser(sil **silHead);
|
||||
void DebugPrintFileNodes(sil* silFile);
|
||||
void ParseForFile(LPSTR szString, LPSTR szKey, LPSTR szShortFilename, DWORD dwShortFilenameBufSize);
|
||||
void ParseForWinRegInfo(LPSTR szString, LPSTR szKeyStr, LPSTR szRootKey, DWORD dwRootKeyBufSize, LPSTR szKey, DWORD dwKeyBufSize, LPSTR szName, DWORD dwNameBufSize);
|
||||
void DeleteWinRegKey(HKEY hkRootKey, LPSTR szKey);
|
||||
void DeleteWinRegValue(HKEY hkRootKey, LPSTR szKey, LPSTR szName);
|
||||
sil *InitSilNodes(char *szFileIni);
|
||||
void DeInitSilNodes(sil **silHead);
|
||||
void ParseCommandLine(LPSTR lpszCmdLine);
|
||||
HRESULT FileExists(LPSTR szFile);
|
||||
void Uninstall(sil* silFile);
|
||||
void ParseForFile(LPSTR szString, LPSTR szKey, LPSTR szShortFilename, DWORD dwShortFilenameBufSize);
|
||||
void ParseForWinRegInfo(LPSTR szString, LPSTR szKeyStr, LPSTR szRootKey, DWORD dwRootKeyBufSize, LPSTR szKey, DWORD dwKeyBufSize, LPSTR szName, DWORD dwNameBufSize);
|
||||
void DeleteWinRegKey(HKEY hkRootKey, LPSTR szKey);
|
||||
void DeleteWinRegValue(HKEY hkRootKey, LPSTR szKey, LPSTR szName);
|
||||
DWORD GetLogFile(LPSTR szTargetPath, LPSTR szInFilename, LPSTR szOutBuf, DWORD dwOutBufSize);
|
||||
|
||||
#endif
|
||||
|
||||
|
|
|
@ -50,7 +50,8 @@ typedef int PRInt32;
|
|||
|
||||
#define CLASS_NAME "Uninstall"
|
||||
#define FILE_INI_UNINSTALL "uninstall.ini"
|
||||
#define WIZ_TEMP_DIR "ns_utemp"
|
||||
#define FILE_LOG_INSTALL "install.log"
|
||||
#define WIZ_TEMP_DIR "ns_temp"
|
||||
|
||||
/* PP: Parse Path */
|
||||
#define PP_FILENAME_ONLY 1
|
||||
|
@ -97,8 +98,10 @@ typedef struct uninstallStruct
|
|||
{
|
||||
DWORD dwMode;
|
||||
LPSTR szLogPath;
|
||||
LPSTR szLogFilename;
|
||||
LPSTR szProductName;
|
||||
LPSTR szDescription;
|
||||
LPSTR szUninstallKeyDescription;
|
||||
HKEY hWrMainRoot;
|
||||
LPSTR szWrMainKey;
|
||||
HKEY hWrRoot;
|
||||
|
|
Загрузка…
Ссылка в новой задаче