Describe the bughost.PlatformInformationWithContext returns platform = "Microsoft Windows 10 Pro" on a fresh RTM Windows 11 install (HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\BuildLabEx is 22000.1.amd64fre.co_release.210604-1628, HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProductName is "Windows 10 Pro", HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\CurrentBuildNumber is 22000).
To Reproduce
Let me know if you need code for this.
Expected behavior
To be honest, I am not sure how to proceed in this case, as nothing is really wrong with the way gopsutil obtains the platform information. It's just that Microsoft (probably for compatibility reasons) didn't bother to update the value of ProductName. My point with this issue is to raise the question whether or not to stick with the current behavior and take the value of ProductName as the single source of truth, or to also read CurrentBuildNumber and report Windows 11 if CurrentBuildNumber >= 22000.
I would be happy to provide a PR in the latter case.
Environment (please complete the following information):
[x] Windows: Microsoft Windows [Version 10.0.22000.194]
[ ] Linux: [paste contents of /etc/os-release and the result of uname -a]
[ ] Mac OS: [paste the result of sw_vers and uname -a
[ ] FreeBSD: [paste the result of freebsd-version -k -r -u and uname -a]
From googling, 1, 2, 3, and some of my friends PCs, using CurrentBuildNumber is only way to detect Windows 11. so I agree to implement CurrentBuildNumber >= 22000. We will be very appreciated if you made a PR.
Describe the bug
host.PlatformInformationWithContext
returnsplatform = "Microsoft Windows 10 Pro"
on a fresh RTM Windows 11 install (HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\BuildLabEx
is22000.1.amd64fre.co_release.210604-1628
,HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProductName
is "Windows 10 Pro",HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\CurrentBuildNumber
is22000
).To Reproduce Let me know if you need code for this.
Expected behavior To be honest, I am not sure how to proceed in this case, as nothing is really wrong with the way
gopsutil
obtains the platform information. It's just that Microsoft (probably for compatibility reasons) didn't bother to update the value ofProductName
. My point with this issue is to raise the question whether or not to stick with the current behavior and take the value ofProductName
as the single source of truth, or to also readCurrentBuildNumber
and reportWindows 11
ifCurrentBuildNumber >= 22000
.I would be happy to provide a PR in the latter case.
Environment (please complete the following information):
Microsoft Windows [Version 10.0.22000.194]
/etc/os-release
and the result ofuname -a
]sw_vers
anduname -a
freebsd-version -k -r -u
anduname -a
]uname -a
]