How do I get MSI to return the correct VersionNT value when running on Windows 2012 R2?

蹲街弑〆低调 提交于 2019-12-23 20:00:15

问题


When I run my MSI on a Windows 2012 R2 machine (RTM build 9600) the VersionNT property is set to 602 (instead of 603). If 602 is actually the correct OS version, then how to I programmatically differentiate between Windows 2012 and Windows 2012 R2 at install time?

Update: It looks as though if I run my MSI directly on Windows 2012 R2 or Windows 8.1, VersionNT will be, correctly, set to 603. If my MSI is kicked off by a bootstrapper (a win32 app), VersionNT will be set, incorrectly, to 602. So, there's a discrepancy between an MSI being run directly vs. being launched by a win32 app.

Windows 10 Update:
I'm finding that when I update the manifest for my bootstrapper to support Windows 10 compatability, the InstallUISequence of the MSI will correctly set VersionNT=1000, but the InstallExecuteSequence will have VersionNT=603.

How do I make the InstallExecuteSequence also set VersionNT=1000?


回答1:


Your bootstrapper needs to be manifest to explicit support Win8/2012R3. This will be fixed in WiX 3.8 soon in Burn, but you can manifest any bootstrapper as documented here: http://msdn.microsoft.com/en-us/library/aa374191%28v=vs.85%29.aspx.

Specifically, you need to add the GUIDs for Windows 8 and Windows 8.1:

  • {4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}
  • {1f676c76-80e1-4239-95bb-83d0f6d0da78}

If you have access to the source code for the bootstrapper, the better, future-proof way is to call RtlGetVersion as documented here: http://msdn.microsoft.com/en-us/library/windows/hardware/ff561910(v=vs.85).aspx. This is the change I'm pushing to Burn externally (we use this internally for Visual Studio).



来源:https://stackoverflow.com/questions/19055285/how-do-i-get-msi-to-return-the-correct-versionnt-value-when-running-on-windows-2

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!