Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Actually fix timeout
  • Loading branch information
rcmaehl committed Sep 2, 2021
1 parent 3b5587c commit 7eda51d
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 10 deletions.
14 changes: 10 additions & 4 deletions WhyNotWin11.au3
Original file line number Diff line number Diff line change
Expand Up @@ -719,7 +719,8 @@ Func Main(ByRef $aResults, ByRef $aOutput)

; DirectX 12 takes a while. Grab the result once done
Case IsArray($aDirectX)
Switch _GetDirectXCheck($aDirectX)
$aDirectX = _GetDirectXCheck($aDirectX)
Switch $aDirectX
Case 2
_GUICtrlSetState($hCheck[5][0], $iPass)
GUICtrlSetData($hCheck[5][2], "DirectX 12 && WDDM 3") ; <== No translation, "DirectX 12 and WDDM 3" in LANG-file
Expand All @@ -729,8 +730,14 @@ Func Main(ByRef $aResults, ByRef $aOutput)
Case Else
Switch @error
Case 0
_GUICtrlSetState($hCheck[5][0], $iUnsure)
GUICtrlSetData($hCheck[5][2], _Translate($iMUI, "Check Timed Out"))
Switch @extended
Case 1
_GUICtrlSetState($hCheck[5][0], $iUnsure)
GUICtrlSetData($hCheck[5][2], _Translate($iMUI, "DxDiag Errored"))
Case 2
_GUICtrlSetState($hCheck[5][0], $iUnsure)
GUICtrlSetData($hCheck[5][2], _Translate($iMUI, "Check Timed Out"))
EndSwitch
Case 1
_GUICtrlSetState($hCheck[5][0], $iPass)
GUICtrlSetData($hCheck[5][2], _Translate($iMUI, "No DirectX 12, but WDDM2"))
Expand All @@ -742,7 +749,6 @@ Func Main(ByRef $aResults, ByRef $aOutput)
GUICtrlSetData($hCheck[5][2], _Translate($iMUI, "No DirectX 12 or WDDM2"))
EndSwitch
EndSwitch
$aDirectX = Null

Case $hMsg = $hDumpLang
FileDelete(@LocalAppDataDir & "\WhyNotWin11\langs\")
Expand Down
14 changes: 8 additions & 6 deletions includes/_Checks.au3
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,13 @@ Func _DirectXStartCheck()
Return $aReturn
EndFunc ;==>_DirectXStartCheck

Func _GetDirectXCheck($aArray)
If Not ProcessExists($aArray[1]) And FileExists($aArray[0]) Then
Func _GetDirectXCheck(ByRef $aArray)
ConsoleWrite(TimerDiff($aArray[2]) & @CRLF)
If TimerDiff($aArray[2]) > 120000 Then
FileDelete($aArray[0])
Return SetError(0, 2, False)
ElseIf Not ProcessExists($aArray[1]) Then
MsgBox(0, "", 1)
Local $sDXFile = StringStripWS(StringStripCR(FileRead($aArray[0])), $STR_STRIPALL)
Select
Case StringInStr($sDXFile, "FeatureLevels:12") Or StringInStr($sDXFile, "DDIVersion:12") And StringInStr($sDXFile, "DriverModel:WDDM" & Chr(160) & "3") ; Non-English Languages
Expand All @@ -111,12 +116,9 @@ Func _GetDirectXCheck($aArray)
Case StringInStr($sDXFile, "DDIVersion:12") And Not StringInStr($sDXFile, "DriverModel:WDDM2")
Return SetError(2, 0, False)
Case Else
Return False
Return SetError(0, 1, False)
EndSelect
FileDelete($aArray[0])
ElseIf TimerDiff($aArray[2]) > 120000 Then
FileDelete($aArray[0])
Return SetError(0, 1, False)
Else
Return $aArray
EndIf
Expand Down

0 comments on commit 7eda51d

Please sign in to comment.