Is there a Registry setting that I can look for to determine whether or not the Visual C++ redistributable is installed, whether standalone or as part of Visual Studio 2008?
Found registry entry for VC2008 redistributable. Here is my solution:
BOOL IsVC2008RedistInstalled(LPCTSTR pLogFile)
{
TCHAR szLogEntry[256];
memset(szLogEntry, '0', sizeof(szLogEntry));
HKEY hKey;
LONG lErr;
TCHAR csid[256];
_stprintf( csid, _T("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\{9A25302D-30C0-39D9-BD6F-21E6EC160475}"));
lErr = RegOpenKeyEx(HKEY_LOCAL_MACHINE, csid, 0, KEY_QUERY_VALUE, &hKey);
if (lErr == ERROR_SUCCESS)
{
_stprintf(szLogEntry, _T("VC2008 Redistributable was installed before.\n"));
toFile(pLogFile, szLogEntry);
return TRUE;
}
else
{
_stprintf(szLogEntry, _T("VC2008 Redistributable was not installed before. %ld\n"), lErr);
toFile(pLogFile, szLogEntry);
return FALSE;
}
}