⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 setup.rul

📁 vc环境下的pgp源码
💻 RUL
📖 第 1 页 / 共 3 页
字号:
	RegDBDeleteKey ("Software\\Network Associates\\PGPdiskBeta");
	RegDBDeleteKey ("Software\\PGP\\PGPdisk");
	RegDBDeleteKey ("Software\\PGP\\PGPdiskAlpha");
	RegDBDeleteKey ("Software\\PGP\\PGPdiskBeta");

	if (bIsWindowsNT4) then
		RegDBSetDefaultRoot (HKEY_LOCAL_MACHINE);
		RegDBDeleteKey ("System\\CurrentControlSet\\Services\\PGPdisk");
		RegDBDeleteKey ("System\\CurrentControlSet\\Services\\EventLog\\System\\PGPdisk");
		TARGETDIR = WINSYSDIR ^ "Drivers";
		DeleteFile ("pgpdisk.sys");
	else
		TARGETDIR = WINSYSDIR ^ "Iosubsys";
		DeleteFile ("pgpdisk.pdr");
	endif;

	UnUseDLL (SUPPORTDIR ^ "PGPdskIH.dll");
	VarRestore (SRCTARGETDIR);
end;

///////////////////////////////////////////////////////////////////////////////
//
// Function: UninstallPGPnet
//
//  Purpose: Uninstalls PGPnet
//
//
///////////////////////////////////////////////////////////////////////////////
function UninstallPGPnet(InstallDirectory)
STRING szKey, szName, svAdapterNum, svAdapterName;
NUMBER nvType, nvSize;

