WiX刻录引导为静默安装运行不同的InstallCommand参数

时间:2017-08-16 14:07:03

标签: wix nsis chain silent-installer

我有一个需要使用引导程序的Wix安装程序。我已经在下面提供了Bundle.wxs的摘录。它显示Chain,即首先安装.Net 4.5.2,然后根据是否使用-s调用安装程序,以便在有或没有ExePackage的情况下进行静默安装调用InstallCommand值为/S。 “ OtherInstaller ”是NSIS(nulscript安装程序)安装程序,因此需要区分大小写/S才能触发其静默安装。我知道UILevel=2是检查静默安装的条件,但由于某种原因,“OtherInstaller”没有被/S静默参数调用。之后,调用“ MainMsiInstaller ”。

<Chain>      
  <PackageGroupRef Id="NetFx452Web"/>      

  <ExePackage Id="OtherInstallerLoud" 
              SourceFile="..\..\bootstrapper\OtherInstallerFile" 
              InstallCondition="NOT UILevel=2"/>

  <ExePackage Id="OtherInstallerSilent"
              SourceFile="..\..\bootstrapper\\OtherInstallerFile"
              InstallCommand="/S "
              InstallCondition="UILevel=2"/>

  <MsiPackage Id="MainMsiInstaller" 
              DisplayInternalUI="yes" 
              SourceFile="..\..\bin\$(var.CandleCfgName)\MainMsiInstaller.msi" />
</Chain>

任何帮助表示赞赏。

1 个答案:

答案 0 :(得分:1)

最终,对我有用的解决方案(无论是否为最佳解决方案)是确保我使用的burn.exe版本为3.11.xxxxInstallCondition="WixBundleUILevel=2",这是一个WIX变量,在v3.11向上可用。

所以实质上......

<Chain>      
  <PackageGroupRef Id="NetFx452Web"/>      

  <ExePackage Id="OtherInstallerLoud" 
              SourceFile="..\..\bootstrapper\OtherInstallerFile" 
              InstallCondition="NOT WixBundleUILevel=2"/>

  <ExePackage Id="OtherInstallerSilent"
              SourceFile="..\..\bootstrapper\OtherInstallerFile"
              InstallCommand="/S "
              InstallCondition="WixBundleUILevel=2"/>

  <MsiPackage Id="MainMsiInstaller" 
              DisplayInternalUI="no" 
              SourceFile="..\..\bin\$(var.CandleCfgName)\MainMsiInstaller.msi" />
</Chain>