Skip to content

Commit

Permalink
Fix version parsing error on Windows Server 2012
Browse files Browse the repository at this point in the history
Closes #1176
  • Loading branch information
tresf committed Sep 13, 2023
1 parent 4024f22 commit 119de93
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/qz/utils/WindowsUtilities.java
Original file line number Diff line number Diff line change
Expand Up @@ -79,11 +79,16 @@ public static Version getOsVersion() {
build = getRegInt(HKEY_LOCAL_MACHINE, "SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion", "UBR").toString();
}

return Version.forIntegers(
Version osVersion = Version.forIntegers(
versionInfo.dwMajorVersion.intValue(),
versionInfo.dwMinorVersion.intValue(),
versionInfo.dwBuildNumber.intValue()
).setBuildMetadata(build);
);

if(!build.trim().isEmpty()) {
osVersion.setBuildMetadata(build);
}
return osVersion;
}

/**
Expand Down

0 comments on commit 119de93

Please sign in to comment.