feat: 优化 CPU 和磁盘信息获取,增强对 Server 版本的支持,改进终端关闭逻辑

This commit is contained in:
Akizon77
2025-06-09 00:57:17 +08:00
parent 6e4bd4e4ae
commit ef2c638932
4 changed files with 49 additions and 19 deletions

View File

@@ -21,6 +21,10 @@ func OSName() string {
if err != nil {
return "Microsoft Windows"
}
// 如果是 Server 版本,直接返回原始名称
if strings.Contains(productName, "Server") {
return productName
}
// Windows 11
majorVersion, _, err := key.GetIntegerValue("CurrentMajorVersionNumber")