begin
	VarSave (SRCTARGETDIR);
	//PGPnet
	ChangeDirectory(InstallDirectory);
	LaunchAppAndWait (InstallDirectory ^ "SetAdapter.exe","uninstall", WAIT);
		
	LongPathToShortPath (InstallDirectory);
	TARGETDIR = InstallDirectory;
	//Delete program files
	DeleteFile ("IKEservice.exe");
	DeleteFile ("PGP_SDK.dll");
	DeleteFile ("PGPcl.dll");
	DeleteFile ("PGPnet.sys");
	DeleteFile ("PGPnet.exe");
	DeleteFile ("PGPsdkUI.dll");
	DeleteFile ("PGPNetCL.dll");
	DeleteFile ("PGPsdkNL.dll");
	DeleteFile ("Readme.txt");
	DeleteFile ("PGPnet.hlp");
	DeleteFile ("PGPnet.cnt");
	DeleteFile ("PGPnet.dat");
	DeleteFile ("PGPRebind.inf");
	DeleteDir  (InstallDirectory, ONLYDIR);
		
	if!(bIsWindowsNT4) then
		TARGETDIR = WINSYSDIR;
    	DeleteFile ("PGPnet.vxd");
    endif;

	if(bIsWindowsNT4) then	
    	TARGETDIR = WINSYSDIR ^ "drivers";
    	DeleteFile ("PGPnet.sys");
       	RegDBSetDefaultRoot (HKEY_LOCAL_MACHINE);
    	szKey = "SOFTWARE\\Network Associates\\PGP\\PGPnet";
    	szName = "AdapterNum";

    	//cleanup
    	if (RegDBGetKeyValueEx (szKey , szName , nvType , svAdapterNum , nvSize)=0) then
    		szKey = "SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\NetworkCards\\" ^ svAdapterNum;
    		RegDBGetKeyValueEx (szKey , szName , nvType , svAdapterName , nvSize);
    		if ((svAdapterName = "PGPMacMP") || (svAdapterName = "NDISWANPGPMacMP")) then
    			RegDBDeleteKey (szKey);
    		endif;
    	endif;
    endif;
    	
    //most of this will not be needed, its more of a "backup"
	//Delete the reg. entries
	RegDBSetDefaultRoot (HKEY_CURRENT_USER);
	RegDBDeleteKey ("Software\\Network Associates\\PGP\\PGPnet");
		
	if(bIsWindowsNT4) then
		RegDBSetDefaultRoot (HKEY_LOCAL_MACHINE);
		RegDBDeleteKey ("SOFTWARE\\Network Associates\\PGP\\PGPnet");
		RegDBDeleteKey ("SOFTWARE\\Network Associates\\PgpMacMP");
		RegDBDeleteKey ("SOFTWARE\\Network Associates\\NDISWANPgpMacMP");
		RegDBDeleteKey ("SOFTWARE\\Network Associates\\PgpMac");
		//These are copies that windows makes
		RegDBDeleteKey ("SYSTEM\\ControlSet001\\Services\\EventLog\\System\\PgpMac");
		RegDBDeleteKey ("SYSTEM\\ControlSet001\\Services\\EventLog\\System\\PgpMacMP");
		RegDBDeleteKey ("SYSTEM\\ControlSet001\\Services\\EventLog\\System\\NDISWANPgpMacMP");
		RegDBDeleteKey ("SYSTEM\\ControlSet001\\Services\\EventLog\\System\\PgpMacMP"+svAdapterNum);
		RegDBDeleteKey ("SYSTEM\\ControlSet001\\Services\\EventLog\\System\\NDISWANPgpMacMP"+svAdapterNum);
		RegDBDeleteKey ("SYSTEM\\ControlSet002\\Services\\EventLog\\System\\PgpMac");
		RegDBDeleteKey ("SYSTEM\\ControlSet002\\Services\\EventLog\\System\\PgpMacMP");
		RegDBDeleteKey ("SYSTEM\\ControlSet002\\Services\\EventLog\\System\\NDISWANPgpMacMP");
		RegDBDeleteKey ("SYSTEM\\ControlSet002\\Services\\EventLog\\System\\PgpMacMP"+svAdapterNum);
		RegDBDeleteKey ("SYSTEM\\ControlSet002\\Services\\EventLog\\System\\NDISWANPgpMacMP"+svAdapterNum);
		RegDBDeleteKey ("SYSTEM\\ControlSet003\\Services\\EventLog\\System\\PgpMac");
		RegDBDeleteKey ("SYSTEM\\ControlSet003\\Services\\EventLog\\System\\PgpMacMP");
		RegDBDeleteKey ("SYSTEM\\ControlSet003\\Services\\EventLog\\System\\NDISWANPgpMacMP");
		RegDBDeleteKey ("SYSTEM\\ControlSet003\\Services\\EventLog\\System\\PgpMacMP"+svAdapterNum);
		RegDBDeleteKey ("SYSTEM\\ControlSet003\\Services\\EventLog\\System\\NDISWANPgpMacMP"+svAdapterNum);
		RegDBDeleteKey ("SYSTEM\\ControlSet001\\Services\\PgpMac");
		RegDBDeleteKey ("SYSTEM\\ControlSet001\\Services\\PgpMacMP");
		RegDBDeleteKey ("SYSTEM\\ControlSet001\\Services\\NDISWANPgpMacMP");
		RegDBDeleteKey ("SYSTEM\\ControlSet001\\Services\\PgpMacMP"+svAdapterNum);
		RegDBDeleteKey ("SYSTEM\\ControlSet001\\Services\\NDISWANPgpMacMP"+svAdapterNum);
		RegDBDeleteKey ("SYSTEM\\ControlSet002\\Services\\PgpMac");
		RegDBDeleteKey ("SYSTEM\\ControlSet002\\Services\\PgpMacMP");
		RegDBDeleteKey ("SYSTEM\\ControlSet002\\Services\\NDISWANPgpMacMP");
		RegDBDeleteKey ("SYSTEM\\ControlSet002\\Services\\PgpMacMP"+svAdapterNum);
		RegDBDeleteKey ("SYSTEM\\ControlSet002\\Services\\NDISWANPgpMacMP"+svAdapterNum);
		RegDBDeleteKey ("SYSTEM\\ControlSet003\\Services\\PgpMac");
		RegDBDeleteKey ("SYSTEM\\ControlSet003\\Services\\PgpMacMP");
		RegDBDeleteKey ("SYSTEM\\ControlSet003\\Services\\NDISWANPgpMacMP");
		RegDBDeleteKey ("SYSTEM\\ControlSet003\\Services\\PgpMacMP"+svAdapterNum);
		RegDBDeleteKey ("SYSTEM\\ControlSet003\\Services\\NDISWANPgpMacMP"+svAdapterNum);
		//This is the original
		RegDBDeleteKey ("SYSTEM\\CurrentControlSet\\Services\\EventLog\\System\\PgpMac");
		RegDBDeleteKey ("SYSTEM\\CurrentControlSet\\Services\\EventLog\\System\\PgpMacMP");
		RegDBDeleteKey ("SYSTEM\\CurrentControlSet\\Services\\EventLog\\System\\NDISWANPgpMacMP");
		RegDBDeleteKey ("SYSTEM\\CurrentControlSet\\Services\\EventLog\\System\\PgpMacMP"+svAdapterNum);
		RegDBDeleteKey ("SYSTEM\\CurrentControlSet\\Services\\EventLog\\System\\NDISWANPgpMacMP"+svAdapterNum);
		RegDBDeleteKey ("SYSTEM\\CurrentControlSet\\Services\\PgpMac");
		RegDBDeleteKey ("SYSTEM\\CurrentControlSet\\Services\\PgpMacMP");
		RegDBDeleteKey ("SYSTEM\\CurrentControlSet\\Services\\PgpMac"+svAdapterNum);
		RegDBDeleteKey ("SYSTEM\\CurrentControlSet\\Services\\PgpMacMP"+svAdapterNum);
		//These are PGPnetIKE service entries that the -u does not remove
		//These are copies that windows makes
		RegDBDeleteKey ("SYSTEM\\ControlSet001\\Services\\EventLog\\Application\\PGPnetIKE");
		RegDBDeleteKey ("SYSTEM\\ControlSet001\\Services\\PGPnetIKE");
		RegDBDeleteKey ("SYSTEM\\ControlSet002\\Services\\EventLog\\Application\\PGPnetIKE");
		RegDBDeleteKey ("SYSTEM\\ControlSet002\\Services\\PGPnetIKE");
		RegDBDeleteKey ("SYSTEM\\ControlSet003\\Services\\EventLog\\Application\\PGPnetIKE");
		RegDBDeleteKey ("SYSTEM\\ControlSet003\\Services\\PGPnetIKE");
		//This is the original
		RegDBDeleteKey ("SYSTEM\\CurrentControlSet\\Services\\EventLog\\Application\\PGPnetIKE");
		RegDBDeleteKey ("SYSTEM\\CurrentControlSet\\Services\\PGPnetIKE");
		
		//Perform final Bind Review
		ChangeDirectory(InstallDirectory);
		LaunchAppAndWait (InstallDirectory ^ "SetAdapter.exe","review", WAIT);
		Delay(2);
	endif;
	TARGETDIR = InstallDirectory;
	DeleteFile ("SetAdapter.exe");
	DeleteFile ("Oemsetup.inf");
	DeleteFile ("*.dbg");
	DeleteFile ("PGPnetLog.dat");
	DeleteFile ("randseed.rnd");
	RegDBSetDefaultRoot (HKEY_LOCAL_MACHINE);
	RegDBDeleteKey("SOFTWARE\\Network Associates\\PGP\\PGPnet");
	VarRestore (SRCTARGETDIR);
