WiX刻录主题复选框 - 默认选中它

时间:2017-08-22 13:20:56

标签: checkbox wix

我已在选项页面中为已存在的WixBootstrapper主题添加了一个复选框:

<Checkbox Name="MyCheckbox" X="11" Y="217" Width="17" Height="17" TabStop="yes" FontId="3" HideWhenDisabled="yes" />

在我的包中,我将此复选框的值传递给MSI:

<MsiPackage DisplayInternalUI="no" SourceFile="..\WixInstaller\bin\$(var.Configuration)\myinstaller.msi" Id="MainPackage">
<MsiProperty Name="INSTALLDIR" Value="[InstallFolder]" />
<MsiProperty Name="CHECKED" Value="[MyCheckbox]" />

这样可以正常工作,但我希望默认情况下选中复选框。

我已经看到了您定义的解决方案:

<Property Id="myprop" Value="1" />

并将复选框更改为Property="myprop"属性。

将任何<Property>元素添加到刻录主题似乎会破坏它(.exe在构建后不会运行)

1 个答案:

答案 0 :(得分:3)

我终于找到了答案here

您在Bundle中设置一个与您的复选框同名的变量:

var str = 'hello how are you dog? "d" I am "good" "g" ha good';

document.write(str.replace(/("[^"]*"|[^dg])|./g, function(a, b) {
    if(b==undefined)
      return a.toUpperCase();
    return b;
  }));

我一直都很高兴看到一个复选框!

相关问题