[Setup]
; 注: AppId的值为单独标识该应用程序。
; 不要为其他安装程序使用相同的AppId值。
; (生成新的GUID,点击 工具|在IDE中生成GUID。)
AppId={{47A165D0-6237-4B7D-915E-4C3779A70F93}
AppName={#MyAppName}
AppVersion={#MyAppVersion}
;AppVerName={#MyAppName} {#MyAppVersion}
AppPublisher={#MyAppPublisher}
AppPublisherURL={#MyAppURL}
AppSupportURL={#MyAppURL}
AppUpdatesURL={#MyAppURL}
DefaultDirName={pf}\{#MyAppName}
DisableProgramGroupPage=yes
OutputBaseFilename=DataOutSetup
Compression=lzma
SolidCompression=yes
PrivilegesRequired=admin [Languages]
Name: "chinesesimp"; MessagesFile: "compiler:Default.isl" [Tasks]
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked [Types]
Name: full; Description: Full installation
Name: custom; Description: Custom installation; Flags: iscustom [Components]
Name: MainApp; Description: 主程序文件; Types: full custom; Flags: fixed
Name: VCDll; Description: VC++运行库; Types: full custom [Files]
Source: "C:\Documents and Settings\Administrator\桌面\\vccrt8_Win32.msi"; DestDir: "{app}"; Flags: ignoreversion; Components: VCDll; AfterInstall: MyAfterInstall
Source: "C:\Documents and Settings\Administrator\桌面\\MyApp.exe"; DestDir: "{app}"; Flags: ignoreversion; Components: MainApp
Source: "C:\Documents and Settings\Administrator\桌面\\config.ini"; DestDir: "{app}"; Flags: ignoreversion; Components: MainApp
Source: "C:\Documents and Settings\Administrator\桌面\\fbclient.dll"; DestDir: "{app}"; Flags: ignoreversion; Components: MainApp
Source: "C:\Documents and Settings\Administrator\桌面\\ib_util.dll"; DestDir: "{app}"; Flags: ignoreversion; Components: MainApp
Source: "C:\Documents and Settings\Administrator\桌面\\icudt30.dll"; DestDir: "{app}"; Flags: ignoreversion; Components: MainApp
Source: "C:\Documents and Settings\Administrator\桌面\\icuin30.dll"; DestDir: "{app}"; Flags: ignoreversion; Components: MainApp
Source: "C:\Documents and Settings\Administrator\桌面\\icuuc30.dll"; DestDir: "{app}"; Flags: ignoreversion; Components: MainApp
Source: "C:\Documents and Settings\Administrator\桌面\\ABCDB.DAT"; DestDir: "{app}"; Flags: ignoreversion; Components: MainApp
Source: "C:\Documents and Settings\Administrator\桌面\\msvcp80.dll"; DestDir: "{app}"; Flags: ignoreversion; Components: MainApp
Source: "C:\Documents and Settings\Administrator\桌面\\msvcr80.dll"; DestDir: "{app}"; Flags: ignoreversion; Components: MainApp
; 注意: 不要在任何共享系统文件上使用“Flags: ignoreversion” [Icons]
Name: "{commonprograms}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"
Name: "{commondesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: desktopicon [Run]
;Filename: "msiexec.exe"; Parameters: "/i ""{app}\vccrt8_Win32.msi"" /quiet";Description:"安装动态库"; StatusMsg:"正在安装必须的文件"
Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Flags: nowait postinstall skipifsilent [CODE]
procedure MyAfterInstall;
var
RetCode: integer;
begin
ShellExec('open', ExpandConstant('{app}\vccrt8_Win32.msi'), '', '', SW_SHOWNORMAL, ewWaitUntilTerminated, RetCode);
if RetCode <> then
MsgBox(SysErrorMessage(RetCode), mbInformation, MB_OK);
end;
不知道为什么Exec不成功,必须用ShellExec才可以。
另外,在[Run]下注释的方法也是可行的,但