如何设置WiX中UI控件的默认值?
如何在 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>
How can I set the default value of a UI control in WiX installer?
When I change the value in the control, the changes are propagated to the property. But I want some specific value to be set when the dialog is first displayed.
<?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>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以将
Indirect="yes"
添加到您的控件定义中,之后该控件将显示您的属性值,并且对控件的所有更改将立即更改您的属性。例如,
you may add
Indirect="yes"
to yout control definition, after that control will display your property's value and all changes to control will change your property immideately.for example,
这似乎对我有用(
Indirect="yes"
不起作用)。当该对话框显示时,控件在框中显示该值作为其值。This seemed to work for me (
Indirect="yes"
didn't work). When that dialog was shown, the control had Show this value in the box as its value.