mirror of
https://github.com/wailsapp/wails.git
synced 2025-05-04 04:11:56 +08:00
Refactor doctor for windows
This commit is contained in:
parent
bf36b6a59d
commit
9ab06152c5
@ -17,9 +17,6 @@ func platformInfo() (*OS, error) {
|
|||||||
// Ignore errors as it isn't a showstopper
|
// Ignore errors as it isn't a showstopper
|
||||||
key, _ := registry.OpenKey(registry.LOCAL_MACHINE, `SOFTWARE\Microsoft\Windows NT\CurrentVersion`, registry.QUERY_VALUE)
|
key, _ := registry.OpenKey(registry.LOCAL_MACHINE, `SOFTWARE\Microsoft\Windows NT\CurrentVersion`, registry.QUERY_VALUE)
|
||||||
|
|
||||||
defer key.Close()
|
|
||||||
|
|
||||||
// Ignore errors as it isn't a showstopper
|
|
||||||
productName, _, _ := key.GetStringValue("ProductName")
|
productName, _, _ := key.GetStringValue("ProductName")
|
||||||
currentBuild, _, _ := key.GetStringValue("CurrentBuildNumber")
|
currentBuild, _, _ := key.GetStringValue("CurrentBuildNumber")
|
||||||
displayVersion, _, _ := key.GetStringValue("DisplayVersion")
|
displayVersion, _, _ := key.GetStringValue("DisplayVersion")
|
||||||
@ -29,5 +26,5 @@ func platformInfo() (*OS, error) {
|
|||||||
result.Version = fmt.Sprintf("%s (Build: %s)", releaseId, currentBuild)
|
result.Version = fmt.Sprintf("%s (Build: %s)", releaseId, currentBuild)
|
||||||
result.ID = displayVersion
|
result.ID = displayVersion
|
||||||
|
|
||||||
return &result, nil
|
return &result, key.Close()
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user