I am trying to perform a check of whether Visual C++ version 2015-2019 redistributable is installed on the clients system.
The filename is VC_redist.x64.exe, which I also have installed on my own Windows 10 OS. The product version is 14.28.29913
I am attempting to use a MsiProductCheck to check for the install.
As I also have this file installed on my system, when I check the registry for the version 14.28.29913, it returns the following registry path, which does list that file version.
HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Installer\Dependencies\Microsoft.VS.VcLibrary_CRT_clickonce_enu,v14
The above key lists a DisplayName of vcpp_crt.redist.clickonce, and ProductCode of {C0A2A578-778A-4300-9DC9-185E6893816C}.
Based on the above registry values, in my product.xml file, under <InstallChecks> I ran the following check.
<InstallChecks>
<MsiProductCheck Property="VCRedistInstalled" Product="{C0A2A578-778A-4300-9DC9-185E6893816C}"/>
</InstallChecks>
Under InstallConditions, I have the following code.
<InstallConditions>
<BypassIf Property="VCRedistInstalled" Compare="ValueGreaterThanOrEqualTo" Value="5"/>
</InstallConditions>
However, this returns MsiQueryProductState = -1 and the install.log reports the following error messages.
Result of checks for command 'vcredist_x64\VC_redist.x64.exe' is 'Fail'
'vcpp_crt.redist.clickonce' RunCheck result: Fail
A prerequisite failed for Package "vcpp_crt.redist.clickonce"
It is my understanding that a value of "5" indicates the file is installed, but that a -1 indicates "The product is neither advertised or installed." However, it IS installed on my system.
Am I passing the wrong ProductCode to the MsiProductCheck? Please advise.