Creating a Setup Project for multiple applications in Visual Studio

感情迁移 提交于 2021-01-28 12:05:22

问题


Suppose I have two application - App A and App B which are already created and are working fine. 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.

Thanks.


回答1:


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. 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.

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.

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. 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.

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.

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.

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.



来源:https://stackoverflow.com/questions/31267236/creating-a-setup-project-for-multiple-applications-in-visual-studio

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!