简体   繁体   English

如何从其他设置运行安装程序?

[英]How to run a setup from another setup?

I have a solution with 3 modules. 我有3个模块的解决方案。 Windows, Web, and Windows Service. Windows,Web和Windows服务。 I want to create one parent setup that runs three child setup packages regarding to the user choose. 我想创建一个父设置,运行三个与用户选择有关的子设置包。

I created a setup project as the following: 我创建了一个安装项目,如下所示:

  • I created a library that contains InstallerHelper which is inherited from Installer class 我创建了一个包含InstallerHelper的库,它继承自Installer
  • I added the following code: 我添加了以下代码:

public override void Install(IDictionary stateSaver)
{
    base.Install(stateSaver);
    try
    {
        FileInfo fileInfo = new FileInfo(System.Reflection.Assembly.GetExecutingAssembly().Location);

        string sProgram = Path.Combine(fileInfo.DirectoryName, "Setup1.msi");

        Process p = Process.Start(sProgram);
        p.WaitForExit();
    }
    catch (Exception exc)
    {
        Context.LogMessage(exc.ToString());
        throw;
    }
}

The problem is that the windows installer refuses to run multiple instances of windows installer and throws the following error: 问题是Windows安装程序拒绝运行多个Windows安装程序实例并抛出以下错误:

Another installation is in progress. 另一个安装正在进行中。 You must complete that installation before continuing this one. 在继续此安装之前,您必须完成该安装。

Is my approach correct? 我的方法是否正确? Is ther another way to run another setup and the parent setup should wait all of them with one Finish click?. 另一种方法是运行另一个设置,父设置应该等待所有这些设置点击完成吗?

You can use Wix Burn to create a setup package contained multiple application installers (msi/exe): 您可以使用Wix Burn创建包含多个应用程序安装程序(msi / exe)的安装程序包:

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM