Aaron Stebner's WebLog

Thoughts about setup and deployment issues, WiX, XNA, the .NET Framework and Visual Studio

Mailbag: How to detect the presence of the Visual C++ 2010 redistributable package

Mailbag: How to detect the presence of the Visual C++ 2010 redistributable package

Rate This
  • Comments 64

Question:

I have seen your previous blog posts that describe how to detect the presence of the Visual C++ 2005 redistributable package and the Visual C++ 2008 redistributable package.  I am creating an installer that requires the Visual C++ 2010 runtime files.  How can I detect the presence of the Visual C++ 2010 redistributable package?

Answer:

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




Alternatively, like in past releases of the Visual C++ redistributable package, you can use an algorithm like the one I described in my previous blog posts to detect the presence of the Visual C++ 2010 redistributable package on a system:

  1. Call the MsiQueryProductState API
  2. Pass in the product code for the package that you want to detect based on the list below
  3. Check the return value of this API.  If it is anything other than INSTALLSTATE_DEFAULT, the package is not yet installed

Visual C++ 2010 redistributable package product codes

Visual C++ 2010 SP1 redistributable package product codes

<update date="4/12/2011"> Added product codes for Visual C++ 2010 SP1 redistributable packages. </update>

 

  • It should be Version 40219.325 but the security patch install version 40219.1. The scanner is Nessus

  • Hi Mjocasio23 - Are you referring to this update - support.microsoft.com/.../2565063  If so, and if you've already installed it, then it is possible that there is a problem with the detection logic in the scanning software you're using.  If that's the case, you'll likely need to contact the manufacturer to see if they have any known issues related to detection of VC++ redistributable updates.

  • I see what you saying; they confirm that is the version they expecting to be used for that dll...

    Kind of stuck.... Do not know what to do....

  • I take that back..... Yes that is the KB article and the version is suggesting for file mfc100.dll is 40219.325..... I under hand the software associated with the installtion of software is Microsoft Visual C++ 2010 Runtime version 10.0.40219.To my understanding the article is pointing to software Microaoft Visual C++ 2010 Redistributable x86 in a Winodws Server 2003 Machine. Is it possible the machine does not have the correct security update patch for this file.

  • Hi Mjocasio23 - Do you know exactly what the scanning software is looking for when it determines that you have version 40219.1 instead of 40219.325?  Is it a registry key, a version of a specific file (if so, which one), etc?

  • Yes the scanner is specting version 40219.325 for mfc100.dll

  • This is the outcome of the scanner

    - e:\Program Files\Microsoft Visual Studio 10.0\VC\redist\x86\Microsoft.VC100.MFC\mfc100.dll has not been patched

    Remote version : 10.0.40219.1

    Should be : 10.0.40219.325

  • Hi Mjocasio23 - Have you confirmed that this computer has this security update package installed, and if so, can you double-check the version of that file manually (as opposed to letting the scanner check for you)?  If the version is 40219.1, can you try to uninstall + re-install this security update package to see if it installs the correct version of mfc100.dll?

  • Are these checks even necessary for windows 8? I can't seem to find any information regarding it, and some versions of win8 have the keys, some doesn't. Still the software seem to work on all windows 8 machines either way.

  • Hi Sam - I'm not sure which exact versions of the VC runtimes are included with Winodws 8.  However, in general, it isn't safe to assume that a given version of the VC runtimes are available on a given version of Windows.  I'd always recommend trying to install the redistributable that includes the exact versions that your application needs.

  • I have a failed install of C++ 2010 and cant uninstall or reinstall because i get an error like there is an instance already running,tried an uninstaller specific to remove it but i still get the same error. Can I remove any registry entries?

  • Hi FastEd - In some cases, rebooting the computer will be enough to clear up this error message.  If that doesn't help, then the suggestions at assortedtopics.blogspot.com/.../fix-for-windows-error-1500-another.html might help instead.

  • Hi Aaron,

    Where did you find the product codes? I am looking for the correct product codes for Microsoft Visual C++ 2012 Redistributable (x86) and Microsoft Visual C++ 2012 Redistributable (x64), but I cannot find them.

    When I check my registry I see:

    - Microsoft Visual C++ 2012 x86 Additional Runtime

    - Microsoft Visual C++ 2012 x86 Minimum Runtime

    - Microsoft Visual C++ 2012 Redistributable

    I am not sure which of these applications’ code I should use.

    Thank you in advance

  • Hi George Karadjov - I typically download the redistributable installer, extract the .msi and open it in the Orca .msi editing tool too determine the product codes.  I believe that the "Minimum Runtime" and "Additional Runtime" are only installed by Visual Studio and aren't licensed for redistribution, so you shouldn't need to worry about detecting those packages.

  • Thank you Aaron,

    I used similar approach and found out that for the redistributable package 'Microsoft Visual C++ 2012 x86' there are two msi. One for 'Microsoft Visual C++ 2012 x86 Additional Runtime' and one for 'Microsoft Visual C++ 2012 x86 Minimum Runtime'. I use the product codes from 'Microsoft Visual C++ 2012 x86 Minimum Runtime' and all 'is installed' checks work correctly. Here are the produce codes for the three updates if someone needs them:

    Microsoft Visual C++ 2012 x86 Minimum Runtime - 11.0.50727

    {2F73A7B2-E50E-39A6-9ABC-EF89E4C62E36}

    Microsoft Visual C++ 2012 x86 Minimum Runtime - 11.0.51106

    {E824E81C-80A4-3DFF-B5F9-4842A9FF5F7F}

    Microsoft Visual C++ 2012 x86 Minimum Runtime - 11.0.60610

    {E7D4E834-93EB-351F-B8FB-82CDAE623003}

    <--->

    Microsoft Visual C++ 2012 x64 Minimum Runtime - 11.0.50727

    {A2CB1ACB-94A2-32BA-A15E-7D80319F7589}

    Microsoft Visual C++ 2012 x64 Minimum Runtime - 11.0.51106

    {5AF4E09F-5C9B-3AAF-B731-544D3DC821DD}

    Microsoft Visual C++ 2012 x64 Minimum Runtime - 11.0.60610

    {2EDC2FA3-1F34-34E5-9085-588C9EFD1CC6}

    Thank you for the article Aaron

Page 3 of 5 (64 items) 12345
Leave a Comment
  • Please add 8 and 2 and type the answer here:
  • Post