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

📄 setup.rul

📁 vc环境下的pgp源码
💻 RUL
📖 第 1 页 / 共 5 页
字号:
    //Installshields automatic OS dependancies do not seem
    //to work properly.

    //If this is an easy/quick install, set components
    if (bEasyInstall = TRUE) then
    	if (bIsWindowsNT4) then
      		if(nvNTcmdln)then
        		ComponentSelectItem(MEDIA,"NTCmdlinedocs",TRUE);
				ComponentSelectItem(MEDIA,"NTCmdline",TRUE);
        	else
	        	ComponentSelectItem(MEDIA,"NTCmdlinedocs",FALSE);
				ComponentSelectItem(MEDIA,"NTCmdline",FALSE);
			endif;
		endif;
        if(nvPGPdisk)then
            ComponentSelectItem(MEDIA,"PGPdisk",TRUE);
        else
        	ComponentSelectItem(MEDIA,"PGPdisk",FALSE);
        endif;
        if(nvPGPnet)then
            ComponentSelectItem(MEDIA,"PGPnet",TRUE);
        else
        	ComponentSelectItem(MEDIA,"PGPnet",FALSE);
        endif;
        if(nvUserManual)then
            ComponentSelectItem(MEDIA,"User's Manual",TRUE);
        else
        	ComponentSelectItem(MEDIA,"User's Manual",FALSE);
        endif;
        if(nvOutlookExpressPlugin)then
            ComponentSelectItem(MEDIA,"Outlook Exp Plugin",TRUE);
        else
        	ComponentSelectItem(MEDIA,"Outlook Exp Plugin",FALSE);
        endif;
        if(nvExchangeOutlookPlugin)then
            ComponentSelectItem(MEDIA,"Exch Plugin",TRUE);
        else
        	ComponentSelectItem(MEDIA,"Exch Plugin",FALSE);
        endif;
        if(nvEudoraPlugin)then
            ComponentSelectItem(MEDIA,"Eudora Plugin",TRUE);
        else
        	ComponentSelectItem(MEDIA,"Eudora Plugin",FALSE);
        endif;
    endif;

    if (bIsWindowsNT4) then
        ComponentSelectItem(MEDIA,"PGPmemlock NT",TRUE);
        ComponentSelectItem(MEDIA,"PGPmemlock9598",FALSE);
    else //is 98 or 95
        ComponentSelectItem(MEDIA,"PGPmemlock NT",FALSE);
        ComponentSelectItem(MEDIA,"PGPmemlock9598",TRUE);
    endif;
    //END FIX FOR INSTALLSHIELD BUG

    if (bEasyInstall = FALSE) then
        szTitle  = "";
        szMsg    = "";
        nResult  = SdComponentDialog2( szTitle, szMsg, svDir, "" );

        if (nResult = BACK) then
            return nResult;
        endif;
    endif;

    if (ComponentIsItemSelected ( MEDIA , "Program Files" ) = FALSE) then
        Disable (DIALOGCACHE);
        MessageBox("Program Files are required.\n"+
        "Please try again.", WARNING);
        //re-select program files
        ComponentSelectItem(MEDIA,"Program Files",TRUE);
        goto Top;
        Enable (DIALOGCACHE);
    endif;

	if (ComponentIsItemSelected ( MEDIA , "PGPnet" ) = TRUE) then
   	//select proper driver
    	if (bIsWindowsNT4) then
        	ComponentSelectItem(MEDIA,"PGPnet Driver NT",TRUE);
      	else
	   		ComponentSelectItem(MEDIA,"PGPnet Driver 95",TRUE);  	
    	endif;
    endif;

    if (ComponentIsItemSelected ( MEDIA , "PGPdisk" ) = TRUE) then
        UseDLL (SUPPORTDIR ^ "PGPdskIH.dll");
        //added call to PGPdiskCleanup (nryan request)
        PGPdiskCleanup();
        UnUseDLL (SUPPORTDIR ^ "PGPdskIH.dll");
        bReboot = TRUE;
        if (bIsWindowsNT4) then
            ComponentSelectItem(MEDIA,"PGPdisk Driver 95",FALSE);
            ComponentSelectItem(MEDIA,"PGPdisk Driver NT",TRUE);
        else //is 98 or 95
            ComponentSelectItem(MEDIA,"PGPdisk Driver 95",TRUE);
            ComponentSelectItem(MEDIA,"PGPdisk Driver NT",FALSE);
        endif;
    endif;

    //only install admin docs if this is an admin build.
	if !(bImAdminInstall) then
    	ComponentSelectItem(MEDIA,"PGPdocsadmin",FALSE);	
    endif;

    // Create list of end user selections to be displayed by DialogShowSdStartCopy()
    listStartCopy = ListCreate(STRINGLIST);
    // If an error occurred, report it then terminate.
    if (listStartCopy = LIST_NULL) then
        MessageBox ("Unable to create list.", SEVERE);
        abort;
    endif;

    if (svName != "") then
        ListAddString (listStartCopy, "Name: ", AFTER);
        ListAddString (listStartCopy, "- " + svName, AFTER);
    endif;

    if (svCompany != "") then
    	ListAddString (listStartCopy, "Company: ", AFTER);
    	ListAddString (listStartCopy, "- " + svCompany, AFTER);
    	ListAddString (listStartCopy, "", AFTER);
    endif;

    ListAddString (listStartCopy, "Client Type:", AFTER);
    if (FREEWARE = "TRUE") then
    	ListAddString (listStartCopy, "- Freeware", AFTER);
    endif;
    if (PERSONALPRIVACY = "TRUE") then
        ListAddString (listStartCopy, "- Personal Privacy", AFTER);
    else
        if (bImClientInstall = TRUE) then
            ListAddString (listStartCopy, "- Configured Client", AFTER);
        else
            ListAddString (listStartCopy, "- Administrative Client", AFTER);
        endif;
    endif;
    ListAddString (listStartCopy, "", AFTER);

    ListAddString (listStartCopy, "Install Directory: ", AFTER);
    ListAddString (listStartCopy, "- " + TARGETDIR, AFTER);
    ListAddString (listStartCopy, "", AFTER);

    ListAddString (listStartCopy, "Selected Components:", AFTER);
    if (ComponentIsItemSelected ( MEDIA , "Program Files" ) = TRUE) then
        ListAddString (listStartCopy, "- PGP Key Management", AFTER);
    endif;
    if (ComponentIsItemSelected ( MEDIA , "Outlook Exp Plugin" ) = TRUE) then
        Disable (DIALOGCACHE);
        FindOutlookExpress();
        Enable (DIALOGCACHE);
    endif;
    if (ComponentIsItemSelected ( MEDIA , "Eudora Plugin" ) = TRUE) then
        Disable (DIALOGCACHE);
        FindEudora();
        Enable (DIALOGCACHE);
    endif;

    if ((bIsWindowsNT4)||(bIsWindows95)) then
    	if (ComponentIsItemSelected ( MEDIA , "PGPnet" ) = TRUE) then
        	CanIinstallPGPnet();
    	endif;
	endif;
	
    if (ComponentIsItemSelected ( MEDIA , "PGPnet" ) = TRUE) then
        ListAddString (listStartCopy, "- PGPnet Virtual Private Networking", AFTER);
        bReboot = TRUE;
    endif;
    if (ComponentIsItemSelected ( MEDIA , "PGPdisk" ) = TRUE) then
        ListAddString (listStartCopy, "- PGPdisk Volume Security", AFTER);
    endif;
    if (ComponentIsItemSelected ( MEDIA , "NTCmdline" ) = TRUE) then
        ListAddString (listStartCopy, "- PGP Command Line", AFTER);
    endif;
    //Need to check again since FindEudora() may have disabled the choice
    if (ComponentIsItemSelected ( MEDIA , "Eudora Plugin" ) = TRUE) then
            ListAddString (listStartCopy, "- Eudora Plugin", AFTER);
    endif;
    if (ComponentIsItemSelected ( MEDIA , "Exch Plugin" ) = TRUE) then
        ListAddString (listStartCopy, "- Microsoft Exchange Plugin", AFTER);
    endif;
    //Need to check again since FindOutlookExpress() may have disabled the choice
    if (ComponentIsItemSelected ( MEDIA , "Outlook Exp Plugin" ) = TRUE) then
        ListAddString (listStartCopy, "- Microsoft Outlook Express Plugin", AFTER);
    endif;
    if (ComponentIsItemSelected ( MEDIA , "User's Manual" ) = TRUE) then
        ListAddString (listStartCopy, "- User's Manual", AFTER);
    endif;

    return nResult;
