Browse Source

Improved VS paths lookup checking.

This fixes a bug that happened when you had multiple versions of VS installed and your highest version did not provide the native development SDK.
pull/28/head
triton 13 years ago
parent
commit
ef69a28bed
  1. 14
      src/Parser/VSLookup.cpp

14
src/Parser/VSLookup.cpp

@ -92,7 +92,19 @@ static bool getSystemRegistryString(const char *keyPath, const char *valueName,
strncpy(numBuf, sp, sizeof(numBuf) - 1); strncpy(numBuf, sp, sizeof(numBuf) - 1);
numBuf[sizeof(numBuf) - 1] = '\0'; numBuf[sizeof(numBuf) - 1] = '\0';
double value = strtod(numBuf, NULL); double value = strtod(numBuf, NULL);
if (value > bestValue) {
// Check if InstallDir key value exists.
bool isViableVersion = false;
lResult = RegOpenKeyExA(hTopKey, keyName, 0, KEY_READ, &hKey);
if (lResult == ERROR_SUCCESS) {
lResult = RegQueryValueExA(hKey, valueName, NULL, NULL, NULL, NULL);
if (lResult == ERROR_SUCCESS)
isViableVersion = true;
RegCloseKey(hKey);
}
if (isViableVersion && (value > bestValue)) {
bestIndex = (int)index; bestIndex = (int)index;
bestValue = value; bestValue = value;
strcpy(bestName, keyName); strcpy(bestName, keyName);

Loading…
Cancel
Save