mirror of
https://github.com/rclone/rclone.git
synced 2024-11-22 08:23:47 +01:00
version: report correct friendly-name for windows 10/11 versions after 2004
Until Windows 10 version 2004 (May 2020) this can be found from registry entry ReleaseID, after that we must use entry DisplayVersion (ReleaseId is stuck at 2009). Source: https://ss64.com/nt/ver.html
This commit is contained in:
parent
c504d97017
commit
2523dd6220
@ -39,9 +39,18 @@ func GetOSVersion() (osVersion, osKernel string) {
|
||||
}
|
||||
}
|
||||
|
||||
friendlyName := getRegistryVersionString("ReleaseId")
|
||||
if osVersion != "" && friendlyName != "" {
|
||||
osVersion += " " + friendlyName
|
||||
if osVersion != "" {
|
||||
// Include the friendly-name of the version, which is typically what is referred to.
|
||||
// Until Windows 10 version 2004 (May 2020) this can be found from registry entry
|
||||
// ReleaseID, after that we must use entry DisplayVersion (ReleaseId is stuck at 2009).
|
||||
// Source: https://ss64.com/nt/ver.html
|
||||
friendlyName := getRegistryVersionString("DisplayVersion")
|
||||
if friendlyName == "" {
|
||||
friendlyName = getRegistryVersionString("ReleaseId")
|
||||
}
|
||||
if friendlyName != "" {
|
||||
osVersion += " " + friendlyName
|
||||
}
|
||||
}
|
||||
|
||||
updateRevision := getRegistryVersionInt("UBR")
|
||||
|
Loading…
Reference in New Issue
Block a user