如果 CustomAction 中显示任何错误,我可以停止设置吗?因为我可以在自定义操作中显示错误消息,它会显示错误消息,但是一旦我点击确定按钮,我的下一个 UI 序列表单就会出现。我将如何强制用户完成按钮?
添加我的源代码:
<Binary Id="BIN_CustomAction" SourceFile="CustomAction.CA.dll" />
<CustomAction Id="CA_CheckList" BinaryKey="BIN_CustomAction" DllEntry="CA_CheckList" Execute="immediate" Impersonate="yes" Return="ignore" />
<UI Id="MyWixUI_Mondo">
<UIRef Id="WixUI_Mondo" />
<UIRef Id="WixUI_ErrorProgressText" />
<DialogRef Id="UserRegistrationDlg" />
<Dialog Id="UserRegistrationDlg" Width="370" Height="270" Title="[ProductName] Setup" NoMinimize="yes">
<Control Id="ComboBoxMain" Type="ComboBox" X="124" Y="158" Width="241" Height="16" Property="LOCATIONNAME">
</Control>
<Control Id="Back" Type="PushButton" X="180" Y="243" Width="56" Height="17" Text="&Back">
<Publish Event="NewDialog" Value="LicenseAgreementDlg">1</Publish>
</Control>
<Control Id="Next" Type="PushButton" X="236" Y="243" Width="56" Height="17" Default="yes" Text="&Next">
<Publish Event="SpawnDialog" Value="SetupTypeDlg">1</Publish>
</Control>
<Control Id="Cancel" Type="PushButton" X="304" Y="243" Width="56" Height="17" Cancel="yes" Text="Cancel">
<Publish Event="SpawnDialog" Value="CancelDlg">1</Publish>
</Control>
</Dialog>
<Control Id="Next" Type="PushButton" X="180" Y="243" Width="56" Height="17" Text="&NExt">
<Publish Event="DoAction" Value="RadioButtonCheck">1</Publish>
</Control>
</Dialog>-->
<Publish Dialog="LicenseAgreementDlg" Control="Next" Event="NewDialog" Value="UserRegistrationDlg" Order="3">
LicenseAccepted = "1"
</Publish>
<Publish Dialog="SetupTypeDlg" Control="Back" Event="NewDialog" Value="UserRegistrationDlg">1</Publish>
</UI>
<InstallUISequence>
<Custom Action="CA_CheckList" Before="AppSearch">Not Installed</Custom>
</InstallUISequence>
[CustomAction]
public static ActionResult CA_CheckList(Session session)
{
if (installer.ListStatus == false)
{
// dispaly
Record record = new Record();
record.FormatString = string.Format("Error!");
session.Message(
InstallMessage.Error | (InstallMessage)(MessageIcon.Error) |
(InstallMessage)MessageButtons.OK,record);
return ActionResult.Failure;
}
else
{
return ActionResult.Success;
}
}
添加屏幕截图也证明一旦我单击图像(1)的确定按钮,我的下一个对话框即图像(2)正在出现:- 当我收到错误时,我需要的是完成对话框。
1)
2)
Any idea??kindly help me.