1 [Setup] 2 ; 注: AppId的值为单独标识该应用程序。 3 ; 不要为其他安装程序使用相同的AppId值。 4 ; (生成新的GUID,点击 工具|在IDE中生成GUID。) 5 AppId={{47A165D0-6237-4B7D-915E-4C3779A70F93} 6 AppName={#MyAppName} 7 AppVersion={#MyAppVersion} 8 ;AppVerName={#MyAppName} {#MyAppVersion} 9 AppPublisher={#MyAppPublisher} 10 AppPublisherURL={#MyAppURL} 11 AppSupportURL={#MyAppURL} 12 AppUpdatesURL={#MyAppURL} 13 DefaultDirName={pf}{#MyAppName} 14 DisableProgramGroupPage=yes 15 OutputBaseFilename=DataOutSetup 16 Compression=lzma 17 SolidCompression=yes 18 PrivilegesRequired=admin 19 20 [Languages] 21 Name: "chinesesimp"; MessagesFile: "compiler:Default.isl" 22 23 [Tasks] 24 Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked 25 26 [Types] 27 Name: full; Description: Full installation 28 Name: custom; Description: Custom installation; Flags: iscustom 29 30 [Components] 31 Name: MainApp; Description: 主程序文件; Types: full custom; Flags: fixed 32 Name: VCDll; Description: VC++运行库; Types: full custom 33 34 [Files] 35 Source: "C:Documents and SettingsAdministrator桌面4vccrt8_Win32.msi"; DestDir: "{app}"; Flags: ignoreversion; Components: VCDll; AfterInstall: MyAfterInstall 36 Source: "C:Documents and SettingsAdministrator桌面4MyApp.exe"; DestDir: "{app}"; Flags: ignoreversion; Components: MainApp 37 Source: "C:Documents and SettingsAdministrator桌面4config.ini"; DestDir: "{app}"; Flags: ignoreversion; Components: MainApp 38 Source: "C:Documents and SettingsAdministrator桌面4fbclient.dll"; DestDir: "{app}"; Flags: ignoreversion; Components: MainApp 39 Source: "C:Documents and SettingsAdministrator桌面4ib_util.dll"; DestDir: "{app}"; Flags: ignoreversion; Components: MainApp 40 Source: "C:Documents and SettingsAdministrator桌面4icudt30.dll"; DestDir: "{app}"; Flags: ignoreversion; Components: MainApp 41 Source: "C:Documents and SettingsAdministrator桌面4icuin30.dll"; DestDir: "{app}"; Flags: ignoreversion; Components: MainApp 42 Source: "C:Documents and SettingsAdministrator桌面4icuuc30.dll"; DestDir: "{app}"; Flags: ignoreversion; Components: MainApp 43 Source: "C:Documents and SettingsAdministrator桌面4ABCDB.DAT"; DestDir: "{app}"; Flags: ignoreversion; Components: MainApp 44 Source: "C:Documents and SettingsAdministrator桌面4msvcp80.dll"; DestDir: "{app}"; Flags: ignoreversion; Components: MainApp 45 Source: "C:Documents and SettingsAdministrator桌面4msvcr80.dll"; DestDir: "{app}"; Flags: ignoreversion; Components: MainApp 46 ; 注意: 不要在任何共享系统文件上使用“Flags: ignoreversion” 47 48 [Icons] 49 Name: "{commonprograms}{#MyAppName}"; Filename: "{app}{#MyAppExeName}" 50 Name: "{commondesktop}{#MyAppName}"; Filename: "{app}{#MyAppExeName}"; Tasks: desktopicon 51 52 [Run] 53 ;Filename: "msiexec.exe"; Parameters: "/i ""{app}vccrt8_Win32.msi"" /quiet";Description:"安装动态库"; StatusMsg:"正在安装必须的文件" 54 Filename: "{app}{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Flags: nowait postinstall skipifsilent 55 56 [CODE] 57 procedure MyAfterInstall; 58 var 59 RetCode: integer; 60 begin 61 ShellExec('open', ExpandConstant('{app}vccrt8_Win32.msi'), '', '', SW_SHOWNORMAL, ewWaitUntilTerminated, RetCode); 62 if RetCode <> 0 then 63 MsgBox(SysErrorMessage(RetCode), mbInformation, MB_OK); 64 end;
不知道为什么Exec不成功,必须用ShellExec才可以。
另外,在[Run]下注释的方法也是可行的,但