简体   繁体   中英

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:

            <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. 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

Using a WiX property from a browse dialog

Changing the Type from Edit to LogPathEdit solved the issue. Here's the new line:

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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