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

查看:93
本文介绍了在.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安装程序UI面前显示topmostForm。以上是我CustomAction内样本code,我使用创建表单。设置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,你将无法使用安装和部署项目,因为它缺乏必要的功能实施。考虑使用一个安装工具包,如维克斯或的 Inno 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.

关于你的问题的第一部分,你参数传递的自定义对话框中的所有者的 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天全站免登陆