C++ library for detecting Visual C++ runtimes on Windows XP and later.
crt-detector allows you to detect both the availability of Visual C++ runtimes installed onto the end-user's computer and any VC++ runtimes that are available in the current working directory.
If you want to check for the availability of Visual C++ 2008 SP1 with an image compiled for x86, you can look for it globally first:
//Is Visual C++ 2008 SP1 runtime for x86 installed?
if(IsVC2008SP1Installed_x86()){ ... }
And then you can check for it in the current working directory if necessary:
//Are the Visual C++ 2008 SP1 DLLs for x86 available in my current directory?
if(IsVC2008AvailableLocally_x86()()){ ... }
That's all there is to it! VCDetector.h
contains all of the following methods for your use:
//VC++9
bool IsVC2008Installed_x86();
bool IsVC2008SP1Installed_x86();
bool IsVC2008Installed_x64();
bool IsVC2008SP1Installed_x64();
//Check to see if VC++9 binaries are available in current directory
bool IsVC2008AvailableLocally_x86();
bool IsVC2008AvailableLocally_x64();
//VC++10
bool IsVC2010Installed_x86();
bool IsVC2010SP1Installed_x86();
bool IsVC2010Installed_x64();
bool IsVC2010SP1Installed_x64();
//Check to see if VC++10 binaries are available in current directory
bool IsVC2010AvailableLocally_x86();
bool IsVC2010AvailableLocally_x64();
The only two files that you need to integrate this detection functionality into your apps are:
- VCDetector.h and
- VCDetector.cpp.
It is worth noting, however, that stdafx.h
contains the list of all of the Win32 API dependencies that this code takes.
In order to compile this project or any others that depend on you must link the add the following assemblies to the Linker --> Additional Input
options for all of your build configurations.
- msi.lib used for querying the MsiProductAvailable APIs.
- shlwapi.lib used for file path manipulation.
- dbghelp.lib used for inspecting the images of locally-available DLLs.
Licensed under Apache 2.0 - see the License file for details.
We accept pull requests - include descriptions of your changes and please follow our comment style inside VCDetector.cpp
.
Copyright 2013-2014 MarkedUp Inc. Check out MarkedUp Analytics for Windows Desktop Applications!