修复多语言包

时间:2016-05-18 12:35:14

标签: wix bootstrapper

我有WixStandardBootstrapper语言选择单选按钮:

<Button Name="InstallEnglish" HexStyle="000009" X="180" Y="150" Width="100" Height="15" TabStop="yes" FontId="5" HideWhenDisabled="no">#(loc.InstallEnglishRadio)</Button>
<Button Name="InstallGerman" HexStyle="000009" X="180" Y="170" Width="100" Height="15" TabStop="yes" FontId="5" HideWhenDisabled="no">#(loc.InstallGermanRadio)</Button>

这样可以正常工作,并相应地设置变量InstallEnglishInstallGerman

基于这些变量,我启动了我的MSI:

<MsiPackage Name="Installer"
                  SourceFile="Installer.msi"
                  Vital="yes"
                  Visible="no"
                  InstallCondition="InstallEnglish"
                  DisplayInternalUI="yes" />
<MsiPackage Name="Installer_de"
                  SourceFile="Installer.msi"
                  Vital="yes"
                  Visible="no"
                  InstallCondition="InstallGerman"
                  DisplayInternalUI="yes">
   <MsiProperty Name="TRANSFORMS" Value=":de-DE.mst"/>
</MsiPackage>

安装按预期工作,但是在“例如”之后选择“修复”时在德国安装时,首先修复德语安装并卸载英语安装,删除德语安装。

这并不意外,因为InstallCondition仅检查安装条件。但是我该如何处理修理?

1 个答案:

答案 0 :(得分:2)

仅指定一次MSI并动态生成TRANSFORMS值(例如,我使用自定义托管引导程序)。

<MsiPackage Name="Installer"
                  SourceFile="Installer.msi"
                  Vital="yes"
                  Visible="no"
                  DisplayInternalUI="yes">
   <MsiProperty Name="TRANSFORMS" Value="[Transforms]"/>
</MsiPackage>