visual-studio 如何在单个 MSI 中部署多个项目?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/295138/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-22 09:56:23  来源:igfitidea点击:

How to deploy multiple projects in a single MSI?

visual-studiowindows-installer

提问by Damian Powell

I have 3 projects in my solution that I want to deploy. Is there a nice and quick way of using Visual Studio's setup projects to deploy all three apps using one MSI and letting the user decide which apps he wants to install during the install process?

我的解决方案中有 3 个项目要部署。是否有使用 Visual Studio 的安装项目使用一个 MSI 部署所有三个应用程序并让用户决定他要在安装过程中安装哪些应用程序的快速方法?

I have setup projects for the 3 individual apps, I also have an overarching setup project that has the output of those other three projects. Am I on the right track or is there a better way?

我为 3 个单独的应用程序设置了项目,我还有一个总体设置项目,其中包含其他三个项目的输出。我是在正确的轨道上还是有更好的方法?

回答by Damian Powell

I think you probably want merge modules. Accrding to MSDN:

我想你可能想要合并模块。根据 MSDN:

A merge module is a standard feature of Microsoft Windows Installer that packages components together with any related files, resources, registry entries, and setup logic. You can use merge modules to install components that multiple applications share. You cannot install merge modules directly. You must merge them into deployment projects.

合并模块是 Microsoft Windows Installer 的标准功能,它将组件与任何相关文件、资源、注册表项和安装逻辑打包在一起。您可以使用合并模块来安装多个应用程序共享的组件。您不能直接安装合并模块。您必须将它们合并到部署项目中。

http://support.microsoft.com/kb/827025

http://support.microsoft.com/kb/827025

In your case, each application would be a merge module and you would need to provide some UI to select which applications you would like to install. You could modify one of the default page templates to do that.

在您的情况下,每个应用程序都是一个合并模块,您需要提供一些 UI 来选择要安装的应用程序。您可以修改默认页面模板之一来执行此操作。

回答by Rob McCready

If using WiX (which I suggest doing) then you break each project down into its components, each project would be represented as a Feature in WiX/MSI which you can do conditional installs on. The standard tree dialog on installers for selecting features is based on this and the WiX examples have a ready made UI that uses it.

如果使用 WiX(我建议这样做),那么您将每个项目分解为其组件,每个项目将表示为 WiX/MSI 中的一个功能,您可以对其进行有条件的安装。用于选择功能的安装程序上的标准树对话框基于此,并且 WiX 示例具有使用它的现成 UI。

As for merge modules the lead developer of WiX was involved in the early creation of the Merge Module specs and he reccomends using .wixlibs now. See Here

至于合并模块,WiX 的首席开发人员参与了合并模块规范的早期创建,他建议现在使用 .wixlibs。看这里

WiX v3 Docs

WiX v3 文档

回答by Rob McCready

I also have a similar requirement, however i used merge modules but cant seem to find a way of selecting which specific msm to install and which not to. As i understand there is a no condition property which can be set on msm's while integrating them with msi's. Please let me know if there is some alternate way of doin so..

我也有类似的要求,但是我使用了合并模块,但似乎无法找到一种选择安装和不安装特定 msm 的方法。据我所知,没有条件属性可以在 msm 上设置,同时将它们与 msi 集成。请让我知道是否有其他方法可以这样做..

Thanks, Apn

谢谢,阿普

回答by Leon Tayson

You can use Wix as i've posted here -->

您可以使用我在此处发布的 Wix -->

VS 2005 Setup Projects: Deploy Many Projects With One MSI

VS 2005 安装项目:使用一个 MSI 部署多个项目