简体   繁体   English

在Visual Studio中为多个应用程序创建安装项目

[英]Creating a Setup Project for multiple applications in Visual Studio

Suppose I have two application - App A and App B which are already created and are working fine. 假设我有两个应用程序-App A和App B,它们已经创建并且运行良好。 Now I want to create a new setup project which can be used to create a setup file for both of the applications. 现在,我想创建一个新的安装项目,该项目可用于为两个应用程序创建安装文件。 Can this be possible of creating a setup file for installing both apps? 可以创建用于安装两个应用程序的安装文件吗? Also I want to perform the installation in such a way that - once the App A is installed then only the installation of App B should begin. 我还想以一种方式执行安装-一旦安装了App A,则仅应开始安装AppB。

Thanks. 谢谢。

With VS setup projects you can create one setup (I assume you mean an MSI setup and not ClickOnce) that contains "everything" from both apps - the files, the shortcuts, dependencies etc. Then you will have a single setup that will install and give you one entry in Programs&Features. 使用VS安装程序项目,您可以创建一个包含两个应用程序中“所有内容”的安装程序(我假设您的意思是MSI安装程序,而不是ClickOnce),包括文件,快捷方式,依赖项等。然后您将拥有一个安装程序,可以安装和在“程序和功能”中给您一个条目。 There's often no need to have a "A must install ok before B installs" because that single combined setup is transactional, like all MSI installs - if anything fails then the entire install rolls back. 通常不需要“ A必须先安装好,然后B才能安装”,因为与所有MSI安装一样,单个组合设置是事务性的-如果任何失败,则整个安装将回滚。

If A just contains functionality that happens to be packaged as an MSI that B and other products are going to use, then sometimes people just build A as a merge module and include it into B (and the other setups) but that depends on why there are two setups and the business/workflow requirements. 如果A仅包含恰好打包为B和其他产品将要使用的MSI的功能,则有时人们只是将A构建为合并模块并将其包含到B(和其他设置)中,但这取决于为什么要这样做有两个设置以及业务/工作流程要求。

There's no VS support for combinining separate MSI files into one setup and conditioning B on the success of A. You may as well just write a launcher that runs both MSIs, but you'll see two sets of UI and two entries in Programs&Features, but you don't say if these are things you want to avoid or not. 没有VS支持将单独的MSI文件合并为一个设置,并以A成功为条件B。您也可以编写运行两个MSI的启动器,但是您会在Programs&Features中看到两组UI和两个条目,但是您不会说是否要避免这些事情。 Obviously if B depends on A and there are two entries in Programns&Features it's possible a user could uninstall A and break B. 显然,如果B依赖于A并且在Programns&Features中有两个条目,则用户可能会卸载A并破坏B。

The main issue is whether you just want a launcher that will install some number of MSI files each with their own UI and entry in Programs&Features, or you want an integrated experience that makes multiple MSI files install and uninstall as a single product. 主要问题是您是否只是想要一个启动程序,该启动程序将安装一定数量的MSI文件,每个文件都有其自己的UI和在“程序和功能”中的条目,还是想要使多个MSI文件作为一个产品进行安装和卸载的集成体验。

Apart from that, I've known people build their MSI files with something like VS and then use the WiX Burn bootstrapper to combine them into one product, where the Programs&Features entry combines all the MSI files. 除此之外,我知道人们使用诸如VS之类的东西来构建他们的MSI文件,然后使用WiX Burn引导程序将它们组合为一个产品,其中Programs&Features条目将所有MSI文件组合在一起。

There used to be the Bootstrap Manifest Generator tool that would let you add A as a prerequisite so setup.exe would install prerequisites, including A, and then install B, but that tool and its docs are hard to find since setup projects got taken away in VS 2012. 曾经有Bootstrap Manifest Generator工具,该工具可让您添加A作为必备软件,因此setup.exe将先安装必备软件(包括A),然后再安装B,但是由于安装项目被删除,因此很难找到该工具及其文档。在VS 2012中。

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

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