转载:http://www.cnblogs.com/installshield/archive/2010/12/23/1914595.html 作者: Kevin Wan
下面是一段Sample代码,我们假设MSI文件被放到了Support Files中,并且通过静默安装方式调用第三方MSI包,msiexec的相关参数可以在运行中输入msiexec查看。
function CallThirdMSIPackage()STRING svMsiexec, svParam, svMsiPackage;
begin
svMsiexec =WINSYSDIR ^"msiexec.exe";
svMsiPackage =SUPPORTDIR ^"***.msi";
svParam ="/i \"" + svMsiPackage + "\" /qn";
LaunchAppAndWait(svMsiexec, svParam, WAIT);
end;
=====================================================================================================
前面的方法只适用我写的项目
第二种方法:
function OnEnd()
STRING szParam,svParam;
begin
szParam="/i "+SUPPORTDIR^"CRRedist2005_x86.msi"+"";
LaunchAppAndWait("msiexec.exe",szParam,WAIT);
svParam="/i "+SUPPORTDIR^"CRRedist2005_x86_chs.msi"+"";
LaunchAppAndWait("msiexec.exe",svParam,WAIT);
LaunchAppAndWait(SUPPORTDIR^"LandaV9ClientSetup.exe","",WAIT);
end;
=================================================================================================
svParam="/i "+SUPPORTDIR^"CRRedist2005_x86_chs.msi"+"/qb" ;
"/qb"代表静默安装。