简体   繁体   English

如何在wix安装程序的自定义对话框中验证文本?

[英]How to verify a text in custom dialog in wix installer?

For my product, I am using the wix installer and there I am using custom UI dialog. 对于我的产品,我正在使用wix安装程序,并且在那里使用自定义UI对话框。 In that dialog, I have a control of type Edit, where I am taking user's IP value. 在该对话框中,我有一个类型为Edit的控件,该控件用于获取用户的IP值。 Now I want to verify that when user press next, installer should verify the input. 现在,我要验证,当用户按下一步时,安装程​​序应验证输入。

So I am wondering how can I do it? 所以我想知道我该怎么做?

I found few examples with CDATA, where they are checking product key, but I am unable to apply it with my question, so any leads for the same ? 我发现CDATA的几个示例正在检查产品密钥,但我无法将其与我的问题一起使用,因此是否有相同的线索?

Here is my snippet for just taking value and proceeding without any check: 这是我的代码片段,它仅是取值并继续进行而没有任何检查:

 <Control Id="NameEdit" Type="Edit" X="45" Y="85" Width="220" Height="18" Property="IPVAL" Text="{80} " />
 <Control Id="Next" Type="PushButton" X="236" Y="243" Width="56" Height="17" Default="yes" Text="&amp;Next">
          <Publish Event="ValidateProductID" Value="0">1</Publish>
          <Publish Event="SpawnWaitDialog" Value="WaitForCostingDlg">CostingComplete = 1</Publish>
          <Publish Event="EndDialog" Value="Return" Order="2">ProductID</Publish>
        </Control>

It's not clear how CDATA is connected to the question, or whether you've tried anything specific, but in general you need to publish a DoAction event that calls a custom action. 目前尚不清楚CDATA如何与问题联系在一起,或者您是否尝试过任何特定的事情,但通常您需要发布一个调用自定义动作的DoAction事件。 In that custom action you get hold of the property value and validate it. 在该自定义操作中,您将掌握属性值并进行验证。 Validation usually results in setting some other property saying that validation succeeded. 验证通常会导致设置一些其他属性,表示验证成功。 Then you can disable the Next control if the validation failed, together with an error message. 然后,如果验证失败,则可以禁用Next控件以及错误消息。

The example seems pretty thorough, but if it isn't then ask a more specific question: 该示例似乎非常详尽,但如果不是,则提出一个更具体的问题:

https://www.firegiant.com/wix/tutorial/events-and-actions/control-your-controls/ https://www.firegiant.com/wix/tutorial/events-and-actions/control-your-controls/

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

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