Prior to Windows 10 it was possible to use the Windows Installer property VersionNT to determine the version of the operating system. For Example: Windows 7 VersionNT=601, Windows 8=602, Windows 8.1=603.
Windows 10 has a VersionNT value of 603. An MSI will therefore identify the OS as Windows 8.1.
The issue is the value returned by the GetVersionEx API on operating systems from Windows 8.1 onwards.
The Value returned by GetVersionEx API now depends on how the application is manifested. The applicaion responsible for running MSI's is msiexec.exe which contains no Windows 10 information in its manifest on a Windows 10 machine. A sample of the msiexec.exe manifest file shipped with Windows 10 can be seen below:
<!-- Windows BLUE -->
The supportedOS Id GUID used here is for Windows 8.1 and does not contain any Windows 10 details.
It is possible to identify Windows 10 by using a setup.exe bootstrapper.
This ability is built into InstallShield's Suite Project - the setup.exe manifest in use with InstallShield 2015 contains Windows 10 specific information, see below:
By wrapping your MSI with an InstallShield Suite Project you can use a platform condition with an OS Version value of 10.0 to identify Windows 10. The example below shows an Exit Condition which launches a message box and prevents the MSI from launching if run on a Windows 10 machine.
An alternative solution within the Suite project is to use the Object Expressions introduced in InstallShield 2015. Using this approach we can create a Property within the packaged MSI to hold the Windows 10 OS version number. The following expression can be entered as the value of the "MSI Command Line" property on an MSI package included in a suite:
If the suite is run on a Windows 10 machine this expression will create the Property REALVERSIONNT with a value of 10 within the targeted MSI. This property can then be used as an install condition on the actual MSI to prevent installs on a Windows 10 machine. For example:
If using Suite installers is not an option, the following workaround may be something to consider but should be used with caution.
Within a Basic MSI project we can use a System Search > Registry Entry to locate a registry which is new within Windows 10 OS's:
On Windows 10, this value will be 10. If we then store this in a Property and use it as an Install Condition, we can control the behaviour of the MSI on Windows 10 machines.
This approach should however be used with caution as there is no guarantee that Microsoft will not remove or edit this registry key in future updates or releases of Windows 10. If this occurs this would add additional maintenance to your application.
In summary due to changes in the behaviour of Windows 10 it is not possible to reliably identify a Windows 10 Operating System from within an MSI. The solution is to use a setup.exe which targets Windows 10 within its manifest file.
The same behavior occurs with the Windows Installer property WindowsBuild. This property will report as 9600 which is the value for Windows 8.1