From 487b1fbee948a7ebcc43c1bd281daaafb4ad884a Mon Sep 17 00:00:00 2001 From: Raphire <9938813+Raphire@users.noreply.github.com> Date: Fri, 27 Mar 2026 21:14:22 +0100 Subject: [PATCH 01/22] Prevent Window Snapping --- Scripts/GUI/Show-MainWindow.ps1 | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/Scripts/GUI/Show-MainWindow.ps1 b/Scripts/GUI/Show-MainWindow.ps1 index a437314..b709558 100644 --- a/Scripts/GUI/Show-MainWindow.ps1 +++ b/Scripts/GUI/Show-MainWindow.ps1 @@ -30,10 +30,38 @@ function Show-MainWindow { $importConfigBtn = $window.FindName('ImportConfigBtn') $exportConfigBtn = $window.FindName('ExportConfigBtn') + # Manual drag state + $script:IsDragging = $false + $script:DragStartMouse = $null + $script:DragStartWindow = $null + $script:DragRelX = 0.0 + # Title bar event handlers $titleBar.Add_MouseLeftButtonDown({ if ($_.OriginalSource -is [System.Windows.Controls.Grid] -or $_.OriginalSource -is [System.Windows.Controls.Border] -or $_.OriginalSource -is [System.Windows.Controls.TextBlock]) { - $window.DragMove() + $script:DragRelX = [Math]::Min(1.0, [Math]::Max(0.0, $_.GetPosition($titleBar).X / $titleBar.ActualWidth)) + $script:DragStartMouse = [System.Windows.Forms.Cursor]::Position + $script:DragStartWindow = [System.Windows.Point]::new($window.Left, $window.Top) + $script:IsDragging = $true + $titleBar.CaptureMouse() | Out-Null + } + }) + + $titleBar.Add_MouseMove({ + if ($script:IsDragging -and $_.LeftButton -eq [System.Windows.Input.MouseButtonState]::Pressed) { + $cur = [System.Windows.Forms.Cursor]::Position + $dx = $cur.X - $script:DragStartMouse.X + $dy = $cur.Y - $script:DragStartMouse.Y + + $window.Left = $script:DragStartWindow.X + $dx + $window.Top = $script:DragStartWindow.Y + $dy + } + }) + + $titleBar.Add_MouseLeftButtonUp({ + if ($script:IsDragging) { + $script:IsDragging = $false + $titleBar.ReleaseMouseCapture() } }) From 3eade4ddbaf62b1c2b0246688c5776e959a69d3f Mon Sep 17 00:00:00 2001 From: Natan Heringer Date: Sat, 28 Mar 2026 20:25:12 -0300 Subject: [PATCH 02/22] Add drive letter position and visibility options (#527) (#533) --- Config/Features.json | 98 +++++++++++++++++++ README.md | 1 + Regfiles/Hide_Drive_Letters.reg | 4 + Regfiles/Show_Drive_Letters_First.reg | 4 + Regfiles/Show_Drive_Letters_Last.reg | 4 + Regfiles/Show_Network_Drive_Letters_First.reg | 4 + Regfiles/Sysprep/Hide_Drive_Letters.reg | 4 + Regfiles/Sysprep/Show_Drive_Letters_First.reg | 4 + Regfiles/Sysprep/Show_Drive_Letters_Last.reg | 4 + .../Show_Network_Drive_Letters_First.reg | 4 + Regfiles/Undo/Show_Drive_Letters_Last.reg | 4 + Scripts/Get.ps1 | 6 +- Win11Debloat.ps1 | 6 +- 13 files changed, 145 insertions(+), 2 deletions(-) create mode 100644 Regfiles/Hide_Drive_Letters.reg create mode 100644 Regfiles/Show_Drive_Letters_First.reg create mode 100644 Regfiles/Show_Drive_Letters_Last.reg create mode 100644 Regfiles/Show_Network_Drive_Letters_First.reg create mode 100644 Regfiles/Sysprep/Hide_Drive_Letters.reg create mode 100644 Regfiles/Sysprep/Show_Drive_Letters_First.reg create mode 100644 Regfiles/Sysprep/Show_Drive_Letters_Last.reg create mode 100644 Regfiles/Sysprep/Show_Network_Drive_Letters_First.reg create mode 100644 Regfiles/Undo/Show_Drive_Letters_Last.reg diff --git a/Config/Features.json b/Config/Features.json index 72f559c..ed8a718 100644 --- a/Config/Features.json +++ b/Config/Features.json @@ -187,6 +187,7 @@ "Label": "Open File Explorer to", "ToolTip": "This setting allows you to choose the default location that File Explorer opens to.", "Category": "File Explorer", + "Priority": 1, "Values": [ { "Label": "Home", @@ -214,6 +215,39 @@ } ] }, + { + "GroupId": "DriveLetterPosition", + "Label": "Drive letter position", + "ToolTip": "This setting allows you to choose where drive letters are shown in File Explorer.", + "Category": "File Explorer", + "Priority": 20, + "Values": [ + { + "Label": "Show drive letters after drive label (Default)", + "FeatureIds": [ + "ShowDriveLettersLast" + ] + }, + { + "Label": "Show drive letters before drive label", + "FeatureIds": [ + "ShowDriveLettersFirst" + ] + }, + { + "Label": "Show network drive letters before drive label", + "FeatureIds": [ + "ShowNetworkDriveLettersFirst" + ] + }, + { + "Label": "Hide all drive letters", + "FeatureIds": [ + "HideDriveLetters" + ] + } + ] + }, { "GroupId": "ShowTabsInAltTab", "Label": "Show tabs from apps when snapping or pressing Alt+Tab", @@ -1220,6 +1254,7 @@ "Label": "file extensions for known file types", "ToolTip": "This will show file extensions for known file types. By default, Windows hides file extensions for known file types which can lead to confusion and security risks.", "Category": "File Explorer", + "Priority": 2, "Action": "Show", "RegistryKey": "Show_Extensions_For_Known_File_Types.reg", "ApplyText": "Enabling file extensions for known file types...", @@ -1233,6 +1268,7 @@ "Label": "hidden files, folders and drives", "ToolTip": "By default, Windows hides certain files, folders and drives to prevent accidental modification or deletion. Turn this on to show all files in File Explorer.", "Category": "File Explorer", + "Priority": 3, "Action": "Show", "RegistryKey": "Show_Hidden_Folders.reg", "ApplyText": "Unhiding hidden files, folders and drives...", @@ -1246,6 +1282,7 @@ "Label": "'Home' from navigation pane", "ToolTip": "Hides the 'Home' section from the File Explorer navigation pane.", "Category": "File Explorer", + "Priority": 4, "Action": "Hide", "RegistryKey": "Hide_Home_from_Explorer.reg", "ApplyText": "Hiding the home section from the File Explorer navigation pane...", @@ -1259,6 +1296,7 @@ "Label": "'Gallery' from navigation pane", "ToolTip": "Hides the 'Gallery' section from the File Explorer navigation pane.", "Category": "File Explorer", + "Priority": 5, "Action": "Hide", "RegistryKey": "Hide_Gallery_from_Explorer.reg", "ApplyText": "Hiding the gallery section from the File Explorer navigation pane...", @@ -1272,6 +1310,7 @@ "Label": "duplicate removable drive entries", "ToolTip": "By default, Windows shows removable drives both under 'This PC' and in the navigation pane with its own entry. Enable this setting to only show removable drives under 'This PC'.", "Category": "File Explorer", + "Priority": 6, "Action": "Hide", "RegistryKey": "Hide_duplicate_removable_drives_from_navigation_pane_of_File_Explorer.reg", "ApplyText": "Hiding duplicate removable drive entries from the File Explorer navigation pane...", @@ -1285,6 +1324,7 @@ "Label": "common folders back to 'This PC' page", "ToolTip": "This setting will add common folders like Desktop, Documents, Downloads, Music, Pictures and Videos back to the 'This PC' page in File Explorer.", "Category": "File Explorer", + "Priority": 7, "Action": "Add", "RegistryKey": "Add_All_Folders_Under_This_PC.reg", "ApplyText": "Adding all common folders (Desktop, Downloads, etc.) back to 'This PC' in File Explorer...", @@ -1376,6 +1416,7 @@ "Label": "'Include in library' option in the context menu", "ToolTip": "Hides the 'Include in library' option from the File Explorer context menu.", "Category": "File Explorer", + "Priority": 8, "Action": "Hide", "RegistryKey": "Disable_Include_in_library_from_context_menu.reg", "ApplyText": "Hiding 'Include in library' in the context menu...", @@ -1389,6 +1430,7 @@ "Label": "'Give access to' option in the context menu", "ToolTip": "Hides the 'Give access to' option from the File Explorer context menu.", "Category": "File Explorer", + "Priority": 9, "Action": "Hide", "RegistryKey": "Disable_Give_access_to_context_menu.reg", "ApplyText": "Hiding 'Give access to' in the context menu...", @@ -1402,6 +1444,7 @@ "Label": "'Share' option in the context menu", "ToolTip": "Hides the 'Share' option from the File Explorer context menu.", "Category": "File Explorer", + "Priority": 10, "Action": "Hide", "RegistryKey": "Disable_Share_from_context_menu.reg", "ApplyText": "Hiding 'Share' in the context menu...", @@ -1415,6 +1458,7 @@ "Label": "'OneDrive' folder from navigation pane", "ToolTip": "Hides the 'OneDrive' folder from the File Explorer navigation pane.", "Category": "File Explorer", + "Priority": 11, "Action": "Hide", "RegistryKey": "Hide_Onedrive_Folder.reg", "ApplyText": "Hiding the OneDrive folder from the File Explorer navigation pane...", @@ -1428,6 +1472,7 @@ "Label": "'3D objects' folder under 'This PC'", "ToolTip": "Hides the '3D objects' folder from the File Explorer navigation pane.", "Category": "File Explorer", + "Priority": 12, "Action": "Hide", "RegistryKey": "Hide_3D_Objects_Folder.reg", "ApplyText": "Hiding the 3D objects folder from the File Explorer navigation pane...", @@ -1441,6 +1486,7 @@ "Label": "'Music' folder under 'This PC'", "ToolTip": "Hides the 'Music' folder from the File Explorer navigation pane.", "Category": "File Explorer", + "Priority": 13, "Action": "Hide", "RegistryKey": "Hide_Music_Folder.reg", "ApplyText": "Hiding the music folder from the File Explorer navigation pane...", @@ -1489,6 +1535,58 @@ "RequiresReboot": true, "MinVersion": 22000, "MaxVersion": null + }, + { + "FeatureId": "ShowDriveLettersFirst", + "Label": "show drive letters before drive label", + "ToolTip": "This setting will show drive letters before the drive label in File Explorer.", + "Category": "File Explorer", + "Action": "Show first", + "RegistryKey": "Show_Drive_Letters_First.reg", + "ApplyText": "Showing drive letters before drive label...", + "UndoAction": "Show last", + "RegistryUndoKey": "Undo/Show_Drive_Letters_Last.reg", + "MinVersion": null, + "MaxVersion": null + }, + { + "FeatureId": "ShowDriveLettersLast", + "Label": "show drive letters after drive label", + "ToolTip": "This setting will show drive letters after the drive label in File Explorer (Default Windows behavior).", + "Category": "File Explorer", + "Action": "Show last", + "RegistryKey": "Show_Drive_Letters_Last.reg", + "ApplyText": "Showing drive letters after drive label...", + "UndoAction": null, + "RegistryUndoKey": null, + "MinVersion": null, + "MaxVersion": null + }, + { + "FeatureId": "ShowNetworkDriveLettersFirst", + "Label": "show network drive letters before drive label", + "ToolTip": "This setting will show only network drive letters before the drive label in File Explorer.", + "Category": "File Explorer", + "Action": "Show network first", + "RegistryKey": "Show_Network_Drive_Letters_First.reg", + "ApplyText": "Showing network drive letters before drive label...", + "UndoAction": "Show last", + "RegistryUndoKey": "Undo/Show_Drive_Letters_Last.reg", + "MinVersion": null, + "MaxVersion": null + }, + { + "FeatureId": "HideDriveLetters", + "Label": "hide all drive letters", + "ToolTip": "This setting will hide all drive letters from the File Explorer navigation pane and 'This PC'.", + "Category": "File Explorer", + "Action": "Hide", + "RegistryKey": "Hide_Drive_Letters.reg", + "ApplyText": "Hiding all drive letters...", + "UndoAction": "Show last", + "RegistryUndoKey": "Undo/Show_Drive_Letters_Last.reg", + "MinVersion": null, + "MaxVersion": null } ] } \ No newline at end of file diff --git a/README.md b/README.md index 93ba13e..b93ac70 100755 --- a/README.md +++ b/README.md @@ -160,6 +160,7 @@ Below is an overview of the key features and functionality offered by Win11Deblo - Add all common folders (Desktop, Downloads, etc.) back to 'This PC' in File Explorer. - Hide the 3D objects, music or OneDrive folder from the File Explorer navigation pane. - Hide the 'Include in library', 'Give access to' and 'Share' options from the context menu. +- Change drive letter position or visibility in File Explorer. #### Multi-tasking diff --git a/Regfiles/Hide_Drive_Letters.reg b/Regfiles/Hide_Drive_Letters.reg new file mode 100644 index 0000000..ecd2576 --- /dev/null +++ b/Regfiles/Hide_Drive_Letters.reg @@ -0,0 +1,4 @@ +Windows Registry Editor Version 5.00 + +[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer] +"ShowDriveLettersFirst"=dword:00000002 diff --git a/Regfiles/Show_Drive_Letters_First.reg b/Regfiles/Show_Drive_Letters_First.reg new file mode 100644 index 0000000..7403a2e --- /dev/null +++ b/Regfiles/Show_Drive_Letters_First.reg @@ -0,0 +1,4 @@ +Windows Registry Editor Version 5.00 + +[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer] +"ShowDriveLettersFirst"=dword:00000004 diff --git a/Regfiles/Show_Drive_Letters_Last.reg b/Regfiles/Show_Drive_Letters_Last.reg new file mode 100644 index 0000000..5362089 --- /dev/null +++ b/Regfiles/Show_Drive_Letters_Last.reg @@ -0,0 +1,4 @@ +Windows Registry Editor Version 5.00 + +[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer] +"ShowDriveLettersFirst"=dword:00000000 diff --git a/Regfiles/Show_Network_Drive_Letters_First.reg b/Regfiles/Show_Network_Drive_Letters_First.reg new file mode 100644 index 0000000..e8dad3e --- /dev/null +++ b/Regfiles/Show_Network_Drive_Letters_First.reg @@ -0,0 +1,4 @@ +Windows Registry Editor Version 5.00 + +[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer] +"ShowDriveLettersFirst"=dword:00000001 diff --git a/Regfiles/Sysprep/Hide_Drive_Letters.reg b/Regfiles/Sysprep/Hide_Drive_Letters.reg new file mode 100644 index 0000000..b0c6820 --- /dev/null +++ b/Regfiles/Sysprep/Hide_Drive_Letters.reg @@ -0,0 +1,4 @@ +Windows Registry Editor Version 5.00 + +[hkey_users\default\Software\Microsoft\Windows\CurrentVersion\Explorer] +"ShowDriveLettersFirst"=dword:00000002 diff --git a/Regfiles/Sysprep/Show_Drive_Letters_First.reg b/Regfiles/Sysprep/Show_Drive_Letters_First.reg new file mode 100644 index 0000000..be8192f --- /dev/null +++ b/Regfiles/Sysprep/Show_Drive_Letters_First.reg @@ -0,0 +1,4 @@ +Windows Registry Editor Version 5.00 + +[hkey_users\default\Software\Microsoft\Windows\CurrentVersion\Explorer] +"ShowDriveLettersFirst"=dword:00000004 diff --git a/Regfiles/Sysprep/Show_Drive_Letters_Last.reg b/Regfiles/Sysprep/Show_Drive_Letters_Last.reg new file mode 100644 index 0000000..b44b896 --- /dev/null +++ b/Regfiles/Sysprep/Show_Drive_Letters_Last.reg @@ -0,0 +1,4 @@ +Windows Registry Editor Version 5.00 + +[hkey_users\default\Software\Microsoft\Windows\CurrentVersion\Explorer] +"ShowDriveLettersFirst"=dword:00000000 diff --git a/Regfiles/Sysprep/Show_Network_Drive_Letters_First.reg b/Regfiles/Sysprep/Show_Network_Drive_Letters_First.reg new file mode 100644 index 0000000..d1ac10d --- /dev/null +++ b/Regfiles/Sysprep/Show_Network_Drive_Letters_First.reg @@ -0,0 +1,4 @@ +Windows Registry Editor Version 5.00 + +[hkey_users\default\Software\Microsoft\Windows\CurrentVersion\Explorer] +"ShowDriveLettersFirst"=dword:00000001 diff --git a/Regfiles/Undo/Show_Drive_Letters_Last.reg b/Regfiles/Undo/Show_Drive_Letters_Last.reg new file mode 100644 index 0000000..5362089 --- /dev/null +++ b/Regfiles/Undo/Show_Drive_Letters_Last.reg @@ -0,0 +1,4 @@ +Windows Registry Editor Version 5.00 + +[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer] +"ShowDriveLettersFirst"=dword:00000000 diff --git a/Scripts/Get.ps1 b/Scripts/Get.ps1 index 68176e9..d760a5f 100644 --- a/Scripts/Get.ps1 +++ b/Scripts/Get.ps1 @@ -96,7 +96,11 @@ param ( [switch]$HideMusic, [switch]$HideIncludeInLibrary, [switch]$HideGiveAccessTo, - [switch]$HideShare + [switch]$HideShare, + [switch]$ShowDriveLettersFirst, + [switch]$ShowDriveLettersLast, + [switch]$ShowNetworkDriveLettersFirst, + [switch]$HideDriveLetters ) # Show error if current powershell environment does not have LanguageMode set to FullLanguage diff --git a/Win11Debloat.ps1 b/Win11Debloat.ps1 index fba84b1..94d48bb 100644 --- a/Win11Debloat.ps1 +++ b/Win11Debloat.ps1 @@ -98,7 +98,11 @@ param ( [switch]$HideMusic, [switch]$HideIncludeInLibrary, [switch]$HideGiveAccessTo, - [switch]$HideShare + [switch]$HideShare, + [switch]$ShowDriveLettersFirst, + [switch]$ShowDriveLettersLast, + [switch]$ShowNetworkDriveLettersFirst, + [switch]$HideDriveLetters ) From 54edf224a3a94ca5ca19a775f296cbc09a44de3b Mon Sep 17 00:00:00 2001 From: Raphire <9938813+Raphire@users.noreply.github.com> Date: Thu, 2 Apr 2026 00:00:32 +0200 Subject: [PATCH 03/22] Improve Window controls --- Schemas/MainWindow.xaml | 48 ++--- Scripts/GUI/Show-MainWindow.ps1 | 302 +++++++++++++------------------- 2 files changed, 145 insertions(+), 205 deletions(-) diff --git a/Schemas/MainWindow.xaml b/Schemas/MainWindow.xaml index 559fd74..7fd0f44 100644 --- a/Schemas/MainWindow.xaml +++ b/Schemas/MainWindow.xaml @@ -1,15 +1,22 @@ + + + - - - - + Margin="0"> @@ -621,18 +621,18 @@ - - - - - - - - + + + + + + + + - + @@ -645,8 +645,8 @@ Margin="12,0,0,0" FontSize="12"/> - - - - + + @@ -895,9 +901,67 @@ - + + + + + + + + + + + + + + diff --git a/Scripts/GUI/Show-MainWindow.ps1 b/Scripts/GUI/Show-MainWindow.ps1 index c022240..e8b93f4 100644 --- a/Scripts/GUI/Show-MainWindow.ps1 +++ b/Scripts/GUI/Show-MainWindow.ps1 @@ -287,21 +287,75 @@ function Show-MainWindow { $jsonPresetsPanel = $window.FindName('JsonPresetsPanel') $presetsArrow = $window.FindName('PresetsArrow') $clearAppSelectionBtn = $window.FindName('ClearAppSelectionBtn') + $tweaksPresetsBtn = $window.FindName('TweaksPresetsBtn') + $tweaksPresetsPopup = $window.FindName('TweaksPresetsPopup') + $presetDefaultTweaksBtn = $window.FindName('PresetDefaultTweaksBtn') + $presetLastUsedTweaksBtn = $window.FindName('PresetLastUsedTweaksBtn') + $presetPrivacyTweaksBtn = $window.FindName('PresetPrivacyTweaksBtn') + $presetAITweaksBtn = $window.FindName('PresetAITweaksBtn') + $tweaksPresetsArrow = $window.FindName('TweaksPresetsArrow') + + function AttachTriStateClickBehavior { + param([System.Windows.Controls.CheckBox]$checkBox) + + if (-not $checkBox -or -not $checkBox.IsThreeState) { return } + + if (-not $checkBox.PSObject.Properties['WasIndeterminateBeforeClick']) { + Add-Member -InputObject $checkBox -MemberType NoteProperty -Name 'WasIndeterminateBeforeClick' -Value $false + } + + $checkBox.Add_PreviewMouseLeftButtonDown({ + $this.WasIndeterminateBeforeClick = ($this.IsChecked -eq [System.Nullable[bool]]$null) + }) + } function NormalizeCheckboxState { param([System.Windows.Controls.CheckBox]$checkBox) - $isChecked = ($checkBox.IsChecked -eq $true) - if ($null -eq $checkBox.IsChecked) { - $checkBox.IsChecked = $false - return $false + if ($checkBox.PSObject.Properties['WasIndeterminateBeforeClick'] -and $checkBox.WasIndeterminateBeforeClick) { + # WPF toggles null -> false before Click handlers fire; restore desired mixed -> checked behavior. + $checkBox.WasIndeterminateBeforeClick = $false + $checkBox.IsChecked = $true + return $true } - return $isChecked + return ($checkBox.IsChecked -eq $true) } - function AnimatePresetsArrow { - param([double]$angle) + function SetTriStatePresetCheckBoxState { + param( + [System.Windows.Controls.CheckBox]$CheckBox, + [int]$Total, + [int]$Selected + ) + + if (-not $CheckBox) { return } + + if ($Total -eq 0) { + $CheckBox.IsEnabled = $false + $CheckBox.IsChecked = $false + return + } + + $CheckBox.IsEnabled = $true + if ($Selected -eq 0) { + $CheckBox.IsChecked = $false + } + elseif ($Selected -eq $Total) { + $CheckBox.IsChecked = $true + } + else { + $CheckBox.IsChecked = [System.Nullable[bool]]$null + } + } + + function AnimateDropdownArrow { + param( + [System.Windows.Controls.TextBlock]$arrow, + [double]$angle + ) + + if (-not $arrow) { return } $animation = New-Object System.Windows.Media.Animation.DoubleAnimation $animation.To = $angle @@ -311,7 +365,7 @@ function Show-MainWindow { $ease.EasingMode = 'EaseOut' $animation.EasingFunction = $ease - $presetsArrow.RenderTransform.BeginAnimation([System.Windows.Media.RotateTransform]::AngleProperty, $animation) + $arrow.RenderTransform.BeginAnimation([System.Windows.Media.RotateTransform]::AngleProperty, $animation) } # Load JSON-defined presets and build dynamic preset checkboxes @@ -321,15 +375,17 @@ function Show-MainWindow { $checkbox.Content = $preset.Name $checkbox.IsThreeState = $true $checkbox.Style = $window.Resources['PresetCheckBoxStyle'] + $checkbox.ToolTip = "Select $($preset.Name)" $checkbox.SetValue([System.Windows.Automation.AutomationProperties]::NameProperty, $preset.Name) + AttachTriStateClickBehavior -checkBox $checkbox Add-Member -InputObject $checkbox -MemberType NoteProperty -Name 'PresetAppIds' -Value $preset.AppIds $jsonPresetsPanel.Children.Add($checkbox) | Out-Null $script:JsonPresetCheckboxes += $checkbox $checkbox.Add_Click({ if ($script:UpdatingPresets) { return } - $check = NormalizeCheckboxState -checkBox $this $presetIds = $this.PresetAppIds + $check = NormalizeCheckboxState -checkBox $this ApplyPresetToApps -MatchFilter { param($c) (@($c.AppIds) | Where-Object { $presetIds -contains $_ }).Count -gt 0 }.GetNewClosure() -Check $check }) } @@ -354,6 +410,7 @@ function Show-MainWindow { # Guard flag to prevent preset handlers from firing when we update their state programmatically $script:UpdatingPresets = $false + $script:UpdatingTweakPresets = $false # Sort state for the app table $script:SortColumn = 'Name' @@ -484,19 +541,7 @@ function Show-MainWindow { } } } - if ($total -eq 0) { - $checkbox.IsChecked = $false - $checkbox.IsEnabled = $false - } else { - $checkbox.IsEnabled = $true - if ($checked -eq 0) { - $checkbox.IsChecked = $false - } elseif ($checked -eq $total) { - $checkbox.IsChecked = $true - } else { - $checkbox.IsChecked = [System.Nullable[bool]]$null - } - } + SetTriStatePresetCheckBoxState -CheckBox $checkbox -Total $total -Selected $checked } SetPresetState $presetDefaultApps { param($c) $c.SelectedByDefault -eq $true } @@ -772,7 +817,7 @@ function Show-MainWindow { try { $lblBorderObj = $window.FindName("$comboName`_LabelBorder") } catch {} if ($lblBorderObj) { $lblBorderObj.ToolTip = $tipBlock } } - $script:UiControlMappings[$comboName] = @{ Type='group'; Values = $group.Values; Label = $group.Label } + $script:UiControlMappings[$comboName] = @{ Type='group'; Values = $group.Values; Label = $group.Label; Category = $categoryName } } elseif ($item.Type -eq 'feature') { $feature = $item.Data @@ -792,7 +837,7 @@ function Show-MainWindow { try { $lblBorderObj = $window.FindName("$comboName`_LabelBorder") } catch {} if ($lblBorderObj) { $lblBorderObj.ToolTip = $tipBlock } } - $script:UiControlMappings[$comboName] = @{ Type='feature'; FeatureId = $feature.FeatureId; Action = $feature.Action; Label = $feature.Label } + $script:UiControlMappings[$comboName] = @{ Type='feature'; FeatureId = $feature.FeatureId; Action = $feature.Action; Label = $feature.Label; Category = $categoryName } } } } @@ -989,27 +1034,45 @@ function Show-MainWindow { # Animate arrow when popup opens/closes, and lazily update preset states $presetsPopup.Add_Opened({ UpdatePresetStates - AnimatePresetsArrow -angle 180 + AnimateDropdownArrow -arrow $presetsArrow -angle 180 }) $presetsPopup.Add_Closed({ - AnimatePresetsArrow -angle 0 + AnimateDropdownArrow -arrow $presetsArrow -angle 0 $presetsBtn.IsChecked = $false }) + $tweaksPresetsPopup.Add_Opened({ + UpdateTweakPresetStates + AnimateDropdownArrow -arrow $tweaksPresetsArrow -angle 180 + }) + $tweaksPresetsPopup.Add_Closed({ + AnimateDropdownArrow -arrow $tweaksPresetsArrow -angle 0 + $tweaksPresetsBtn.IsChecked = $false + }) + # Close popup when clicking anywhere outside the popup or the presets button. $window.Add_PreviewMouseDown({ - if (-not $presetsPopup.IsOpen) { return } - if ($null -ne $presetsPopup.Child -and $presetsPopup.Child.IsMouseOver) { return } + $isAppPopupOpen = $presetsPopup.IsOpen + $isTweaksPopupOpen = $tweaksPresetsPopup.IsOpen + if (-not $isAppPopupOpen -and -not $isTweaksPopupOpen) { return } + + if ($isAppPopupOpen -and $null -ne $presetsPopup.Child -and $presetsPopup.Child.IsMouseOver) { return } + if ($isTweaksPopupOpen -and $null -ne $tweaksPresetsPopup.Child -and $tweaksPresetsPopup.Child.IsMouseOver) { return } + $src = $_.OriginalSource -as [System.Windows.DependencyObject] if ($null -ne $src) { - $inBtn = $presetsBtn.IsAncestorOf($src) -or [System.Object]::ReferenceEquals($presetsBtn, $src) - if (-not $inBtn) { $presetsPopup.IsOpen = $false } + $inAppBtn = $presetsBtn.IsAncestorOf($src) -or [System.Object]::ReferenceEquals($presetsBtn, $src) + $inTweaksBtn = $tweaksPresetsBtn.IsAncestorOf($src) -or [System.Object]::ReferenceEquals($tweaksPresetsBtn, $src) + + if ($isAppPopupOpen -and -not $inAppBtn) { $presetsPopup.IsOpen = $false } + if ($isTweaksPopupOpen -and -not $inTweaksBtn) { $tweaksPresetsPopup.IsOpen = $false } } }) # Close the preset menu when the main window loses focus (e.g., user switches to another app). $window.Add_Deactivated({ if ($presetsPopup.IsOpen) { $presetsPopup.IsOpen = $false } + if ($tweaksPresetsPopup.IsOpen) { $tweaksPresetsPopup.IsOpen = $false } }) # Toggle popup on button click @@ -1018,6 +1081,22 @@ function Show-MainWindow { $presetsBtn.IsChecked = $presetsPopup.IsOpen }) + $tweaksPresetsBtn.Add_Click({ + $tweaksPresetsPopup.IsOpen = -not $tweaksPresetsPopup.IsOpen + $tweaksPresetsBtn.IsChecked = $tweaksPresetsPopup.IsOpen + }) + + foreach ($presetCheckBox in @( + $presetDefaultApps, + $presetLastUsed, + $presetDefaultTweaksBtn, + $presetLastUsedTweaksBtn, + $presetPrivacyTweaksBtn, + $presetAITweaksBtn + )) { + AttachTriStateClickBehavior -checkBox $presetCheckBox + } + # Preset: Default selection $presetDefaultApps.Add_Click({ if ($script:UpdatingPresets) { return } @@ -1751,6 +1830,9 @@ function Show-MainWindow { # Initialize UI elements on window load $window.Add_Loaded({ BuildDynamicTweaks + RefreshTweakPresetSources -defaultSettingsJson $defaultsJson -lastUsedSettingsJson $lastUsedSettingsJson + RegisterTweakPresetControlStateHandlers + UpdateTweakPresetStates LoadAppsIntoMainUI @@ -1793,57 +1875,276 @@ function Show-MainWindow { UpdateNavigationButtons }) - # Handle Load Defaults button - $loadDefaultsBtn = $window.FindName('LoadDefaultsBtn') - $loadDefaultsBtn.Add_Click({ - $defaultsJson = LoadJsonFile -filePath $script:DefaultSettingsFilePath -expectedVersion "1.0" + function BuildTweakPresetControlMap { + param($settingsJson) - if (-not $defaultsJson) { - Show-MessageBox -Message "Failed to load default settings file" -Title "Error" -Button 'OK' -Icon 'Error' - return + $presetMap = @{} + if (-not $settingsJson -or -not $settingsJson.Settings -or -not $script:UiControlMappings) { + return $presetMap } - - ApplySettingsToUiControls -window $window -settingsJson $defaultsJson -uiControlMappings $script:UiControlMappings - }) - # Handle Load Last Used settings and Load Last Used apps - $loadLastUsedBtn = $window.FindName('LoadLastUsedBtn') + # FeatureId -> control metadata, similar to ApplySettingsToUiControls lookup. + $featureIdIndex = @{} + foreach ($controlName in $script:UiControlMappings.Keys) { + $control = $window.FindName($controlName) + if (-not $control -or $control.Visibility -ne 'Visible') { continue } + + $mapping = $script:UiControlMappings[$controlName] + if ($mapping.Type -eq 'group') { + $i = 1 + foreach ($val in $mapping.Values) { + foreach ($fid in $val.FeatureIds) { + $featureIdIndex[$fid] = @{ ControlName = $controlName; Control = $control; MappingType = 'group'; Index = $i } + } + $i++ + } + } + elseif ($mapping.Type -eq 'feature') { + $featureIdIndex[$mapping.FeatureId] = @{ ControlName = $controlName; Control = $control; MappingType = 'feature' } + } + } + + foreach ($setting in $settingsJson.Settings) { + if ($setting.Value -ne $true) { continue } + if ($setting.Name -eq 'CreateRestorePoint') { continue } + + $entry = $featureIdIndex[$setting.Name] + if (-not $entry) { continue } + if ($presetMap.ContainsKey($entry.ControlName)) { continue } + + $controlType = if ($entry.Control -is [System.Windows.Controls.CheckBox]) { 'CheckBox' } else { 'ComboBox' } + $desiredValue = switch ($entry.MappingType) { + 'group' { $entry.Index } + default { if ($controlType -eq 'CheckBox') { $true } else { 1 } } + } + + $presetMap[$entry.ControlName] = @{ Control = $entry.Control; ControlType = $controlType; DesiredValue = $desiredValue } + } + + return $presetMap + } + + function BuildCategoryTweakPresetMap { + param([string]$Category) + + $presetMap = @{} + if (-not $script:UiControlMappings) { return $presetMap } + + foreach ($controlName in $script:UiControlMappings.Keys) { + $mapping = $script:UiControlMappings[$controlName] + if ($mapping.Category -ne $Category) { continue } + + $control = $window.FindName($controlName) + if (-not $control -or $control.Visibility -ne 'Visible') { continue } + + $controlType = if ($control -is [System.Windows.Controls.CheckBox]) { 'CheckBox' } else { 'ComboBox' } + $desiredValue = if ($controlType -eq 'CheckBox') { $true } else { 1 } + $presetMap[$controlName] = @{ Control = $control; ControlType = $controlType; DesiredValue = $desiredValue } + } + + return $presetMap + } + + function GetSavedAppIdsFromSettingsJson { + param($settingsJson) + + if (-not $settingsJson -or -not $settingsJson.Settings) { + return $null + } + + $appsValue = $null + foreach ($setting in $settingsJson.Settings) { + if ($setting.Name -eq 'Apps' -and $setting.Value) { + $appsValue = $setting.Value + break + } + } + + if (-not $appsValue) { + return $null + } + + $savedAppIds = @() + if ($appsValue -is [string]) { + $savedAppIds = $appsValue.Split(',') + } + elseif ($appsValue -is [array]) { + $savedAppIds = $appsValue + } + + $savedAppIds = $savedAppIds | ForEach-Object { $_.Trim() } | Where-Object { $_ -ne '' } + if ($savedAppIds.Count -eq 0) { + return $null + } + + return $savedAppIds + } + + function ApplyTweakPresetMap { + param( + [hashtable]$PresetMap, + [bool]$Check + ) + + if (-not $PresetMap) { + $PresetMap = @{} + } + + $wasUpdatingTweakPresets = [bool]$script:UpdatingTweakPresets + $script:UpdatingTweakPresets = $true + try { + foreach ($target in $PresetMap.Values) { + $control = $target.Control + if (-not $control) { continue } + + if ($target.ControlType -eq 'CheckBox') { + $control.IsChecked = $Check + } + elseif ($target.ControlType -eq 'ComboBox') { + $desiredIndex = [int]$target.DesiredValue + if ($Check) { + $control.SelectedIndex = $desiredIndex + } + elseif ($control.SelectedIndex -eq $desiredIndex) { + $control.SelectedIndex = 0 + } + } + } + } + finally { + $script:UpdatingTweakPresets = $wasUpdatingTweakPresets + } + + if (-not $wasUpdatingTweakPresets) { + UpdateTweakPresetStates + } + } + + function SetTweakPresetState { + param( + [System.Windows.Controls.CheckBox]$PresetCheckBox, + [hashtable]$PresetMap + ) + + if (-not $PresetCheckBox) { return } + if (-not $PresetMap) { + $PresetMap = @{} + } + + $total = $PresetMap.Count + $selected = 0 + + foreach ($target in $PresetMap.Values) { + $control = $target.Control + if (-not $control) { continue } + + if ($target.ControlType -eq 'CheckBox' -and $control.IsChecked -eq $true) { + $selected++ + } + elseif ($target.ControlType -eq 'ComboBox' -and $control.SelectedIndex -eq [int]$target.DesiredValue) { + $selected++ + } + } + + SetTriStatePresetCheckBoxState -CheckBox $PresetCheckBox -Total $total -Selected $selected + } + + function UpdateTweakPresetStates { + $script:UpdatingTweakPresets = $true + try { + SetTweakPresetState -PresetCheckBox $presetDefaultTweaksBtn -PresetMap $script:DefaultTweakPresetMap + if ($presetLastUsedTweaksBtn -and $presetLastUsedTweaksBtn.Visibility -ne 'Collapsed') { + SetTweakPresetState -PresetCheckBox $presetLastUsedTweaksBtn -PresetMap $script:LastUsedTweakPresetMap + } + SetTweakPresetState -PresetCheckBox $presetPrivacyTweaksBtn -PresetMap $script:PrivacyTweakPresetMap + SetTweakPresetState -PresetCheckBox $presetAITweaksBtn -PresetMap $script:AITweakPresetMap + } + finally { + $script:UpdatingTweakPresets = $false + } + } + + function RegisterTweakPresetControlStateHandlers { + if (-not $script:UiControlMappings) { return } + + foreach ($controlName in $script:UiControlMappings.Keys) { + $control = $window.FindName($controlName) + if (-not $control) { continue } + + if ($control -is [System.Windows.Controls.CheckBox]) { + $control.Add_Checked({ if (-not $script:UpdatingTweakPresets) { UpdateTweakPresetStates } }) + $control.Add_Unchecked({ if (-not $script:UpdatingTweakPresets) { UpdateTweakPresetStates } }) + } + elseif ($control -is [System.Windows.Controls.ComboBox]) { + $control.Add_SelectionChanged({ if (-not $script:UpdatingTweakPresets) { UpdateTweakPresetStates } }) + } + } + } + + function RefreshTweakPresetSources { + param( + $defaultSettingsJson, + $lastUsedSettingsJson + ) + + $script:DefaultTweakPresetMap = BuildTweakPresetControlMap -settingsJson $defaultSettingsJson + $script:LastUsedTweakPresetMap = BuildTweakPresetControlMap -settingsJson $lastUsedSettingsJson + $script:PrivacyTweakPresetMap = BuildCategoryTweakPresetMap -Category 'Privacy & Suggested Content' + $script:AITweakPresetMap = BuildCategoryTweakPresetMap -Category 'AI' + + if ($presetLastUsedTweaksBtn) { + $presetLastUsedTweaksBtn.Visibility = if ($script:LastUsedTweakPresetMap.Count -gt 0) { 'Visible' } else { 'Collapsed' } + } + } $lastUsedSettingsJson = LoadJsonFile -filePath $script:SavedSettingsFilePath -expectedVersion "1.0" -optionalFile - $hasSettings = $false - $appsSetting = $null - if ($lastUsedSettingsJson -and $lastUsedSettingsJson.Settings) { - foreach ($s in $lastUsedSettingsJson.Settings) { - # Only count as hasSettings if a setting other than RemoveApps/Apps is present and true - if ($s.Value -eq $true -and $s.Name -ne 'RemoveApps' -and $s.Name -ne 'Apps') { $hasSettings = $true } - if ($s.Name -eq 'Apps' -and $s.Value) { $appsSetting = $s.Value } - } - } + $defaultsJson = LoadJsonFile -filePath $script:DefaultSettingsFilePath -expectedVersion "1.0" + $script:DefaultTweakPresetMap = @{} + $script:LastUsedTweakPresetMap = @{} + $script:PrivacyTweakPresetMap = @{} + $script:AITweakPresetMap = @{} + $script:SavedAppIds = GetSavedAppIdsFromSettingsJson -settingsJson $lastUsedSettingsJson - # Show option to load last used settings if they exist - if ($hasSettings) { - $loadLastUsedBtn.Add_Click({ - try { - ApplySettingsToUiControls -window $window -settingsJson $lastUsedSettingsJson -uiControlMappings $script:UiControlMappings - } - catch { - Show-MessageBox -Message "Failed to load last used settings: $_" -Title "Error" -Button 'OK' -Icon 'Error' - } + if ($presetDefaultTweaksBtn) { + $presetDefaultTweaksBtn.Add_Click({ + if ($script:UpdatingTweakPresets) { return } + $check = NormalizeCheckboxState -checkBox $this + ApplyTweakPresetMap -PresetMap $script:DefaultTweakPresetMap -Check $check }) } - else { - $loadLastUsedBtn.Visibility = 'Collapsed' + + if ($presetLastUsedTweaksBtn) { + $presetLastUsedTweaksBtn.Add_Click({ + if ($script:UpdatingTweakPresets) { return } + $check = NormalizeCheckboxState -checkBox $this + ApplyTweakPresetMap -PresetMap $script:LastUsedTweakPresetMap -Check $check + }) + } + + if ($presetPrivacyTweaksBtn) { + $presetPrivacyTweaksBtn.Add_Click({ + if ($script:UpdatingTweakPresets) { return } + $check = NormalizeCheckboxState -checkBox $this + ApplyTweakPresetMap -PresetMap $script:PrivacyTweakPresetMap -Check $check + }) + } + + if ($presetAITweaksBtn) { + $presetAITweaksBtn.Add_Click({ + if ($script:UpdatingTweakPresets) { return } + $check = NormalizeCheckboxState -checkBox $this + ApplyTweakPresetMap -PresetMap $script:AITweakPresetMap -Check $check + }) + } + + # Hide Last used tweak preset by default; it is shown after dynamic controls are built and mappings are resolved. + if ($presetLastUsedTweaksBtn) { + $presetLastUsedTweaksBtn.Visibility = 'Collapsed' } # Preset: Last used selection (wired to PresetLastUsed checkbox) - if ($appsSetting -and $appsSetting.ToString().Trim().Length -gt 0) { - # Parse and store saved app IDs for UpdatePresetStates - $script:SavedAppIds = @() - if ($appsSetting -is [string]) { $script:SavedAppIds = $appsSetting.Split(',') } - elseif ($appsSetting -is [array]) { $script:SavedAppIds = $appsSetting } - $script:SavedAppIds = $script:SavedAppIds | ForEach-Object { $_.Trim() } | Where-Object { $_ -ne '' } - + if ($script:SavedAppIds) { $presetLastUsed.Add_Click({ if ($script:UpdatingPresets) { return } $check = NormalizeCheckboxState -checkBox $this @@ -1870,6 +2171,7 @@ function Show-MainWindow { } } } + UpdateTweakPresetStates }) # Preload app data to speed up loading when user navigates to App Removal tab From 6db2c158bda607519d89fc6c96f7bb9a99a57045 Mon Sep 17 00:00:00 2001 From: David Date: Sat, 25 Apr 2026 18:09:57 +0200 Subject: [PATCH 18/22] Added prompt asking user to run as adminstrator (#556) Co-authored-by: Raphire <9938813+Raphire@users.noreply.github.com> --- Win11Debloat.ps1 | 37 +++++++++++++++++++++++++++++++++++-- 1 file changed, 35 insertions(+), 2 deletions(-) diff --git a/Win11Debloat.ps1 b/Win11Debloat.ps1 index 5c3e5b4..bb44166 100644 --- a/Win11Debloat.ps1 +++ b/Win11Debloat.ps1 @@ -1,5 +1,3 @@ -#Requires -RunAsAdministrator - [CmdletBinding(SupportsShouldProcess)] param ( [switch]$CLI, @@ -105,7 +103,42 @@ param ( [switch]$HideDriveLetters ) +# Check if script is running as administrator +$isAdmin = ([Security.Principal.WindowsPrincipal] ` + [Security.Principal.WindowsIdentity]::GetCurrent() +).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator) +# If script is not running as administrator ask user if they want to allow it +if (-not $isAdmin) { + Write-Host "Win11Debloat must be run as Administrator." -ForegroundColor Red + + $choice = Read-Host "Restart as Administrator? (y/n)" + + if ($choice -match '^[Yy]$') { + $elevatedArgs = @("-NoProfile", "-ExecutionPolicy", "Bypass", "-File", $PSCommandPath) + + foreach ($paramName in $PSBoundParameters.Keys) { + $paramValue = $PSBoundParameters[$paramName] + + if ($paramValue -is [System.Management.Automation.SwitchParameter]) { + if ($paramValue.IsPresent) { + $elevatedArgs += "-$paramName" + } + } + else { + $elevatedArgs += "-$paramName" + $elevatedArgs += "$paramValue" + } + } + + if ($MyInvocation.UnboundArguments.Count -gt 0) { + $elevatedArgs += $MyInvocation.UnboundArguments + } + + Start-Process powershell -ArgumentList $elevatedArgs -Verb RunAs + } + exit +} # Define script-level variables & paths $script:Version = "2026.04.05" From 9ca87b129cba8c36106949998ac2bcb72e7f4015 Mon Sep 17 00:00:00 2001 From: Jeffrey <9938813+Raphire@users.noreply.github.com> Date: Sat, 25 Apr 2026 18:46:36 +0200 Subject: [PATCH 19/22] Update HideOnedrive option to also work in Windows 11 (#559) --- Config/Features.json | 156 +++++++++++----------- Regfiles/Hide_Onedrive_Folder.reg | Bin 546 -> 1466 bytes Regfiles/Sysprep/Hide_Onedrive_Folder.reg | Bin 546 -> 1902 bytes Regfiles/Undo/Show_Onedrive_folder.reg | Bin 542 -> 1464 bytes 4 files changed, 78 insertions(+), 78 deletions(-) diff --git a/Config/Features.json b/Config/Features.json index 5db2739..75a86ff 100644 --- a/Config/Features.json +++ b/Config/Features.json @@ -1277,15 +1277,29 @@ "MinVersion": null, "MaxVersion": null }, + { + "FeatureId": "HideDupliDrive", + "Label": "duplicate removable drive entries", + "ToolTip": "By default, Windows shows removable drives both under 'This PC' and in the navigation pane with its own entry. Enable this setting to only show removable drives under 'This PC'.", + "Category": "File Explorer", + "Priority": 4, + "Action": "Hide", + "RegistryKey": "Hide_duplicate_removable_drives_from_navigation_pane_of_File_Explorer.reg", + "ApplyText": "Hiding duplicate removable drive entries from the File Explorer navigation pane...", + "UndoAction": "Show", + "RegistryUndoKey": "Show_duplicate_removable_drives_in_navigation_pane_of_File_Explorer.reg", + "MinVersion": null, + "MaxVersion": null + }, { "FeatureId": "HideHome", "Label": "'Home' from navigation pane", "ToolTip": "Hides the 'Home' section from the File Explorer navigation pane.", "Category": "File Explorer", - "Priority": 4, + "Priority": 5, "Action": "Hide", "RegistryKey": "Hide_Home_from_Explorer.reg", - "ApplyText": "Hiding the home section from the File Explorer navigation pane...", + "ApplyText": "Hiding the 'Home' section from the File Explorer navigation pane...", "UndoAction": "Show", "RegistryUndoKey": "Show_Home_in_Explorer.reg", "MinVersion": 22000, @@ -1296,40 +1310,12 @@ "Label": "'Gallery' from navigation pane", "ToolTip": "Hides the 'Gallery' section from the File Explorer navigation pane.", "Category": "File Explorer", - "Priority": 5, - "Action": "Hide", - "RegistryKey": "Hide_Gallery_from_Explorer.reg", - "ApplyText": "Hiding the gallery section from the File Explorer navigation pane...", - "UndoAction": "Show", - "RegistryUndoKey": "Show_Gallery_in_Explorer.reg", - "MinVersion": 22000, - "MaxVersion": null - }, - { - "FeatureId": "HideDupliDrive", - "Label": "duplicate removable drive entries", - "ToolTip": "By default, Windows shows removable drives both under 'This PC' and in the navigation pane with its own entry. Enable this setting to only show removable drives under 'This PC'.", - "Category": "File Explorer", "Priority": 6, "Action": "Hide", - "RegistryKey": "Hide_duplicate_removable_drives_from_navigation_pane_of_File_Explorer.reg", - "ApplyText": "Hiding duplicate removable drive entries from the File Explorer navigation pane...", + "RegistryKey": "Hide_Gallery_from_Explorer.reg", + "ApplyText": "Hiding the 'Gallery' section from the File Explorer navigation pane...", "UndoAction": "Show", - "RegistryUndoKey": "Show_duplicate_removable_drives_in_navigation_pane_of_File_Explorer.reg", - "MinVersion": null, - "MaxVersion": null - }, - { - "FeatureId": "AddFoldersToThisPC", - "Label": "common folders back to 'This PC' page", - "ToolTip": "This setting will add common folders like Desktop, Documents, Downloads, Music, Pictures and Videos back to the 'This PC' page in File Explorer.", - "Category": "File Explorer", - "Priority": 7, - "Action": "Add", - "RegistryKey": "Add_All_Folders_Under_This_PC.reg", - "ApplyText": "Adding all common folders (Desktop, Downloads, etc.) back to 'This PC' in File Explorer...", - "UndoAction": "Remove", - "RegistryUndoKey": "Remove_All_Folders_Under_This_PC.reg", + "RegistryUndoKey": "Show_Gallery_in_Explorer.reg", "MinVersion": 22000, "MaxVersion": null }, @@ -1411,12 +1397,68 @@ "MinVersion": null, "MaxVersion": null }, + { + "FeatureId": "HideOnedrive", + "Label": "'OneDrive' from navigation pane", + "ToolTip": "Hides the 'OneDrive' section from the File Explorer navigation pane.", + "Category": "File Explorer", + "Priority": 7, + "Action": "Hide", + "RegistryKey": "Hide_Onedrive_Folder.reg", + "ApplyText": "Hiding the 'OneDrive' section from the File Explorer navigation pane...", + "UndoAction": "Show", + "RegistryUndoKey": "Show_Onedrive_Folder.reg", + "MinVersion": null, + "MaxVersion": null + }, + { + "FeatureId": "Hide3dObjects", + "Label": "'3D objects' folder under 'This PC'", + "ToolTip": "Hides the '3D objects' folder from the File Explorer navigation pane.", + "Category": "File Explorer", + "Priority": 8, + "Action": "Hide", + "RegistryKey": "Hide_3D_Objects_Folder.reg", + "ApplyText": "Hiding the '3D objects' folder from the File Explorer navigation pane...", + "UndoAction": "Show", + "RegistryUndoKey": "Show_3D_Objects_Folder.reg", + "MinVersion": null, + "MaxVersion": 21999 + }, + { + "FeatureId": "HideMusic", + "Label": "'Music' folder under 'This PC'", + "ToolTip": "Hides the 'Music' folder from the File Explorer navigation pane.", + "Category": "File Explorer", + "Priority": 9, + "Action": "Hide", + "RegistryKey": "Hide_Music_Folder.reg", + "ApplyText": "Hiding the 'Music' folder from the File Explorer navigation pane...", + "UndoAction": "Show", + "RegistryUndoKey": "Show_Music_Folder.reg", + "MinVersion": null, + "MaxVersion": 21999 + }, + { + "FeatureId": "AddFoldersToThisPC", + "Label": "common folders back to 'This PC' page", + "ToolTip": "This setting will add common folders like Desktop, Documents, Downloads, Music, Pictures and Videos back to the 'This PC' page in File Explorer.", + "Category": "File Explorer", + "Priority": 10, + "Action": "Add", + "RegistryKey": "Add_All_Folders_Under_This_PC.reg", + "ApplyText": "Adding all common folders (Desktop, Downloads, etc.) back to 'This PC' in File Explorer...", + "UndoAction": "Remove", + "RegistryUndoKey": "Remove_All_Folders_Under_This_PC.reg", + "MinVersion": 22000, + "MaxVersion": null + }, { "FeatureId": "HideIncludeInLibrary", "Label": "'Include in library' option in the context menu", "ToolTip": "Hides the 'Include in library' option from the File Explorer context menu.", "Category": "File Explorer", - "Priority": 8, + "Priority": 11, "Action": "Hide", "RegistryKey": "Disable_Include_in_library_from_context_menu.reg", "ApplyText": "Hiding 'Include in library' in the context menu...", @@ -1430,7 +1472,7 @@ "Label": "'Give access to' option in the context menu", "ToolTip": "Hides the 'Give access to' option from the File Explorer context menu.", "Category": "File Explorer", - "Priority": 9, + "Priority": 12, "Action": "Hide", "RegistryKey": "Disable_Give_access_to_context_menu.reg", "ApplyText": "Hiding 'Give access to' in the context menu...", @@ -1444,7 +1486,7 @@ "Label": "'Share' option in the context menu", "ToolTip": "Hides the 'Share' option from the File Explorer context menu.", "Category": "File Explorer", - "Priority": 10, + "Priority": 13, "Action": "Hide", "RegistryKey": "Disable_Share_from_context_menu.reg", "ApplyText": "Hiding 'Share' in the context menu...", @@ -1453,48 +1495,6 @@ "MinVersion": null, "MaxVersion": 21999 }, - { - "FeatureId": "HideOnedrive", - "Label": "'OneDrive' folder from navigation pane", - "ToolTip": "Hides the 'OneDrive' folder from the File Explorer navigation pane.", - "Category": "File Explorer", - "Priority": 11, - "Action": "Hide", - "RegistryKey": "Hide_Onedrive_Folder.reg", - "ApplyText": "Hiding the OneDrive folder from the File Explorer navigation pane...", - "UndoAction": "Show", - "RegistryUndoKey": "Show_Onedrive_Folder.reg", - "MinVersion": null, - "MaxVersion": 21999 - }, - { - "FeatureId": "Hide3dObjects", - "Label": "'3D objects' folder under 'This PC'", - "ToolTip": "Hides the '3D objects' folder from the File Explorer navigation pane.", - "Category": "File Explorer", - "Priority": 12, - "Action": "Hide", - "RegistryKey": "Hide_3D_Objects_Folder.reg", - "ApplyText": "Hiding the 3D objects folder from the File Explorer navigation pane...", - "UndoAction": "Show", - "RegistryUndoKey": "Show_3D_Objects_Folder.reg", - "MinVersion": null, - "MaxVersion": 21999 - }, - { - "FeatureId": "HideMusic", - "Label": "'Music' folder under 'This PC'", - "ToolTip": "Hides the 'Music' folder from the File Explorer navigation pane.", - "Category": "File Explorer", - "Priority": 13, - "Action": "Hide", - "RegistryKey": "Hide_Music_Folder.reg", - "ApplyText": "Hiding the music folder from the File Explorer navigation pane...", - "UndoAction": "Show", - "RegistryUndoKey": "Show_Music_Folder.reg", - "MinVersion": null, - "MaxVersion": 21999 - }, { "FeatureId": "DisableBraveBloat", "Label": "bloat in Brave browser (AI, Crypto, etc.)", diff --git a/Regfiles/Hide_Onedrive_Folder.reg b/Regfiles/Hide_Onedrive_Folder.reg index d8e037ccec5a2939489968811f93e6e39649f5a6..c500982912a0156283daf0fc3ac65bf28c14b389 100644 GIT binary patch literal 1466 zcmb`HS#Q%o6ot<-692*SGev~%ARdZqL_{~GX)A_NSc5E zfkxIWcb#+2_}kYrl^Q5lrI8v%>Zs5=&KeC>Yr;v2wPaVZk93N?##*u;uwU0hJ!0I~ zJ@-B3>?PJ5zetDp6xt=C)U7-5Q3vX=FR9ccbI5hX&io@?Ppe(&hS-|30e%s?hIQ>K zy`j!4x_hm2B|4$=4!Z+&*`Mf`bw?R$yA`zJ1n>%hceJXb-P8U1s{sOBW_`qs z2kxdh-B$G6!&cz=iPaUWuIsf>tY;uOa%kjw;*d79!H* z$_#VkHKOMdR1Eo4W9)rb(UA6B^c|nJn~!evfRhoiLn=nj=b9Vb5N~W5S2p_^rlJPx zrK^-Lakz(C679gox%Qb8_-%tt>R3Fa$F9yeHKU8Dt2{qf?bI~)X%g>&vn7sC9Ff5F1i!p64zOLo>b@zq+-!~Rd zk?YdiczS2+>R0-o`A<-}=Ou=(z}hAE8FMdtS22GPQ$nzrBL0?>nSXfW0k?noCs=pi E0YDP#uK)l5 delta 127 zcmdnRy@+K(kZLr8E`tYyH-jrfBttxdGlLIM5Qa=)bFlI1f@B{Kv7*atdv4Bhg0F53M4FCWD diff --git a/Regfiles/Sysprep/Hide_Onedrive_Folder.reg b/Regfiles/Sysprep/Hide_Onedrive_Folder.reg index d8e037ccec5a2939489968811f93e6e39649f5a6..6a2caba6e4c90f216c9a8e919831b5eada632ae3 100644 GIT binary patch literal 1902 zcmc(f?N1Xy5XPU+CjJkX`z%5Q6g7Up>nTl(5UCPljTG(*7lk8zp)|&SUH#2&m$OGg z@GWL@x!u{BotfvEneX5BRp?BaN=-FVq}R%IjBKQ_hMFNsxh*)AoFl#Ee#mXX`Hb_r z?rVj0S9jd^6xkNH8G4a+(8<-rqR@qtc&k_Hb1v}I=jHI$E+^Bsx8CbSpV-gzQ4{=m zuRZtf0KJJmW7*RlK3=G+eQgqZie#Jjj__DwRche07PIUr!G6ff@i(sJ)Z?8Aa*O>4 zjSnuK_$sS6FtR8TK6-T^F%&yNspPORAS})P#W@PEB`X8LznA z04zdn+@8}qK6P{wRoMJZWCGWJf{gK>(M?tlnVx{d;tFV3r);8OSRH`y2^LfK_4+zM zR)T-kC)SG*Y!=jvF;TC;h^jBSvmUgb{n>h?dq}3(j`0{dovNQASAWK<_hFqsg84(| zDVulZmfHAy2kRZ8O~|6dew%+nm$axF>%)K1ne|M24#5i|^u3zl*Uy$PODqnLY#rCY zb;5m4ZQHcTm<4@uov^=|$HsgrG|{Z^yREgKmo`({*w5&jk~O~Ob7P@)g3lIl-W;80 zD&}3ALWYI0?I+X!o<4pa#LSnR$?0>BuUNWX|CRoXF7Uj>@D*4)1i4Fcv%ZR%uvQ7- V?pGKMoKzf!=@)SO{b}i=`vHKLG|d12 delta 127 zcmaFIw}@pzkZLr8E`tYyH-jrfBttxdGlLIM5Qa?N%Cymymw}4` kgo)C@5W^78kk3%gV8&p=V9a2|;0NTTFrLt+84~>Z#Nx=30%^Xv$2=YK2$hM>=M`VYR{^;%{kP z5Bcuvp8KCM_fDT(zDNhelzPdIO5d=e*{*%%_!TGRWDdCw@hm>l^cyF?aXbVi=r@IP}5 zT+Lx_yhhYqfr=rYYC;tQccLNfxfqbydo`YI$_>8&WNbMsiDf2-}uc~omaB)I#Tf0BbP~|}+ue2- zN|e?Ej~YCdm9z6(HKrY}oEU_QmB^qjKYFHO^4hy#SQyuq-ITq2w^nc0;{E!+H!Pmr zus*d-W<6U~x2gY6{1g>?USjwPtew-(gud)8i+Mv#31Q6?aaT_KYZ%YPhZ`Pn` Date: Sun, 26 Apr 2026 00:10:00 +0200 Subject: [PATCH 20/22] Improve DisableWidgets feature by removing additional Widget related apps (#561) --- Config/Apps.json | 14 ++++++++++++++ Scripts/Features/ExecuteChanges.ps1 | 4 ++-- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/Config/Apps.json b/Config/Apps.json index bfd5f98..65e579f 100644 --- a/Config/Apps.json +++ b/Config/Apps.json @@ -841,6 +841,20 @@ "SelectedByDefault": false, "Recommendation": "optional" }, + { + "FriendlyName": "Windows Web Experience Pack", + "AppId": "MicrosoftWindows.Client.WebExperience", + "Description": "Helps deliver and update certain features, like Widgets, through the Microsoft Store", + "SelectedByDefault": false, + "Recommendation": "optional" + }, + { + "FriendlyName": "Widgets Platform Runtime", + "AppId": "Microsoft.WidgetsPlatformRuntime", + "Description": "Runtime required for Windows Widgets to function", + "SelectedByDefault": false, + "Recommendation": "optional" + }, { "FriendlyName": "HP AI Experience Center", "AppId": "AD2F1837.HPAIExperienceCenter", diff --git a/Scripts/Features/ExecuteChanges.ps1 b/Scripts/Features/ExecuteChanges.ps1 index 35c727f..299dd42 100644 --- a/Scripts/Features/ExecuteChanges.ps1 +++ b/Scripts/Features/ExecuteChanges.ps1 @@ -27,8 +27,8 @@ function ExecuteParameter { RemoveApps 'Microsoft.Copilot' } 'DisableWidgets' { - # Also remove the app package for Widgets - RemoveApps 'Microsoft.StartExperiencesApp' + # Also remove the app packages for Widgets + RemoveApps 'Microsoft.StartExperiencesApp','MicrosoftWindows.Client.WebExperience','Microsoft.WidgetsPlatformRuntime' } } return From 92ac5b441ebe637c1c6bcd6f3109263042a72af9 Mon Sep 17 00:00:00 2001 From: Jeffrey <9938813+Raphire@users.noreply.github.com> Date: Sun, 26 Apr 2026 14:11:29 +0200 Subject: [PATCH 21/22] Add setting details in config import/export interface (#562) --- Schemas/ImportExportConfigWindow.xaml | 22 +++--- Scripts/GUI/Show-ConfigWindow.ps1 | 108 ++++++++++++++++++++++++-- 2 files changed, 114 insertions(+), 16 deletions(-) diff --git a/Schemas/ImportExportConfigWindow.xaml b/Schemas/ImportExportConfigWindow.xaml index 17617c7..c76bbdc 100644 --- a/Schemas/ImportExportConfigWindow.xaml +++ b/Schemas/ImportExportConfigWindow.xaml @@ -43,16 +43,18 @@ - - - - - + + + + + + + Date: Sun, 26 Apr 2026 14:15:26 +0200 Subject: [PATCH 22/22] Fix user display in deployment category details for unspecified usernames --- Scripts/GUI/Show-ConfigWindow.ps1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Scripts/GUI/Show-ConfigWindow.ps1 b/Scripts/GUI/Show-ConfigWindow.ps1 index 97b7fec..6f0d898 100644 --- a/Scripts/GUI/Show-ConfigWindow.ps1 +++ b/Scripts/GUI/Show-ConfigWindow.ps1 @@ -249,7 +249,7 @@ function Get-DeploymentCategoryDetailString { if ($lookup.ContainsKey('UserSelectionIndex')) { switch ([int]$lookup['UserSelectionIndex']) { 0 { $line1 += 'User: Current User' } - 1 { if ($lookup['OtherUsername']) { $line1 += "User: $($lookup['OtherUsername'])" } } + 1 { $line1 += "User: $(if ($lookup['OtherUsername']) { $lookup['OtherUsername'] } else { 'Other User' })" } 2 { $line1 += 'User: Sysprep' } } } @@ -258,7 +258,7 @@ function Get-DeploymentCategoryDetailString { switch ([int]$lookup['AppRemovalScopeIndex']) { 0 { $line1 += 'App Removal: All Users' } 1 { $line1 += 'App Removal: Current User' } - 2 { if ($lookup['OtherUsername']) { $line1 += "App Removal: $($lookup['OtherUsername'])" } } + 2 { $line1 += "App Removal: $(if ($lookup['OtherUsername']) { $lookup['OtherUsername'] } else { 'Other User' })" } } }