.Net 中的自定义安装程序显示安装程序后面的表单 [英] Custom Installer in .Net showing Form behind installer

查看:19
本文介绍了.Net 中的自定义安装程序显示安装程序后面的表单的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

[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();
  } }

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

I need to display the topmostForm in front of the default Windows Installer UI. The above is sample code inside my CustomAction that I am using to create a Form. Setting the TopMost property or using ShowDialog is not helping. Is there any other solution to make my form the top most and focussed?

推荐答案

如果您想在安装程序中显示您自己的 UI,您将无法使用安装和部署项目,因为它缺少必要的功能执行那个.考虑使用安装工具包,如 WiXInno Setup 代替.

If you want to show your own UI in the installer, you won't be able to use a setup and deployment project, because it lacks the features necessary to implement that. Consider using an installer toolkit like WiX or Inno Setup instead.

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

Concerning the first part of your question, are you passing the custom dialog box in the owner argument to MessageBox.Show()?

这篇关于.Net 中的自定义安装程序显示安装程序后面的表单的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