InstallShield2008脚本安装制作方法Setup

  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. //原型创建卸载快捷方式
  15. prototype CreateUninstallShortcut();
  16. //注册第三方DLL函数
  17. prototype CallRegsterThirdDLL();
  18. prototype CallUnRegsterThirdDLL();
  19. //先安装的组件函数
  20. prototype SetupPreCompontDLLorExe();
  21. //---------------------------------------------------------------------------
  22. // OnFirstUIBefore
  23. // 第一个窗体之前  执行事件
  24. // First Install UI Sequence - Before Move Data
  25. //
  26. // The OnFirstUIBefore event is called by OnShowUI when the setup is
  27. // running in first install mode. By default this event displays UI allowing
  28. // the end user to specify installation parameters.
  29. //
  30. // Note: This event will not be called automatically in a
  31. // program...endprogram style setup.
  32. //---------------------------------------------------------------------------
  33. function OnFirstUIBefore()
  34. number  nResult, nLevel, nSize, nSetupType;
  35. string  szTitle, szMsg, szOpt1, szOpt2, szLicenseFile;
  36. string  szName, szCompany, szTargetPath, szDir, szFeatures;
  37. BOOL    bLicenseAccepted;
  38. begin
  39. nSetupType = COMPLETE;
  40. szDir = TARGETDIR;
  41. szName = "";
  42. szCompany = "";
  43. bLicenseAccepted = FALSE;
  44. //调用 先安装的组件函数
  45. SetupPreCompontDLLorExe();
  46. // Beginning of UI Sequence
  47. Dlg_Start:
  48. nResult = 0;
  49. Dlg_SdWelcome:
  50. szTitle = "";
  51. szMsg = "";
  52. //{{IS_SCRIPT_TAG(Dlg_SdWelcome)
  53. nResult = SdWelcome( szTitle, szMsg );
  54. //}}IS_SCRIPT_TAG(Dlg_SdWelcome)
  55. if (nResult = BACK) goto Dlg_Start;
  56. Dlg_SdLicense2:
  57. szTitle = "";
  58. szOpt1 = "";
  59. szOpt2 = "";
  60. //{{IS_SCRIPT_TAG(License_File_Path)
  61. szLicenseFile = SUPPORTDIR ^ "Eula.rtf";
  62. //}}IS_SCRIPT_TAG(License_File_Path)
  63. //{{IS_SCRIPT_TAG(Dlg_SdLicense2)
  64. nResult = SdLicense2Rtf( szTitle, szOpt1, szOpt2, szLicenseFile, bLicenseAccepted );
  65. //}}IS_SCRIPT_TAG(Dlg_SdLicense2)
  66. if (nResult = BACK) then
  67. goto Dlg_SdWelcome;
  68. else
  69. bLicenseAccepted = TRUE;
  70. endif;
  71. Dlg_SdRegisterUser:
  72. szMsg = "";
  73. szTitle = "";
  74. //{{IS_SCRIPT_TAG(Dlg_SdRegisterUser)
  75. // nResult = SdRegisterUser( szTitle, szMsg, szName, szCompany );
  76. //}}IS_SCRIPT_TAG(Dlg_SdRegisterUser)
  77. if (nResult = BACK) goto Dlg_SdLicense2;
  78. Dlg_SetupType2:
  79. szTitle = "";
  80. szMsg = "";
  81. nResult = CUSTOM;
  82. //{{IS_SCRIPT_TAG(Dlg_SetupType2)
  83. nResult = SetupType2( szTitle, szMsg, "", nSetupType, 0 );     //完整/自定义安装
  84. //}}IS_SCRIPT_TAG(Dlg_SetupType2)
  85. if (nResult = BACK) then
  86. goto Dlg_SdRegisterUser;
  87. else
  88. nSetupType = nResult;
  89. if (nSetupType != CUSTOM) then
  90. szTargetPath = TARGETDIR;
  91. nSize = 0;
  92. FeatureCompareSizeRequired( MEDIA, szTargetPath, nSize );
  93. if (nSize != 0) then
  94. MessageBox( szSdStr_NotEnoughSpace, WARNING );
  95. goto Dlg_SetupType2;
  96. endif;
  97. endif;
  98. endif;
  99. Dlg_SdAskDestPath2:
  100. if ((nResult = BACK) && (nSetupType != CUSTOM)) goto Dlg_SetupType2;
  101. szTitle = "";
  102. szMsg = "";
  103. if (nSetupType = CUSTOM) then
  104. //{{IS_SCRIPT_TAG(Dlg_SdAskDestPath2)
  105. nResult = SdAskDestPath2( szTitle, szMsg, szDir );
  106. //}}IS_SCRIPT_TAG(Dlg_SdAskDestPath2)
  107. TARGETDIR = szDir;
  108. endif;
  109. if (nResult = BACK) goto Dlg_SetupType2;
  110. Dlg_SdFeatureTree:
  111. if ((nResult = BACK) && (nSetupType != CUSTOM)) goto Dlg_SdAskDestPath2;
  112. szTitle = "";
  113. szMsg = "";
  114. szFeatures = "";
  115. nLevel = 2;
  116. if (nSetupType = CUSTOM) then
  117. //{{IS_SCRIPT_TAG(Dlg_SdFeatureTree)
  118. nResult = SdFeatureTree( szTitle, szMsg, TARGETDIR, szFeatures, nLevel );
  119. //}}IS_SCRIPT_TAG(Dlg_SdFeatureTree)
  120. if (nResult = BACK) goto Dlg_SdAskDestPath2;
  121. endif;
  122. Dlg_SQLServer:
  123. nResult = OnSQLServerInitialize( nResult );
  124. if( nResult = BACK ) goto Dlg_SdFeatureTree;
  125. Dlg_ObjDialogs:
  126. nResult = ShowObjWizardPages( nResult );
  127. if (nResult = BACK) goto Dlg_SQLServer;
  128. Dlg_SdStartCopy2:
  129. szTitle = "";
  130. szMsg = "";
  131. //{{IS_SCRIPT_TAG(Dlg_SdStartCopy2)
  132. nResult = SdStartCopy2( szTitle, szMsg );
  133. //}}IS_SCRIPT_TAG(Dlg_SdStartCopy2)
  134. if (nResult = BACK) goto Dlg_ObjDialogs;
  135. // Added in 11.0 - Set appropriate StatusEx static text.
  136. SetStatusExStaticText( SdLoadString( IDS_IFX_STATUSEX_STATICTEXT_FIRSTUI ) );
  137. return 0;
  138. end;
  139. //定义 先安装的组件函数
  140. function SetupPreCompontDLLorExe()
  141. string  szDotNetFx,SzLanguagePack;
  142. string  szAERRealVersion,szAERSpNumber;
  143. string  svNumber;
  144. number  nvType,nvSize;
  145. string szOfficeLastProduct,svOfficeValue;
  146. string szWinInstallerExe;
  147. begin
  148. //安装Window Installer 3.1   有哪些任兄知道的说一下谢谢!
  149. //szWinInstallerExe=SUPPORTDIR ^ "WINDOWSINSTALLER-KB893803-V2-X86.EXE";
  150. //RegDBSetDefaultRoot ( HKEY_LOCAL_MACHINE );
  151. //if (RegDBKeyExist ("SOFTWARE//Classes//Msi.Package" ) < 0) then
  152. //  SdShowMsg("正在安装Window Installer 3.1,请稍候......",TRUE);
  153. //  LaunchAppAndWait(szWinInstallerExe,"",WAIT);
  154. //endif;
  155. //安装.NetFramework2.0
  156. szDotNetFx = SUPPORTDIR ^ "dotnetfx.exe";
  157. SzLanguagePack = SUPPORTDIR ^ "langpack.exe";
  158. //szMDAC = SUPPORTDIR ^ "MDAC2.8.EXE";   //v1.1
  159. RegDBSetDefaultRoot ( HKEY_LOCAL_MACHINE );
  160. if (RegDBKeyExist ("SOFTWARE//Microsoft//.NETFramework//policy//v2.0" ) < 0) then
  161. SdShowMsg("正在安装.Net2.0运行环境,请稍候......",TRUE);
  162. LaunchAppAndWait(szDotNetFx,"",WAIT);
  163. LaunchAppAndWait(SzLanguagePack,"",WAIT);
  164. endif;
  165. //安装MDAC2.8
  166. //RegDBSetDefaultRoot ( HKEY_LOCAL_MACHINE );
  167. //if (RegDBKeyExist ("SOFTWARE//Classes//MDACVer.Version.2.80" ) < 0) then
  168. //  LaunchAppAndWait(szMDAC,"",WAIT);
  169. //endif;
  170. //判断是否安装了ArcEngine9.2+SP3补丁包
  171. szAERRealVersion="9.2";
  172. szAERSpNumber="3";
  173. nvSize=-1;
  174. RegDBSetDefaultRoot ( HKEY_LOCAL_MACHINE );
  175. if (RegDBGetKeyValueEx ("SOFTWARE//ESRI//ArcGIS Engine Runtime","RealVersion",nvType,svNumber,nvSize) < 0) then
  176. MessageBox ("未安装ArcEngine9.2+SP3补丁包,请本安装完成后再安装!", SEVERE);
  177. else
  178. if(svNumber!=szAERRealVersion) then
  179. MessageBox ("未安装ArcEngine9.2+SP3补丁包,请本安装完成后再安装!", SEVERE);
  180. else
  181. if(RegDBGetKeyValueEx ("SOFTWARE//ESRI//ArcGIS Engine Runtime","SPNumber",nvType,svNumber,nvSize) < 0) then
  182. MessageBox ("未安装ArcEngine9.2+SP3补丁包,请本安装完成后再安装!", SEVERE);
  183. else
  184. if(svNumber!=szAERSpNumber) then
  185. MessageBox ("未安装ArcEngine9.2+SP3补丁包,请本安装完成后再安装!", SEVERE);
  186. endif;
  187. endif;
  188. endif;
  189. endif;
  190. //判断是否安装了Microsoft Office 2003 V11.0+SP2及以上版本
  191. szOfficeLastProduct="11.0.7969.0";  //sp2 版本号
  192. RegDBSetDefaultRoot ( HKEY_LOCAL_MACHINE );
  193. if (RegDBKeyExist ("SOFTWARE//Microsoft//Office//11.0//Common//ProductVersion" ) < 0) then
  194. MessageBox ("未安装Microsoft Office 2003 V11.0+SP2及以上版本,请本安装完成后再安装!", SEVERE);
  195. else
  196. if(RegDBGetKeyValueEx ("SOFTWARE//Microsoft//Office//11.0//Common//ProductVersion","LastProduct",nvType,svOfficeValue,nvSize) < 0) then
  197. MessageBox ("未安装Microsoft Office 2003 V11.0+SP2及以上版本,请本安装完成后再安装!", SEVERE);
  198. else
  199. if(svOfficeValue<szOfficeLastProduct) then
  200. MessageBox ("未安装Microsoft Office 2003 V11.0+SP2及以上版本,请本安装完成后再安装!", SEVERE);
  201. endif;
  202. endif;
  203. endif;
  204. end;
  205. //注册第三方DLL函数
  206. function CallRegsterThirdDLL()
  207. string szDevExpress_Dll,szmicrosoft_mshtml_dll;
  208. begin
  209. //安装完后注册 DevExpress_Dll
  210. szDevExpress_Dll = TARGETDIR ^ "//devexpress_dll//reg.bat";
  211. //SdShowMsg("正在注册 DevExpress_Dll,请稍候......",TRUE);
  212. //Delay(2);
  213. if(LaunchAppAndWait(szDevExpress_Dll,"",WAIT)<0) then
  214. endif;
  215. //安装完后注册 microsoft_mshtml_dll
  216. szmicrosoft_mshtml_dll = TARGETDIR ^ "//microsoft_mshtml_dll//reg.bat";
  217. //SdShowMsg("正在注册 microsoft_mshtml_dll,请稍候......",TRUE);
  218. //Delay(2);
  219. if(LaunchAppAndWait(szmicrosoft_mshtml_dll,"",WAIT)<0) then
  220. endif;
  221. end;
  222. //调用 卸载第三方组件
  223. function CallUnRegsterThirdDLL()
  224. string szDevExpress_Dll,szmicrosoft_mshtml_dll;
  225. begin
  226. //安装完后注册 DevExpress_Dll
  227. szDevExpress_Dll = TARGETDIR ^ "//devexpress_dll//unreg.bat";
  228. //SdShowMsg("正在注册 DevExpress_Dll,请稍候......",TRUE);
  229. //Delay(2);
  230. if(LaunchAppAndWait(szDevExpress_Dll,"",WAIT)<0) then
  231. endif;
  232. //LaunchApp(szDevExpress_Dll,"");
  233. //安装完后注册 microsoft_mshtml_dll
  234. szmicrosoft_mshtml_dll = TARGETDIR ^ "//microsoft_mshtml_dll//unreg.bat";
  235. //SdShowMsg("正在注册 microsoft_mshtml_dll,请稍候......",TRUE);
  236. //Delay(2);
  237. //NOWAIT
  238. if(LaunchAppAndWait(szmicrosoft_mshtml_dll,"",WAIT) <0) then
  239. endif;
  240. end;
  241. //定义创建卸载快捷方式
  242. function CreateUninstallShortcut()
  243. string strCmdLine;
  244. LIST lstPath;
  245. begin
  246. // For an InstallScript installation:
  247. strCmdLine = DISK1TARGET ^ "Setup.exe";
  248. // For an InstallScript MSI installation:
  249. strCmdLine = UNINSTALL_STRING;
  250. // The path has to be handled differently if you are running
  251. // an InstallScript MSI installation on Windows 9X.
  252. if (SYSINFO.WIN9X.bWin9X ) then
  253. lstPath = ListCreate( STRINGLIST );
  254. StrGetTokens( lstPath, UNINSTALL_STRING, "/" );
  255. ListGetFirstString( lstPath, strCmdLine );
  256. LongPathToQuote( strCmdLine, TRUE );
  257. strCmdLine = strCmdLine + " /M" + PRODUCT_GUID;
  258. endif;
  259. // Create the shortcut.
  260. AddFolderIcon(FOLDER_PROGRAMS ^ "XXXXX系统","卸载XXXXX系统V1.0",strCmdLine,"",TARGETDIR ^ "//remove.ico",0,"",REPLACE);
  261. end;
  262. //---------------------------------------------------------------------------
  263. // OnFirstUIAfter
  264. //
  265. // First Install UI Sequence - After Move Data
  266. //
  267. // The OnFirstUIAfter event called by OnShowUI after the file transfer
  268. // of the setup when the setup is running in first install mode. By default
  269. // this event displays UI that informs the end user that the setup has been
  270. // completed successfully.
  271. //
  272. // Note: This event will not be called automatically in a
  273. // program...endprogram style setup.
  274. //---------------------------------------------------------------------------
  275. function OnFirstUIAfter()
  276. STRING szTitle, szMsg1, szMsg2, szOpt1, szOpt2;
  277. NUMBER bvOpt1, bvOpt2;
  278. NUMBER bShowUpdateServiceDlg;
  279. begin
  280. ShowObjWizardPages(NEXT);
  281. szTitle = "";
  282. szMsg1 = "";
  283. szMsg2 = "";
  284. szOpt1 = "";
  285. szOpt2 = "";
  286. bvOpt1   = FALSE;
  287. bvOpt2   = FALSE;
  288. // Set this to true if you have the update service enabled, and if you want to check for updates.
  289. // Note: the ISUS Starter Edition does not support checking for updates programatically.  So,
  290. // only set this to true if you have at least the ISUS Professional Edition.
  291. bShowUpdateServiceDlg = FALSE;
  292. //调用 创建卸载快捷方式
  293. CreateUninstallShortcut();
  294. //调用第三方组件 函数
  295. CallRegsterThirdDLL();
  296. //{{IS_SCRIPT_TAG(Dlg_SdDinishEx)
  297. if ( BATCH_INSTALL ) then
  298. SdFinishReboot ( szTitle , szMsg1 , SYS_BOOTMACHINE , szMsg2 , 0 );
  299. else
  300. // If the update service is enabled, show finish dialog that includes
  301. // update check option.
  302. if( bShowUpdateServiceDlg && ( ENABLED_ISERVICES & SERVICE_ISUPDATE ) ) then
  303. if( SdFinishUpdateEx( szTitle, szMsg1, szMsg2, szOpt1, szOpt2, TRUE ) ) then
  304. // Don‘t check for updates in silent mode.
  305. if( MODE != SILENTMODE ) then
  306. UpdateServiceCheckForUpdates( "", FALSE );
  307. endif;
  308. endif;
  309. else
  310. SdFinish ( szTitle , szMsg1 , szMsg2 , szOpt1 , szOpt2 , bvOpt1 , bvOpt2 );
  311. endif;
  312. endif;
  313. //}}IS_SCRIPT_TAG(Dlg_SdDinishEx)
  314. end;
  315. //---------------------------------------------------------------------------
  316. // OnSetTARGETDIR
  317. //
  318. // OnSetTARGETDIR is called directly by the framework to initialize
  319. // TARGETDIR to it‘s default value.
  320. //
  321. // Note: This event is called for all setups.
  322. //---------------------------------------------------------------------------
  323. function OnSetTARGETDIR()
  324. number nId, nIgnore, nResult;
  325. string szId, szTARGETDIR;
  326. begin
  327. // In maintenance mode the value of TARGETDIR is read from the log file.
  328. if( MAINTENANCE ) then
  329. return ISERR_SUCCESS;
  330. endif;
  331. // Set TARGETDIR to script default.
  332. TARGETDIR = "<FOLDER_APPLICATIONS>//XXXX系统";
  333. // Read TARGETDIR from the media.
  334. nResult = MediaGetData( MEDIA, MEDIA_FIELD_TARGETDIR, nIgnore, szTARGETDIR );
  335. // Use the TARGETDIR from the media if anything was read.
  336. if( nResult >= ISERR_SUCCESS && StrLengthChars( szTARGETDIR ) ) then
  337. TARGETDIR = szTARGETDIR;
  338. endif;
  339. // Customize the default TARGETDIR for multi-instance application.
  340. // TODO: If you want something different customize the code below.
  341. if( MAINT_OPTION = MAINT_OPTION_MULTI_INSTANCE  && MULTI_INSTANCE_COUNT > 0) then
  342. // Start with the current multi-instance count plus one.
  343. nId = MULTI_INSTANCE_COUNT + 1;
  344. // Find a unique TARGETDIR.
  345. while( ExistsDir( TARGETDIR ) = EXISTS )
  346. // Convert to string.
  347. NumToStr( szId, nId );
  348. // Update IFX_MULTI_INSTANCE_SUFFIX
  349. IFX_MULTI_INSTANCE_SUFFIX = "_" + szId;
  350. // Update TARGETDIR
  351. TARGETDIR = TARGETDIR + IFX_MULTI_INSTANCE_SUFFIX;
  352. // Update nId
  353. nId = nId + 1;
  354. endwhile;
  355. endif;
  356. end;
  357. //---------------------------------------------------------------------------
  358. // OnMoved
  359. //
  360. // The OnMoved event is called as a result of the setup calling
  361. // FeatureTransferData or FeatureMoveData. The event is called when
  362. // all file transfer operations are completed except for batch
  363. // self-registration which is performed immediately after this event returns.
  364. // During uninstallation this event sent after uninstallation is completed,
  365. // therefore you should not modify system state in this event.
  366. //---------------------------------------------------------------------------
  367. function OnMoved()
  368. begin
  369. end;
  370. //---------------------------------------------------------------------------
  371. // OnSetUpdateMode
  372. //
  373. // OnSetUpdateMode is called directly by the framework to set the UPDATEMODE
  374. // InstallShield system variable appropriately to control which UI events
  375. // are called by OnShowUI.
  376. //
  377. // Note: This event is called for all setups.
  378. //---------------------------------------------------------------------------
  379. function OnSetUpdateMode()
  380. number  nIgnore, nMediaFlags, nInstalledVersion, nUpdateVersion, nResult;
  381. string  szVersion, szIgnore, szMsg;
  382. begin
  383. UPDATEMODE = FALSE; // Non-update mode by default.
  384. // Added 11.5 - Don‘t set UPDATEMODE when running from Add/Remove
  385. if( ADDREMOVE ) then
  386. return ISERR_SUCCESS;
  387. endif;
  388. // Added 11.5 - Don‘t set UPDATEMODE when REMOVEONLY is specified
  389. if( REMOVEONLY ) then
  390. return ISERR_SUCCESS;
  391. endif;
  392. // Get the media flags.
  393. MediaGetData( MEDIA, MEDIA_FIELD_MEDIA_FLAGS, nMediaFlags, szIgnore );
  394. if( ! ( nMediaFlags & MEDIA_FLAG_UPDATEMODE_SUPPORTED ) ) then
  395. return ISERR_SUCCESS; // Update mode not supported by the setup.
  396. endif;
  397. // TODO: If you are updating an application that was installed by a previous
  398. // version of InstallShield, IFX_INSTALLED_VERSION will be empty, and
  399. // VERSION_COMPARE_RESULT_NOT_INSTALLED will be returned by
  400. // VerProductCompareVersions. Change the value of IFX_INSTALLED_VERSION (and
  401. // IFX_INSTALLED_DISPLAY_VERSION) here based on application specific version
  402. // information determined by the setup. Only do this if IFX_INSTALLED_VERSION
  403. // is empty.
  404. //if ( !StrLengthChars( IFX_INSTALLED_VERSION ) && MAINTENANCE ) then
  405. //  IFX_INSTALLED_VERSION = "X.XX.XXX";
  406. //  IFX_INSTALLED_DISPLAY_VERSION = IFX_INSTALLED_VERSION;
  407. //endif;
  408. // Verify that the installed version is valid.
  409. if( !StrLengthChars( IFX_INSTALLED_VERSION ) && MAINTENANCE ) then
  410. // If this error occurs, IFX_INSTALLED_VERSION needs to be set manually.
  411. szMsg = SdLoadString( IDS_IFX_ERROR_UPDATE_NO_INSTALLED_VERSION );
  412. MessageBox( szMsg, SEVERE );
  413. abort;
  414. endif;
  415. // Verify that the product version is valid.
  416. if( !StrLengthChars( IFX_PRODUCT_VERSION ) ) then
  417. // If this error occures, IFX_PRODUCT_VERSION was not initialized correctly.
  418. szMsg = SdLoadString( IDS_IFX_ERROR_UPDATE_NO_PRODUCT_VERSION );
  419. MessageBox( szMsg, SEVERE );
  420. abort;
  421. endif;
  422. // Do the version comparison.
  423. nResult = VerProductCompareVersions();
  424. // Make sure that valid data was returned by VerProductCompareVersions
  425. if( nResult < ISERR_SUCCESS ) then
  426. szMsg = SdLoadString( IDS_IFX_ERROR_UPDATE_VERSION_COMPARE_FAILURE );
  427. MessageBox( szMsg, SEVERE );
  428. abort;
  429. endif;
  430. // Set update mode if this is a differential media or the product is already installed and the versions do not match.
  431. UPDATEMODE = ( nMediaFlags & MEDIA_FLAG_FORMAT_DIFFERENTIAL || ( MAINTENANCE && ( nResult != VERSION_COMPARE_RESULT_SAME ) ) );
  432. end;
  433. //---------------------------------------------------------------------------
  434. // OnCheckMediaPassword
  435. //
  436. // Displays a password dialog if the media is password protected.
  437. //
  438. // Note: This event is called for all setups.
  439. //---------------------------------------------------------------------------
  440. function OnCheckMediaPassword()
  441. string szResult, szMsg;
  442. BOOL bValidated;
  443. begin
  444. // Check whether the setup author selected this option.
  445. if( !SHOW_PASSWORD_DIALOG ) then;
  446. return ISERR_SUCCESS;
  447. endif;
  448. // Check whether the password has been specified previously.
  449. LogReadCustomString( MEDIA_PASSWORD_KEY, szResult );
  450. if( FeatureValidate( MEDIA, "", szResult ) == 0 ) then
  451. return ISERR_SUCCESS;
  452. endif;
  453. // "Back" button should be disabled.
  454. Disable( BACKBUTTON );
  455. // Attempt to validate the media.
  456. bValidated = FALSE;
  457. // Loop until the password is validated.
  458. while( !bValidated )
  459. // Prompt for password.
  460. if( EnterPassword( "", "", szResult ) < ISERR_SUCCESS ) then
  461. abort; // Failed to display password dialog
  462. endif;
  463. // Attempt to validate the media.
  464. if( FeatureValidate( MEDIA, "", szResult ) == 0 ) then
  465. // Store the media password for maintenance mode.
  466. LogWriteCustomString( MEDIA_PASSWORD_KEY, szResult );
  467. bValidated = TRUE;
  468. else
  469. szMsg = SdLoadString( IDS_IFX_ERROR_INVALID_MEDIA_PASSWORD );
  470. MessageBox( szMsg, INFORMATION );
  471. endif;
  472. endwhile;
  473. // Enable "Back" button.
  474. Enable( BACKBUTTON );
  475. end;
  476. //---------------------------------------------------------------------------
  477. // OnEnd
  478. //
  479. // The OnEnd event is called at the end of the setup. This event is not
  480. // called if the setup is aborted.
  481. //---------------------------------------------------------------------------
  482. function OnEnd()
  483. begin
  484. end;
  485. //---------------------------------------------------------------------------
  486. // OnUninstall
  487. //
  488. // The OnUninstall event is called when the setup is run with the -uninst
  489. // switch, in this case this is the only event that will be called.
  490. //---------------------------------------------------------------------------
  491. function OnUninstall()
  492. string szIgnore, szMsg;
  493. number nResult;
  494. BOOL bOpt1, bOpt2;
  495. begin
  496. // Hide the initial progress dialog.
  497. Disable( DIALOGCACHE );
  498. // Show Uninstall Confirmation Dialog
  499. if( MessageBox( SdLoadString( IFX_MAINTUI_MSG ), MB_YESNO ) != IDYES ) then
  500. abort;
  501. endif;
  502. //调用反安装函数
  503. CallUnRegsterThirdDLL();
  504. // Remove all features.
  505. FeatureRemoveAllInMediaAndLog();
  506. // Added in 11.0, disable the cancel button during uninstall.
  507. if( REMOVEALLMODE ) then
  508. Disable( CANCELBUTTON );
  509. endif;
  510. // Added in 11.0 - Set appropriate StatusEx static text.
  511. // Moved in 12.1 - Set before calling Enable( STATUSEX ) to ensure proper product name updating.
  512. SetStatusExStaticText( SdLoadString( IDS_IFX_STATUSEX_STATICTEXT_MAINTUI_REMOVEALL ) );
  513. // Show Status
  514. SetStatusWindow( 0, "" );
  515. Enable( STATUSEX );
  516. StatusUpdate( ON, 100 );
  517. // Uninstall
  518. nResult = FeatureTransferData( MEDIA );
  519. // Handle move data error and abort if error occured.
  520. if( nResult < ISERR_SUCCESS ) then
  521. OnComponentError();
  522. abort;
  523. endif;
  524. // Disable Status
  525. Disable( STATUSEX );
  526. // Show final dialog.
  527. if ( BATCH_INSTALL ) then
  528. SdFinishReboot( SdLoadString(IFX_SDFINISH_REMOVE_TITLE), SdLoadString(IFX_SDFINISH_REMOVE_MSG2), SYS_BOOTMACHINE, "", 0 );
  529. else
  530. SdFinish( SdLoadString(IFX_SDFINISH_REMOVE_TITLE), SdLoadString(IFX_SDFINISH_REMOVE_MSG1), "", "" , "", bOpt1 , bOpt2 );
  531. endif;
  532. end;
