Checking .NET Version with Wix February, 2009
Checking for a specific .NET version is fairly simple with Wix. The following fragment illustrates how to make .NET 3.5 an installation requirement. Two things to note are: 1) The value is prefixed with a pound sign because it is a DWORD in the registry. The RegistrySearch element will prefix values differently depending on the registry data type. 2) The condition is only evaluated when installing, not uninstalling (By using the "Installed" variable). If for some reason your required version of .NET gets uninstalled you still want to be able to uninstall your app.
<Wix ... > <Product ... > <Package ... /> <Property Id="NET_FRAMEWORK_INSTALLED"> <RegistrySearch Id='NetFrameworkCheck' Type='raw' Root='HKLM' Key='SOFTWARE\Microsoft\NET Framework Setup\NDP\v3.5' Name='Install' /> Property> <Condition Message=".NET Framework 3.5 is not installed, go pound salt."> Installed OR (NET_FRAMEWORK_INSTALLED = "#1" AND NOT Installed) Condition> Do other things... Product> Wix>You can also check the exact version by looking at the "Version" reg value. Since this value is a string it will not be prefixed (Unless the first character is a pound sign, see the docs for more info).