Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve disk checks - Second try #488

Closed
wants to merge 36 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
e8a83e4
Update .gitignore for <ISN AutoIT Studio>
htcfreek Jul 7, 2021
3a28392
Small improvements
htcfreek Jul 7, 2021
96c017b
Update/replace <GetDiskInfoFromWmi> from <https://github.com/htcfreek…
htcfreek Jul 7, 2021
22e988d
Remove old functions and mark parts to update
htcfreek Jul 7, 2021
b0f7c23
Add new function <_GetDiskProperties>
htcfreek Jul 7, 2021
60a7bc8
Add new <GPTCheck> function
htcfreek Jul 7, 2021
5a112b0
Fix function <GPTCheck>
htcfreek Jul 7, 2021
e578335
Add new <SpaceCheck>
htcfreek Jul 7, 2021
a33ccfc
Tidy source
htcfreek Jul 7, 2021
8044e39
Fixes and improving progress
htcfreek Jul 7, 2021
6439d9d
Small fixes and improvements
htcfreek Jul 8, 2021
c87658e
Merge branch <Main> from <rcmaehl/WhyNotWin11>
htcfreek Jul 8, 2021
ae1ede2
Fix merge conflict
htcfreek Jul 8, 2021
1a0c96f
Fix typos
htcfreek Jul 8, 2021
678b562
Fix function <GetDiskProperties>
htcfreek Jul 8, 2021
771e9c8
Improve check message
htcfreek Jul 8, 2021
3f4c374
Add missing word <Warning> to lang files (#440)
htcfreek Jul 8, 2021
9546595
update lang files
htcfreek Jul 8, 2021
ca32c02
Fix typo in .gitignore
htcfreek Jul 8, 2021
6fb9241
Fix lang files after update
htcfreek Jul 8, 2021
a10cc0c
Update disk checks; Tidy source
htcfreek Jul 8, 2021
8821c72
small fixes
htcfreek Jul 8, 2021
1c0b4df
Remove added word <Warning> (See conversation on #440)
htcfreek Jul 8, 2021
5bc1ccc
Fix incorrect lang files.
htcfreek Jul 9, 2021
678e685
Merge branch <Main> from <rcmaehl/WhyNotWin11>
htcfreek Jul 9, 2021
838eafb
Fix Typo
htcfreek Jul 9, 2021
8fc267b
Tidy source
htcfreek Jul 9, 2021
b1af270
Clean up lang files
htcfreek Jul 9, 2021
220d422
Merge branch <Main> from <rcmeahl/WhyNotWin11>
htcfreek Jul 10, 2021
f591834
Fix merge mistakes and improve loading bar
htcfreek Jul 10, 2021
c1bba70
Tidy source
htcfreek Jul 10, 2021
8b73195
Merge branch 'main' into Feature/improveDiskCheckTwo
rcmaehl Jul 11, 2021
15fd318
Fix to many wmi calls are done.
htcfreek Jul 11, 2021
e87ed86
Merge branch 'main' into Feature/improveDiskCheckTwo
htcfreek Jul 11, 2021
c74fa13
Fix layout
htcfreek Jul 11, 2021
b0bd0c9
fix build warnings
htcfreek Jul 11, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ WhyNot.txt
WhyNotWin11_stripped.au3
del.au3
Config/config.st
theme.def
**/Backup/*.au3
theme.def
12 changes: 7 additions & 5 deletions Langs/0000.lang
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,15 @@ Not Currently Listed as Compatible=
Listed as Compatible=
Cores=
Threads=
GPT Detected=
GPT Not Detected=
Requirement met.=
Requirement not met.=
Enabled=
Supported=
Not Supported=
Disabled / Not Detected=
Drive(s) Meet Requirements=
0 Drives Meet Requirements=
Partition and disk passed.=
Partition not passed, but disk.=
Partition and disk not passed.=
TPM Missing / Disabled=
Detected=
DirectX 12 and WDDM 3=
Expand All @@ -68,8 +69,9 @@ Invalid Release Types Received!=
Update Available=
An Update is Available, would you like to download it?=
Done=
Loading WMIC=
Warning=
Loading ...=
User interface=
[Descriptions]
Architecture=The amount of data your CPU and OS can process at once. 32-Bit OS result requires a disk wipe and new Windows 11 install. 32-Bit CPU requires a CPU replacement.
Boot=A method your motherboard uses to load Windows. Legacy results can be fixed on newer motherboards in your BIOS/UEFI settings. Refer to your motherboard manual.
Expand Down
10 changes: 8 additions & 2 deletions Langs/0407.lang
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,15 @@ Not Currently Listed as Compatible=CPU derzeit nicht als kompatibel gelistet
Listed as Compatible=CPU als kompatibel gelistet
Cores=Kerne
Threads=Threads
GPT Detected=GPT erkannt
GPT Not Detected=GPT nicht erkannt
Requirement met.=Anforderung erfüllt.
Requirement not met.=Anforderung nicht erfüllt.
Enabled=aktiviert
Supported=unterstützt
Not Supported=nicht unterstützt
Disabled / Not Detected=deaktiviert oder nicht erkannt
Partition and disk passed.=Partition und Laufwerk bestanden.
Partition not passed, but disk.=Partition nicht bestanden, aber Laufwerk.
Partition and disk not passed.=Partition und Laufwerk nicht bestanden.
Drive(s) Meet Requirements=Laufwerk(e) kompatibel
0 Drives Meet Requirements=0 Laufwerk(e) kompatibel
TPM Missing / Disabled=TPM fehlt oder deaktiviert
Expand All @@ -66,6 +69,9 @@ Invalid Release Types Received!=Ungültige Release-Types erhalten!
Update Available=Update verfügbar
An Update is Available, would you like to download it?=Ein Update ist verfügbar. Möchten Sie es herunterladen?
Done=Fertig
Warning=Warnung
Loading ...=Lade ...
User interface=Benutzeroberfläche
Loading WMIC=Lade WMIC
Warning=Warnung
[Descriptions]
Expand Down
11 changes: 7 additions & 4 deletions Langs/0409.lang
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,14 @@ Not Currently Listed as Compatible=Not Currently Listed as Compatible
Listed as Compatible=Listed as Compatible
Cores=# Cores
Threads=# Threads
GPT Detected=GPT Detected
GPT Not Detected=GPT Not Detected
Requirement met.=Requirement met.
Requirement not met.=Requirement not met.
Enabled=Enabled
Supported=Supported
Disabled / Not Detected=Disabled / Not Detected
Drive(s) Meet Requirements=Drive(s) Meet Requirements
Partition and disk passed.=Partition and disk passed.
Partition not passed, but disk.=Partition not passed, but disk.
Partition and disk not passed.=Partition and disk not passed.
TPM Missing / Disabled=TPM Missing / Disabled
Not Supported=Not Supported
Detected=Detected
Expand All @@ -65,8 +67,9 @@ Invalid Release Types Received!=Invalid Release Types Received!
Update Available=Update Available
An Update is Available, would you like to download it?=An Update is Available, would you like to download it?
Done=Done
Loading WMIC=Loading WMIC
Warning=Warning
Loading ...=Loading ...
User interface=User interface
[Descriptions]
Architecture=The amount of data your CPU and OS can process at once. 32-Bit OS result requires a disk wipe and new Windows 11 install. 32-Bit CPU requires a CPU replacement.
Boot=A method your motherboard uses to load Windows. Legacy results can be fixed on newer motherboards in your BIOS/UEFI settings. Refer to your motherboard manual.
Expand Down
104 changes: 59 additions & 45 deletions WhyNotWin11.au3
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ FileChangeDir(@SystemDir)

If @OSVersion = 'WIN_10' Then DllCall(@SystemDir & "\User32.dll", "bool", "SetProcessDpiAwarenessContext", "HWND", "DPI_AWARENESS_CONTEXT" - 1)

#Region Includes
; Include default UDFs
#include <File.au3>
#include <Misc.au3>
#include <Array.au3>
Expand All @@ -49,17 +51,18 @@ If @OSVersion = 'WIN_10' Then DllCall(@SystemDir & "\User32.dll", "bool", "SetPr
#include <StringConstants.au3>
#include <WindowsConstants.au3>

Global $WINDOWS_DRIVE = EnvGet("SystemDrive")

; Include external functions
#include "Includes\ResourcesEx.au3"
#include "Includes\GetDiskInfoFromWmi.au3"

; Include internal WNW11 scripts
#include "Includes\_WMIC.au3"
#include "Includes\_Checks.au3"
#include "Includes\_Theming.au3"
#include "Includes\_Resources.au3"
#include "Includes\_GetDiskInfo.au3"
#include "Includes\_Translations.au3"
; #include "includes\WhyNotWin11_accessibility.au3"
#EndRegion Includes

Opt("TrayIconHide", 1)
Opt("TrayAutoPause", 0)
Expand Down Expand Up @@ -162,11 +165,10 @@ Func ChecksOnly()

$aDirectX = _DirectXStartCheck()

Local $aDisks, $aPartitions
_GetDiskInfoFromWmi($aDisks, $aPartitions, 1)
$aResults[6][0] = _GPTCheck($aDisks)
$aResults[6][1] = @error
$aResults[6][2] = @extended
_GetDiskProperties()
$aResults[6][0] = _GPTCheck(0)
$aResults[6][1] = (_GPTCheck(0) = "GPT") ? "GPT" : (_GPTCheck(0) = "MBR") ? "MBR" : ""
$aResults[6][2] = ""

$aResults[7][0] = _MemCheck()
$aResults[7][1] = @error
Expand All @@ -176,9 +178,9 @@ Func ChecksOnly()
$aResults[8][1] = @error
$aResults[8][2] = @extended

$aResults[9][0] = _SpaceCheck()
$aResults[9][1] = @error
$aResults[9][2] = @extended
$aResults[9][0] = _SpaceCheck(0)
$aResults[9][1] = (_SpaceCheck(1) <> "Error_CheckFailed") ? _SpaceCheck(1) : "" ; Disk size
$aResults[9][2] = (_SpaceCheck(2) <> "Error_CheckFailed") ? _SpaceCheck(2) : "" ; Partiton size

$aResults[10][0] = _TPMCheck()
$aResults[10][1] = @error
Expand Down Expand Up @@ -224,22 +226,21 @@ Func Main()
Local Enum $iFail = 0, $iPass, $iUnsure, $iWarn
Local Enum $iBackground = 0, $iText, $iSidebar, $iFooter

Local $aDisks, $aPartitions
Local Const $DPI_RATIO = _GDIPlus_GraphicsGetDPIRatio()[0]
Local Enum $FontSmall, $FontMedium, $FontLarge, $FontExtraLarge

ProgressOn("WhyNotWin11", _Translate($iMUI, "Loading WMIC"))
#Region Init WMI data
ProgressOn("WhyNotWin11", _Translate($iMUI, "Loading ..."))
ProgressSet(0, "_GetCPUInfo()")
_GetCPUInfo()
ProgressSet(20, "_GetDiskInfo()")
_GetDiskInfo()
ProgressSet(20, "_GetDiskProperties()")
_GetDiskProperties()
ProgressSet(40, "_GetGPUInfo()")
_GetGPUInfo()
ProgressSet(60, "_GetTPMInfo()")
_GetTPMInfo()
ProgressSet(80, "_GetDiskInfoFromWmi")
_GetDiskInfoFromWmi($aDisks, $aPartitions, 1)
ProgressSet(100, _Translate($iMUI, "Done"))
ProgressSet(80, _Translate($iMUI, "User interface"))
#EndRegion Init WMI data

Local $hGUI = GUICreate("WhyNotWin11", 800, 600, -1, -1, BitOR($WS_POPUP, $WS_BORDER))
GUISetBkColor($aColors[$iBackground])
Expand All @@ -248,14 +249,14 @@ Func Main()
GUICtrlSetDefColor($aColors[$iText])
GUICtrlSetDefBkColor($aColors[$iBackground])

#cs
Local $sCheck = _CheckAppsUseLightTheme()
If @error Then
;;;
ElseIf Not $sCheck Then
GUICtrlSetDefColor(0xFFFFFF)
EndIf
#ce
#cs
Local $sCheck = _CheckAppsUseLightTheme()
If @error Then
;;;
ElseIf Not $sCheck Then
GUICtrlSetDefColor(0xFFFFFF)
EndIf
#ce

Local $hDumpLang = GUICtrlCreateDummy()

Expand Down Expand Up @@ -418,7 +419,7 @@ Func Main()
GUICtrlSetFont(-1, $aFonts[$FontLarge] * $DPI_RATIO, $FW_NORMAL)
$hCheck[$iRow][2] = GUICtrlCreateLabel(_Translate($iMUI, "Checking..."), 450, 110 + $iRow * 40, 300, 40, $SS_SUNKEN)
Switch $iRow
Case 0, 3, 9
Case 0, 3, 6, 9
GUICtrlSetStyle(-1, $SS_CENTER + $SS_SUNKEN)
Case Else
GUICtrlSetStyle(-1, $SS_CENTER + $SS_SUNKEN + $SS_CENTERIMAGE)
Expand Down Expand Up @@ -511,18 +512,18 @@ Func Main()
Local $aDirectX
$aDirectX = _DirectXStartCheck()

If _GPTCheck($aDisks) Then
If @error Then
_GUICtrlSetState($hCheck[6][0], $iPass)
GUICtrlSetData($hCheck[6][2], _Translate($iMUI, "GPT Detected"))
Else
#Region - GPTCheck
Switch _GPTCheck(0)
Case True
_GUICtrlSetState($hCheck[6][0], $iPass)
GUICtrlSetData($hCheck[6][2], _Translate($iMUI, "GPT Detected"))
EndIf
Else
GUICtrlSetData($hCheck[6][2], _Translate($iMUI, "GPT Not Detected"))
_GUICtrlSetState($hCheck[6][0], $iFail)
EndIf
GUICtrlSetData($hCheck[6][2], _Translate($iMUI, "System disk: GPT") & @CRLF & _Translate($iMUI, "Requirement met."))
Case False
_GUICtrlSetState($hCheck[6][0], $iFail)
GUICtrlSetData($hCheck[6][2], _Translate($iMUI, "System disk: MBR") & @CRLF & _Translate($iMUI, "Requirement not met."))
Case Else
; Do Nothing!!
EndSwitch
#EndRegion - GPTCheck

If _MemCheck() Then
_GUICtrlSetState($hCheck[7][0], $iPass)
Expand All @@ -544,13 +545,25 @@ Func Main()
GUICtrlSetData($hCheck[8][2], _Translate($iMUI, "Disabled / Not Detected"))
EndSwitch

_SpaceCheck()
GUICtrlSetData($hCheck[9][2], @error & " GB " & $WINDOWS_DRIVE & @CRLF & @extended & " " & _Translate($iMUI, "Drive(s) Meet Requirements"))
If _SpaceCheck() Then
#Region - SpaceCheck
Local $iDiskSpace = _SpaceCheck(2)
Local $iPartitionSpace = _SpaceCheck(4)
Local $sSpaceResultFirstLine = _SpaceCheck(3) & " " & $iPartitionSpace & " GB, " & _Translate($iMUI, "Disk") & " " & _SpaceCheck(1) & ": " & $iDiskSpace & " GB"
; -- Check
If $iDiskSpace >= 64 And $iPartitionSpace >= 64 Then
; Partition and Disk >= 64 GB
_GUICtrlSetState($hCheck[9][0], $iPass)
Else
GUICtrlSetData($hCheck[9][2], $sSpaceResultFirstLine & @CRLF & _Translate($iMUI, "Partition and disk passed."))
ElseIf $iDiskSpace < 64 And $iPartitionSpace >= 64 Then
; Partition < 64 GB and Disk >= 64 GB
_GUICtrlSetState($hCheck[9][0], $iWarn)
GUICtrlSetData($hCheck[9][2], $sSpaceResultFirstLine & @CRLF & _Translate($iMUI, "Partition not passed, but disk."))
ElseIf $iDiskSpace < 64 And $iPartitionSpace < 64 Then
; Partition and Disk < 64 GB
_GUICtrlSetState($hCheck[9][0], $iFail)
GUICtrlSetData($hCheck[9][2], $sSpaceResultFirstLine & @CRLF & _Translate($iMUI, "Partition and disk not pass."))
EndIf
#EndRegion - SpaceCheck

Select
Case _GetTPMInfo(0) = False
Expand Down Expand Up @@ -591,9 +604,10 @@ Func Main()

#EndRegion Settings GUI

GUISwitch($hGUI)

ProgressSet(100)
ProgressOff()

GUISwitch($hGUI)
GUISetState(@SW_SHOW, $hGUI)

Local $hMsg
Expand Down Expand Up @@ -836,4 +850,4 @@ Func _GUICtrlSetState($hCtrl, $iState)
GUICtrlSetData($hCtrl, "!") ; Warn
GUICtrlSetBkColor($hCtrl, 0xF4C141)
EndSwitch
EndFunc ;==>_GUICtrlSetState
EndFunc ;==>_GUICtrlSetState
5 changes: 4 additions & 1 deletion includes/GetDiskInfoFromWmi.au3
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,15 @@
Language ............: English
Description .........: Get disk and partition informations from WMI.
Author ..............: htcfreek (Heiko) - https://github.com/htcfreek [original]
Modified ............:
Modified ............: 2021-07-12 (htcfreek): Temporary fix build warnings until new version is released.
Required includes ...: Array.au3
Dll .................:
===============================================================================================================================

CHANGELOG:
2021-07-12 (v1.4.1 + temporary fix)
Fix: Build warings for non declared vars $sDiskHeader, $sPartitionHeader

2021-07-06 (v1.4.1)
Fixed: Code styling

Expand Down
Loading