问题
I have created an .msi installer. I want to further add prerequisites (such as .Net) but when I go to Setup Project properties, the Prerequisites button is disabled. How do I enable it?
Other details:
- I'm using VS 2015, SQL Server 2008 R2, .Net 4.5.2, C#, WinForms, Win 10 Pro x64
- My setup project is in the same solution as the main project
回答1:
Prerequisities in Visual Studio Projects
In Configuration
at the top of the dialog, did you try to select either Release
or Debug
? That should enable the Prerequisites...
button.
Unecessary, outdated prerequisites?
One pet-peeve of mine: is it really necessary to include the .NET runtime as a prerequisite when most users have it installed by their deployment team (corporations) or via Windows Update (home and small office users)?
If there are security updates for the runtime, your old, embedded runtime is just a nuisance to be honest. Corporate packagers spend a great deal of time removing runtimes and prerequisites for corporate deployment where all runtime components are packaged separately in the corporate standard format. Perhaps consider making a special corporate "large scale deployment" version of your setup bundle? Just a zip with components will be very appreciated, along with a one page PDF on how to deploy them.
For the .NET framework you could just add a launch condition to abort the installation if the runtime is not found, and tell the user to get the runtime via Windows Update or from their system administrator or deployment team.
Just a thought I wanted to share with you. Prerequisites can really bloat a setup - especially when they are almost never needed like the .NET framework. In the future we will certainly pull prerequisite packages straight from online repositories and not embed anything in our main setups (and probably struggle with new security issues from that approach).
- What version of the .NET Framework is included in what version of the OS?
- Selectively disable versions of the .NET Framework (.NET versions overwrite each other)
WiX and other deployment technologies
Setup projects are rather limited. If you find yourself needing more features, you might want to check out the WiX toolkit.
Here is a previous answer on WiX and other deployment tools that seems to have been helpful for people: MSI vs nuget packages: which are is better for continuous delivery?
来源:https://stackoverflow.com/questions/48704781/prerequisites-button-disabled-msi-installer