The Wayback Machine - https://web.archive.org/web/20220422165345/https://github.com/nodejs/node/issues/40862
Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Node reports Windows 10 on Windows 11 #40862

Open
JakubDrozd opened this issue Nov 18, 2021 · 10 comments
Open

Node reports Windows 10 on Windows 11 #40862

JakubDrozd opened this issue Nov 18, 2021 · 10 comments
Labels
libuv os windows

Comments

@JakubDrozd
Copy link

@JakubDrozd JakubDrozd commented Nov 18, 2021

Version

v14.17.6

Platform

x64

Subsystem

os

What steps will reproduce the bug?

On Windows 11, run os.version(). It will return 'Windows 10' instead 'Windows 11'. Strange.

How often does it reproduce? Is there a required condition?

Always, when the OS is Windows 11.

What is the expected behavior?

e.g. 'Windows 11 Home'

What do you see instead?

e.g. 'Windows 10 Home'

Additional information

No response

@Mesteery Mesteery added os windows labels Nov 18, 2021
@mscdex
Copy link
Contributor

@mscdex mscdex commented Nov 18, 2021

This should be reported upstream to libuv, which is the project that provides node with that information.

@mscdex
Copy link
Contributor

@mscdex mscdex commented Nov 18, 2021

On a related note, it seems the current consensus is that if dwMajorVersion is 10, then you need to check if dwBuildNumber >= 22000 is true. If it is, then it's Windows 11 and not 10.

@Ayase-252 Ayase-252 added the libuv label Nov 19, 2021
@JakubDrozd
Copy link
Author

@JakubDrozd JakubDrozd commented Nov 20, 2021

Yes, and I know C++. GIve me the related files and functions, and I will fix them.

@bavulapati
Copy link
Contributor

@bavulapati bavulapati commented Nov 20, 2021

libuv picks the version details from windows registry Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion. The productName registry entry on windows 11 contains windows 10 .
We will either have to get this fixed from windows side or change the libuv implementation to accommodate the required changes

@bavulapati
Copy link
Contributor

@bavulapati bavulapati commented Nov 20, 2021

Also, windows official documentations doesn't yet address windows 11 in the version detection APIs.

@bavulapati
Copy link
Contributor

@bavulapati bavulapati commented Nov 20, 2021

Wondering about the API or the implementation details of Winodws About . About displays appropriate information.
Any resources or pointers would be helpful.
image

@targos
Copy link
Member

@targos targos commented Nov 21, 2021

@JakubDrozd
Copy link
Author

@JakubDrozd JakubDrozd commented Dec 6, 2021

Wondering about the API or the implementation details of Winodws About . About displays appropriate information.

Maybe 'Windows About'.

@nassau-t
Copy link

@nassau-t nassau-t commented Dec 9, 2021

From another web:

// CurrentMajorVersionNumber present in registry starting with Windows 10
// If CurrentMajorVersionNumber not present in registry then use CurrentVersion
HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\CurrentMajorVersionNumber
// CurrentMinorVersionNumber present in registry starting with Windows 10
// If CurrentMinorVersionNumber not present in registry then use CurrentVersion
HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\CurrentMinorVersionNumber 
@nassau-t
Copy link

@nassau-t nassau-t commented Dec 9, 2021

Opened issue on libuv libuv/libuv#3381

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
libuv os windows
7 participants