How to check that Visual C++ 2013 redistributable is already installed using WiX bootstrapper?

6.3k Views Asked by At

I am trying to create a bootstrapper for WiX installer. I need to install VC++ 2013 redistributable packages (for both x86 and x64 platforms). And I want to skip the installation of these packages if they are already installed. To do that I add next elements to product.xml for each package:

<InstallChecks>
  <MsiProductCheck
    Property="IsMsiInstalled"
    Product="{?????????????????????????}"/> 
</InstallChecks>

<Commands>
  <Command PackageFile="vcredist_2013_x86.exe">
    <InstallConditions>
      <BypassIf Property="IsMsiInstalled" Compare="ValueGreaterThan" Value="0"/>

So the question is: what product code should be?

After Google didn't help me I tried to extract vcredist_2013_x86.exe and look at msi file properties but that was another problem. After extracting it using 7Zip I got only bunch of files with strange names like: "0", "u0", "u1", "u2" etc. File "0" turned out to be Burn manifest. It contained product codes: for x86: {13A4EE12-23EA-3371-91EE-EFB36DDFFF3E} and for x64: {A749D8E6-B613-3BE3-8F5F-045C84EBA29B}. So I tried to use them but no luck. MsiProductCheck returned -1 despite the package was installed.

Then I looked what changes happen in HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall registry key (I'm working on Win8.1). Keys added during installation and removed after deinstallation were different: {ce085a78-074e-4823-8dc1-8a721b94b76d} for x86 and {7f51bdb9-ee21-49ee-94d6-90afc321780e} for x64. But they didn't work with MsiProductCheck too. It's result was still -1 (unknown product) even if they were installed.

So I am in despair now. The only idea I have is to use RegistryCheck instead of MsiProductCheck and check for keys in Uninstall. But I would like to know what is the problem here. What product code should be used for VC++ 2013 redistributables? Why the only keys that are added during package installation don't work for MsiProductCheck?

0

There are 0 best solutions below