mirror of
https://github.com/rbalsleyMSFT/FFU.git
synced 2026-06-14 02:09:35 -06:00
feat: Add option to dynamically build PE drivers
Introduces a new feature, `UseDriversAsPEDrivers`, that allows WinPE drivers to be sourced directly from the main driver repository. When enabled, the script scans all available drivers, parses their INF files, and copies only the essential driver types (e.g., storage, mouse, keyboard, touchpad, system devices) needed for WinPE. This eliminates the need to maintain a separate, manually curated `PEDrivers` folder. The UI is updated with a new checkbox that becomes visible when "Copy PE Drivers" is selected, making this a sub-option. Parameter validation is also adjusted to support this new workflow.
This commit is contained in:
@@ -175,6 +175,7 @@ function Get-GeneralDefaults {
|
||||
InstallDrivers = $false
|
||||
CopyDrivers = $false
|
||||
CopyPEDrivers = $false
|
||||
UseDriversAsPEDrivers = $false
|
||||
UpdateADK = $true
|
||||
CompressDownloadedDriversToWim = $false
|
||||
}
|
||||
@@ -292,11 +293,14 @@ function Update-DriverCheckboxStates {
|
||||
$installDriversChk = $State.Controls.chkInstallDrivers
|
||||
$copyDriversChk = $State.Controls.chkCopyDrivers
|
||||
$compressWimChk = $State.Controls.chkCompressDriversToWIM
|
||||
$copyPEDriversChk = $State.Controls.chkCopyPEDrivers
|
||||
$useDriversAsPeChk = $State.Controls.chkUseDriversAsPEDrivers
|
||||
|
||||
# Default to enabled, then apply disabling rules
|
||||
$installDriversChk.IsEnabled = $true
|
||||
$copyDriversChk.IsEnabled = $true
|
||||
$compressWimChk.IsEnabled = $true
|
||||
$copyPEDriversChk.IsEnabled = $true
|
||||
|
||||
if ($installDriversChk.IsChecked) {
|
||||
$copyDriversChk.IsEnabled = $false
|
||||
@@ -310,6 +314,16 @@ function Update-DriverCheckboxStates {
|
||||
if ($compressWimChk.IsChecked) {
|
||||
$installDriversChk.IsEnabled = $false
|
||||
}
|
||||
|
||||
# Sub-option visibility logic: only show UseDriversAsPEDrivers when CopyPEDrivers is checked
|
||||
if ($copyPEDriversChk.IsChecked) {
|
||||
$useDriversAsPeChk.Visibility = 'Visible'
|
||||
}
|
||||
else {
|
||||
# Parent unchecked: hide and clear sub-option
|
||||
$useDriversAsPeChk.IsChecked = $false
|
||||
$useDriversAsPeChk.Visibility = 'Collapsed'
|
||||
}
|
||||
}
|
||||
|
||||
# Function to manage the visibility of Office UI panels
|
||||
|
||||
Reference in New Issue
Block a user