.Net中的自定义安装程序显示安装程序后面的表单

Man*_*lia 8 c# installer windows-installer custom-action winforms

[RunInstaller(true)]
public partial class Installer1 : Installer
{
    public Installer1()
    {
        InitializeComponent();
    }

    public override void Install(System.Collections.IDictionary stateSaver)
    {
        base.Install(stateSaver);
    }
    private void Installer1_AfterInstall(object sender, InstallEventArgs e)
    {
        Form1 topmostForm = new Form1();
        topmostForm.BringToFront();
        topmostForm.TopMost = true;            
        topmostForm.ShowDialog();
  } }
Run Code Online (Sandbox Code Playgroud)

我需要在默认的Windows Installer UI前面显示topmostForm.以上是我用于创建表单的CustomAction中的示例代码.设置TopMost属性或使用ShowDialog没有帮助.有没有其他解决方案可以让我的表格成为最重要的?

Fré*_*idi 3

如果您想在安装程序中显示您自己的 UI,您将无法使用安装和部署项目,因为它缺乏实现该功能所需的功能。考虑使用WiXInno Setup等安装程序工具包。

关于问题的第一部分,您是否将参数中的自定义对话框传递ownerMessageBox.Show()