How to detect whether I need to install VCRedist?

lImbus picture lImbus · Apr 8, 2009 · Viewed 45.2k times · Source

I have a question very similar to this one but the answer does not work for me.

Software I am maintaining the setup for depends on VC++ 2008 (SP1, precisely), thus I need to find a solution to install VCRedist if not yet installed. I understand the correct way would be to build msi with merge modules, but it's not on my hands.

The answer of the duplicate question I am referring to (the accepted one) does not work for me because every tiny release (e.g. 9.0.30729.01 vs 9.0.30729.17) has proper GUIDs, which I am not able to guess or predict for future versions. Furthermore, I reckon that this would not detect Visual Studios and thus unnecessarily install the VCRedist Package when it's already on a developers machine. I do not want to bug anybody with this, certainly not somebody who has already a DevStudio installed.

Now another answer says I should look in the WinSxs-folder like $WINDIR\WinSxS\x86_Microsoft.VC80.CRT_ but this does not (yet) help me to imply SP1, or is there anything I am missing at this point ? Is there a table somewhere with the internal and "external" version numbers, so I could imply a certain minor version number ?

I cannot believe that there is nothing provided by Microsoft for this scenario, but searching the interwebs for already far too long now brings me back to good ol' SO :)

Answer

Jedidja picture Jedidja · Dec 18, 2011

For Visual Studio C++ 2010, things got a bit easier.

Unlike the Visual C++ 2005 and 2008 redistributable packages, there are registry keys that can be used to detect the presence of the Visual C++ 2010 redistributable package.

Visual C++ 2010 redistributable package detection registry values

Visual C++ 2010 Redistributable Package (x86)

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\10.0\VC\VCRedist\x86] Installed = 1 (REG_DWORD)

Visual C++ 2010 Redistributable Package (x64)

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\10.0\VC\VCRedist\x64] Installed = 1 (REG_DWORD)

Visual C++ 2010 Redistributable Package (ia64)

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\10.0\VC\VCRedist\ia64] Installed = 1 (REG_DWORD)

Note: You will need to check under Wow6432Node on a 64-bit OS. (HKLM\Software\Wow6432Node\Microsoft....)

If you like the older version, here are the GUIDs

Visual C++ 2010 redistributable package product codes

  • Visual C++ 2010 Redistributable Package (x86) - {196BB40D-1578-3D01-B289-BEFC77A11A1E}
  • Visual C++ 2010 Redistributable Package (x64) - {DA5E371C-6333-3D8A-93A4-6FD5B20BCC6E}
  • Visual C++ 2010 Redistributable Package (ia64) - {C1A35166-4301-38E9-BA67-02823AD72A1B}

Visual C++ 2010 SP1 redistributable package product codes

  • Visual C++ 2010 SP1 Redistributable Package (x86) - {F0C3E5D1-1ADE-321E-8167-68EF0DE699A5}
  • Visual C++ 2010 SP1 Redistributable Package (x64) - {1D8E6291-B0D5-35EC-8441-6616F567A0F7}
  • Visual C++ 2010 SP1 Redistributable Package (ia64) - {88C73C1C-2DE5-3B01-AFB8-B46EF4AB41CD}