如何在 WiX 安装程序中设置 UI 控件的默认值?
当我更改控件中的值时,更改将传播到属性。但是我希望在第一次显示对话框时设置一些特定的值。
<?xml version="1.0" encoding="utf-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Fragment>
<Property Id="PORT" Value="8731" />
<UI>
<Dialog Id="MyDialog" Width="370" Height="270" Title="Service protocol configuration">
<!-- ... -->
<Control Type="Edit" Id="PortEdit" Width="52" Height="15" X="79" Y="68" Text="8731" Property="PORT" Integer="yes" />
</Dialog>
</UI>
</Fragment>
</Wix>
最佳答案
您可以添加 Indirect="yes"
对于您的控件定义,在该控件将显示您的属性值之后,对控件的所有更改都会立即更改您的属性。
例如,
<Dialog Id="InstallDirDlgMine" Width="370" Height="270" Title="!(loc.InstallDirDlgMine_Header)">
...
<Control Id="Folder" Type="PathEdit" X="135" Y="72" Width="230" Height="20" Property="WIXUI_INSTALLDIR" Indirect="yes" />
...
</Dialog>
关于wix - 如何在 WiX 中设置 UI 控件的默认值?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6073785/