fix: Win11 OS-Erkennung via Build >= 22000, v1.0.6
This commit is contained in:
parent
154d1bd8c8
commit
ef567874c6
@ -128,6 +128,13 @@ func getOSVersion() (version, build string) {
|
|||||||
currentBuild, _, _ := k.GetStringValue("CurrentBuild")
|
currentBuild, _, _ := k.GetStringValue("CurrentBuild")
|
||||||
ubr, _, _ := k.GetIntegerValue("UBR")
|
ubr, _, _ := k.GetIntegerValue("UBR")
|
||||||
|
|
||||||
|
// Windows 11 erkennen: Build >= 22000, aber ProductName sagt noch "Windows 10"
|
||||||
|
buildNum := 0
|
||||||
|
fmt.Sscanf(currentBuild, "%d", &buildNum)
|
||||||
|
if buildNum >= 22000 && strings.Contains(productName, "Windows 10") {
|
||||||
|
productName = strings.Replace(productName, "Windows 10", "Windows 11", 1)
|
||||||
|
}
|
||||||
|
|
||||||
if displayVersion != "" {
|
if displayVersion != "" {
|
||||||
version = fmt.Sprintf("%s %s", productName, displayVersion)
|
version = fmt.Sprintf("%s %s", productName, displayVersion)
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user