Changeset 95037 in vbox
- Timestamp:
- May 18, 2022 2:23:26 PM (3 years ago)
- Location:
- trunk/src/VBox/Installer/win
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Installer/win/CommonProperties.wxi
r95033 r95037 17 17 xmlns:difxapp="http://schemas.microsoft.com/wix/DifxAppExtension"> 18 18 19 <!-- MSI is soo messed up wrt NT versioning on Windows 10. msiexec runs in20 Windows 8.1 compatibility mode, so everything returns 6.3 as the21 version. This unfortunately include all system DLLs. Fortunately,22 the build number is left as-is, so we ASSUME build numbers above 1000023 means its Windows 10.24 Note! "HKLM\Software\Microsoft\Windows NT\CurrentVersion\CurrentBuild" could25 probably be read here as well (CurrentVersion is "6.3" of course). -->26 <Property Id="VBOX_IS_WINDOWS_10" >27 <DirectorySearch Id="DirSearchForWindows10NtDll" Path="[SystemFolder]" >28 <FileSearch Name="kernelbase.dll" MinVersion="6.3.10000.000" />29 </DirectorySearch>30 </Property>31 32 19 </Include> 33 20 -
trunk/src/VBox/Installer/win/InstallHelper/VBoxInstallHelper.cpp
r93343 r95037 431 431 432 432 VBoxSetMsiProp(hModule, L"VBOX_PYTHON_DEPS_INSTALLED", dwErr == ERROR_SUCCESS ? L"1" : L"0"); 433 return ERROR_SUCCESS; /* Never return failure. */ 434 } 435 436 /** 437 * Checks if the running OS is (at least) Windows 10 (e.g. >= build 10000). 438 * 439 * Called from the MSI installer as custom action. 440 * 441 * @returns Always ERROR_SUCCESS. 442 * Sets public property VBOX_IS_WINDOWS_10 to "" (empty / false) or "1" (success). 443 * 444 * @param hModule Windows installer module handle. 445 */ 446 UINT __stdcall IsWindows10(MSIHANDLE hModule) 447 { 448 /* 449 * Note: We cannot use RtlGetVersion() / GetVersionExW() here, as the Windows Installer service 450 * all shims this, unfortunately. So we have to go another route by querying the major version 451 * number from the registry. 452 */ 453 HKEY hKeyCurVer = NULL; 454 LSTATUS dwErr = RegOpenKeyExW(HKEY_LOCAL_MACHINE, L"SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion", 0, KEY_READ, &hKeyCurVer); 455 if (dwErr == ERROR_SUCCESS) 456 { 457 DWORD dwVal = 0; 458 DWORD cbVal = sizeof(dwVal); 459 DWORD dwValueType = REG_DWORD; 460 dwErr = RegQueryValueExW(hKeyCurVer, L"CurrentMajorVersionNumber", NULL, &dwValueType, (LPBYTE)&dwVal, &cbVal); 461 if (dwErr == ERROR_SUCCESS) 462 { 463 logStringF(hModule, L"IsWindows10/CurrentMajorVersionNumber: %ld", dwVal); 464 465 VBoxSetMsiProp(hModule, L"VBOX_IS_WINDOWS_10", dwVal >= 10 ? L"1" : L""); 466 } 467 else 468 logStringF(hModule, L"IsWindows10/RegOpenKeyExW: Error reading CurrentMajorVersionNumber (%ld)", dwErr); 469 470 RegCloseKey(hKeyCurVer); 471 } 472 else 473 logStringF(hModule, L"IsWindows10/RegOpenKeyExW: Error opening CurrentVersion key (%ld)", dwErr); 474 433 475 return ERROR_SUCCESS; /* Never return failure. */ 434 476 } -
trunk/src/VBox/Installer/win/InstallHelper/VBoxInstallHelper.def
r93242 r95037 21 21 CheckSerial 22 22 IsPythonInstalled 23 IsWindows10 23 24 ArePythonAPIDepsInstalled 24 25 InstallPythonAPI -
trunk/src/VBox/Installer/win/UserInterface.wxi
r94380 r95037 1200 1200 <Custom Action="ca_OriginalTargetDir" After="FileCost"><![CDATA[(NOT INSTALLDIR) AND (NOT EXISTINGINSTALLDIR)]]></Custom> 1201 1201 <Custom Action="ca_DefaultTargetDir" After="FileCost"><![CDATA[NOT Installed AND (NOT INSTALLDIR) AND EXISTINGINSTALLDIR]]></Custom> 1202 <Custom Action="ca_IsWindows10" After="CostFinalize" /> 1202 1203 1203 1204 <?if $(env.VBOX_WITH_PYTHON) = "yes" ?> -
trunk/src/VBox/Installer/win/VBoxMergeAppCA.wxi
r82970 r95037 17 17 xmlns:difxapp="http://schemas.microsoft.com/wix/DifxAppExtension"> 18 18 19 <CustomAction Id="ca_IsWindows10" BinaryKey="VBoxInstallHelper" 20 DllEntry="IsWindows10" Execute="immediate" Return="ignore" Impersonate="no" /> 21 19 22 </Include> -
trunk/src/VBox/Installer/win/VBoxMergeAppSeq.wxi
r82970 r95037 17 17 xmlns:difxapp="http://schemas.microsoft.com/wix/DifxAppExtension"> 18 18 19 <Custom Action="ca_IsWindows10" After="FileCost">1</Custom> 20 19 21 </Include> 20 22
Note:
See TracChangeset
for help on using the changeset viewer.