PDA

View Full Version : Incorrect OS Version Returned



st09
01-06-2021, 08:46 AM
On a Windows 10 PC, the following values are returned under the registry key HKLM\SOFTWARE\Microsoft\Windows NT

CURRENTBUILD: 19041
CURRENTMAJORVERSIONNUMBER: 10
CURRENTMINORVERSIONNUMBER: 0
CURRENTVERSION: 6.1
EDITIONID: Professional
RELEASEID: 2004



Yet, the value of %WINVER% is 1024 ($WIN_7$). This is causing our installer to report as not supported on the PC. From where is %WINVER% populated?

Thanks!

linder
01-07-2021, 05:25 AM
Hello,

which SetupBuilder version is this?

Possible reasons: if the installer is running in compatibility mode, it can return WIN7 in this case. If the installer is not Windows 10 compliant, it can also return WIN7 here (this is by Windows design and the expected behavior). The %&WINVER$ comes from API calls (this is a Windows Development Guideline requirement).

Please compile a small test.exe with your SetupBuilder version and upload it (or send it to support [at] lindersoft [dot] com) and we can tell you if it is #1 or #2.

Friedrich

linder
01-07-2021, 05:31 AM
BTW, I have uploaded a quick WINVER check app for you (compiled with the latest SetupBuilder version).

http://www.lindersoft.com/projects/Check_Ver.zip

It displays the correct value (65536) for Windows 10 here on our machines.

Friedrich

st09
01-07-2021, 07:41 AM
Hello Friedrich,

This is on only a few PCs globally. My team has been unable to reproduce it locally. I expect that on these PCs, either corruption has occurred, or the upgrade path to Windows 10 was unique. Are you able to specify which API calls are used?

-Seth

linder
01-07-2021, 01:07 PM
Seth,

you can reproduce this on your machine! Just copy my "Check_Ver.exe" executable to a test folder on Windows 10. Right-click it and select "Properties". Go to the "Compatibility" tab and select "Run this program in compatibility mode for" WINDOWS 7. Click the Apply button and then OK. Run the App and it will display (as expected) 1024 on Windows 10 because it runs in Windows 7 compatibility mode ;-)

I think your customer did the same. He can right-click your setup.exe and disable compatibility mode.

Does this help?

BTW, applications have to use the GetVersionEx API. The Registry values should never be used!

Friedrich