3

My end goal is to allow installation only on Server 2016, 2019 and 2022. I've opted to use VersionNT64 and WindowsBuild in <Condition>, however they seem to always be set to 603 and 9600 (respectively) regardless of what OS I'm running the msi on.

On the left the installation log generated by executing the msi with /l*vx and on the right winver.

enter image description here

enter image description here

enter image description here

DeepSpace
  • 78,697
  • 11
  • 109
  • 154
  • The GetVersionEx function lies. Which process is setting those properties? Does it have a supported OS guid for Win10 in its manifest? – Anders Mar 28 '22 at 12:49
  • @Anders 1. According to the docs the installer itself sets these values, however I'm not sure why it sets it to the *wrong* values. 2. Not sure what you mean by "supported OS guid for Win10 in its manifest". At the moment I don't have any reference to any OS in the `*.wsx` file. – DeepSpace Mar 28 '22 at 12:55
  • Sorry, I was talking about the application manifest inside .exe files. Windows lies about the version by design unless the .exe opts in to Windows 10 support. https://learn.microsoft.com/en-us/windows/win32/sbscs/application-manifests#supportedOS – Anders Mar 28 '22 at 13:27
  • @Anders I see, thanks. Do you have any resources? Anyway I'm not dealing with exe files, I'm generating an msi file from a wsx file – DeepSpace Mar 28 '22 at 13:29
  • I manually created a manifest file, but still not sure how to tell wix to embed/connect it to the generated msi file – DeepSpace Mar 28 '22 at 15:27
  • I don't think you can manually add the manifest if it is the MSI service doing the call to GetVersion. Do you have a plain .msi file or a exe bootstrapper? – Anders Mar 28 '22 at 15:48
  • @Anders Plain msi – DeepSpace Mar 28 '22 at 15:55
  • 1
    Related: https://stackoverflow.com/questions/31932646/versionnt-msi-property-on-windows-10/31991006#31991006 and https://stackoverflow.com/questions/33817452/wix-toolset-custom-action-command-doesnt-correctly-detect-windows-10-version – Anders Mar 28 '22 at 15:58
  • Broken by design I guess https://learn.microsoft.com/en-US/troubleshoot/windows-client/application-management/versionnt-value-for-windows-10-server – Anders Mar 28 '22 at 16:03
  • @Anders jeez... thanks. Ended up reading the registry – DeepSpace Mar 28 '22 at 16:27
  • I wrote up an "answer" [on the (origin of the) issues with Windows 10 version checking](https://stackoverflow.com/a/49343826/129130) quite some time ago. I haven't reviewed it since, but maybe have a quick look? – Stein Åsmul Mar 28 '22 at 23:39

0 Answers0