时间: 2024-08-13 07:24:14

InstallShield2008脚本安装制作方法Setup的相关文章

Windows10官方原版系统下载安装制作方法

Windows10官方原版系统下载安装制作方法 去官网下载系统安装程序 点进去 https://www.microsoft.com/zh-cn/software-download/windows10 MediaCreationTool1909.exe工具下载地址:https://www.lanzous.com/i8v3mod U盘制作好后的样子 安装注意事项: 将U盘插入到需要安装系统的电脑上,重启电脑就会进入到系统安装界面 系统在安装完成提示:需要重启才能完成的时候需要拔掉U盘,否则的话重启后

脚本安装Discuz论坛(shell + Python 实现自动化安装)

实验环境 1.shell 脚本:linux centos 7 系统2.Python shell 脚本:window 系统 3.其他:python selenium 模块,谷歌浏览器, 谷歌浏览器驱动.4.discuz 链接:https://pan.baidu.com/s/1vOwN_f56wJlIzauGrFoR1Q 提取码:mijf 实验步骤 1.上传discuz包到Linux系统/opt目录下 方法一:挂载 方法二:通过Xftp软件上传 2.编写脚本package.sh (可查看上一篇博客,

制作U盘启动盘及安装操作系统的方法

U盘启动盘制作方法: 1.从网上下载最新的老毛桃U盘启动制作工具主程序并安装 2.插入U盘(制作启动盘前先保存好你的资料到其它地方,以防丢失不可找回) 3.插入正确的U盘后程序会自动检测到U盘,启动模式用默认USB-HDD即可,然后再单击下面的“一键制成USB启动盘”按钮 4.在弹出的“警告”确认对话框中单击“是”按钮继续 5.随后程序主界面下文显示“正在写入启动文件”的字样,此时一定不能随便碰到或拔掉U盘 6.稍等一会即可看到成功的提示对话框,按提示拔掉U盘再重新插入即可. 7.之后即可用此U