end;

///////////////////////////////////////////////////////////////////////////////
//
//  Function: DeleteSharedFile
//
//  Purpose:  This function will check if a library is shared before deleteing
//
//
///////////////////////////////////////////////////////////////////////////////
function DeleteSharedFile (szDeleteFilePath, szDeleteFile)
    STRING  szDelKey, svString, svValue;
    NUMBER  nvVar, nvType, nvSize, nSize, numDelays;

begin
    RegDBSetDefaultRoot (HKEY_LOCAL_MACHINE);
    szDelKey	= "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\SharedDLLs";
	numDelays = 0;
    RegDBSetDefaultRoot (HKEY_LOCAL_MACHINE);
    if (RegDBGetKeyValueEx(szDelKey,  szDeleteFilePath ^ szDeleteFile, nvType, svValue, nvSize) < 0 ) then
	    //this is not a shared .dll so delete
	    TARGETDIR  = szDeleteFilePath;
	    SRCDIR     = szDeleteFilePath;
	    DeleteFile (szDeleteFile);
DeleteingNonSharedFile:
		if(DeleteFile (szDeleteFile)<0) then
			Delay(1);
			numDelays ++;
			if(numDelays <= 7)then
				goto DeleteingNonSharedFile;
			endif;
		endif;
    else
	    //this is a shared file
	    StrToNum (nvVar, svValue);
	    nvVar = nvVar - 1;
	    if (nvVar < 1) then
				//Delete the file and decrement the count
				RegDBDeleteValue (szDelKey, szDeleteFilePath ^ szDeleteFile);
				TARGETDIR  = szDeleteFilePath;
				SRCDIR     = szDeleteFilePath;
				//NT
				//If we are removing memlock we need to remove service entry
				if (szDeleteFile = "PGPmemlock.sys") then
					RegDBSetDefaultRoot (HKEY_LOCAL_MACHINE);
					RegDBDeleteKey ("SYSTEM\\CurrentControlSet\\Services\\PGPmemlock");
				endif;
DeleteingFile:
				if(DeleteFile (szDeleteFile)<0) then
					Delay(1);
					numDelays ++;
					if(numDelays <= 7)then
						goto DeleteingFile;
					endif;
				endif;				
	    endif;
	    //write the new number of apps shareing the library
	    if (nvVar > 0) then
		    NumToStr(svString, nvVar);
		    RegDBSetDefaultRoot (HKEY_LOCAL_MACHINE);
		    RegDBSetKeyValueEx(szDelKey,  szDeleteFilePath ^ szDeleteFile, REGDB_NUMBER, svString, nSize);
		endif;
    endif;
end;

