Windows 7 disguises as Vista to MSI Custom Actions

In every new version of Windows, Microsoft includes numerous “shims” to improve compatibility with existing software. These shims are applied on a per-application basis. You can see which shims apply to an application using the Compatibility Administrator which is part of the Microsoft Application Compatibility Toolkit (ACT) – Download ACT version 5.5

The below screenshot shows the application compatibility settings for msiexec.exe, the process that runs all Windows Installer (MSI) setups.

MsiAppCompat

As you can see among the shims that apply to Windows Installer there is VistaRTMVersionLie. This setting causes the GetVersionEx API to return Windows Vista values on Windows 7,when called from a custom action in a MSI setup.

Note that this only applies when a custom action checks for the Windows version using the GetVersionEx API. However the pre-defined MSI property VersionNT will properly be set to 601 on Windows 7 and Windows Server 2008 R2 as documented. (Remember that that the VersionNT value is not 700 as one might expect, which is another application compatibility measure to work around setups that check the major OS version number.)

For information about the other shims that apply to MSI setups and a discussion about the “OS version lying” see Chris Jackson’s blog where he states that “there’s an arms race between app compat and the people who want to do the checks”.

Published Mon, May 18 2009 10:46 by stefan