NSIS安装制作基础教程[初级篇], 献给对NSIS有兴趣的初学者

NSIS安装制作基础教程[初级篇], 献给对NSIS有兴趣的初学者 作者: raindy 来源:http://bbs.hanzify.org/index.php?showtopic=30029 时间:2005-02-15 点击:70791 raindy NSIS简介: NSIS 是“Nullsoft 脚本安装系统”(Nullsoft Scriptable Installation System)的缩写,它是一个免费的 Win32 安装.卸载系统,它的特点:脚本简洁高效:系统开销小:当然进行安装.

INNO 补丁制作技术, 打开 INNO 补丁制作方法的第一页

INNO 补丁制作技术, 打开 INNO 补丁制作方法的第一页 作者:xin 日期:2005-09-23 字体大小: 小 中 大   VPatch 在 INNO 中的应用. VPatch 属于专为NSIS开发的补丁插件,通过本人开发的调用插件 callvpatch.dll 进行调用.在 INNO 中得到很好的应用.(注意:你可以在 VPatch 的官方网站“http://www.tibed.net/vpatch/”得到源代码,从而编译成一个适合在 INNO 中直接利用的 DLL,这里我为了通用性

Radmin Server-3.5 完美绿色破解版(x32 x64通用) 第三版 + 单文件制作方法

Radmin Server v3.5 汉化破解绿色版(x32 x64通用) 第三版 下载链接: http://pan.baidu.com/s/1dFmb9fF 密码: 95gd 2016年7月8日更新第三版1.修复在单文件中系统位宽判断错误的问题,修复自动增加防火墙白名单命令错误的问题,增加卸载时清除注册表设置信息2.增加单文件制作方法和单文件成品3.修改默认设置的方法有所改变,请查看下方的:二.如何修改默认安装设置? 4.修复启动时不加载 mirror driver 的问题(不加载这个会导致远

安装器---Inno Setup

Inno Setup[1]  用Delphi写成,其官方网站同时也提供源程序免费下载.它虽不能与Installshield这类恐龙级的安装制作软件相比,但也当之无愧算是后起之秀.Inno Setup是一个免费的安装制作软件,小巧.简便.精美是其最大特点,支持pascal脚本,能快速制作出标准Windows2000风格的安装界面,足以完成一般安装任务. 用innoSetup做应用程序安装包的示例脚本(.iss文件),具体要看innoSetup附带的文档,好象是pascal语言写的脚本. 示例1(应

Webcast / 技术小视频制作方法——自己动手录制video轻松搞定

Webcast / 技术小视频制作方法——自己动手录制video轻松搞定 http://blog.sina.com.cn/s/blog_67d387490100wdnh.html 最近申请加入MSP的童鞋应该发现了一个新的要求——制作简短的视频!视频的内容要求是与微软技术相关~我们希望通过使用这种方法,简化申请流程,加强对创意.微软相关技术的考察~关于MSP项目以及申请流程的细则近期也会出台,请童鞋们耐心等待~ 首先呢,就跟广大的童鞋们介绍一款简单使用的录屏软件~而通过简单的安装,便可以轻松.便

Windows应用安装制作工具调查报告

Windows应用安装方式 Windows应用安装主要有如下两种方式: exe:可执行程序(executable program,EXE File) Microsoft Windows Installer( MSI) 说到MSI文件,不得不先说说Windows Installer,它不只是安装程序,而且是可扩展的软件管理系统.Windows Installer的用途包括:管理软件的安装.管理软件组件的添加和删除.监视文件的复原以及使用回滚技术维护基本的灾难恢复.另外,Windows Instal