mirror of
https://github.com/rbalsleyMSFT/FFU.git
synced 2026-06-14 02:09:35 -06:00
Add 'Remove Apps Folder Content' checkbox to UI and update related logic
- Introduced a new checkbox in the UI for removing application content in the Apps folder after FFU capture. - Updated the Get-UIConfig function to retrieve the state of the new checkbox. - Added default value for the new 'RemoveApps' parameter in the general defaults.
This commit is contained in:
@@ -648,7 +648,7 @@ function Get-UIConfig {
|
|||||||
Processors = [int]$window.FindName('txtProcessors').Text
|
Processors = [int]$window.FindName('txtProcessors').Text
|
||||||
ProductKey = $window.FindName('txtProductKey').Text
|
ProductKey = $window.FindName('txtProductKey').Text
|
||||||
PromptExternalHardDiskMedia = $window.FindName('chkPromptExternalHardDiskMedia').IsChecked
|
PromptExternalHardDiskMedia = $window.FindName('chkPromptExternalHardDiskMedia').IsChecked
|
||||||
RemoveApps = $false # Parameter from Sample_default.json, no UI control
|
RemoveApps = $window.FindName('chkRemoveApps').IsChecked
|
||||||
RemoveFFU = $window.FindName('chkRemoveFFU').IsChecked
|
RemoveFFU = $window.FindName('chkRemoveFFU').IsChecked
|
||||||
RemoveUpdates = $false # Parameter from Sample_default.json, no UI control
|
RemoveUpdates = $false # Parameter from Sample_default.json, no UI control
|
||||||
ShareName = $window.FindName('txtShareName').Text
|
ShareName = $window.FindName('txtShareName').Text
|
||||||
@@ -1601,6 +1601,7 @@ $window.Add_Loaded({
|
|||||||
$script:chkInstallDrivers = $window.FindName('chkInstallDrivers')
|
$script:chkInstallDrivers = $window.FindName('chkInstallDrivers')
|
||||||
$script:chkCopyDrivers = $window.FindName('chkCopyDrivers')
|
$script:chkCopyDrivers = $window.FindName('chkCopyDrivers')
|
||||||
$script:chkCompressDriversToWIM = $window.FindName('chkCompressDriversToWIM')
|
$script:chkCompressDriversToWIM = $window.FindName('chkCompressDriversToWIM')
|
||||||
|
$script:chkRemoveApps = $window.FindName('chkRemoveApps')
|
||||||
|
|
||||||
# AppsScriptVariables Controls
|
# AppsScriptVariables Controls
|
||||||
$script:chkDefineAppsScriptVariables = $window.FindName('chkDefineAppsScriptVariables')
|
$script:chkDefineAppsScriptVariables = $window.FindName('chkDefineAppsScriptVariables')
|
||||||
@@ -1726,6 +1727,7 @@ $window.Add_Loaded({
|
|||||||
$window.FindName('chkCleanupDeployISO').IsChecked = $script:generalDefaults.CleanupDeployISO
|
$window.FindName('chkCleanupDeployISO').IsChecked = $script:generalDefaults.CleanupDeployISO
|
||||||
$window.FindName('chkCleanupDrivers').IsChecked = $script:generalDefaults.CleanupDrivers
|
$window.FindName('chkCleanupDrivers').IsChecked = $script:generalDefaults.CleanupDrivers
|
||||||
$window.FindName('chkRemoveFFU').IsChecked = $script:generalDefaults.RemoveFFU
|
$window.FindName('chkRemoveFFU').IsChecked = $script:generalDefaults.RemoveFFU
|
||||||
|
$script:chkRemoveApps.IsChecked = $script:generalDefaults.RemoveApps # New
|
||||||
|
|
||||||
# Hyper-V Settings defaults from General Defaults
|
# Hyper-V Settings defaults from General Defaults
|
||||||
$window.FindName('txtDiskSize').Text = $script:generalDefaults.DiskSizeGB
|
$window.FindName('txtDiskSize').Text = $script:generalDefaults.DiskSizeGB
|
||||||
@@ -3023,6 +3025,7 @@ $btnLoadConfig.Add_Click({
|
|||||||
Set-UIValue -ControlName 'chkCleanupDeployISO' -PropertyName 'IsChecked' -ConfigObject $configContent -ConfigKey 'CleanupDeployISO' -WindowInstance $window
|
Set-UIValue -ControlName 'chkCleanupDeployISO' -PropertyName 'IsChecked' -ConfigObject $configContent -ConfigKey 'CleanupDeployISO' -WindowInstance $window
|
||||||
Set-UIValue -ControlName 'chkCleanupDrivers' -PropertyName 'IsChecked' -ConfigObject $configContent -ConfigKey 'CleanupDrivers' -WindowInstance $window
|
Set-UIValue -ControlName 'chkCleanupDrivers' -PropertyName 'IsChecked' -ConfigObject $configContent -ConfigKey 'CleanupDrivers' -WindowInstance $window
|
||||||
Set-UIValue -ControlName 'chkRemoveFFU' -PropertyName 'IsChecked' -ConfigObject $configContent -ConfigKey 'RemoveFFU' -WindowInstance $window
|
Set-UIValue -ControlName 'chkRemoveFFU' -PropertyName 'IsChecked' -ConfigObject $configContent -ConfigKey 'RemoveFFU' -WindowInstance $window
|
||||||
|
Set-UIValue -ControlName 'chkRemoveApps' -PropertyName 'IsChecked' -ConfigObject $configContent -ConfigKey 'RemoveApps' -WindowInstance $window # New
|
||||||
|
|
||||||
# Hyper-V Settings
|
# Hyper-V Settings
|
||||||
Set-UIValue -ControlName 'cmbVMSwitchName' -PropertyName 'SelectedItem' -ConfigObject $configContent -ConfigKey 'VMSwitchName' -WindowInstance $window
|
Set-UIValue -ControlName 'cmbVMSwitchName' -PropertyName 'SelectedItem' -ConfigObject $configContent -ConfigKey 'VMSwitchName' -WindowInstance $window
|
||||||
|
|||||||
@@ -235,6 +235,7 @@
|
|||||||
<CheckBox x:Name="chkCleanupDeployISO" Content="Cleanup Deploy ISO" Margin="5" VerticalAlignment="Center" Tag="Remove WinPE deployment ISO after FFU capture."/>
|
<CheckBox x:Name="chkCleanupDeployISO" Content="Cleanup Deploy ISO" Margin="5" VerticalAlignment="Center" Tag="Remove WinPE deployment ISO after FFU capture."/>
|
||||||
<CheckBox x:Name="chkCleanupDrivers" Content="Cleanup Drivers" Margin="5" VerticalAlignment="Center" Tag="Remove drivers folder after FFU capture."/>
|
<CheckBox x:Name="chkCleanupDrivers" Content="Cleanup Drivers" Margin="5" VerticalAlignment="Center" Tag="Remove drivers folder after FFU capture."/>
|
||||||
<CheckBox x:Name="chkRemoveFFU" Content="Remove FFU" Margin="5" VerticalAlignment="Center" Tag="Remove FFU after copying to USB drive."/>
|
<CheckBox x:Name="chkRemoveFFU" Content="Remove FFU" Margin="5" VerticalAlignment="Center" Tag="Remove FFU after copying to USB drive."/>
|
||||||
|
<CheckBox x:Name="chkRemoveApps" Content="Remove Apps Folder Content" Margin="5" VerticalAlignment="Center" Tag="When set to $true, will remove the application content in the Apps folder after the FFU has been captured."/>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</Grid>
|
</Grid>
|
||||||
</ScrollViewer>
|
</ScrollViewer>
|
||||||
|
|||||||
@@ -292,6 +292,7 @@ function Get-GeneralDefaults {
|
|||||||
CleanupDeployISO = $false
|
CleanupDeployISO = $false
|
||||||
CleanupDrivers = $false
|
CleanupDrivers = $false
|
||||||
RemoveFFU = $false
|
RemoveFFU = $false
|
||||||
|
RemoveApps = $false # New
|
||||||
# Hyper-V Settings Defaults
|
# Hyper-V Settings Defaults
|
||||||
VMHostIPAddress = "" # Requires user input
|
VMHostIPAddress = "" # Requires user input
|
||||||
DiskSizeGB = 30
|
DiskSizeGB = 30
|
||||||
|
|||||||
Reference in New Issue
Block a user