通过wix中的用户选择设置属性值 [英] Set property value from user selection in wix

查看:134
本文介绍了通过wix中的用户选择设置属性值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个带有3个单选按钮的窗口(删除了所有不有趣的道具):

I have a window with 3 radiobuttons like this(removed all non interesting props):

<Control Id="Back" Type="PushButton" Text="!(loc.WixUIBack)">
   <Publish Event="NewDialog" Value="InstallDirDlg">1</Publish>
</Control>
<Control Id="Cancel" Type="PushButton" Text="!(loc.WixUICancel)">
   <Publish Event="SpawnDialog" Value="CancelDlg">1</Publish>
</Control>
<Control Id="Next" Type="PushButton" Text="!(loc.WixUINext)">
   <Publish Event="NewDialog" Value="VerifyReadyDlg">1</Publish>
</Control>
<Control Id="InstallTypeSelection" Type="RadioButtonGroup" Property="INSTALL_TYPE">
   <RadioButtonGroup Property="INSTALL_TYPE">
      <RadioButton Value="0" Text="InstallType A" />
      <RadioButton Value="1" Text="InstallType B" />
      <RadioButton Value="2"Text="InstallType C" />
   </RadioButtonGroup>

在下一个"中,我要根据用户选择的安装类型设置一些属性.

On "next" I want to sett some propertys based on what the Installtype the user did select.

像这样..

if(INSTALL_TYPE == 0)
{
   REG_VALUE_AUTO_LOGIN = 0;
   REG_VALUE_TIMEOUT = 300;
}
if(INSTALL_TYPE == 1)
{
   REG_VALUE_AUTO_LOGIN = 1;
   REG_VALUE_TIMEOUT = 600;
}

在wix中如何工作?

推荐答案

一周前,我遇到了类似的情况.我不正确地记住语法,但是它看起来像这样.就我的口味而言,它不是很干净,但是应该可以完成工作.

I run into something like this a week ago. I don't remember the syntax correctly, but it looks something like this. For my taste, it not very clean, but it should do the work.

<Control Id="Next" Type="PushButton" Text="!(loc.WixUINext)">
   <Publish Event="NewDialog" Value="VerifyReadyDlg">1</Publish>
   <!-- INSTALL_TYPE == 0 -->
   <Publish Property="REG_VALUE_AUTO_LOGIN" Value="1">INSTALL_TYPE  = "0"</Publish>
   <Publish Property="REG_VALUE_TIMEOUT" Value="300">INSTALL_TYPE  = "0"</Publish>

   <!-- INSTALL_TYPE == 1 -->
   <Publish Property="REG_VALUE_AUTO_LOGIN" Value="1">INSTALL_TYPE  = "1"</Publish>
   <Publish Property="REG_VALUE_TIMEOUT" Value="600">INSTALL_TYPE  = "1"</Publish>

   <! -- FINALLY, CALL NEXT DIALOG : added by Chris Painter -->
   <Publish Event="NewDialog" Value="VerifyReadyDlg">1</Publish> 

</Control>

我没有时间对其进行测试,但是我认为这是最少的方法. 希望对您有所帮助.

I didn't have the time to test it, but I think it the way to go for the least. I hope it going to help you.

干杯.

这篇关于通过wix中的用户选择设置属性值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