-
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Enhancement: check the windows version meets the minimum requirement …
…(launcher)
- Loading branch information
Showing
4 changed files
with
47 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
//go:build !windows | ||
|
||
package cmdUtils | ||
|
||
func CheckVersion() error { | ||
return nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
package cmdUtils | ||
|
||
import ( | ||
"fmt" | ||
"golang.org/x/sys/windows" | ||
) | ||
|
||
const minMajorVersion = 10 | ||
const minMinorVersion = 0 | ||
const minBuildNumber = 17763 | ||
const alias = "Windows 10 (1809 - Redstone 5)" | ||
|
||
func CheckVersion() error { | ||
major, minor, build := windows.RtlGetNtVersionNumbers() | ||
if major > minMajorVersion { | ||
return nil | ||
} | ||
if major == minMajorVersion && minor > minMinorVersion { | ||
return nil | ||
} | ||
if major == minMajorVersion && minor == minMinorVersion && build >= minBuildNumber { | ||
return nil | ||
} | ||
return fmt.Errorf( | ||
"unsupported Windows version: %d.%d.%d, minimum is %d.%d.%d also known as %s. Update your system", | ||
major, | ||
minor, | ||
build, | ||
minMajorVersion, | ||
minMinorVersion, | ||
minBuildNumber, | ||
alias, | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -39,4 +39,5 @@ const ( | |
ErrConfigCDNMap | ||
ErrSteamRoot | ||
ErrAnnouncementMulticastGroup | ||
ErrUnsupportedOS | ||
) |