【发布时间】:2020-08-21 07:30:00
【问题描述】:
我是 WIX 的新手。我想验证文本框等输入控件不为空,密码和确认密码是否相同。 我尝试在自定义操作中执行此操作,但无法发送参数。 如果我发送参数如何返回值以留在同一安装页面中。
<Dialog Id="XXX" Width="370" Height="270" Title="Installation">
<Control Id="Next" Type="PushButton" X="236" Y="243" Width="56" Height="17" Default="yes" Text="!(loc.WixUINext)" >
<Publish Event="DoAction" Value="CheckingPID">1</Publish>
<Publish Event="SpawnDialog" Value="InvalidPidDlg">PIDACCEPTED = "0"</Publish>
<Control Id="Usernamelbl" Type="Text" X="20" Y="100" Width="95" Height="10" NoPrefix="yes" Property="WIXUI_INSTALLDIR" Text="Username:" />
<Control Id="UsernameVal" Type="Edit" X="125" Y="100" Width="200" Height="17" Property="SETUSERNAME" Indirect="no" Disabled="no" />
</Dialog>
<CustomAction Id="CheckingPID" BinaryKey="CustomActionBinary" Impersonate="no" DllEntry="Validate" Execute="immediate" Return="check"/>
[CustomAction]
public static ActionResult Validate(Session session)
{
MessageBox.Show(Session.CustomActionData["SETUSERNAME"]);
return ActionResult.Success;
}
这是正确的验证方式还是其他任何验证方式。
提前致谢
【问题讨论】: