WixSharp注入多个自定义CLR对话框

本文关键字:CLR 对话框 自定义 注入 WixSharp | 更新日期: 2023-09-27 17:50:22

使用WixSharp,我们可以插入一个自定义System.Windows.Forms窗口作为对话框。

project.InjectClrDialog("ShowCustomDialog", Dialogs.InstallDirDlg, Dialogs.VerifyReadyDlg);
[CustomAction]
public static ActionResult ShowCustomDialog(Session session)
{
    return WixCLRDialog.ShowAsMsiDialog(new MyCustomDialog(session));
}

MyCustomDialog是从WixCLRDialog类派生出来的。

如果我有连续的自定义对话框(在System.Windows.Forms中完成)要显示。如何插入?

WixSharp注入多个自定义CLR对话框

最简单的方法是将多个对话框打包到一个UI shell中,并允许shell在对话框之间导航。如果你采用这种方法,那么你只需要注入一个shell-ClrDialog。

顺便说一句,带有多个CLR对话框的UI shell是我计划很快发布的一个功能。

奥列格