Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
rcmaehl committed Jul 7, 2021
1 parent 92079da commit d2c0ea5
Show file tree
Hide file tree
Showing 2 changed files with 66 additions and 42 deletions.
85 changes: 55 additions & 30 deletions WhyNotWin11.au3
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,8 @@ Func ChecksOnly()

$aDirectX = _DirectXStartCheck()

$aResults[6][0] = _GPTCheck()
GetDiskInfoFromWmi($aDisks, $aPartitions, 1)
$aResults[6][0] = _GPTCheck($aDisks)
$aResults[6][1] = @error
$aResults[6][2] = @extended

Expand Down Expand Up @@ -216,6 +217,8 @@ Func Main()
Local Static $aFonts[4]
$aFonts = _GetTranslationFonts($iMUI)

Local Enum $iFail = 0, $iPass, $iUnsure, $iWarn

Local Enum $FontSmall, $FontMedium, $FontLarge, $FontExtraLarge
Local Const $DPI_RATIO = _GDIPlus_GraphicsGetDPIRatio()[0]
Local $aDisks, $aPartitions
Expand Down Expand Up @@ -421,34 +424,34 @@ Func Main()

Switch _ArchCheck()
Case True
_GUICtrlSetPass($hCheck[0][0])
_GUICtrlSetState($hCheck[0][0], $iPass)
GUICtrlSetData($hCheck[0][2], _Translate($iMUI, "64 Bit CPU") & @CRLF & _Translate($iMUI, "64 Bit OS"))
Case Else
Switch @error
Case 1
_GUICtrlSetWarn($hCheck[0][0], "!")
_GUICtrlSetState($hCheck[0][0], $iWarn)
GUICtrlSetData($hCheck[0][2], _Translate($iMUI, "64 Bit CPU") & @CRLF & _Translate($iMUI, "32 bit OS"))
Case 2
_GUICtrlSetFail($hCheck[0][0])
_GUICtrlSetState($hCheck[0][0], $iFail)
GUICtrlSetData($hCheck[0][2], _Translate($iMUI, "32 Bit CPU") & @CRLF & _Translate($iMUI, "32 Bit OS"))
Case Else
_GUICtrlSetFail($hCheck[0][0])
_GUICtrlSetState($hCheck[0][0], $iFail)
GUICtrlSetData($hCheck[0][2], "?")
EndSwitch
EndSwitch

Switch _BootCheck()
Case True
_GUICtrlSetPass($hCheck[1][0])
_GUICtrlSetState($hCheck[1][0], $iPass)
GUICtrlSetData($hCheck[1][2], "UEFI")
Case False
Switch @error
Case 0
_GUICtrlSetFail($hCheck[1][0])
_GUICtrlSetState($hCheck[1][0], $iFail)
GUICtrlSetData($hCheck[1][2], "Legacy")
Case Else
GUICtrlSetData($hCheck[1][2], @extended)
_GUICtrlSetWarn($hCheck[1][0])
_GUICtrlSetState($hCheck[1][0], $iWarn)
EndSwitch
EndSwitch

Expand All @@ -457,25 +460,25 @@ Func Main()
Case False
Switch @error
Case 1
_GUICtrlSetWarn($hCheck[2][0])
_GUICtrlSetState($hCheck[2][0], $iWarn)
GUICtrlSetData($hCheck[2][2], _Translate($iMUI, "Unable to Check List"))
Case 2
_GUICtrlSetWarn($hCheck[2][0])
_GUICtrlSetState($hCheck[2][0], $iWarn)
GUICtrlSetData($hCheck[2][2], _Translate($iMUI, "Error Accessing List"))
Case 3
_GUICtrlSetWarn($hCheck[2][0])
_GUICtrlSetState($hCheck[2][0], $iUnsure)
GUICtrlSetData($hCheck[2][2], _Translate($iMUI, "Not Currently Listed as Compatible"))
EndSwitch
Case Else
_GUICtrlSetPass($hCheck[2][0])
_GUICtrlSetState($hCheck[2][0], $iPass)
GUICtrlSetData($hCheck[2][2], _Translate($iMUI, "Listed as Compatible"))
EndSwitch

#Region - Determining CPU properties
If _CPUCoresCheck(_GetCPUInfo(0), _GetCPUInfo(1)) Then
_GUICtrlSetPass($hCheck[3][0])
_GUICtrlSetState($hCheck[3][0], $iPass)
Else
_GUICtrlSetFail($hCheck[3][0])
_GUICtrlSetState($hCheck[3][0], $iFail)
EndIf

Local $sCores = StringReplace(_Translate($iMUI, "Cores"), '#', _GetCPUInfo(0))
Expand All @@ -485,32 +488,35 @@ Func Main()
GUICtrlSetData($hCheck[3][2], $sCores & @CRLF & $sThreads)

