首页 > 其他 > 详细

Inno Setup打包带有MSI文件的程序

时间:2018-12-30 00:04:20      阅读:248      评论:0      收藏:0      [点我收藏+]
 1 [Files]
 2 Source: "C:\Documents and Settings\Administrator\桌面\4\abc.exe"; DestDir: "{app}"; Flags: ignoreversion
 3 Source: "C:\Documents and Settings\Administrator\桌面\4\vccrt8_Win32.msi"; DestDir: "{app}"; Flags: ignoreversion; AfterInstall: MyAfterInstall
 4 ; 注意: 不要在任何共享系统文件上使用“Flags: ignoreversion”
 5 
 6 [Icons]
 7 Name: "{commonprograms}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"
 8 Name: "{commondesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: desktopicon
 9 
10 [Run]
11 ;Filename: "msiexec.exe"; Parameters: "/i ""{app}\vccrt8_Win32.msi"" /quiet";Description:"安装动态库"; StatusMsg:"正在安装必须的文件"
12 Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, ‘&‘, ‘&&‘)}}"; Flags: nowait postinstall skipifsilent
13 
14 [CODE]
15 procedure MyAfterInstall;
16 var
17   RetCode: integer;
18 begin
19   ShellExec(open, ExpandConstant({app}\vccrt8_Win32.msi), ‘‘, ‘‘, SW_SHOWNORMAL, ewWaitUntilTerminated, RetCode);
20   if RetCode <> 0 then
21     MsgBox(SysErrorMessage(RetCode), mbInformation, MB_OK);
22 end;

不知道为什么Exec不成功,必须用ShellExec才可以。

另外,在[Run]下注释的方法也是可行的,但

Inno Setup打包带有MSI文件的程序

原文:https://www.cnblogs.com/Jiaojiawang/p/10198413.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!