3.18.4 virtual private network

This commit is contained in:
TenderIronh
2024-07-14 11:00:43 +08:00
parent e7b696c474
commit 9dda148232
62 changed files with 3845 additions and 898 deletions
+12
View File
@@ -5,6 +5,7 @@ import (
"os"
"os/exec"
"path/filepath"
"strconv"
"strings"
"golang.org/x/sys/windows/registry"
@@ -23,6 +24,17 @@ func getOsName() (osName string) {
defer k.Close()
pn, _, err := k.GetStringValue("ProductName")
if err == nil {
currentBuild, _, err := k.GetStringValue("CurrentBuild")
if err != nil {
return
}
buildNumber, err := strconv.Atoi(currentBuild)
if err != nil {
return
}
if buildNumber >= 22000 {
pn = strings.Replace(pn, "Windows 10", "Windows 11", 1)
}
osName = pn
}
return