简体   繁体   English

WiX安装程序浏览对话框不会更新文本字段

[英]WiX installer browse dialog doesn't update text field

I have the following two controls in my WiX installer that render and work correctly most of the time: 我的WiX安装程序中有以下两个控件,它们在大多数情况下可以正常渲染和正常工作:

            <Control Id="LogPathEdit" Type="Edit" X="134" Y="71" Width="130" Height="15" Property="LOGPATH" Text="[LOGPATH]">
                <Condition Action="hide"><![CDATA[&Server<>3]]></Condition>
                <Condition Action="show"><![CDATA[&Server=3]]></Condition>
            </Control>
            <Control Id="btnDirBrowse" Type="PushButton" Width="56" Height="17" X="268" Y="70" Text="Browse..." >
                <Condition Action="hide"><![CDATA[&Server<>3]]></Condition>
                <Condition Action="show"><![CDATA[&Server=3]]></Condition>
              <Publish Property="_BrowseProperty" Value="LOGPATH" Order="1">1</Publish>
              <Publish Event="SpawnDialog" Value="BrowseDlg" Order="2">1</Publish>
            </Control>

However if I edit the LogPathEdit text box before I browse for a directory, the text box doesn't get updated with the value selected from the browse directory dialog. 但是,如果在浏览目录之前编辑LogPathEdit文本框,则该文本框不会使用从浏览目录对话框中选择的值进行更新。 If I just click on the Browse... button and select a directory, the text field gets updated and works correctly. 如果我仅单击“ 浏览...”按钮并选择目录,则文本字段将更新并正常工作。

I've looked at these two links, but they don't solve my issue: 我看了以下两个链接,但它们不能解决我的问题:

Use WiX browser dialog to set edit box value 使用WiX浏览器对话框设置编辑框值

Using a WiX property from a browse dialog 在浏览对话框中使用WiX属性

Changing the Type from Edit to LogPathEdit solved the issue. 将类型从编辑更改为LogPathEdit解决了该问题。 Here's the new line: 这是新行:

            <Control Id="LogPathEdit" Type="PathEdit" X="134" Y="71" Width="130" Height="15" Property="LOGPATH" Text="[LOGPATH]">

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM