I have a wix sharp bundle that i create and I am trying to use UtilRegistrySearch to check the version of .NETFramework that is on the target machine:
new UtilRegistrySearch
{
Root = RegistryHive.LocalMachine,
Key = "SOFTWARE\Microsoft\Net Framework Setup\NDP\v4\Full",
Value = "Release",
Variable = "NetFrameworkVersion";
}
I want to take that NetFrameworkVersion variable and use that as my installcondition to install .NET framework 4.6.1 if the target machine is not at least at .NET Framework 4.5
ExePackage dotNet_exe = new ExePackage(@"prereqs\DotNet4.6.1.exe")
{
Name = "Microsoft .NET Framework 4.6.1",
InstallCommand = "/passive /norestart",
InstallCondition = "NetFrameworkVersion < 394254",
};
The problem is that the registry value I am checking is a REG_SZ and therefore the NetFrameworkVersion variable is a string. So it seems the comparison with the integer (394254) is not working. Any ideas on how I can cast the variable to an int or what I should do to define the InstallCondition correctly?
What I have tried:
Tried just setting InstallCondition to the following:
InstallCondition = "NetFrameworkVersion"
InstallCondition = "NetFrameworkVersion < 394254"
and using DetectCondition
DetectCondition = "NetFrameworkVersion",