Changeset 108072 in vbox for trunk/src/VBox/Installer
- Timestamp:
- Feb 5, 2025 2:48:28 PM (3 months ago)
- svn:sync-xref-src-repo-rev:
- 167365
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Installer/win/InstallHelper/VBoxInstallHelper.cpp
r108069 r108072 1053 1053 UINT __stdcall IsMSCRTInstalled(MSIHANDLE hModule) 1054 1054 { 1055 HKEY hKey VS = NULL;1055 HKEY hKey; 1056 1056 LSTATUS lrc = RegOpenKeyExW(HKEY_LOCAL_MACHINE, 1057 1057 L"SOFTWARE\\Microsoft\\VisualStudio\\14.0\\VC\\Runtimes\\X64", 1058 0, KEY_READ, &hKey VS);1058 0, KEY_READ, &hKey); 1059 1059 if (lrc == ERROR_SUCCESS) 1060 1060 { 1061 DWORD dwVal = 0; 1062 DWORD cbVal = sizeof(dwVal); 1063 lrc = RegQueryValueExW(hKeyVS, L"Installed", NULL /* lpReserved */, NULL /* lpType */, (LPBYTE)&dwVal, &cbVal); 1064 if (lrc == ERROR_SUCCESS) 1061 DWORD dwVal; 1062 int rc = VBoxMsiRegQueryDWORD(hModule, hKey, "Installed", &dwVal); 1063 if (RT_SUCCESS(rc)) 1065 1064 { 1066 1065 if (dwVal >= 1) 1067 1066 { 1068 1067 DWORD dwMaj; 1069 lrc = RegQueryValueExW(hKeyVS, L"Major", NULL /* lpReserved */, NULL /* lpType */, (LPBYTE)&dwMaj, &cbVal);1070 if ( lrc == ERROR_SUCCESS)1068 rc = VBoxMsiRegQueryDWORD(hModule, hKey, "Major", &dwMaj); 1069 if (RT_SUCCESS(rc)) 1071 1070 { 1072 1071 VBoxMsiSetPropDWORD(hModule, L"VBOX_MSCRT_VER_MAJ", dwMaj); 1073 1072 1074 DWORD dwMin = 0;1075 lrc = RegQueryValueExW(hKeyVS, L"Minor", NULL /* lpReserved */, NULL /* lpType */, (LPBYTE)&dwMin, &cbVal);1076 if ( lrc == ERROR_SUCCESS)1073 DWORD dwMin; 1074 lrc = VBoxMsiRegQueryDWORD(hModule, hKey, "Minor", &dwMin); 1075 if (RT_SUCCESS(rc)) 1077 1076 { 1078 1077 VBoxMsiSetPropDWORD(hModule, L"VBOX_MSCRT_VER_MIN", dwMin); … … 1098 1097 else 1099 1098 logStringF(hModule, "IsMSCRTInstalled: Found, but 'Installed' key not present (lrc=%d)", lrc); 1099 1100 RegCloseKey(hKey); 1100 1101 } 1101 1102 … … 1123 1124 * number from the registry. 1124 1125 */ 1125 HKEY hKey CurVer = NULL;1126 LSTATUS lrc = RegOpenKeyExW(HKEY_LOCAL_MACHINE, L"SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion", 0, KEY_READ, &hKey CurVer);1126 HKEY hKey; 1127 LSTATUS lrc = RegOpenKeyExW(HKEY_LOCAL_MACHINE, L"SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion", 0, KEY_READ, &hKey); 1127 1128 if (lrc == ERROR_SUCCESS) 1128 1129 { 1129 DWORD dwVal = 0; 1130 DWORD cbVal = sizeof(dwVal); 1131 lrc = RegQueryValueExW(hKeyCurVer, L"CurrentMajorVersionNumber", NULL /* lpReserved */, NULL /* lpType */, (LPBYTE)&dwVal, &cbVal); 1132 if (lrc == ERROR_SUCCESS) 1133 { 1134 logStringF(hModule, "IsWindows10/CurrentMajorVersionNumber: %u", dwVal); 1135 1136 VBoxMsiSetProp(hModule, L"VBOX_IS_WINDOWS_10", dwVal >= 10 ? L"1" : L""); 1130 DWORD dwMaj; 1131 int rc = VBoxMsiRegQueryDWORD(hModule, hKey, "CurrentMajorVersionNumber", &dwMaj); 1132 if (RT_SUCCESS(rc)) 1133 { 1134 VBoxMsiSetProp(hModule, L"VBOX_IS_WINDOWS_10", dwMaj >= 10 ? L"1" : L""); 1135 1137 1136 } 1138 1137 else 1139 logStringF(hModule, "IsWindows10 /RegOpenKeyExW: Error reading CurrentMajorVersionNumber (%ld)", lrc);1140 1141 RegCloseKey(hKey CurVer);1138 logStringF(hModule, "IsWindows10: Error reading CurrentMajorVersionNumber (%Rrc)", rc); 1139 1140 RegCloseKey(hKey); 1142 1141 } 1143 1142 else
Note:
See TracChangeset
for help on using the changeset viewer.