Skip to content
This repository has been archived by the owner on Mar 6, 2022. It is now read-only.

Commit

Permalink
fix display bug;workaround windows version issues
Browse files Browse the repository at this point in the history
  • Loading branch information
obsti8383 committed Apr 13, 2021
1 parent db6a734 commit e41328e
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 5 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
*.exe
*.log
resource.syso
vergrabber.json
2 changes: 1 addition & 1 deletion gui.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ func outputResults(installedSoftwareMappings []installedSoftwareMapping) {
RecentVersionReleaseDateColumn.Append(widget.NewLabel(
entry.MappedStatus.Released))
} else {
RecentVersionColumn.Append(widget.NewLabel("not available"))
RecentVersionReleaseDateColumn.Append(widget.NewLabel("not available"))
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import (
"github.com/rhysd/go-github-selfupdate/selfupdate"
)

const version = "0.2.3"
const version = "0.2.4"

const logpath = "UpdateChecker.log"

Expand Down
14 changes: 11 additions & 3 deletions windows_os.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,17 @@ func getWindowsVersion() (windowsVersion WindowsVersion, err error) {
return WindowsVersion{0, 0, 0, cb, "", pn}, errors.New("Could not get version information from registry - CurrentMajorVersionNumber")
}

relID, _, err := k.GetStringValue("ReleaseId")
if err != nil {
return WindowsVersion{maj, 0, 0, cb, "", pn}, errors.New("Could not get version information from registry - ReleaseId")
// since 20H2 MS has messed up version numbering - working around this here
// DisplayVersion seems to be new. We take this field, if available, otherwise ReleaseID
relID := ""
relDisplayVersion, _, _ := k.GetStringValue("DisplayVersion")
if relDisplayVersion != "" {
relID = relDisplayVersion
} else {
relID, _, err = k.GetStringValue("ReleaseId")
if err != nil {
return WindowsVersion{maj, 0, 0, cb, "", pn}, errors.New("Could not get version information from registry - ReleaseId")
}
}

ubr, _, err := k.GetIntegerValue("UBR")
Expand Down

0 comments on commit e41328e

Please sign in to comment.