Wix:如何在一个复选框中选中条件分支?

时间:2018-04-05 07:33:29

标签: wix

Wix 3.10

您好:

我害怕另一个基本问题...... 是否有可能使条件分支引用Publish标签中的Property?

该窗口有一个复选框和两个编辑文本框。 当我检查X86SAMEASX64复选框时,我想制作TxtX86Folder.value =“[TxtX64Folder](x86)”...当X86SAMEASX64取消选中时,我不想更改编辑值。

例如,如果我在TxtX64Folder中设置“D:\ hogehoge \ database”并检查X86SAMEASX64,我想在TxtX86Folder中输出“D:\ hogehoge \ database(x86)”。

有什么想法吗?

<Wix xmlns='http://schemas.microsoft.com/wix/2006/wi'>

    <!-- this property links to the UI SQLSvrInstanceDlg defined -->
    <Property Id="X64ROOTPATH" Secure="yes" Value="C:\Program Files\" />
    <Property Id="X86FLDSAMEASX64" Secure="yes" Value="1" />
    <Property Id="X86ROOTPATH" Secure="yes" Value="C:\Program Files (x86)\" />


  <Fragment>

    <UI>
      <Dialog Id="SQLSvrInstanceDlg"
              Title="[ProductName] [Setup]" NoMinimize="yes">

        ~Snip~

        <Control Type="Edit" Id="TxtX64Folder" X="45" Y="170" Width="220" Height="18" Property="X64ROOTPATH" Indirect="no">
        </Control>

        ~Snip~

        <!--X86 Install Folder-->

        <Control Id="X86SAMEASX64" Type="CheckBox"
                 TabSkip="no" CheckBoxValue="1" Property="X86FLDSAMEASX64" Text="Use same X64 drive(&amp;S):">
          <Publish Property="X86ROOTPATH" Value="[X64ROOTPATH]] (x86)"><![CDATA[X86SAMEASX64 = "1"]]></Publish><!--It seems I cannot write such condition in Publish tag, I simply want to show what I want to do...-->
        </Control>

        ~Snip~

        <Control Type="Edit" Id="TxtX86Folder" X="45" Y="225" Width="220" Height="18" Property="X86ROOTPATH" Indirect="no">
          <Condition Action="disable"><![CDATA[X86FLDSAMEASX64 = "1"]]></Condition>
          <Condition Action="enable"><![CDATA[X86FLDSAMEASX64 <> "1"]]></Condition>
        </Control>

        ~Snip~

      </Dialog>
    </UI>
  </Fragment>
</Wix>

光命令错误是LGHT0204:ICE03上面的错误语法。但似乎逃避http://windows-installer-xml-wix-toolset.687559.n2.nabble.com/error-LGHT0204-ICE03-Invalid-format-string-when-use-quot-quot-in-value-td4763093.html并不能解决这个问题。

      <Publish Property="X86ROOTPATH" Value="[X64ROOTPATH]] (x86)"><![CDATA[[\[X86SAMEASX64[\]] = "1"]]></Publish>

1 个答案:

答案 0 :(得分:0)

对不起,请忘了。只是我的愚蠢错误.... orz。我将属性与复选框ID混淆....

      <Publish Property="X86ROOTPATH" Value="[X64ROOTPATH] (x86)" Order="5"><![CDATA[X86FLDSAMEASX64 = "1"]]></Publish>