If _GetCPUInfo(3) >= 1000 Then
_GUICtrlSetPass($hCheck[4][0])
_GUICtrlSetState($hCheck[4][0], $iPass)
GUICtrlSetData($hCheck[4][2], _GetCPUInfo(3) & " MHz")
Else
_GUICtrlSetFail($hCheck[4][0])
_GUICtrlSetState($hCheck[4][0], $iFail)
GUICtrlSetData($hCheck[4][2], _GetCPUInfo(3) & " MHz")
EndIf
#EndRegion - Determining CPU properties

For $iLoop = 0 To UBound($aDisks) - 1
If $aDisks[$iLoop][11] = "True" Then
Switch $aDisks[$iLoop][9]
Case "GPT"
_GUICtrlSetPass($hCheck[6][0])
GUICtrlSetData($hCheck[6][2], _Translate($iMUI, "GPT Detected"))
Case Else
_GUICtrlSetFail($hCheck[6][0])
GUICtrlSetData($hCheck[6][2], _Translate($iMUI, "GPT Not Detected") & @CRLF & $aDisks[$iLoop][9])
EndSwitch
Local $aDirectX[2]
$aDirectX[2] = _DirectXStartCheck()

If _GPTCheck($aDisks) Then
If @error Then
_GUICtrlSetState($hCheck[6][0], $iPass)
GUICtrlSetData($hCheck[6][2], _Translate($iMUI, "GPT Detected"))
Else
_GUICtrlSetState($hCheck[6][0], $iPass)
GUICtrlSetData($hCheck[6][2], _Translate($iMUI, "GPT Detected"))
EndIf
Next
Else
GUICtrlSetData($hCheck[6][2], _Translate($iMUI, "GPT Not Detected") & @CRLF & @error)
_GUICtrlSetState($hCheck[6][0], $iFail)
EndIf

If _MemCheck() Then
_GUICtrlSetPass($hCheck[7][0])
_GUICtrlSetState($hCheck[7][0], $iPass)
GUICtrlSetData($hCheck[7][2], _MemCheck() & " GB")
Else
_GUICtrlSetFail($hCheck[7][0])
_GUICtrlSetState($hCheck[7][0], $iFail)
GUICtrlSetData($hCheck[7][2], _MemCheck() & " GB")
EndIf

Expand Down Expand Up @@ -594,6 +600,7 @@ Func Main()
#ce

; DirectX 12 takes a while. Grab the result once done
Case _GetDirectXCheck($aDirectX)
Case (Not ProcessExists($hDXPID)) And FileExists($hDXFile)
$sDXFile = StringStripWS(StringStripCR(FileRead($hDXFile)), $STR_STRIPALL)
Select
Expand Down Expand Up @@ -755,6 +762,24 @@ Func _SetBannerText($hBannerText, $hBanner)

EndFunc ;==>_SetBannerText

_GUICtrlSetState($hCtrl, $iState)
Switch $iState
Case 0
GUICtrlSetData($hCtrl, "X")
GUICtrlSetBkColor($hCtrl, 0xFA113D)
Case 1
GUICtrlSetData($hCtrl, "OK")
GUICtrlSetBkColor($hCtrl, 0x4CC355)
Case 2
GUICtrlSetData($hCtrl, "?")
GUICtrlSetBkColor($hCtrl, 0xF4C141)
Case 3
GUICtrlSetData($hCtrl, "!")
GUICtrlSetBkColor($hCtrl, 0xF4C141)
EndSwitch
EndFunc ;==>_GUICtrlSetState


Func _GUICtrlSetPass($hCtrl)
GUICtrlSetData($hCtrl, "OK")
GUICtrlSetBkColor($hCtrl, 0x4CC355)
Expand All @@ -768,4 +793,4 @@ EndFunc ;==>_GUICtrlSetFail
Func _GUICtrlSetWarn($hCtrl, $symbol = "?")
GUICtrlSetData($hCtrl, $symbol)
GUICtrlSetBkColor($hCtrl, 0xF4C141)
EndFunc ;==>_GUICtrlSetWarn
EndFunc ;==>_GUICtrlSetWarn
23 changes: 11 additions & 12 deletions includes/_Checks.au3
Original file line number Diff line number Diff line change
Expand Up @@ -113,18 +113,17 @@ Func _GetDirectXCheck($aArray)
EndIf
EndFunc ;==>_GetDirectXCheck

Func _GPTCheck()
Local $aDisks = _GetDiskInfo(1)
Switch _GetDiskInfo(0)
Case "GPT"
If $aDisks[0] = $aDisks[1] Then
Return True
Else
SetError($aDisks[1], $aDisks[0], True)
EndIf
Case Else
Return False
EndSwitch
Func _GPTCheck($aDisks)
For $iLoop = 0 To UBound($aDisks) - 1
If $aDisks[$iLoop][11] = "True" Then
Switch $aDisks[$iLoop][9]
Case "GPT"
Return True
Case Else
Return SetError($aDisks[$iLoop][9], 0, False)
EndSwitch
EndIf
Next
EndFunc ;==>_GPTCheck

Func _MemCheck()
Expand Down

0 comments on commit d2c0ea5

Please sign in to comment.