杉宫竹苑工作室

 找回密码
 立即注册
搜索
热搜: 活动 交友 discuz
查看: 2472|回复: 0

一个installsheild脚本安装的代码

[复制链接]
发表于 2017-3-1 18:41:50 | 显示全部楼层 |阅读模式

正式会员享受无限制浏览网站功能和高速网盘下载,赶快加入本站吧!

您需要 登录 才可以下载或查看,没有账号?立即注册

x
  1. //===========================================================================
  2. //
  3. //  File Name:    Setup.rul
  4. //
  5. //  Description:  Blank setup main script file
  6. //
  7. //  Comments:     Blank setup is an empty setup project. If you want to
  8. //      create a new project via. step-by step instructions use the
  9. //      Project Assistant.
  10. //
  11. //===========================================================================
  12. // Included header files ----------------------------------------------------
  13. #include "ifx.h"
  14. // Note: In order to have your InstallScript function executed as a custom
  15. // action by the Windows Installer, it must be prototyped as an
  16. // entry-point function.
  17. // The keyword export identifies MyFunction() as an entry-point function.
  18. // The argument it accepts must be a handle to the Installer database.
  19.    
  20. /* export prototype MyFunction(HWND); */
  21. #define szKey "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\Infomedia_Dog\"
  22. STRING oldGuid;
  23. BOOL OS64,OS32;
  24. //获取安装包位置
  25. STRING SETUPEXEDIR[MAX_PATH + 1];
  26. string setupDIR;
  27. number  nBuffer;
  28. export prototype UninstallOldVersion(); //卸载旧版本
  29. export prototype WriteInstallGuid();//将本安装包的GUID写入注册表
  30. //prototype YiJiaoReg(STRING); //声明函数
  31. //---------------------------------------------------------------------------
  32. // OnEnd
  33. //
  34. // The OnEnd event is called at the end of the setup. This event is not
  35. // called if the setup is aborted.
  36. //---------------------------------------------------------------------------
  37. function OnEnd()   
  38. STRING szFeatureName;
  39. STRING serviceTarget;
  40. STRING szDocFile;
  41. begin     

  42. szFeatureName="Client";
  43. serviceTarget=TARGETDIR^"AutoUpdater.exe";
  44. if(FindFile(TARGETDIR, "AutoUpdater.exe", szDocFile)=0) then
  45. if (LaunchApp (serviceTarget, "") < 0) then
  46. MessageBox ("Unable to launch "+serviceTarget+".", SEVERE);
  47. endif;
  48. endif;
  49. end;
  50. //---------------------------------------------------------------------------
  51. // OnFirstUIAfter
  52. //
  53. // The OnFirstUIAfter event called by the framework after the file transfer
  54. // of the setup when the setup is running in first install mode. By default
  55. // this event displays UI that informs the end user that the setup has been
  56. // completed successfully.
  57. //---------------------------------------------------------------------------
  58. function OnFirstUIAfter()
  59.     STRING szTitle, szMsg1, szMsg2, szOpt1, szOpt2;
  60.     NUMBER bOpt1, bOpt2;  
  61.     STRING szfilename,szFolder ,szmsg1,szmsg2;
  62.     NUMBER nresult;
  63. begin

  64. szfilename = UNINSTALL_STRING +" /UNINSTALL";
  65. nresult = StrFind(szfilename,".exe");
  66. if nresult >=0 then
  67. StrSub(szmsg1,szfilename,0,nresult + 4);
  68. //YiJiaoReg(szmsg1);//写注册表
  69. WriteInstallGuid();//写注册表
  70. StrSub(szmsg2,szfilename,nresult + 4,200);
  71. LongPathToQuote(szmsg1, FALSE );
  72. LongPathToQuote(szmsg2, FALSE );
  73. szfilename = """ + szmsg1 + """ +szmsg2;
  74. endif;
  75. AddFolderIcon(FOLDER_PROGRAMS^"中国艺交所会员客户端","Uninstall",szfilename,WINDIR,"",0,"",REPLACE);
  76.                   
  77. Disable(STATUSEX);
  78. bOpt1   = FALSE;
  79.     bOpt2   = FALSE;
  80.    
  81.     if ( BATCH_INSTALL ) then
  82.      SdFinishReboot ( szTitle , szMsg1 , SYS_BOOTMACHINE , szMsg2 , 0 );
  83.     else
  84.      SdFinish ( szTitle , szMsg1 , szMsg2 , szOpt1 , szOpt2 , bOpt1 , bOpt2 );
  85. endif;
  86. end;
  87. //---------------------------------------------------------------------------
  88. // OnMaintUIAfter
  89. //
  90. // The OnMaintUIAfter event called by the framework after the file transfer
  91. // of the setup when the setup is running in maintenance mode. By default
  92. // this event displays UI that informs the end user that the maintenance setup
  93. // has been completed successfully.
  94. //---------------------------------------------------------------------------
  95. function OnMaintUIAfter()
  96.     STRING szTitle, szMsg1, szMsg2, szOpt1, szOpt2;
  97.     NUMBER bOpt1, bOpt2;  
  98.     STRING szItemName;
  99.     STRING szProgramFolder;
  100. begin


  101. // 删除开始所有程序中的AliProbe文件夹
  102.   DeleteProgramFolder("中国艺交所会员客户端");
  103.   
  104.   // 删除桌面上的快捷方式
  105.   szItemName = "中国艺交所会员客户端";
  106.   szProgramFolder = FOLDER_DESKTOP;
  107.   DeleteFolderIcon(szProgramFolder, szItemName);
  108.   
  109.   // 删除安装目录文件夹
  110.   DeleteProgramFolder(TARGETDIR);
  111. Disable(STATUSEX);
  112.    
  113.     if( REMOVEALLMODE ) then
  114.         szTitle = SdLoadString(IFX_SDFINISH_REMOVE_TITLE);
  115.         szMsg1 = SdLoadString(IFX_SDFINISH_REMOVE_MSG1);
  116.     else
  117.         szTitle = SdLoadString(IFX_SDFINISH_MAINT_TITLE);   
  118.         szMsg1  = SdLoadString(IFX_SDFINISH_MAINT_MSG1);
  119.     endif;
  120. bOpt1   = FALSE;
  121.     bOpt2   = FALSE;   
  122.     if ( BATCH_INSTALL ) then
  123.      SdFinishReboot ( szTitle , szMsg1 , SYS_BOOTMACHINE , szMsg2 , 0 );
  124.     else   
  125.         SdFinish ( szTitle , szMsg1 , szMsg2 , szOpt1 , szOpt2 , bOpt1 , bOpt2 );
  126.     endif;
  127. end;
  128. // SdWelcome ----------------------------------------------------------------
  129. function  SdWelcome(szTitle, szMsg)
  130.     string  szDlg, szTemp;
  131.     number  nId, nMessage, nTemp, nSdDialog;
  132.     HWND    hwndDlg;
  133.     BOOL    bDone;
  134. begin
  135.     szDlg     = SD_DLG_WELCOME;
  136.     nSdDialog = SD_NDLG_WELCOME;
  137.    
  138.    
  139.      szTitle="中国艺交所会员客户端安装向导";  
  140.      szMsg="中国艺交所会员客户端安装程序正在准备安装向导,它将引导您完成剩余的过程,请稍后。";
  141.     // record data produced by this dialog
  142.     if(MODE=SILENTMODE) then
  143.         SdMakeName( szAppKey, szDlg, szTitle, nSdWelcome );
  144.         SilentReadData( szAppKey, "Result", DATA_NUMBER, szTemp, nId );
  145.         return nId;
  146.     endif;
  147.     // ensure general initialization is complete
  148.     if(!bSdInit) then
  149.         SdInit();
  150.     endif;
  151.     if(EzDefineDialog( szDlg, "", "", SD_NDLG_WELCOME ) = DLG_ERR) then
  152.         return -1;
  153.     endif;
  154.     Disable( BACKBUTTON );
  155.     // Loop in dialog until the user selects a standard button
  156.     bDone = FALSE;
  157.     while (!bDone)
  158.         nId = WaitOnDialog( szDlg );
  159.         switch(nId)
  160.         case DLG_INIT:
  161.             // Put the corresponding Info in the List Field
  162.             if( szMsg != "" ) then
  163.                 SdSetStatic(szDlg, SD_STA_MSG, szMsg);
  164.             endif;
  165.             hwndDlg = CmdGetHwndDlg( szDlg );
  166.             SdGeneralInit( szDlg, hwndDlg, STYLE_NORMAL, szSdProduct );
  167.             SdSetDlgTitle(szDlg, hwndDlg, szTitle);
  168.         case NEXT:
  169.             nId    = NEXT;
  170.             bDone  = TRUE;
  171.         case BACK:
  172.             nId    = BACK;
  173.             bDone  = TRUE;
  174.         case DLG_ERR:
  175.             SdError( -1, "SdWelcome" );
  176.             nId    = -1;
  177.             bDone  = TRUE;
  178.         case DLG_CLOSE:
  179.             SdCloseDlg( hwndDlg, nId, bDone );
  180.         default:
  181.             // check standard handling
  182.             if(SdIsStdButton( nId ) && SdDoStdButton( nId )) then
  183.                 bDone = TRUE;
  184.             endif;
  185.         endswitch;
  186.     endwhile;
  187.     // Cleanup Dialog
  188.     EndDialog( szDlg );
  189.     ReleaseDialog( szDlg );
  190.     SdUnInit();
  191.     Enable( BACKBUTTON );
  192.     // record data produced by this dialog
  193.     if(MODE=RECORDMODE) then
  194.         SdMakeName( szAppKey, szDlg, szTitle, nSdWelcome );
  195.         SilentWriteData( szAppKey, "Result", DATA_NUMBER, "", nId );
  196.     endif;
  197.     return nId;
  198. end;
  199. //---------------------------------------------------------------------------
  200. // OnFirstUIBefore
  201. //
  202. // The OnFirstUIBefore event is called by the framework when the setup is
  203. // running in first install mode. By default this event displays UI allowing
  204. // the end user to specify installation parameters.
  205. //---------------------------------------------------------------------------
  206. function OnFirstUIBefore()
  207.     NUMBER nResult, nSetupType, nvSize, nUser;
  208.     STRING szTitle, szMsg, szQuestion, svName, svCompany, szFile;
  209.     STRING szLicenseFile;
  210. BOOL bCustom, bIgnore1, bIgnore2;   
  211. NUMBER nvType;
  212. STRING  szPath;   
  213. STRING ProductCode,VERCHEKER,szCMDLineTest;
  214. begin
  215.     // TO DO: if you want to enable background, window title, and caption bar title                                                                  
  216.     // SetTitle( @PRODUCT_NAME, 24, WHITE );                                       
  217.     // SetTitle( @PRODUCT_NAME, 0, BACKGROUNDCAPTION );                    
  218.     // Enable( FULLWINDOWMODE );         
  219.     // Enable( BACKGROUND );         
  220.     // SetColor(BACKGROUND,RGB (0, 128, 128));      
  221.     // Added in InstallShield 15 - Show an appropriate error message if
  222.     // -removeonly is specified and the product is not installed.
  223.    
  224.       
  225.      UninstallOldVersion();
  226.     if( REMOVEONLY ) then
  227.         Disable( DIALOGCACHE );
  228.   szMsg = SdLoadString( IDS_IFX_ERROR_PRODUCT_NOT_INSTALLED_UNINST );
  229.      SdSubstituteProductInfo( szMsg );
  230.   MessageBox( szMsg, SEVERE );
  231.   abort;
  232.     endif;
  233.    
  234. nSetupType = TYPICAL;
  235.      
  236.      /*RegDBSetDefaultRoot(HKEY_LOCAL_MACHINE);  
  237.     nvType = REGDB_NUMBER;
  238.     if(RegDBKeyExist("SOFTWARE\\YiJiao")>0) then
  239.       RegDBGetKeyValueEx("SOFTWARE\\YiJiao\","uninstall",nvType,szPath,nvSize);
  240.       if(Is (FILE_EXISTS, szPath)>0) then
  241.       MessageBox ("检测到本机安装有其他版本,请按操作移除其它版本! ", INFORMATION);
  242.       RegDBDeleteKey("SOFTWARE\\YiJiao");
  243.       LaunchAppAndWait(szPath,"",WAIT);
  244.       WaitForApplication(LAAW_PROCESS_INFORMATION.hProcess, LAAW_PROCESS_INFORMATION.dwProcessId, INFINITE, LAAW_OPTION_WAIT_INCL_CHILD | LAAW_OPTION_WAIT);
  245.       endif;
  246.       RegDBDeleteKey("SOFTWARE\\YiJiao");
  247.      endif;  */
  248.      
  249. Dlg_SdWelcome:
  250.     szTitle = "";
  251.     szMsg   = "";
  252.     nResult = SdWelcome(szTitle, szMsg);
  253.     if (nResult = BACK) goto Dlg_SdWelcome;

  254. szTitle   = "";
  255. svName    = "";
  256.     svCompany = "";
  257.    
  258. Dlg_SdAskDestPath:     
  259.     nResult = SdAskDestPath(szTitle, szMsg, INSTALLDIR, 0);
  260.     if (nResult = BACK) goto Dlg_SdWelcome;
  261. Dlg_SdFeatureTree:
  262.     szTitle    = "";
  263.     szMsg      = "";
  264.     if (nSetupType = CUSTOM) then
  265.   nResult = SdFeatureTree(szTitle, szMsg, INSTALLDIR, "", 2);
  266.   if (nResult = BACK) goto Dlg_SdAskDestPath;  
  267.     endif;
  268. Dlg_SQL:
  269.     nResult = OnSQLLogin( nResult );
  270.     if( nResult = BACK ) then
  271.      if (!bCustom) then
  272.       goto Dlg_SdAskDestPath;   
  273.      else
  274.       goto Dlg_SdFeatureTree;
  275.      endif;
  276.     endif;
  277. Dlg_SdStartCopy:
  278.     szTitle = "";
  279.     szMsg   = "";
  280.     nResult = SdStartCopy2( szTitle, szMsg );   

  281.     if (nResult = BACK) then
  282.        goto Dlg_SQL;;
  283.     endif;
  284.     // Added in IS 2009 - Set appropriate StatusEx static text.
  285.     SetStatusExStaticText( SdLoadString( IDS_IFX_STATUSEX_STATICTEXT_FIRSTUI ) );
  286.     // setup default status
  287.     Enable(STATUSEX);
  288.       
  289.      //判断注册表中的值
  290.     /*RegDBSetDefaultRoot(HKEY_LOCAL_MACHINE);  
  291.     nvType = REGDB_NUMBER;
  292.     if(RegDBKeyExist("SOFTWARE\\YiJiao")>0) then
  293.            RegDBGetKeyValueEx("SOFTWARE\\YiJiao\","ProductCode",nvType,szPath,nvSize);
  294.            ProductCode="\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\" +szPath;
  295.      if(RegDBKeyExist(ProductCode)>0) then
  296.        //RegDBGetKeyValueEx("\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\{F7BCAE73-5488-494D-B23F-C792D8C4A97D}","UninstallString",nvType,szPath,nvSize);
  297.         RegDBDeleteKey(ProductCode);  
  298.         endif;  
  299.      // 删除开始所有程序中的AliProbe文件夹
  300.     DeleteProgramFolder("中国艺交所会员客户端");
  301.   
  302.     // 删除桌面上的快捷方式
  303.     DeleteFolderIcon(FOLDER_DESKTOP, "中国艺交所会员客户端");
  304.      
  305.      
  306.     RegDBGetKeyValueEx("SOFTWARE\\YiJiao","install",nvType,szPath,nvSize);
  307.    
  308.     // 删除安装目录文件夹
  309.     DeleteProgramFolder(szPath);   
  310.     RegDBDeleteKey("SOFTWARE\\YiJiao");
  311.     endif;  */   
  312.    
  313.     //YiJiaoReg();  
  314.     /*if(RegDBKeyExist("SOFTWARE\\YiJiao")>0) then
  315.       
  316.       RegDBGetKeyValueEx("SOFTWARE\\YiJiao\","ProductCode",nvType,szPath,nvSize);
  317.        ProductCode="\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\" +szPath;
  318.       

  319.               if (RegDBKeyExist(ProductCode) = 1)then  // has the key
  320.              RegDBGetKeyValueEx(ProductCode,"UninstallString",nvType,szPath,nvSize);
  321.                  VERCHEKER = SUPPORTDIR ^ "setup.iss";
  322.                  XCopyFile ( VERCHEKER, "C://Program Files//InstallShield Installation Information//"+"ProductCode", COMP_NORMAL );
  323.                  szCMDLineTest = "/s /f1/"+"C://Program Files//InstallShield Installation Information//"+"ProductCode"+"//setup.iss/";
  324.                  LaunchAppAndWait( szPath, szCMDLineTest, LAAW_OPTION_WAIT_INCL_CHILD | LAAW_OPTION_WAIT);
  325.                 WaitForApplication(LAAW_PROCESS_INFORMATION.hProcess, LAAW_PROCESS_INFORMATION.dwProcessId, INFINITE, LAAW_OPTION_WAIT_INCL_CHILD | LAAW_OPTION_WAIT);
  326.             endif;
  327.                // 删除开始所有程序中的AliProbe文件夹
  328.    
  329.     RegDBDeleteKey("SOFTWARE\\YiJiao");
  330.         endif;  */
  331.       
  332.     return 0;
  333. end;
  334. //---------------------------------------------------------------------------
  335. // OnBegin
  336. //
  337. // The OnBegin event is called directly by the framework after the setup
  338. // initializes.
  339. //---------------------------------------------------------------------------
  340. function OnBegin()
  341. string svCurrentDir;   
  342. //NUMBER   nvType,nvSize;
  343. STRING   szPath;
  344. string szNumName,szNumValue;  
  345. number nType,nSize;
  346. begin
  347. // TO DO: you may change default non-UI setting, for example
  348. //
  349. // You may also perform your custom initialization steps, check requirements, etc.
  350. //GetCurrentDir(svCurrentDir);
  351. //svCurrentDir =  svCurrentDir+"\\dotNetFx40_Full_x86_x64.exe";//这里的dotnetfx20.exe可到官网上下载
  352.   //判断操作系统
  353.      if (SYSINFO.bIsWow64) then
  354.           OS64=TRUE;
  355.      else
  356.           OS32=TRUE;
  357.      endif;
  358.     //旧的安装GUID
  359.     RegDBSetDefaultRoot(HKEY_LOCAL_MACHINE);
  360.     if(RegDBKeyExist(szKey)>0)then
  361.         szNumName="Dog";
  362.         nType=REGDB_STRING;
  363.         RegDBGetKeyValueEx(szKey,szNumName,nType,szNumValue,nSize);
  364.         oldGuid= szNumValue;
  365.     endif;   

  366.    
  367.      
  368. svCurrentDir =  SUPPORTDIR^"\\dotNetFx40_Full_x86_x64.exe";//这里的dotnetfx20.exe可到官网上下载
  369. RegDBSetDefaultRoot(HKEY_LOCAL_MACHINE);  //设置默认的注册表键值根节点
  370. // 判断是否存在.net
  371. if (RegDBKeyExist ("SOFTWARE\\Microsoft\\NET Framework Setup\\NDP\\v4.0") <0 &&RegDBKeyExist ("SOFTWARE\\Microsoft\\NET Framework Setup\\NDP\\v4") < 0) then
  372. //当上面判断了没有安装.net这个软件时,则启动光盘里
  373. //dotnetfx.exe安装程序来安装。
  374.      MessageBox ("检测到本机未安装.Net FrameWork 4.0,下一步将会先安装.Net FrameWork 4.0 ", INFORMATION);  
  375.      if(LaunchAppAndWait (svCurrentDir ,"", LAAW_OPTION_WAIT)<0) then     
  376.      MessageBox ("找不到安装程序或者安装出错,请自行下载.Net FrameWork 4.0,手动安装", INFORMATION);
  377.      return 0;
  378.      endif;        
  379. endif;
  380. end;
  381. //
  382. //
  383. ///将安装路径写进注册表
  384. /*function YiJiaoReg(Path)
  385. number nRootKey,nType,nSize;
  386. string szKey,szNumName,szNumValue,szClass;
  387. begin     
  388. //修改注册表
  389. nRootKey = HKEY_LOCAL_MACHINE;
  390. RegDBSetDefaultRoot (nRootKey); //置根为nRootKey
  391. //注册子项
  392. szKey="SOFTWARE\\YiJiao\";
  393. if RegDBKeyExist(szKey) < 0 then
  394.     //不存在“SOFTWARE//NNLLTEST”,创建这个项
  395.     Disable(LOGGING);
  396.     RegDBCreateKeyEx(szKey,"");  
  397.     Enable(LOGGING);
  398. endif;
  399. //初始化每个键的公共值
  400. nType=REGDB_STRING;
  401. nSize=-1;
  402. //注册安装路径
  403. szNumName="install";
  404. szNumValue=TARGETDIR;
  405.     RegDBSetKeyValueEx(szKey,szNumName,nType,szNumValue,nSize);   
  406.    
  407. szNumName="uninstall";
  408. //szNumValue=UNINSTALL_STRING +" /UNINSTALL";//
  409. szNumValue=Path;
  410.     RegDBSetKeyValueEx(szKey,szNumName,nType,szNumValue,nSize);
  411.    
  412.    
  413. szNumName="ProductCode";
  414. szNumValue="";//记录上个版本的产品号
  415.     RegDBSetKeyValueEx(szKey,szNumName,nType,szNumValue,nSize);
  416.    
  417.     //设置为未注册版本
  418.     szNumName="soft";
  419. szNumValue="0";
  420. if RegDBKeyExist(szKey) < 0 then
  421.     //如果不存在这个项,就注册,如果存在,就跳过
  422.     RegDBSetKeyValueEx(szKey,szNumName,nType,szNumValue,nSize);
  423.     RegDBCreateKeyEx (szKey, szClass);
  424. endif;
  425. end;  */

  426. ///卸载旧版本
  427. function UninstallOldVersion()  
  428. string szPath,UninstallString;
  429. string szNumName,szNumValue;
  430. number nType,nSize;
  431. begin      
  432. szPath=WINDIR+"Installer\"+oldGuid;
  433. RegDBSetDefaultRoot(HKEY_LOCAL_MACHINE);
  434. UninstallString="\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\InstallShield_"+oldGuid;
  435. nType=REGDB_STRING;
  436. szNumName="UninstallString";
  437. RegDBGetKeyValueEx(UninstallString,szNumName,nType,szNumValue,nSize); //获取卸载脚本
  438.     if(RegDBKeyExist(UninstallString)>0) then   
  439.         //if(AskYesNo("Install the software detects an earlier version, in order to ensure the software is installed correctly uninstall that version!",NO)=YES) then   
  440.                 SdShowMsg("正在卸载旧版本请稍等...",TRUE);
  441.                 Delay(1);
  442.                 LaunchAppAndWait(szNumValue," /S",LAAW_OPTION_WAIT_INCL_CHILD | LAAW_OPTION_WAIT);                 
  443.                 //DeleteDir("C:\\Program Files (x86)\\InstallShield Installation Information\"+oldGuid,ALLCONTENTS);
  444.                 //刷新注册表
  445.                 LaunchAppAndWait ( "","cmd /c gpupdate /force /wait:0 ",LAAW_OPTION_WAIT_INCL_CHILD | LAAW_OPTION_WAIT|LAAW_OPTION_HIDDEN);   
  446.                 SdShowMsg("", FALSE);
  447.                    //SdShowMsg("Uninstall is complete",TRUE);
  448.                 Delay(2);
  449.                 SdShowMsg("", FALSE);
  450.                 LaunchAppAndWait( WINSYSDIR^"cmd.exe", "/c rd /s/q ""+szPath+""", LAAW_OPTION_WAIT_INCL_CHILD | LAAW_OPTION_WAIT | LAAW_OPTION_HIDDEN);
  451.         //else
  452.             //abort;
  453.         //endif;
  454.     endif;   
  455. end;


  456. //写注册表
  457. function WriteInstallGuid()
  458. string svSubStr,productCode;
  459. number nRootKey,nType;
  460. begin
  461.      
  462.     if(OS32=TRUE) then
  463.         StrSub(svSubStr,UNINSTALL_STRING,57,38); //获取guid  
  464.     else
  465.         StrSub(svSubStr,UNINSTALL_STRING,63,38);
  466.     endif;
  467.     productCode=svSubStr;
  468.     nRootKey=HKEY_LOCAL_MACHINE;
  469.     RegDBSetDefaultRoot(nRootKey);
  470.     nType=REGDB_STRING;
  471.     RegDBSetKeyValueEx(szKey,"Dog",nType,productCode,-1);   
  472. end;
  473. //---------------------------------------------------------------------------
  474. // OnMaintUIBefore
  475. //
  476. // The OnMaintUIBefore event is called by the framework when the setup is
  477. // running in maintenance mode. By default this event displays UI that
  478. // allows the end user to add or remove features, repair currently
  479. // installed features or uninstall the application.
  480. //---------------------------------------------------------------------------
  481. function OnMaintUIBefore()
  482.     NUMBER nResult, nType,nBuffer;
  483.     STRING szTitle, szMsg, svDir, svResult, szCaption;  
  484.     string setupDIR;
  485. begin
  486.     Dlg_Start:
  487.     if( !REMOVEONLY ) then
  488.       /*if(AskYesNo("计算机上已经安装了该版本,是否卸载?",YES)=NO) then
  489.          abort;
  490.       else */
  491.           ComponentRemoveAll();      
  492.          SetStatusExStaticText( SdLoadString( IDS_IFX_STATUSEX_STATICTEXT_MAINTUI_REMOVEALL ) );   
  493.       //endif;
  494.     else
  495.          ComponentRemoveAll();
  496.         SetStatusExStaticText( SdLoadString( IDS_IFX_STATUSEX_STATICTEXT_MAINTUI_REMOVEALL ) );      
  497.     endif;  
  498.     // setup default status
  499.     SetStatusWindow(0, "");
  500.     Enable(STATUSEX);
  501.     StatusUpdate(ON, 100);
  502. end;
复制代码


回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|小黑屋|手机版|Archiver|SgzyStudio

GMT+8, 2024-5-18 10:10 , Processed in 0.098502 second(s), 19 queries .

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表