///////////////////////////////////////////////////////////////////////////////
//
//  Function: ShutDownApps
//
//  Purpose: This function finds running apps. and informs the user
//           to shut them down in order to continue with the install
//
///////////////////////////////////////////////////////////////////////////////
function ShutDownApps()
	#define MB_OKCANCEL					1
	#define IDCANCEL					2
	#define IDRETRY 					4
	#define MB_RETRYCANCEL				5
	#define IDYES						6
	#define WM_CLOSE					0x0010 // defines the WM_CLOSE message.
	#define	WM_DESTROY					0x0002 // defines the WMDESTROY message.
	#define PGP_HIDDEN_WINDOW			"PGPtray_Hidden_Window"
	#define PGPNET_WINDOW	 			"PGPnet System Tray App"
	
	HWND hWnd, hWnd1,hWnd2,hWnd3,hWnd4,hWnd5,hWnd6,hWnd7,hWnd8,hWnd9;
	
begin

TestForRunningApps:

	if (FindWindow ("", "PGPdisk") != NULL) then
		if (SprintfBox (MB_RETRYCANCEL, "Application Running", "%s",
		"Please shut down PGPdisk before continuing.") = IDCANCEL) then
			abort;
		else
			goto TestForRunningApps;
		endif;
	endif;

	//kill pgptray.exe if possible
	hWnd = FindWindow(PGP_HIDDEN_WINDOW,"");
	if (hWnd > 0) then
		SendMessage(hWnd,WM_CLOSE,0,0);
		//This delay is needed for PGP Dlls to unlock unfortunately
		Delay(4);
	endif;
	
	//Close service windows
	//hWnd = FindWindow("","PGPnet GUI-IKE Communication");
	//if (hWnd > 0) then
	//	SendMessage(hWnd,WM_CLOSE,0,0);
	//	Delay(1);
	//endif;
	
	hWnd = FindWindow("","PGPnet IKE service");
	if (hWnd > 0) then
		SendMessage(hWnd,WM_DESTROY,0,0);
		Delay(1);
	endif;	
	
	//hWnd = FindWindow("","PGPnetReadWorker");
	//if (hWnd > 0) then
	//	SendMessage(hWnd,WM_CLOSE,0,0);
	//	Delay(1);
	//endif;	
	
	//kill pgpnettray.exe if possible
	hWnd = FindWindow(PGPNET_WINDOW,"");
	if (hWnd > 0) then
		SendMessage(hWnd,WM_CLOSE,0,0);
		//This delay is needed for PGP Dlls to unlock unfortunately
		Delay(4);
	endif;
	
	if (FindWindow ("", "PGPnet") != NULL) then
		if (SprintfBox (MB_RETRYCANCEL, "Application Running", "%s",
		"Please shut down PGPnet before continuing.") = IDCANCEL) then
			abort;
		else
			goto TestForRunningApps;
		endif;
	endif;

	//ENSURE NO PLUGINS\DLL's ARE IN USE
	hWnd2 = FindWindow("Microsoft Exchange 4.0 Viewer","");
	if (hWnd2 != NULL) then
		if (SprintfBox (MB_RETRYCANCEL, "Application Running", "%s","For install to continue Microsoft Exchange must not be" +
		" running.\nPlease shut down Microsoft Exchange.")= IDCANCEL) then
		abort;	
		else
			goto TestForRunningApps;
		endif;
	endif;
	
	hWnd3 = FindWindow("Microsoft Exchange 5.0 Viewer","");
	if (hWnd3 != NULL) then
		if (SprintfBox (MB_RETRYCANCEL, "Application Running", "%s","For install to continue Microsoft Exchange must not be" +
		" running.\nPlease shut down Microsoft Exchange.") = IDCANCEL) then
			abort;
		else
			goto TestForRunningApps;
		endif;
	endif;

	hWnd4 = FindWindow("rctrl_renwnd32","");
	if (hWnd4!= NULL) then
		if (SprintfBox (MB_RETRYCANCEL, "Application Running", "%s","For install to continue Microsoft Outlook must not be" +
		" running.\nPlease shut down Microsoft Outlook.") = IDCANCEL) then
			abort;
		else
			goto TestForRunningApps;
		endif;
	endif;

	hWnd5 = FindWindow("EudoraMainWindow","");
	if (hWnd5 != NULL) then
		if (SprintfBox (MB_RETRYCANCEL, "Application Running", "%s","For install to continue Eudora must not be running.\n"+
		"Please shut down Eudora.") = IDCANCEL) then
			abort;
		else
			goto TestForRunningApps;
		endif;
	endif;

	hWnd6 = FindWindow("PGPAdminWizardClass","");
	if (hWnd6 != NULL) then
		if (SprintfBox (MB_RETRYCANCEL, "Application Running", "%s","For install to continue the admin. wizard must not be" +
		" running.\nPlease shut down the admin. wizard.") = IDCANCEL) then
			abort;
		else
			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

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -