📄 setup.rul
字号:
goto TestForRunningApps;
endif;
endif;
hWnd7 = FindWindow("PGPkeysMainWinClass","");
if (hWnd7 != NULL) then
if (SprintfBox (MB_RETRYCANCEL, "Application Running", "%s","For install to continue PGPkeys must not be running.\n"+
"Please shut down PGPkeys.") = IDCANCEL) then
abort;
else
goto TestForRunningApps;
endif;
endif;
hWnd8 = FindWindow("PGPtools","");
if (hWnd8 != NULL) then
if (SprintfBox (MB_RETRYCANCEL, "Application Running", "%s","For install to continue PGPtools must not be running.\n"+
"Please shut down PGPtools.") = IDCANCEL) then
abort;
else
goto TestForRunningApps;
endif;
endif;
hWnd9 = FindWindow("PGPlog","");
if (hWnd9 != NULL) then
if (SprintfBox (MB_RETRYCANCEL, "Application Running", "%s","For install to continue PGPLog must not be running.\n"+
"Please shut down PGPLog.") = IDCANCEL) then
abort;
else
goto TestForRunningApps;
endif;
endif;
//Ensure that Outlook Express is not running
if (FindWindow ("ThorBrowserWndClass", "") != NULL) then
if (SprintfBox (MB_RETRYCANCEL, "Application Running", "%s","For install to continue Outlook Express must not be running.\n"+
"Please shut down Outlook Express.") = IDCANCEL) then
abort;
else
goto TestForRunningApps;
endif;
endif;
if (FindWindow ("Ath_Note", "") != NULL) then
if (SprintfBox (MB_RETRYCANCEL, "Application Running", "%s","For install to continue Outlook Express must not be running.\n"+
"Please shut down Outlook Express.") = IDCANCEL) then
abort;
else
goto TestForRunningApps;
endif;
endif;
if(bIsWindowsNT4) then
UseDLL (SUPPORTDIR ^ "install.dll");
StopService("PGPnetIke");
StopService("PgpMacMP");
StopService("NdisWanPgpMacMP");
StopService("PGPmemlock");
UnUseDLL (SUPPORTDIR ^ "install.dll");
endif;
end;
///////////////////////////////////////////////////////////////////////////////
//
// Function: FindInstalledVersions()
//
// Purpose: Find out if the user has any old versions of this software
// installed.
//
///////////////////////////////////////////////////////////////////////////////
function FindInstalledVersions ()
LIST listInfo;
NUMBER nvType, nvSize;
STRING svValue, szKey, szName;
begin
bPGPFiveZero = FALSE;
bPGPFiveFive = FALSE;
bFiveFive = FALSE;
bSixZero = FALSE;
Disable(DIALOGCACHE);
SdShowMsg ( "Searching for installed components." , TRUE );
Delay(3);
// Retrieve previous install path and determine components installed
RegDBSetDefaultRoot (HKEY_CURRENT_USER);
if (RegDBKeyExist ("Software\\PGP\\PGP50\\PGPkeys") >= 0) then
bPGPFiveZero = TRUE;
elseif (RegDBKeyExist ("Software\\PGP\\PGP55\\PGPkeys") >= 0) then
bPGPFiveFive = TRUE;
elseif (RegDBKeyExist ("Software\\Network Associates\\PGP55\\PGPkeys") >= 0) then
bFiveFive = TRUE;
elseif (RegDBKeyExist ("Software\\Network Associates\\PGP60\\PGPkeys") >= 0) then
bSixZero = TRUE;
endif;
RegDBSetDefaultRoot (HKEY_LOCAL_MACHINE);
if (RegDBKeyExist ("SOFTWARE\\Network Associates\\PGP") >= 0) then
RegDBSetDefaultRoot(HKEY_LOCAL_MACHINE);
szKey = "SOFTWARE\\Network Associates\\PGP";
szName = "InstallPath";
if (RegDBGetKeyValueEx (szKey, szName, nvType, svValue, nvSize)=0) then
bSixFive = TRUE;
endif;
endif;
Enable(DIALOGCACHE);
SdShowMsg ( "Searching for installed components" , FALSE );
listInfo = ListCreate( STRINGLIST );
if (listInfo = LIST_NULL) then
MessageBox ("Unable to create list.", SEVERE);
abort;
endif;
ListAddString (listInfo, "Setup has found the following installs on your", AFTER);
ListAddString (listInfo, "system.", AFTER);
ListAddString (listInfo, "", AFTER);
if (bPGPFiveZero = TRUE) then
ListAddString (listInfo, " PGP 5.0", AFTER);
endif;
if (bPGPFiveFive = TRUE) then
ListAddString (listInfo, " PGP 5.5", AFTER);
endif;
if (bFiveFive = TRUE) then
ListAddString (listInfo, " PGP 5.5", AFTER);
endif;
if (bSixZero = TRUE) then
if (RegDBGetKeyValueEx ("Software\\Network Associates\\PGP60", "Version" , nvType , svValue , nvSize) = 0) then
ListAddString (listInfo, " " + svValue, AFTER);
else
ListAddString (listInfo, " PGP 6.0X", AFTER);
endif;
endif;
if (bSixFive = TRUE) then
if (RegDBGetKeyValueEx ("Software\\Network Associates\\PGP", "Version" , nvType , svValue , nvSize) = 0) then
ListAddString (listInfo, " " + svValue, AFTER);
else
ListAddString (listInfo, " PGP 6.5X", AFTER);
endif;
endif;
if ((bSixZero = TRUE) || (bFiveFive = TRUE) ||
(bPGPFiveFive = TRUE) || (bPGPFiveZero = TRUE) ||
(bSixFive = TRUE)) then
ListAddString (listInfo, "", AFTER);
ListAddString (listInfo, "These need to be removed for setup to", AFTER);
ListAddString (listInfo, "continue. If you press NEXT setup can remove", AFTER);
ListAddString (listInfo, "these for you, or you can press CANCEL to exit", AFTER);
ListAddString (listInfo, "this install and uninstall these manually.", AFTER);
ListAddString (listInfo, "", AFTER);
ListAddString (listInfo, "PRESSING NEXT", AFTER);
ListAddString (listInfo, "Uninstalls old versions automatically.", AFTER);
ListAddString (listInfo, "", AFTER);
ListAddString (listInfo, "PRESSING CANCEL", AFTER);
ListAddString (listInfo, "Exits setup. So you can uninstall manually.", AFTER);
ListAddString (listInfo, "", AFTER);
if (bEasyInstall = FALSE) then
Disable(BACKBUTTON);
SdShowInfoList ( "Search Results" , "Components found" , listInfo );
Enable(BACKBUTTON);
endif;
endif;
ListDestroy (listInfo);
end;
///////////////////////////////////////////////////////////////////////////////
//
// Function: SetInstallType
//
// Purpose: Sets the build type variables.
//
//
///////////////////////////////////////////////////////////////////////////////
function SetInstallType()
LIST listID;
NUMBER nCount, nvReturnValue;
STRING szPath, svResult, szFileName;
begin
bImClientInstall = FALSE;
bImAdminInstall = FALSE;
bImPersonal = FALSE;
bImFreeware = FALSE;
bEasyInstall = FALSE;
if((PERSONALPRIVACY = "TRUE" ) && (FREEWARE = "TRUE" )) then
MessageBox (@PPANDFREESET, WARNING);
abort;
endif;
if ((PERSONALPRIVACY = "FALSE") && (FREEWARE = "FALSE")) then
szPath = SRCDIR;
szFileName = "PGPadmin.dat";
if (FindFile (szPath, szFileName, svResult) = 0 ) then
bImClientInstall = TRUE;
else
bImAdminInstall = TRUE;
endif;
endif;
if(PERSONALPRIVACY = "TRUE" ) then
bImPersonal = TRUE;
elseif (FREEWARE = "TRUE" ) then
bImFreeware = TRUE;
endif;
//Is this a Quick Install ? If YES then set needed values.
GetProfInt (SRCDIR ^ "setup.ini", "Startup", "EasyInstall", nvReturnValue);
if (nvReturnValue = 1) then
bEasyInstall = TRUE;
//this is a quick install so we need to get all the values
GetProfString (SRCDIR ^ "setup.ini", "Startup", "InstallDir", svInstallDirectory);
GetProfInt (SRCDIR ^ "setup.ini", "Startup", "ProgramFiles", nvProgramFiles);
GetProfInt (SRCDIR ^ "setup.ini", "Startup", "EudoraPlugin", nvEudoraPlugin);
GetProfInt (SRCDIR ^ "setup.ini", "Startup", "ExchangeOutlookPlugin", nvExchangeOutlookPlugin);
GetProfInt (SRCDIR ^ "setup.ini", "Startup", "OutlookExpressPlugin", nvOutlookExpressPlugin);
GetProfInt (SRCDIR ^ "setup.ini", "Startup", "UserManual", nvUserManual);
GetProfInt (SRCDIR ^ "setup.ini", "Startup", "PGPdisk", nvPGPdisk);
GetProfInt (SRCDIR ^ "setup.ini", "Startup", "PGPnet", nvPGPnet);
GetProfInt (SRCDIR ^ "setup.ini", "Startup", "UninstallOld", nvUninstallOld);
GetProfInt (SRCDIR ^ "setup.ini", "Startup", "NTcmdln", nvNTcmdln);
endif;
bReboot = FALSE;
if (bEasyInstall) then
svDir = svInstallDirectory;
else
if (bIsWindowsNT4) then
svDir = PROGRAMFILES ^ @COMPANY_NAME ^ @PRODUCT_NAME + "NT";
else
svDir = PROGRAMFILES ^ @COMPANY_NAME ^ @PRODUCT_NAME;
endif;
endif;
TARGETDIR = svDir;
end;
///////////////////////////////////////////////////////////////////////////////
//
// Function: SetPrefUserInfo
//
// Purpose: Sets the user info that was entered into the pref file.
//
//
///////////////////////////////////////////////////////////////////////////////
function SetPrefUserInfo()
begin
UseDLL(WINSYSDIR ^ "pgpcl.dll");
if (bImClientInstall = FALSE) then
PGPclSetUserInfo (svName, svCompany,"");
else
if (svCompany != "") then
PGPclSetUserInfo ("", svCompany,"");
endif;
endif;
UnUseDLL(WINSYSDIR ^ "pgpcl.dll");
end;
///////////////////////////////////////////////////////////////////////////////
//
// Function: SetKeyRings
//
// Purpose: Sets the users keyring info.
//
//
///////////////////////////////////////////////////////////////////////////////
function SetKeyRings()
STRING szPubRingPath, szPrivRingPath, szRandSeedPath;
STRING szFileFilter, szDlgTitle, szExt, svSelectedFile;
STRING svSelectedFileb, svReturnString, svReturnStringb, svPubLoc;
STRING szLongTarget, svPrivLoc;
NUMBER nResult;
BOOL bCopyKeys, bPubKeysFound, UseDefaultPubKey;
BOOL bPrvKeysFound, bUseDefault;
HWND hwndIS;
STRING svString, szBuffer;
NUMBER nReturn, nvVar;
begin
bUseDefault = FALSE;
UseDLL(WINSYSDIR ^ "pgpcl.dll");
//Set Default keyring info.
szPubRingPath = TARGETDIR ^ "PGP Keyrings\\pubring.pkr";
szPrivRingPath = TARGETDIR ^ "PGP Keyrings\\secring.skr";
szRandSeedPath = TARGETDIR ^ "randseed.rnd";
//Set Keyring Locations if needed
bCopyKeys = FALSE;
//if they dont have a PGP Keyrings dir its created.
CreateDir (TARGETDIR ^ "PGP Keyrings");
if (bEasyInstall = FALSE) then
SetDialogTitle
(DLG_ASK_YESNO,"Existing Keyrings?");
if (AskYesNo
("Do you have existing keyrings you wish to use?",YES) = YES) then
//get main window handle
hwndIS = GetWindowHandle(HWND_INSTALL);
//Get new Public ring
szFileFilter = "Public Keyring Files (*.pkr ; pubring.* ; *.pubkr),*.pkr;pubring.pgp;" +
"*.pubkr;,All Files (*.*),*.*";
// Give the file browse dialog a custom title,if you wish.
// Leave szDlgTitle null ("") to accept the default title ("Open").
szDlgTitle = "Browse to your Public Keyring";
// Pass in a default file extension. Do NOT include the period.
// If you pass a null string,no extension is used.
szExt = "pgp";
// Call the FileBrowse function.
svSelectedFile = TARGETDIR ^ "PGP Keyrings" ^ "*.pkr";
UseDLL(SUPPORTDIR ^ "Install.dll");
nResult = FileBrowse(hwndIS,szFileFilter,svSelectedFile,szDlgTitle,szExt);
UnUseDLL(SUPPORTDIR ^ "Install.dll");
if (!nResult) then
// Do something with the selected file.
szPubRingPath = svSelectedFile;
bPubKeysFound = TRUE;
else
// Handle the lack of selection,which could be due to a dialog
// box-related error,chosing the Cancel button,or closing
// the dialog with the Close button.
bUseDefault = TRUE;
bPubKeysFound = FALSE;
endif;
//Get new Private ring
if (bPubKeysFound = TRUE) then
szFileFilter = "Private Keyring Files (*.skr ; *.prvkr ; secring.*)" +
",*.skr;*.prvkr;secring.pgp;,All Files (*.*),*.*";
// Give the file browse dialog a custom title,if you wish.
// Leave szDlgTitle null ("") to accept the default title ("Open").
szDlgTitle = "Browse to your Private Keyring";
// Call the FileBrowse function.
svSelectedFile = TARGETDIR ^ "PGP Keyrings" ^ "*.skr";
// Call the FileBrowse function.
UseDLL(SUPPORTDIR ^ "Install.dll");
nResult = FileBrowse(hwndIS,szFileFilter,svSelectedFileb,szDlgTitle,szExt);
UnUseDLL(SUPPORTDIR ^ "Install.dll");
if (!nResult) then
// Do something with the selected file.
szPrivRingPath = svSelectedFileb;
bPrvKeysFound = TRUE;
else
// Handle the lack of selection,which could be due to a dialog
// box-related error,chosing the Cancel button,or closing
// the dialog with the Close button.
bPrvKeysFound = FALSE;
endif;
endif;
if ((bPrvKeysFound = TRUE) &&
(bPubKeysFound = TRUE)) then
VarSave (SRCTARGETDIR);
//public
ParsePath (svReturnString, szPubRingPath, FILENAME);
ParsePath (svPubLoc, szPubRingPath, PATH);
//private
ParsePath (svReturnStringb, szPrivRingPath, FILENAME);
ParsePath (svPrivLoc, szPrivRingPath, PATH);
TARGETDIR = TARGETDIR ^ "PGP Keyrings";
SRCDIR = svReturnString;
szLongTarget = TARGETDIR;
VarRestore(SRCTARGETDIR);
LongPathFromShortPath (szLongTarget);
if ((svPubLoc != szLongTarget ^ "\\") ||
(svPrivLoc != szLongTarget ^ "\\")) then
SetDialogTitle
(DLG_ASK_YESNO,"Copy keyrings?");
if (AskYesNo
("Do you want setup to copy these keyrings to your" +
" PGP Keyrings directory?",YES) = YES) then
bCopyKeys = TRUE;
//save any old rings
nReturn = 0;
nvVar = 1;
VarSave(SRCTARGETDIR);
szBuffer = TARGETDIR;
if (ExistsDir(TARGETDIR ^ "PGP Keyrings") = EXISTS) then
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -