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

Fix Storage detection on WinPE. Advise on required WinPE setup for proper results. #656

Open
beta-tester opened this issue Feb 9, 2022 · 12 comments
Assignees
Labels
checks Check improvement or new check. enhancement New feature or request

Comments

@beta-tester
Copy link

Describe the bug
there is a use case to run WhyNotWin11 under a Win PE environment.
see Windows-11-Kompatibilität ermitteln – ohne installiertes Windows
but doing it WhyNotWin11 will show some data wrongly:

  • the partition type of the external boot media (WinPE) is shown but the internal media should be taken.
  • the available size of partition of the external boot media (WinPE) is shown, but the internal media should be taken.
  • the real graphic card capability isn't able to detect, because of the limited driver of the WinPE environment.

To Reproduce

  • create a windows installation media
  • copy WhyNotWin11 to that media
  • boot PC into the windows install media
  • hit [Shift]+[F10] to open a cmd box
  • run WhyNotWin11.exe in the cmd-box

Expected behavior
i would expect that data that can not be detected correctly under a WinPE environment would be marked as status "Unknown"

Screenshots
Läuft WhyNotWin11 unter Windows PE, können Sie die Angaben zu DirectX-Version, Partitionslayout und Laufwerksspeicher ignorieren – die anderen aber nicht.

Desktop (please complete the following information):

  • OS: Windows Preinstallation Environment (Win PE / e.g. Windows installation media)
  • Version 2.4.3.1
@rcmaehl rcmaehl self-assigned this Feb 9, 2022
@rcmaehl rcmaehl added checks Check improvement or new check. enhancement New feature or request labels Feb 9, 2022
@WilloIzCitron
Copy link
Contributor

WilloIzCitron commented Mar 12, 2022

WhyNotWin11 on Windows PE (Pre-Installation Environment) Problems:

1- DxDiag: its related on #594
2- GPT: because WMIC doesn't detect disks
3- Storage: same on 2
4- TPM: because WMIC doesn't detect TPM

@beta-tester
Copy link
Author

beta-tester commented Mar 12, 2022

when things can't be detected because of limitations of the environment, then maybe don't list them or mark them as kind of "not detectable" / Yellow.

when WMIC isn't able to detect the GPT & storage, maybe the command DISKPART.EXE can as workaround for WinPE environment. (LIST / SELECT / DETAIL for DISK / PARTITION)

@xCSxXenon
Copy link
Contributor

when things can't be detected because of limitations of the environment, then maybe don't list them or mark them as kind of "not detectable" / Yellow.

when WMIC isn't able to detect the GPT & storage, maybe the command DISKPART.EXE can as workaround for WinPE environment. (LIST / SELECT / DETAIL for DISK / PARTITION)

Or just prevent it from running in a PE at all

@PicoMitchell
Copy link

I work at a refurbisher and we are using WhyNotWin11 in WinPE (actually WinRE for more capabilities) to determine if Windows 11 can be installed.

TPM can indeed be properly detected in WinPE/WinRE by WhyNotWin11 and manually using PowerShell. We have all the PowerShell features installed into WinPE/WinRE as well though, which may be required for this check to work (I'm not sure since I never use WinPE or WinRE without PowerShell). But, I have seen an issue with WinRE from Win 10 21H2 that if some newer Cumulative Updates are installed into the WinRE image, the TPM check fails for some reason. I've worked around this issue by only installing the older Cumulative Update into WinRE that doesn't break TPM checking. This issue appears to not affect a fully updated WinRE from Windows 11 though, so that can be used instead as well.

For the Storage issue, I simply ignore the failure from WhyNotWin11 and wrote my own check in PowerShell to make sure the drive that will actually be used is 64GB or larger. And the GPT check is irrelevant for us since our scripts we will be formatting the drive to GPT before installation anyway.

The GPU check does indeed fail in WinPE/WinRE since GPU drivers are not available, which is understandable. Also, that's not really a big deal as the other checks (such as the compatible CPU list check) are invaluable to have in WinPE/WinRE to be able to even begin to determine which version of Windows should be installed. Also, it's extremely unlikely that a system that passes all other checks will have an incompatible GPU.

After installation and all drivers have been installed, we run WhyNotWin11 again to double check and confirm that the GPU check passed.

Mainly, I want @rcmaehl and others to know that even with WhyNotWin11 not being able to perform every check in WinPE/WinRE, it is an absolutely invaluable tool to be able to run before installation to determine which version of Windows can be installed.

It would be a great loss for us if the choice was made to block WhyNotWin11 from running in WinPE/WinRE just because it can't check 100% of every requirement. The compatible CPU list check alone makes it an invaluable tool in WinPE/WinRE. The other checks aren't even that hard to code yourself, but maintaining and checking compatible CPUs would be very cumbersome to do manually.

@rcmaehl
Copy link
Owner

rcmaehl commented Mar 26, 2022

I work at a refurbisher and we are using WhyNotWin11 in WinPE (actually WinRE for more capabilities) to determine if Windows 11 can be installed.

TPM can indeed be properly detected in WinPE/WinRE by WhyNotWin11 and manually using PowerShell. We have all the PowerShell features installed into WinPE/WinRE as well though, which may be required for this check to work (I'm not sure since I never use WinPE or WinRE without PowerShell). But, I have seen an issue with WinRE from Win 10 21H2 that if some newer Cumulative Updates are installed into the WinRE image, the TPM check fails for some reason. I've worked around this issue by only installing the older Cumulative Update into WinRE that doesn't break TPM checking. This issue appears to not affect a fully updated WinRE from Windows 11 though, so that can be used instead as well.

For the Storage issue, I simply ignore the failure from WhyNotWin11 and wrote my own check in PowerShell to make sure the drive that will actually be used is 64GB or larger. And the GPT check is irrelevant for us since our scripts we will be formatting the drive to GPT before installation anyway.

The GPU check does indeed fail in WinPE/WinRE since GPU drivers are not available, which is understandable. Also, that's not really a big deal as the other checks (such as the compatible CPU list check) are invaluable to have in WinPE/WinRE to be able to even begin to determine which version of Windows should be installed. Also, it's extremely unlikely that a system that passes all other checks will have an incompatible GPU.

After installation and all drivers have been installed, we run WhyNotWin11 again to double check and confirm that the GPU check passed.

Mainly, I want @rcmaehl and others to know that even with WhyNotWin11 not being able to perform every check in WinPE/WinRE, it is an absolutely invaluable tool to be able to run before installation to determine which version of Windows can be installed.

It would be a great loss for us if the choice was made to block WhyNotWin11 from running in WinPE/WinRE just because it can't check 100% of every requirement. The compatible CPU list check alone makes it an invaluable tool in WinPE/WinRE. The other checks aren't even that hard to code yourself, but maintaining and checking compatible CPUs would be very cumbersome to do manually.

Would you be willing to share how you setup WinPE so I can get a guide written up for people? Also, I'll see about fixing storage, can you advise what method you're using?

@rcmaehl rcmaehl changed the title some data are detected wrongly under Windows PE Fix Storage detection on WinPE. Advise on required WinPE setup for proper results. Mar 26, 2022
@PicoMitchell
Copy link

PicoMitchell commented Mar 26, 2022

This isn't my latest code, I will try to commit my latest changes this coming week. But, this version of it all can run WhyNotWin11 in WinRE. UPDATE 04/07/22: I've committed my latest code and updated the links below.

The first step is extracting WinRE from the Windows WIM (and running updates on both the Windows and WinRE WIMs): https://github.com/freegeek-pdx/Windows-Deployment-Scripts/blob/main/Create%20Windows%20Install%20Image/Create%20Windows%20Install%20Image.ps1

Next, WinPE or WinRE which will be used for our installation environment is customized with PowerShell etc as well as our install script and other EXEs and DLLs (the result is the WinRE that runs WhyNotWin11): https://github.com/freegeek-pdx/Windows-Deployment-Scripts/blob/main/Create%20WinPE%20Image/Create%20WinPE%20Image.ps1

Here is the code that runs WhyNotWin11 in the install script: https://github.com/freegeek-pdx/Windows-Deployment-Scripts/blob/c18f143c49b4e31520ff1faaf096b5d4169377e0/Create%20WinPE%20Image/System32%20Folder%20Resources/Install%20Windows.ps1#L939

And here is the line that checks the capacity of the chosen install drive: https://github.com/freegeek-pdx/Windows-Deployment-Scripts/blob/c18f143c49b4e31520ff1faaf096b5d4169377e0/Create%20WinPE%20Image/System32%20Folder%20Resources/Install%20Windows.ps1#L1011

There is a lot going on in the Create Windows Install Image and Create WinPE Image scripts, but hopefully it will all make decent sense. Let me know if more of a breakdown of the important parts is needed.

rcmaehl added a commit that referenced this issue Mar 30, 2022
rcmaehl added a commit that referenced this issue Mar 30, 2022
rcmaehl added a commit that referenced this issue Mar 30, 2022
@rcmaehl
Copy link
Owner

rcmaehl commented Mar 30, 2022

@PicoMitchell

I've verified TPM is properly detected in WinPE.

Additionally, the follow changes are added to the latest dev build and 2.4.3.2 which will release soon™:

  • If WinPE is detected, it will now check C: by default.
  • Added /drive <driveletter>: or /d <driveletter>: to change space check

I'll see about adding in working DirectX + WDDM detection for WinPE. I'm sure the cards are detected in WinPE, just not recognized or initialized. It'll require #58 to be completed first.

@PicoMitchell
Copy link

PicoMitchell commented Mar 30, 2022

Nice additions with the drive check for WinPE!

It would be super awesome to be able to detect if a GPU is supported from within WinPE without drivers installed as well!

@PicoMitchell
Copy link

I know that GPU Device IDs can be detected in WinPE (at least when PowerShell + WMI stuff is installed) using Get-CimInstance Win32_PnPEntity via PowerShell (Get-PnpDevice is not available in WinPE).

To detect GPUs in WinPE, I use a variation of the following PowerShell code:

$pnpEntitiesWithVendorsAndDevices = Get-CimInstance Win32_PnPEntity -Filter "DeviceID LIKE '%VEN_%DEV_%'" -Property Name,DeviceID,CompatibleID
$pnpEntitiesWithVendorsAndDevices | ForEach-Object { foreach ($thisCompatibleID in $_.CompatibleID) { if ($thisCompatibleID.Contains('CC_') -or $thisCompatibleID.Contains('Class_')) { $_ | Add-Member CompatibleIDwithClass $thisCompatibleID; break } } }
$pnpEntitiesWithVendorsAndDevices | Format-List CompatibleIDwithClass,DeviceID

This outputs a list which is then parsed further (via a Java app) to match up with the actual GPU name from the PCI ID Repository list: https://pci-ids.ucw.cz

But, that is just for display purposes to be able to show the actual GPU brand and model without drivers being installed. I don't have any list of DirectX 12 compatible cards.

@PicoMitchell
Copy link

For my use case, where a drive won't even be formatted with a Drive Letter yet, it would be more valuable to be able to specify a Disk ID (number) to have its capacity checked. But, it's really not a big deal for me since it's simple to check that after running of WhyNotWin11 and the code it already written for that.

@rcmaehl
Copy link
Owner

rcmaehl commented Mar 31, 2022

For my use case, where a drive won't even be formatted with a Drive Letter yet, it would be more valuable to be able to specify a Disk ID (number) to have its capacity checked. But, it's really not a big deal for me since it's simple to check that after running of WhyNotWin11 and the code it already written for that.

I'll see what can be done regardless :)

@mkhenry41
Copy link

when things can't be detected because of limitations of the environment, then maybe don't list them or mark them as kind of "not detectable" / Yellow.
when WMIC isn't able to detect the GPT & storage, maybe the command DISKPART.EXE can as workaround for WinPE environment. (LIST / SELECT / DETAIL for DISK / PARTITION)

Or just prevent it from running in a PE at all

It would be super stupendous to be suitable to descry if a GPU is supported from within WinPE without motorists installed as well!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
checks Check improvement or new check. enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

7 participants
@rcmaehl @beta-tester @PicoMitchell @xCSxXenon @WilloIzCitron @mkhenry41 and others