I'm trying to modify an existing Wix script to check that .NET 4.0, rather than .NET 2.0 is installed before proceeding. This is currently done using a custom action in the wxs file:
<InstallUISequence>
<Custom Action="VSDCA_VsdLaunchConditions" Before="ValidateProductID">NOT Installed</Custom>
</InstallUISequence>
I can't find any setting to change so that it checks for .NET 4.0 rather than 2.0. It seems to be hard-coded, is it linked to the version of Wix or Windows Installer perhaps? We are currently using Wix 3.0. If only .NET 4.0 is installed on the machine then the following error is in the installer log:
Action start 15:53:36: VSDCA_VsdLaunchConditions. Info 2898. For VSI_MS_Sans_Serif13.0_0_0 textstyle, the system created a 'MS Sans Serif' font, in 0 character set, of 13 pixels height. DEBUG: Error 2835: The control ErrorIcon was not found on dialog ErrorDialog The installer has encountered an unexpected error installing this package. This may indicate a problem with this package. The error code is 2835. The arguments are: ErrorIcon, ErrorDialog, This setup requires the .NET Framework version 4.0 Action ended 15:53:39: VSDCA_VsdLaunchConditions. Return value 3. Action ended 15:53:39: INSTALL. Return value 3.
If .NET 2.0 is installed then it proceeds with the installation.
I've since discovered that the set-up project was originally created in VS2005 and converted into a Wix project using dark etc. This extracts a file called MSVBDPCA.dll that checks for .NET 2.0 via the <CustomAction Id="DIRCA_CheckFX" BinaryKey="MSVBDPCADLL" DllEntry="CheckFX" />
action.
Creating a new set-up project in VS2010, then converting to Wix creates a new MSVBDPCA.dll that checks for .NET 4.0.