Index: trunk/src/VBox/Installer/win/CommonProperties.wxi
===================================================================
--- trunk/src/VBox/Installer/win/CommonProperties.wxi	(revision 95033)
+++ trunk/src/VBox/Installer/win/CommonProperties.wxi	(revision 95037)
@@ -17,17 +17,4 @@
          xmlns:difxapp="http://schemas.microsoft.com/wix/DifxAppExtension">
 
-  <!-- MSI is soo messed up wrt NT versioning on Windows 10.  msiexec runs in
-       Windows 8.1 compatibility mode, so everything returns 6.3 as the
-       version.  This unfortunately include all system DLLs.  Fortunately,
-       the build number is left as-is, so we ASSUME build numbers above 10000
-       means its Windows 10.
-       Note! "HKLM\Software\Microsoft\Windows NT\CurrentVersion\CurrentBuild" could
-             probably be read here as well (CurrentVersion is "6.3" of course). -->
-  <Property Id="VBOX_IS_WINDOWS_10" >
-    <DirectorySearch Id="DirSearchForWindows10NtDll" Path="[SystemFolder]" >
-      <FileSearch Name="kernelbase.dll" MinVersion="6.3.10000.000" />
-    </DirectorySearch>
-  </Property>
-
 </Include>
 
Index: trunk/src/VBox/Installer/win/InstallHelper/VBoxInstallHelper.cpp
===================================================================
--- trunk/src/VBox/Installer/win/InstallHelper/VBoxInstallHelper.cpp	(revision 95033)
+++ trunk/src/VBox/Installer/win/InstallHelper/VBoxInstallHelper.cpp	(revision 95037)
@@ -431,4 +431,46 @@
 
     VBoxSetMsiProp(hModule, L"VBOX_PYTHON_DEPS_INSTALLED", dwErr == ERROR_SUCCESS ? L"1" : L"0");
+    return ERROR_SUCCESS; /* Never return failure. */
+}
+
+/**
+ * Checks if the running OS is (at least) Windows 10 (e.g. >= build 10000).
+ *
+ * Called from the MSI installer as custom action.
+ *
+ * @returns Always ERROR_SUCCESS.
+ *          Sets public property VBOX_IS_WINDOWS_10 to "" (empty / false) or "1" (success).
+ *
+ * @param   hModule             Windows installer module handle.
+ */
+UINT __stdcall IsWindows10(MSIHANDLE hModule)
+{
+    /*
+     * Note: We cannot use RtlGetVersion() / GetVersionExW() here, as the Windows Installer service
+     *       all shims this, unfortunately. So we have to go another route by querying the major version
+     *       number from the registry.
+     */
+    HKEY hKeyCurVer = NULL;
+    LSTATUS dwErr = RegOpenKeyExW(HKEY_LOCAL_MACHINE, L"SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion", 0, KEY_READ, &hKeyCurVer);
+    if (dwErr == ERROR_SUCCESS)
+    {
+        DWORD dwVal = 0;
+        DWORD cbVal = sizeof(dwVal);
+        DWORD dwValueType = REG_DWORD;
+        dwErr = RegQueryValueExW(hKeyCurVer, L"CurrentMajorVersionNumber", NULL, &dwValueType, (LPBYTE)&dwVal, &cbVal);
+        if (dwErr == ERROR_SUCCESS)
+        {
+            logStringF(hModule, L"IsWindows10/CurrentMajorVersionNumber: %ld", dwVal);
+
+            VBoxSetMsiProp(hModule, L"VBOX_IS_WINDOWS_10", dwVal >= 10 ? L"1" : L"");
+        }
+        else
+            logStringF(hModule, L"IsWindows10/RegOpenKeyExW: Error reading CurrentMajorVersionNumber (%ld)", dwErr);
+
+        RegCloseKey(hKeyCurVer);
+    }
+    else
+        logStringF(hModule, L"IsWindows10/RegOpenKeyExW: Error opening CurrentVersion key (%ld)", dwErr);
+
     return ERROR_SUCCESS; /* Never return failure. */
 }
Index: trunk/src/VBox/Installer/win/InstallHelper/VBoxInstallHelper.def
===================================================================
--- trunk/src/VBox/Installer/win/InstallHelper/VBoxInstallHelper.def	(revision 95033)
+++ trunk/src/VBox/Installer/win/InstallHelper/VBoxInstallHelper.def	(revision 95037)
@@ -21,4 +21,5 @@
     CheckSerial
     IsPythonInstalled
+    IsWindows10
     ArePythonAPIDepsInstalled
     InstallPythonAPI
Index: trunk/src/VBox/Installer/win/UserInterface.wxi
===================================================================
--- trunk/src/VBox/Installer/win/UserInterface.wxi	(revision 95033)
+++ trunk/src/VBox/Installer/win/UserInterface.wxi	(revision 95037)
@@ -1200,4 +1200,5 @@
             <Custom Action="ca_OriginalTargetDir" After="FileCost"><![CDATA[(NOT INSTALLDIR) AND (NOT EXISTINGINSTALLDIR)]]></Custom>
             <Custom Action="ca_DefaultTargetDir" After="FileCost"><![CDATA[NOT Installed AND (NOT INSTALLDIR) AND EXISTINGINSTALLDIR]]></Custom>
+            <Custom Action="ca_IsWindows10" After="CostFinalize" />
 
 <?if $(env.VBOX_WITH_PYTHON) = "yes" ?>
Index: trunk/src/VBox/Installer/win/VBoxMergeAppCA.wxi
===================================================================
--- trunk/src/VBox/Installer/win/VBoxMergeAppCA.wxi	(revision 95033)
+++ trunk/src/VBox/Installer/win/VBoxMergeAppCA.wxi	(revision 95037)
@@ -17,3 +17,6 @@
          xmlns:difxapp="http://schemas.microsoft.com/wix/DifxAppExtension">
 
+    <CustomAction Id="ca_IsWindows10" BinaryKey="VBoxInstallHelper"
+                  DllEntry="IsWindows10" Execute="immediate" Return="ignore" Impersonate="no" />
+
 </Include>
Index: trunk/src/VBox/Installer/win/VBoxMergeAppSeq.wxi
===================================================================
--- trunk/src/VBox/Installer/win/VBoxMergeAppSeq.wxi	(revision 95033)
+++ trunk/src/VBox/Installer/win/VBoxMergeAppSeq.wxi	(revision 95037)
@@ -17,4 +17,6 @@
          xmlns:difxapp="http://schemas.microsoft.com/wix/DifxAppExtension">
 
+    <Custom Action="ca_IsWindows10"  After="FileCost">1</Custom>
+
 </Include>
 
