如何在引导对话框中隐藏元素?

时间:2018-08-31 06:12:09

标签: wix wix3.10

根据WiX-bootstrapper中的选择,将安装特定的MSI。
一种选择是用户定义的,可以带有一个复选框。
我只希望用户能够基于另一个变量来选中此框,因此当我的变量设置为特定值时,我想禁用/隐藏该复选框。 我该怎么办?

我当前的XML:

Theme.xml
<?xml version="1.0" encoding="utf-8"?>
<Theme xmlns="http://wixtoolset.org/schemas/thmutil/2010">
  <Window Width="493" Height="400" HexStyle="100a0000" FontId="0">#(loc.Caption)</Window>
  <Font Id="0" Height="-12" Weight="500" Foreground="000000" Background="F0F0F0" >Segoe UI</Font>
  <Font Id="1" Height="-24" Weight="500" Foreground="000000">Segoe UI</Font>
  <Font Id="2" Height="-22" Weight="500" Foreground="666666" Background="F0F0F0">Segoe UI</Font>
  <Font Id="3" Height="-12" Weight="500" Foreground="000000" Background="F0F0F0" >Segoe UI</Font>
  <Font Id="4" Height="-12" Weight="500" Foreground="ff0000" Background="F0F0F0"  Underline="yes">Segoe UI</Font>
  <Font Id="5" Height="-24" Weight="500" Foreground="000000" Background="E0E0E0">Segoe UI</Font>
  <Image X="0" Y="0" Width="130" Height="0" ImageFile="logo.png" Visible="yes" />
  <Text X="130" Y="-45" Width="500" Height="2" FontId="5" Visible="yes"></Text>

  <Page Name="Install">
    <Text X="150" Y="30" Width="-11" Height="100" FontId="2" DisablePrefix="yes">[WixBundleName] will be installed on your PC</Text>
    <Text X="150" Y="130" Width="-11" Height="100" FontId="3" DisablePrefix="yes">
      This installer will install [WixBundleName] on your PC.
    </Text>
    <Checkbox Name="UserOrMachine" X="150" Y="250" Width="-11" Height="17" FontId="3" TabStop="yes" HideWhenDisabled="yes">Install for all users</Checkbox>
    <Button Name="InstallButton" X="-91" Y="-11" Width="75" Height="23" TabStop="yes" FontId="0">#(loc.InstallInstallButton)</Button>
    <Button Name="WelcomeCancelButton" X="-11" Y="-11" Width="75" Height="23" TabStop="yes" FontId="0">#(loc.InstallCloseButton)</Button>
  </Page>

  <!--other Pages-->
</Theme>


==================
Bundl.wxs
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi" xmlns:util="http://schemas.microsoft.com/wix/UtilExtension" xmlns:bal="http://schemas.microsoft.com/wix/BalExtension">
  <Bundle Name="Product" Version="4.5.2" Manufacturer="Company B.V." UpgradeCode="00000000-0000-0000-0000-000000000000">
    <BootstrapperApplicationRef Id="WixStandardBootstrapperApplication.HyperlinkLicense">
      <bal:WixStandardBootstrapperApplication
          LicenseUrl=""
          xmlns:bal="http://schemas.microsoft.com/wix/BalExtension"
          LogoFile="Resources\BigLogo.png"
          SuppressOptionsUI="yes"
          ThemeFile="Theme.xml"
          SuppressRepair="yes"/>
    </BootstrapperApplicationRef>

    <util:RegistrySearch
      Id="OfficeVersionCheck"
      Variable="OfficeVersion"
      Root="HKCR"
      Key="Word.Application\CurVer" />
    <!--Word.Application.xx 2007=12-->
    <Variable Name="UserOrMachine" Type="numeric" bal:Overridable="yes" Value="0" />

    <Chain>
      <MsiPackage Id="Installer1" InstallCondition='VersionNT64 AND OfficeVersion ~= "Word.Application.12"' SourceFile="$(var.MyMSI1.TargetPath)" DisplayInternalUI="yes" />
      <MsiPackage Id="Installer2" InstallCondition='NOT VersionNT64 AND OfficeVersion ~= "Word.Application.12"' SourceFile="$(var.MyMSI2.TargetPath)" DisplayInternalUI="yes" />
        </Chain>
    </Bundle>
</Wix>

我已经尝试This answer无济于事,我似乎也无法在theme.xml中使用<condition>

0 个答案:

没有答案
相关问题