end;

///////////////////////////////////////////////////////////////////////////////
//
//  Function: DialogShowSdStartCopy
//
//  Purpose: This function displays the dialog preceding the start of the
//           file transfer process.
//
///////////////////////////////////////////////////////////////////////////////
function DialogShowSdStartCopy()
    NUMBER nResult;
    STRING szTitle, szMsg;

begin

    szTitle = "Ready to start copying Files.";
    szMsg   = "Setup has enough information to begin copying the new program files.\n" +
            "If you want to review or change any settings, click Back,\n" +
            "If you are satisfied with the settings, click Next.";
    nResult = SdStartCopy( szTitle, szMsg, listStartCopy );
    ListDestroy(listStartCopy);
    return nResult;
end;


///////////////////////////////////////////////////////////////////////////////
//
//  Function: DialogShowSdFinishReboot
//
//  Purpose: This function will show the last dialog of the product.
//           It will allow the user to reboot and/or show some readme text.
//
///////////////////////////////////////////////////////////////////////////////
function DialogShowSdFinishReboot()
    NUMBER nResult, nDefOptions;
    STRING szTitle, szMsg1, szMsg2, szOption1, szOption2;
    STRING szKey;
    NUMBER bOpt1, bOpt2, nSize;

    #define PGPkeys     TARGETDIR ^ "PGPkeys.exe"

begin
    //end of install, refresh the startmenu
    UseDLL (SUPPORTDIR ^ "install.dll");
    RefreshStartMenu();
    UnUseDLL (SUPPORTDIR ^ "install.dll");

    if ((!BATCH_INSTALL) && (!bReboot)) then
        bOpt1 = TRUE;
        bOpt2 = FALSE;
        szMsg1 = "";
        szMsg2 = "";
        szOption1 = "Launch PGPkeys.";
        szOption2 = "";
        nResult = SdFinish( szTitle, szMsg1, szMsg2, szOption1, szOption2, bOpt1, bOpt2 );

        if (bOpt1) then
            LaunchApp (PGPkeys, "");
        endif;
        return 0;
    endif;

    Start:
        bOpt1 = TRUE;
        SdFinish ("Setup Complete.", @StringReboot, "", "&Yes, I want to restart my computer now.",
                "", bOpt1, bOpt2);
        Disable (DIALOGCACHE);
        szKey = "SOFTWARE\\Network Associates\\PGP" ;
        if (bOpt1)then
            RegDBSetDefaultRoot (HKEY_LOCAL_MACHINE);
            RegDBSetKeyValueEx ( szKey, "Reboot" , REGDB_NUMBER , "1" , -1 );
        endif;
     return 0;
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

⌨️ 快捷键说明

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