简体   繁体   English

在Windows 2012 R2上运行时,如何让MSI返回正确的VersionNT值?

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

When I run my MSI on a Windows 2012 R2 machine (RTM build 9600) the VersionNT property is set to 602 (instead of 603). 当我在Windows 2012 R2计算机(RTM build 9600)上运行MSI时,VersionNT属性设置为602(而不是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? 如果602实际上是正确的操作系统版本,那么如何在安装时以编程方式区分Windows 2012和Windows 2012 R2?

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 2012 R2或Windows 8.1上运行我的MSI,VersionNT将正确地设置为603.如果我的MSI由引导程序(win32应用程序)启动,则将设置VersionNT,错误地,到602.因此,直接运行的MSI与win32应用程序启动之间存在差异。

Windows 10 Update: Windows 10更新:
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. 我发现当我更新我的引导程序的清单以支持Windows 10兼容性时,MSI的InstallUISequence将正确设置VersionNT = 1000,但InstallExecuteSequence将具有VersionNT = 603。

How do I make the InstallExecuteSequence also set VersionNT=1000? 如何使InstallExecuteSequence也设置VersionNT = 1000?

Your bootstrapper needs to be manifest to explicit support Win8/2012R3. 您的引导程序需要显式支持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 . 这将在Burn中很快在WiX 3.8中修复,但您可以在此处记录任何引导程序: 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: 具体来说,您需要为Windows 8和Windows 8.1添加GUID:

  • {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 . 如果您可以访问引导程序的源代码,那么更好的,面向未来的方法是调用RtlGetVersion如下所示: http//msdn.microsoft.com/en-us/library/windows/hardware/ff561910( RtlGetVersion = vs.85).aspx This is the change I'm pushing to Burn externally (we use this internally for Visual Studio). 这是我推动外部刻录的变化(我们在内部使用Visual Studio)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM