I know how to include the .NET Framework 4 as a dependency to my installer Setup Project in Visual Studio 2010. However, is there a configuration to set to make the installer check if the dependency is available, and then install .NET 4 on the machine when it isn't?
At the moment all it does is include the .NET Framework 4 installer in a separate folder in the "Release" output folder.
UPDATE:
- I do have the .NET Framework 4 set as a launch condition.
- I do have the .NET Framework 4 set as a precondition.
- One thing I notice, in the launch conditions window, I cannot delete the current .NET Framework launch condition, and the option "Add .NET Framework Launch Condition" is greyed out.
You need to add an launch condition in addition to making a pre-requisite (as described in your link):
http://msdn.microsoft.com/en-us/library/xxyh2e6a.aspx
You need a prerequisite instead of a launch condition:
- in your setup project Launch Conditions Editor remove the .NET Framework launch condition
- right-click your setup project in Solution Explorer and select Properties
- click Prerequisites button in the shown property page
- make sure that the appropriate .NET Framework prerequisite is checked
Optionally, you can create your own custom prerequisite instead of using the predefined one.
Launch conditions stop the install when not met. Prerequisites are packages which are automatically detected and installed before your main installation.