Question

My program contains several dlls which depend on MSVCP100.dll and MSVCR100.dll, in Win7 my program runs without any problem, however in Win8 it failed to locate these two dlls. I notice that in Win8 there is no VCRedist installed by default, so apparently I need to install the VCRedist to enable my program.

The question is, how do I check if the VCRedist is installed?

Looks like we can do it by searching in registry [1] [2]. However, it seems there are many versions of VCRedist(VC2012,2010,2008,2005...), so I need to go through all these registry keys?

Was it helpful?

Solution

If you just run installer of VCRedist (which you should ship with your program, anyway), it will do the job for you. Games "try" to install DirectX the same way.

OTHER TIPS

Since your DLLs depend on MSVCR100.dll, you'll want to find VCRedist for VC 2010.

The number after 'MSVCR' or 'MSVCP' is the internal version of Visual Studio x10 - http://en.wikipedia.org/wiki/Microsoft_Visual_Studio#Version_history lists the values for the various versions.

For Visual Studio 2010 you can detect if the runtime is already installed by checking the "Installed" value of HKLM\SOFTWARE\Microsoft\VisualStudio\10.0\VC\VCRedist\x86 for 32-bit applications/DLLs and HKLM\SOFTWARE\Microsoft\VisualStudio\10.0\VC\VCRedist\x64 for 64-bit applications/DLLs.

For Visual Studio 2010 and previous versions, http://blogs.msdn.com/b/astebner/archive/2010/05/05/10008146.aspx has a good explanation of methods for detecting if the runtime is installed.

With Visual Studio 2012 things have changed and the VCRedist key no longer exists. Instead you may look at the Installed value of the reg key (for 32-bit applications) Software\Microsoft\VisualStudio\11.0\VC\Runtimes\x86

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top