我正在编辑 WIX(Windows Installer XML)的安装项目,并希望使用 WIX 静默安装 VC++ Redistributables(2005x86、2005x64)。
我在如下所示的代码中使用自定义操作:
<Product ...>
<CustomAction Id="vcredist2005x64" ExeCommand="/q" Execute="deferred"
Return="asyncNoWait" Impersonate="no">
<CustomAction Id="vcredist2005x86" ExeCommand="/q" Execute="deferred"
Return="asyncNoWait" Impersonate="no">
</Product>
...
<Fragment>
<InstallExecuteSequence>
<Custom Action="vcredist2005x64" Before="InstallFinalize">NOT Installed</Custom>
<Custom Action="vcredist2005x86" After="vcredist2005x64">NOT Installed</Custom>
</InstallExecuteSequence>
</Fragment>
然而,当执行由上述代码生成的安装程序时,会弹出一个 Windows 安装程序对话框并显示:“正在安装另一个程序。请等待安装完成,然后再次尝试安装此软件。”
似乎这两个 Redistributable 有冲突(注意,执行时,例如 2013x64 和 2005x64,不会发生冲突,它们是静默安装的)。
然后我切换到使用 Bootstrapper Project (Burn) 并编写了以下代码:
<Bundle ...>
<Chain>
<ExePackage Id="vcredist2005x64" SourceFile="C:\path\to\vcredist_x64.exe"/>
<ExePackage Id="vcredist2005x86" SourceFile="C:\path\to\vcredist_x86.exe"/>
</Chain>
</Bundle>
...
<Fragment>
<PackageGroup Id="vcredist">
<ExePackage Id="vcredist2005x64"
Cache="yes" PerMachine="yes" Permanent="yes" Vital="yes" Compressed="yes"
SourceFile="C:\path\to\vcredist_x64.exe"
InstallCommand="/q"
SuppressSignatureVerification="yes"
Protocol="burn"
/>
<ExePackage Id="vcredist2005x86" ... /> <!-- same as above -->
</PackageGroup>
</Fragment>
使用刻录,不会发生冲突,但无法静默安装它们,即在启动引导程序后,会出现 Microsoft 软件许可条款对话框。我想防止弹出对话框。
欢迎任何建议。谢谢你。