mirror of
https://github.com/Raphire/Win11Debloat.git
synced 2026-08-23 16:12:08 +00:00
Improve registry backup safety and add optional backup skipping (#710)
This commit is contained in:
@@ -702,6 +702,11 @@ function Show-MainWindow {
|
||||
Add-Parameter 'CreateRestorePoint'
|
||||
}
|
||||
|
||||
$registryBackupCheckBox = $window.FindName('RegistryBackupCheckBox')
|
||||
if ($registryBackupCheckBox -and -not $registryBackupCheckBox.IsChecked) {
|
||||
Add-Parameter 'SkipRegistryBackup'
|
||||
}
|
||||
|
||||
switch ($userSelectionCombo.SelectedIndex) {
|
||||
0 { Write-Host "Selected user mode: current user ($(Get-UserName))" }
|
||||
1 {
|
||||
@@ -782,6 +787,12 @@ function Show-MainWindow {
|
||||
$restartExplorerCheckBox.IsEnabled = $false
|
||||
}
|
||||
|
||||
$registryBackupCheckBox = $window.FindName('RegistryBackupCheckBox')
|
||||
if ($registryBackupCheckBox -and $script:Params.ContainsKey('SkipRegistryBackup')) {
|
||||
$registryBackupCheckBox.IsChecked = $false
|
||||
$registryBackupCheckBox.IsEnabled = $false
|
||||
}
|
||||
|
||||
if ($script:Params.ContainsKey("Sysprep")) {
|
||||
$userSelectionCombo.SelectedIndex = 2
|
||||
$userSelectionCombo.IsEnabled = $false
|
||||
|
||||
Reference in New Issue
Block a user