20 Commits

Author SHA1 Message Date
Raphire
f8c2c6ddd7 Fix Header styling on Applying Changes page 2026-02-07 19:18:09 +01:00
Raphire
1ea2c63522 Add link to wiki next to tweak category headers 2026-02-07 15:42:06 +01:00
Raphire
675882cb3b Fix key in Enable_Game_Bar_Integration.reg 2026-02-07 15:06:45 +01:00
Raphire
ae4d19f59c Update Start/Apply button styling 2026-02-07 01:40:28 +01:00
Jeffrey
327f4ee7ab Allow forceful MS Edge removal via GUI, remove max version from DisableStartRecommended (#454) 2026-02-06 23:45:47 +01:00
Jeffrey
3af62159a5 UI improvements & cancel execution when closing during execution (#455) 2026-02-06 23:44:39 +01:00
Raphire
6e65a07184 Add missing switches for Windows Update settings 2026-02-04 14:01:04 +01:00
Jeffrey
84bff3ab0c Add option to disable BitLocker automatic device encryption (#451) 2026-02-04 13:59:10 +01:00
Jeffrey
46deca7703 Add Windows Update Settings (#450)
- Prevent getting updates as soon as they're available
- Prevent automatic restarts after updates while signed in
- Disable sharing downloaded updates with other PCs
2026-02-04 13:47:47 +01:00
Jeffrey
6a3f244f9b Support Ctrl+F for search boxes (#449) 2026-02-04 11:43:36 +01:00
Jeffrey
75d783cc63 Make GUI resizable (#448) 2026-02-04 11:34:55 +01:00
Jeffrey
afdb66b5d4 Fix crash on clearing Start menu pinned apps for all users (#447)
As reported in #445
2026-02-04 10:26:55 +01:00
Jeffrey
6a1a091a87 Add search bar to tweak page (#440) 2026-02-02 21:54:40 +01:00
Raphire
1ef8992320 Respect NoRestartExplorer flag in GUI 2026-02-02 21:52:09 +01:00
Jeffrey
59d0e83238 Remove sponsorship (#442) 2026-02-02 20:43:59 +01:00
makhlwf
482161fdd8 Improve UI accessibility for screen readers (#441) 2026-02-02 20:42:29 +01:00
Raphire
91f3dbf5e6 Compressed menu.png to reduce download size 2026-02-01 13:48:05 +01:00
Raphire
57f5e1c632 Remove wiki image to reduce download size 2026-02-01 13:43:02 +01:00
Raphire
95e844923e Minimize the powershell window when no parameters are provided 2026-02-01 13:40:22 +01:00
Raphire
c6e3edbe40 Minimize Win11Debloat powershell window when not running CLI mode 2026-02-01 13:37:27 +01:00
21 changed files with 832 additions and 182 deletions

View File

@@ -1,14 +1,15 @@
{
"Version": "1.0",
"Categories": [
"Start Menu",
"System",
"Privacy & Suggested Content",
"System",
"Start Menu",
"AI",
"Windows Update",
"Taskbar",
"Appearance",
"AI",
"Other",
"File Explorer",
"Other",
"Gaming"
],
"UiGroups": [
@@ -186,11 +187,11 @@
},
{
"FeatureId": "DisableSuggestions",
"Label": "tips, tricks & suggested content",
"Label": "tips, tricks & suggested content throughout Windows",
"Category": "Privacy & Suggested Content",
"Action": "Disable",
"RegistryKey": "Disable_Windows_Suggestions.reg",
"ApplyText": "> Disabling tips, tricks, suggestions and ads across Windows...",
"ApplyText": "> Disabling tips, tricks, suggestions and ads throughout Windows...",
"UndoAction": "Enable",
"RegistryUndoKey": "Enable_Windows_Suggestions.reg",
"MinVersion": null,
@@ -350,7 +351,7 @@
"UndoAction": "Show",
"RegistryUndoKey": "Enable_Start_Recommended.reg",
"MinVersion": 22621,
"MaxVersion": 26199
"MaxVersion": null
},
{
"FeatureId": "DisableBing",
@@ -608,6 +609,18 @@
"MinVersion": null,
"MaxVersion": null
},
{
"FeatureId": "DisableBitlockerAutoEncryption",
"Label": "BitLocker automatic device encryption",
"Category": "System",
"Action": "Disable",
"RegistryKey": "Disable_Bitlocker_Auto_Encryption.reg",
"ApplyText": "> Disabling BitLocker automatic device encryption...",
"UndoAction": "Enable",
"RegistryUndoKey": "Enable_Bitlocker_Auto_Encryption.reg",
"MinVersion": 22000,
"MaxVersion": null
},
{
"FeatureId": "DisableModernStandbyNetworking",
"Label": "Modern Standby network connectivity",
@@ -898,6 +911,42 @@
"MinVersion": null,
"MaxVersion": null
},
{
"FeatureId": "DisableUpdateASAP",
"Label": "updates as soon as they're available",
"Category": "Windows Update",
"Action": "Prevent getting",
"RegistryKey": "Disable_Update_ASAP.reg",
"ApplyText": "> Preventing Windows from getting updates as soon as they are available...",
"UndoAction": "Get",
"RegistryUndoKey": "Enable_Update_ASAP.reg",
"MinVersion": null,
"MaxVersion": null
},
{
"FeatureId": "PreventUpdateAutoReboot",
"Label": "automatic restarts after updates while signed in",
"Category": "Windows Update",
"Action": "Prevent",
"RegistryKey": "Prevent_Auto_Reboot.reg",
"ApplyText": "> Preventing automatic restarts after updates while signed in...",
"UndoAction": "Allow",
"RegistryUndoKey": "Allow_Auto_Reboot.reg",
"MinVersion": null,
"MaxVersion": null
},
{
"FeatureId": "DisableDeliveryOptimization",
"Label": "sharing downloaded updates with other PCs",
"Category": "Windows Update",
"Action": "Disable",
"RegistryKey": "Disable_Delivery_Optimization.reg",
"ApplyText": "> Disabling sharing of downloaded updates with other PCs...",
"UndoAction": "Enable",
"RegistryUndoKey": "Enable_Delivery_Optimization.reg",
"MinVersion": null,
"MaxVersion": null
},
{
"FeatureId": "ForceRemoveEdge",
"Label": "Forcefully uninstall Microsoft Edge. NOT RECOMMENDED!",

Binary file not shown.

Before

Width:  |  Height:  |  Size: 486 KiB

After

Width:  |  Height:  |  Size: 82 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 287 KiB

View File

@@ -227,7 +227,7 @@
Margin="12,0,0,0"
FontSize="12"/>
<StackPanel Grid.Column="1" Orientation="Horizontal">
<Button x:Name="CloseBtn" Content="&#xE8BB;" Style="{StaticResource CloseButton}" ToolTip="Close" IsCancel="True"/>
<Button x:Name="CloseBtn" Content="&#xE8BB;" Style="{StaticResource CloseButton}" ToolTip="Close" IsCancel="True" AutomationProperties.Name="Close"/>
</StackPanel>
</Grid>
</Border>
@@ -250,7 +250,7 @@
Margin="0,0,0,10"/>
<StackPanel Grid.Row="1" Orientation="Horizontal" Margin="0,0,0,8">
<CheckBox x:Name="CheckAllBox" Content="Check/Uncheck all" Margin="8,0,15,0" Foreground="{DynamicResource FgColor}"/>
<CheckBox x:Name="CheckAllBox" Content="Check/Uncheck all" Margin="8,0,15,0" Foreground="{DynamicResource FgColor}" AutomationProperties.Name="Check or Uncheck all"/>
</StackPanel>
<Border Grid.Row="2" BorderBrush="{DynamicResource BorderColor}" CornerRadius="4" BorderThickness="1" Margin="0,0,0,10" Background="{DynamicResource CardBgColor}">
@@ -266,10 +266,10 @@
<StackPanel Grid.Row="3" Orientation="Horizontal" HorizontalAlignment="Right">
<Grid Margin="0,8,10,10">
<CheckBox x:Name="OnlyInstalledBox" Content="Only show installed apps" Foreground="{DynamicResource FgColor}" />
<CheckBox x:Name="OnlyInstalledBox" Content="Only show installed apps" Foreground="{DynamicResource FgColor}" AutomationProperties.Name="Only show installed apps"/>
</Grid>
<Button x:Name="ConfirmBtn" Width="80" Height="32" Margin="0,0,10,0" Content="Confirm" Style="{StaticResource Win11Button}"/>
<Button x:Name="CancelBtn" Width="80" Height="32" Content="Cancel" Style="{StaticResource Win11ButtonSecondary}" IsCancel="True"/>
<Button x:Name="ConfirmBtn" Width="80" Height="32" Margin="0,0,10,0" Content="Confirm" Style="{StaticResource Win11Button}" AutomationProperties.Name="Confirm"/>
<Button x:Name="CancelBtn" Width="80" Height="32" Content="Cancel" Style="{StaticResource Win11ButtonSecondary}" IsCancel="True" AutomationProperties.Name="Cancel"/>
</StackPanel>
</Grid>
</Grid>

View File

@@ -1,8 +1,9 @@
<Window xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="Win11Debloat"
Width="1024" Height="768"
ResizeMode="NoResize"
MinWidth="1024" MinHeight="600"
MaxWidth="1280"
ResizeMode="CanResize"
SnapsToDevicePixels="True"
WindowStartupLocation="CenterScreen"
WindowStyle="None"
@@ -53,7 +54,7 @@
<Setter Property="Foreground" Value="{DynamicResource FgColor}"/>
<Setter Property="BorderBrush" Value="{DynamicResource BorderColor}"/>
<Setter Property="BorderThickness" Value="1"/>
<Setter Property="Margin" Value="0,4,0,8"/>
<Setter Property="Margin" Value="0,4,0,12"/>
<Setter Property="MinHeight" Value="33"/>
<Setter Property="Template">
<Setter.Value>
@@ -158,6 +159,13 @@
<Trigger Property="SelectedIndex" Value="-1">
<Setter TargetName="ClosedAccentLine" Property="Visibility" Value="Collapsed"/>
</Trigger>
<Trigger Property="IsEnabled" Value="False">
<Setter TargetName="ClosedAccentLine" Property="Visibility" Value="Collapsed"/>
<Setter Property="Background" Value="{DynamicResource ButtonDisabled}"/>
<Setter Property="BorderBrush" Value="{DynamicResource BorderColor}"/>
<Setter Property="Foreground" Value="{DynamicResource ButtonTextDisabled}"/>
<Setter Property="Opacity" Value="0.6"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
@@ -212,7 +220,16 @@
<Style x:Key="LabelStyle" TargetType="TextBlock">
<Setter Property="Foreground" Value="{DynamicResource FgColor}"/>
<Setter Property="FontSize" Value="12"/>
<Setter Property="Margin" Value="0,0,0,3"/>
<Setter Property="Margin" Value="0,0,0,2"/>
</Style>
<!-- Label Border Style for ComboBox labels -->
<Style x:Key="LabelBorderStyle" TargetType="Border">
<Setter Property="CornerRadius" Value="4"/>
<Setter Property="Padding" Value="6,2"/>
<Setter Property="Margin" Value="-4,-2,-4,0"/>
<Setter Property="Background" Value="Transparent"/>
<Setter Property="HorizontalAlignment" Value="Stretch"/>
</Style>
<!-- Category card border style -->
@@ -221,28 +238,73 @@
<Setter Property="BorderThickness" Value="1"/>
<Setter Property="CornerRadius" Value="4"/>
<Setter Property="Background" Value="{DynamicResource CardBgColor}"/>
<Setter Property="Padding" Value="16,12"/>
<Setter Property="Padding" Value="16,12,16,2"/>
<Setter Property="Margin" Value="0,0,0,16"/>
</Style>
<!-- Category header text style -->
<Style x:Key="CategoryHeaderTextBlock" TargetType="TextBlock">
<Setter Property="FontWeight" Value="Bold"/>
<Setter Property="FontSize" Value="15"/>
<Setter Property="FontSize" Value="16"/>
<Setter Property="Margin" Value="0,0,0,10"/>
<Setter Property="Foreground" Value="{DynamicResource FgColor}"/>
</Style>
</Style>
<!-- Category help link button/text styles -->
<Style x:Key="CategoryHelpLinkButtonStyle" TargetType="Button">
<Setter Property="Background" Value="Transparent"/>
<Setter Property="BorderBrush" Value="Transparent"/>
<Setter Property="BorderThickness" Value="0"/>
<Setter Property="Padding" Value="0"/>
<Setter Property="Margin" Value="6,1,0,10"/>
<Setter Property="VerticalAlignment" Value="Center"/>
<Setter Property="Focusable" Value="False"/>
<Setter Property="IsTabStop" Value="False"/>
<Setter Property="Cursor" Value="Hand"/>
<Setter Property="FocusVisualStyle" Value="{x:Null}"/>
<Setter Property="Foreground" Value="{DynamicResource ButtonBg}"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="Button">
<Border Background="Transparent" BorderBrush="Transparent" BorderThickness="0">
<ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
<Style.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Foreground" Value="{DynamicResource ButtonHover}"/>
</Trigger>
<Trigger Property="IsPressed" Value="True">
<Setter Property="Foreground" Value="{DynamicResource ButtonPressed}"/>
</Trigger>
</Style.Triggers>
</Style>
<Style x:Key="CategoryHelpLinkTextStyle" TargetType="TextBlock">
<Setter Property="FontSize" Value="12"/>
<Setter Property="FontWeight" Value="Bold"/>
<Setter Property="VerticalAlignment" Value="Center"/>
<Setter Property="Foreground">
<Setter.Value>
<Binding RelativeSource="{RelativeSource AncestorType=Button}" Path="Foreground"/>
</Setter.Value>
</Setter>
</Style>
<!-- Overview changes text style -->
<Style x:Key="OverviewNoChangesTextStyle" TargetType="TextBlock">
<Setter Property="Foreground" Value="{DynamicResource FgColor}"/>
<Setter Property="FontStyle" Value="Italic"/>
<Setter Property="Margin" Value="0,0,0,8"/>
<Setter Property="FontSize" Value="12"/>
<Setter Property="FontStyle" Value="Italic"/>
</Style>
<Style x:Key="OverviewChangeBulletStyle" TargetType="TextBlock">
<Setter Property="Foreground" Value="{DynamicResource FgColor}"/>
<Setter Property="Margin" Value="0,0,0,8"/>
<Setter Property="FontSize" Value="12"/>
<Setter Property="TextWrapping" Value="Wrap"/>
</Style>
@@ -251,6 +313,41 @@
<Setter Property="CaretBrush" Value="{DynamicResource FgColor}"/>
</Style>
<!-- User TextBox Style with disabled state -->
<Style x:Key="UserTextBoxStyle" TargetType="TextBox">
<Setter Property="CaretBrush" Value="{DynamicResource FgColor}"/>
<Setter Property="Background" Value="Transparent"/>
<Setter Property="Foreground" Value="{DynamicResource FgColor}"/>
<Setter Property="BorderThickness" Value="0"/>
<Setter Property="FontSize" Value="13"/>
<Setter Property="Margin" Value="1,0,0,1"/>
<Setter Property="VerticalAlignment" Value="Center"/>
<Setter Property="Padding" Value="0"/>
<Style.Triggers>
<Trigger Property="IsEnabled" Value="False">
<Setter Property="Background" Value="{DynamicResource ButtonDisabled}"/>
<Setter Property="Foreground" Value="{DynamicResource ButtonTextDisabled}"/>
<Setter Property="Opacity" Value="0.6"/>
</Trigger>
</Style.Triggers>
</Style>
<!-- User TextBox Border Style with disabled state -->
<Style x:Key="UserTextBoxBorderStyle" TargetType="Border">
<Setter Property="BorderBrush" Value="{DynamicResource ButtonBorderColor}"/>
<Setter Property="BorderThickness" Value="1"/>
<Setter Property="CornerRadius" Value="4"/>
<Setter Property="Background" Value="{DynamicResource ComboBgColor}"/>
<Setter Property="Padding" Value="8,6"/>
<Style.Triggers>
<Trigger Property="IsEnabled" Value="False">
<Setter Property="Background" Value="{DynamicResource ButtonDisabled}"/>
<Setter Property="BorderBrush" Value="{DynamicResource BorderColor}"/>
<Setter Property="Opacity" Value="0.6"/>
</Trigger>
</Style.Triggers>
</Style>
<!-- CheckBox Style -->
<Style TargetType="CheckBox">
<Setter Property="Foreground" Value="{DynamicResource FgColor}"/>
@@ -268,7 +365,7 @@
<Border x:Name="CheckBoxBorder" Grid.Column="0" Width="18" Height="18" Background="{DynamicResource CheckBoxBgColor}" BorderBrush="{DynamicResource CheckBoxBorderColor}" BorderThickness="1" CornerRadius="4" Margin="0,0,8,0">
<TextBlock x:Name="CheckMark" Text="&#xE73E;" FontFamily="Segoe MDL2 Assets" FontSize="12" Foreground="{DynamicResource ButtonBg}" HorizontalAlignment="Center" VerticalAlignment="Center" Visibility="Collapsed"/>
</Border>
<ContentPresenter Grid.Column="1" VerticalAlignment="Center" Margin="0,0,0,1"/>
<ContentPresenter Grid.Column="1" VerticalAlignment="Center" Margin="0,0,0,2"/>
</Grid>
</Border>
<ControlTemplate.Triggers>
@@ -281,6 +378,13 @@
<Setter TargetName="CheckBoxBorder" Property="BorderBrush" Value="{DynamicResource ButtonBg}"/>
<Setter TargetName="CheckMark" Property="Foreground" Value="White"/>
</Trigger>
<Trigger Property="IsEnabled" Value="False">
<Setter TargetName="CheckBoxBorder" Property="Background" Value="{DynamicResource ButtonDisabled}"/>
<Setter TargetName="CheckBoxBorder" Property="BorderBrush" Value="{DynamicResource BorderColor}"/>
<Setter Property="Foreground" Value="{DynamicResource ButtonTextDisabled}"/>
<Setter Property="Opacity" Value="0.6"/>
<Setter TargetName="CheckMark" Property="Foreground" Value="{DynamicResource ButtonTextDisabled}"/>
</Trigger>
<MultiTrigger>
<MultiTrigger.Conditions>
<Condition Property="IsMouseOver" Value="True"/>
@@ -297,8 +401,8 @@
<!-- CheckBox style for feature toggles -->
<Style x:Key="FeatureCheckboxStyle" TargetType="CheckBox" BasedOn="{StaticResource {x:Type CheckBox}}">
<Setter Property="Margin" Value="0,0,0,10"/>
<Setter Property="Padding" Value="0,2"/>
<Setter Property="Margin" Value="-4,-2,-4,10"/>
<Setter Property="Padding" Value="4,2"/>
</Style>
<!-- CheckBox style for apps panels -->
@@ -429,6 +533,21 @@
</Trigger>
</Style.Triggers>
</Style>
<!-- SearchBox Border Style -->
<Style x:Key="SearchBoxBorderStyle" TargetType="Border">
<Setter Property="Background" Value="{DynamicResource ComboBgColor}"/>
<Setter Property="BorderBrush" Value="{DynamicResource ButtonBorderColor}"/>
<Setter Property="BorderThickness" Value="1"/>
<Setter Property="CornerRadius" Value="4"/>
<Setter Property="Width" Value="300"/>
<Setter Property="Padding" Value="8,6"/>
<Style.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Background" Value="{DynamicResource ComboHoverColor}"/>
</Trigger>
</Style.Triggers>
</Style>
</Window.Resources>
<Border BorderBrush="{DynamicResource BorderColor}"
@@ -442,6 +561,16 @@
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<!-- Resize Borders -->
<Rectangle x:Name="ResizeLeft" Width="5" HorizontalAlignment="Left" Fill="Transparent" Cursor="SizeWE" Grid.Row="0" Grid.RowSpan="3" Panel.ZIndex="100"/>
<Rectangle x:Name="ResizeRight" Width="5" HorizontalAlignment="Right" Fill="Transparent" Cursor="SizeWE" Grid.Row="0" Grid.RowSpan="3" Panel.ZIndex="100"/>
<Rectangle x:Name="ResizeTop" Height="5" VerticalAlignment="Top" Fill="Transparent" Cursor="SizeNS" Grid.Row="0" Panel.ZIndex="100"/>
<Rectangle x:Name="ResizeBottom" Height="5" VerticalAlignment="Bottom" Fill="Transparent" Cursor="SizeNS" Grid.Row="2" Panel.ZIndex="100"/>
<Rectangle x:Name="ResizeTopLeft" Width="8" Height="8" HorizontalAlignment="Left" VerticalAlignment="Top" Fill="Transparent" Cursor="SizeNWSE" Grid.Row="0" Panel.ZIndex="101"/>
<Rectangle x:Name="ResizeTopRight" Width="8" Height="8" HorizontalAlignment="Right" VerticalAlignment="Top" Fill="Transparent" Cursor="SizeNESW" Grid.Row="0" Panel.ZIndex="101"/>
<Rectangle x:Name="ResizeBottomLeft" Width="8" Height="8" HorizontalAlignment="Left" VerticalAlignment="Bottom" Fill="Transparent" Cursor="SizeNESW" Grid.Row="2" Panel.ZIndex="101"/>
<Rectangle x:Name="ResizeBottomRight" Width="8" Height="8" HorizontalAlignment="Right" VerticalAlignment="Bottom" Fill="Transparent" Cursor="SizeNWSE" Grid.Row="2" Panel.ZIndex="101"/>
<!-- Custom Title Bar -->
<Grid Grid.Row="0" x:Name="TitleBar">
<Border Background="{DynamicResource BgColor}" CornerRadius="8,8,0,0">
@@ -457,8 +586,8 @@
Margin="12,0,0,0"
FontSize="12"/>
<StackPanel Grid.Column="1" Orientation="Horizontal">
<Button x:Name="HelpBtn" Content="?" FontFamily="Segoe UI" FontSize="15" Style="{StaticResource HelpButton}" ToolTip="Open Wiki"/>
<Button x:Name="CloseBtn" Content="&#xE8BB;" Style="{StaticResource CloseButton}" ToolTip="Close"/>
<Button x:Name="HelpBtn" Content="?" FontFamily="Segoe UI" FontSize="15" Style="{StaticResource HelpButton}" ToolTip="Open Wiki" AutomationProperties.Name="Open Wiki"/>
<Button x:Name="CloseBtn" Content="&#xE8BB;" Style="{StaticResource CloseButton}" ToolTip="Close" AutomationProperties.Name="Close"/>
</StackPanel>
</Grid>
</Border>
@@ -525,10 +654,9 @@
</TextBlock>
<!-- Start Button -->
<Button x:Name="HomeStartBtn" Width="200" Height="48" Style="{StaticResource Win11Button}" HorizontalAlignment="Center" Margin="0,50,0,0">
<Button x:Name="HomeStartBtn" Width="125" Height="53" Style="{StaticResource Win11Button}" HorizontalAlignment="Center" Margin="0,20,0,0" AutomationProperties.Name="Start">
<StackPanel Orientation="Horizontal" VerticalAlignment="Center">
<TextBlock Text="Start" VerticalAlignment="Center" FontSize="20" Margin="0,0,0,2"/>
<TextBlock Text="&#xE72A;" FontFamily="Segoe MDL2 Assets" FontSize="16" Margin="8,0,0,0" VerticalAlignment="Center"/>
<TextBlock Text="Start" FontWeight="SemiBold" VerticalAlignment="Center" FontSize="24" Margin="0,0,0,3"/>
</StackPanel>
</Button>
</StackPanel>
@@ -549,19 +677,28 @@
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="10"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<StackPanel Orientation="Horizontal" Grid.Column="0">
<Button x:Name="DefaultAppsBtn" Content="Select Default Apps" ToolTip="Select the default selection of apps" Style="{StaticResource Win11ButtonSecondary}" Height="32" Padding="10,0" Margin="0,0,10,0"/>
<Button x:Name="LoadLastUsedAppsBtn" Content="Select Last Used Selection" ToolTip="Select the apps that were selected the last time Win11Debloat was run" Style="{StaticResource Win11ButtonSecondary}" Height="32" Padding="10,0" Margin="0,0,10,0"/>
<Button x:Name="ClearAppSelectionBtn" Content="Clear Selection" ToolTip="Clear all selected apps" Style="{StaticResource Win11ButtonSecondary}" Height="32" Padding="10,0" Margin="0,0,10,0"/>
<Button x:Name="DefaultAppsBtn" Content="Select Default Apps" ToolTip="Select the default selection of apps" Style="{StaticResource Win11ButtonSecondary}" Height="32" Padding="10,0" Margin="0,0,10,0" AutomationProperties.Name="Select Default Apps"/>
<Button x:Name="LoadLastUsedAppsBtn" Content="Select Last Used Selection" ToolTip="Select the apps that were selected the last time Win11Debloat was run" Style="{StaticResource Win11ButtonSecondary}" Height="32" Padding="10,0" Margin="0,0,10,0" AutomationProperties.Name="Select Last Used Selection"/>
<Button x:Name="ClearAppSelectionBtn" Content="Clear Selection" ToolTip="Clear all selected apps" Style="{StaticResource Win11ButtonSecondary}" Height="32" Padding="10,0" Margin="0,0,10,0" AutomationProperties.Name="Clear Selection"/>
</StackPanel>
<CheckBox x:Name="OnlyInstalledAppsBox" Grid.Column="2" Content="Only show installed apps" IsChecked="False" Foreground="{DynamicResource FgColor}" VerticalAlignment="Center"/>
<CheckBox x:Name="OnlyInstalledAppsBox" Grid.Column="2" Content="Only show installed apps" IsChecked="False" Foreground="{DynamicResource FgColor}" VerticalAlignment="Center" AutomationProperties.Name="Only show installed apps"/>
<Border Grid.Column="4" BorderBrush="{DynamicResource ButtonBorderColor}" BorderThickness="1" CornerRadius="4" Background="{DynamicResource ComboBgColor}" Width="300" Padding="8,6">
<Border x:Name="AppSearchBorder" Grid.Column="4">
<Border.Style>
<Style TargetType="Border" BasedOn="{StaticResource SearchBoxBorderStyle}">
<Style.Triggers>
<DataTrigger Binding="{Binding ElementName=AppSearchBox, Path=IsFocused}" Value="True">
<Setter Property="Background" Value="{DynamicResource SecondaryButtonHover}"/>
</DataTrigger>
</Style.Triggers>
</Style>
</Border.Style>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
@@ -569,16 +706,20 @@
</Grid.ColumnDefinitions>
<TextBlock Grid.Column="0" Text="&#xE721;" FontFamily="Segoe MDL2 Assets" FontSize="14" VerticalAlignment="Center" Margin="4,0,8,0" Foreground="{DynamicResource FgColor}"/>
<TextBlock x:Name="AppSearchPlaceholder" Grid.Column="1" Text="Search app" Foreground="{DynamicResource FgColor}" Opacity="0.5" FontSize="13" Margin="3,0,0,1" VerticalAlignment="Center" IsHitTestVisible="False"/>
<TextBox x:Name="AppSearchBox" Grid.Column="1" Background="Transparent" Foreground="{DynamicResource FgColor}" BorderThickness="0" FontSize="13" Margin="1,0,0,1" VerticalAlignment="Center" Text=""/>
<TextBox x:Name="AppSearchBox" Grid.Column="1" Background="Transparent" Foreground="{DynamicResource FgColor}" BorderThickness="0" FontSize="13" Margin="1,0,0,1" VerticalAlignment="Center" Text="" AutomationProperties.Name="Search app"/>
</Grid>
</Border>
</Grid>
</StackPanel>
</Border>
<ScrollViewer VerticalScrollBarVisibility="Auto" Padding="20,0">
<StackPanel>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="*"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<!-- Apps List -->
<Border BorderBrush="{DynamicResource BorderColor}" CornerRadius="4" BorderThickness="1" Margin="0,0,0,10" Background="{DynamicResource CardBgColor}" Height="510">
<Border Grid.Row="0" BorderBrush="{DynamicResource BorderColor}" CornerRadius="4" BorderThickness="1" Margin="20,0,20,10" Background="{DynamicResource CardBgColor}">
<Grid>
<ScrollViewer VerticalScrollBarVisibility="Auto">
<StackPanel x:Name="AppSelectionPanel" Margin="8"/>
@@ -590,11 +731,10 @@
</Border>
<!-- Status Info -->
<StackPanel Orientation="Horizontal">
<TextBlock x:Name="AppSelectionStatus" Text="" Foreground="{DynamicResource FgColor}" Margin="10,0,0,0" HorizontalAlignment="Left"/>
<StackPanel Grid.Row="1" Orientation="Horizontal" Margin="20,0,20,0">
<TextBlock x:Name="AppSelectionStatus" Text="" Foreground="{DynamicResource FgColor}" Margin="10,0,0,5" HorizontalAlignment="Left"/>
</StackPanel>
</StackPanel>
</ScrollViewer>
</Grid>
</DockPanel>
</TabItem>
@@ -608,17 +748,44 @@
<!-- Filter Options -->
<Grid Margin="0,0,0,12">
<StackPanel Orientation="Horizontal">
<Button x:Name="LoadDefaultsBtn" Content="Select Default Settings" ToolTip="Select the settings that are recommended for most people" Style="{StaticResource Win11ButtonSecondary}" Padding="10,0" Height="32" Margin="0,0,10,0"/>
<Button x:Name="LoadLastUsedBtn" Content="Select Last Used Settings" ToolTip="Select the settings that were used the last time Win11Debloat was run" Style="{StaticResource Win11ButtonSecondary}" Padding="10,0" Height="32" Margin="0,0,10,0"/>
<Button x:Name="ClearAllTweaksBtn" Content="Clear Selection" ToolTip="Clear all selected tweaks" Style="{StaticResource Win11ButtonSecondary}" Padding="10,0" Height="32" Margin="0,0,10,0"/>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<StackPanel Grid.Column="0" Orientation="Horizontal">
<Button x:Name="LoadDefaultsBtn" Content="Select Default Settings" ToolTip="Select the settings that are recommended for most people" Style="{StaticResource Win11ButtonSecondary}" Padding="10,0" Height="32" Margin="0,0,10,0" AutomationProperties.Name="Select Default Settings"/>
<Button x:Name="LoadLastUsedBtn" Content="Select Last Used Settings" ToolTip="Select the settings that were used the last time Win11Debloat was run" Style="{StaticResource Win11ButtonSecondary}" Padding="10,0" Height="32" Margin="0,0,10,0" AutomationProperties.Name="Select Last Used Settings"/>
<Button x:Name="ClearAllTweaksBtn" Content="Clear Selection" ToolTip="Clear all selected tweaks" Style="{StaticResource Win11ButtonSecondary}" Padding="10,0" Height="32" Margin="0,0,10,0" AutomationProperties.Name="Clear Selection"/>
</StackPanel>
<Border x:Name="TweakSearchBorder" Grid.Column="2">
<Border.Style>
<Style TargetType="Border" BasedOn="{StaticResource SearchBoxBorderStyle}">
<Style.Triggers>
<DataTrigger Binding="{Binding ElementName=TweakSearchBox, Path=IsFocused}" Value="True">
<Setter Property="Background" Value="{DynamicResource SecondaryButtonHover}"/>
</DataTrigger>
</Style.Triggers>
</Style>
</Border.Style>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<TextBlock Grid.Column="0" Text="&#xE721;" FontFamily="Segoe MDL2 Assets" FontSize="14" VerticalAlignment="Center" Margin="4,0,8,0" Foreground="{DynamicResource FgColor}"/>
<TextBlock x:Name="TweakSearchPlaceholder" Grid.Column="1" Text="Search setting" Foreground="{DynamicResource FgColor}" Opacity="0.5" FontSize="13" Margin="3,0,0,1" VerticalAlignment="Center" IsHitTestVisible="False"/>
<TextBox x:Name="TweakSearchBox" Grid.Column="1" Background="Transparent" Foreground="{DynamicResource FgColor}" BorderThickness="0" FontSize="13" Margin="1,0,0,1" VerticalAlignment="Center" Text=""/>
</Grid>
</Border>
</Grid>
</StackPanel>
</Border>
<Grid>
<ScrollViewer VerticalScrollBarVisibility="Auto" Margin="0,-20,0,0" Padding="20,10,20,0">
<Grid Margin="0,10,0,5">
<ScrollViewer x:Name="TweaksScrollViewer" VerticalScrollBarVisibility="Auto" Margin="0,-20,0,0" Padding="20,10,20,0">
<Grid x:Name="TweaksGrid" Margin="0,10,0,5">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="*"/>
@@ -670,18 +837,27 @@
<Grid>
<ScrollViewer VerticalScrollBarVisibility="Auto" Margin="0,-20,0,0" Padding="20,10,20,0">
<StackPanel Margin="0,10,0,5">
<!-- Apply Changes To -->
<Border BorderBrush="{DynamicResource BorderColor}" BorderThickness="1" CornerRadius="4" Background="{DynamicResource CardBgColor}" Padding="20" Margin="0,0,0,16">
<!-- Selected Changes -->
<Border BorderBrush="{DynamicResource BorderColor}" BorderThickness="1" CornerRadius="4" Background="{DynamicResource CardBgColor}" Padding="16,12,16,4" Margin="0,0,0,16">
<StackPanel>
<TextBlock Text="Apply Changes To" FontWeight="Bold" FontSize="14" Foreground="{DynamicResource FgColor}" Margin="0,0,0,8"/>
<ComboBox x:Name="UserSelectionCombo" Margin="0,0,0,12">
<TextBlock Text="Selected Changes" Style="{StaticResource CategoryHeaderTextBlock}"/>
<StackPanel x:Name="OverviewChangesPanel"/>
<StackPanel Margin="0,0,0,3"/>
</StackPanel>
</Border>
<!-- Apply Changes To -->
<Border BorderBrush="{DynamicResource BorderColor}" BorderThickness="1" CornerRadius="4" Background="{DynamicResource CardBgColor}" Padding="16,12" Margin="0,0,0,16">
<StackPanel>
<TextBlock Text="Apply Changes To" Style="{StaticResource CategoryHeaderTextBlock}"/>
<ComboBox x:Name="UserSelectionCombo" Margin="0,0,0,6" AutomationProperties.Name="Apply Changes To">
<ComboBoxItem Content="Current User" IsSelected="True"/>
<ComboBoxItem Content="Other User"/>
<ComboBoxItem Content="Windows Default User (Sysprep)"/>
</ComboBox>
<StackPanel x:Name="OtherUserPanel" Visibility="Collapsed" Margin="0,0,0,12">
<StackPanel x:Name="OtherUserPanel" Visibility="Collapsed" Margin="0,0,0,6">
<TextBlock x:Name="UsernameValidationMessage" Text="" FontStyle="Italic" Foreground="{DynamicResource CloseHover}" FontSize="11" Margin="3,0,0,4" TextWrapping="Wrap"/>
<Border BorderBrush="{DynamicResource ButtonBorderColor}" BorderThickness="1" CornerRadius="4" Background="{DynamicResource ComboBgColor}" Padding="8,6">
<Border Style="{StaticResource UserTextBoxBorderStyle}" IsEnabled="{Binding ElementName=OtherUsernameTextBox, Path=IsEnabled}">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
@@ -689,36 +865,36 @@
</Grid.ColumnDefinitions>
<TextBlock Grid.Column="0" Text="&#xE77B;" FontFamily="Segoe MDL2 Assets" FontSize="14" VerticalAlignment="Center" Margin="4,0,8,0" Foreground="{DynamicResource FgColor}"/>
<TextBlock x:Name="UsernameTextBoxPlaceholder" Grid.Column="1" Text="Enter username" Foreground="{DynamicResource FgColor}" Opacity="0.5" FontSize="13" Margin="3,0,0,1" VerticalAlignment="Center" IsHitTestVisible="False"/>
<TextBox x:Name="OtherUsernameTextBox" Grid.Column="1" Background="Transparent" Foreground="{DynamicResource FgColor}" BorderThickness="0" FontSize="13" Margin="1,0,0,1" VerticalAlignment="Center" Text="" Padding="0"/>
<TextBox x:Name="OtherUsernameTextBox" Grid.Column="1" Style="{StaticResource UserTextBoxStyle}" Text="" AutomationProperties.Name="Enter username"/>
</Grid>
</Border>
</StackPanel>
<TextBlock x:Name="UserSelectionDescription" Text="Changes will be applied to the currently logged-in user profile." Foreground="{DynamicResource FgColor}" FontSize="12" TextWrapping="Wrap"/>
<TextBlock x:Name="UserSelectionDescription" Text="Changes will be applied to the currently logged-in user profile." Foreground="{DynamicResource FgColor}" FontSize="12" TextWrapping="Wrap" Margin="0,6,0,3"/>
</StackPanel>
</Border>
<!-- Selected Changes -->
<Border BorderBrush="{DynamicResource BorderColor}" BorderThickness="1" CornerRadius="4" Background="{DynamicResource CardBgColor}" Padding="16,12" Margin="0,0,0,16">
<!-- Options -->
<Border BorderBrush="{DynamicResource BorderColor}" BorderThickness="1" CornerRadius="4" Background="{DynamicResource CardBgColor}" Padding="16,12,16,3" Margin="0,0,0,16">
<StackPanel>
<TextBlock Text="Selected Changes" FontWeight="Bold" FontSize="14" Foreground="{DynamicResource FgColor}" Margin="0,0,0,12"/>
<StackPanel x:Name="OverviewChangesPanel"/>
</StackPanel>
</Border>
<!-- System Restore Point -->
<Border BorderBrush="{DynamicResource BorderColor}" BorderThickness="1" CornerRadius="4" Background="{DynamicResource CardBgColor}" Padding="16,12" Margin="0,0,0,16">
<StackPanel>
<TextBlock Text="System Restore Point" FontWeight="Bold" FontSize="14" Foreground="{DynamicResource FgColor}" Margin="0,0,0,8"/>
<TextBlock Text="A restore point will allow you to revert your system to a previous state using the built-in System Restore feature. (Recommended)" Foreground="{DynamicResource FgColor}" FontSize="12" Margin="0,0,0,10" TextWrapping="Wrap"/>
<CheckBox x:Name="RestorePointCheckBox" Content="Create system restore point" Foreground="{DynamicResource FgColor}"/>
<TextBlock Text="Options" Style="{StaticResource CategoryHeaderTextBlock}"/>
<!-- Restore Point Option -->
<StackPanel>
<CheckBox x:Name="RestorePointCheckBox" Style="{StaticResource FeatureCheckboxStyle}" Content="Create a system restore point (Recommended)" AutomationProperties.Name="Create a system restore point (Recommended)"/>
</StackPanel>
<!-- Restart Explorer Option -->
<StackPanel>
<CheckBox x:Name="RestartExplorerCheckBox" Style="{StaticResource FeatureCheckboxStyle}" Content="Restart the Windows Explorer process to apply all changes immediately" AutomationProperties.Name="Restart the Windows Explorer process to apply all changes immediately"/>
</StackPanel>
</StackPanel>
</Border>
<!-- Apply Changes Button -->
<Button x:Name="OverviewApplyBtn" Style="{StaticResource Win11Button}" Padding="14,8" Margin="0,0,0,15" HorizontalAlignment="Center">
<Button x:Name="OverviewApplyBtn" Style="{StaticResource Win11Button}" Width="190" Height="44" Margin="0,0,0,15" HorizontalAlignment="Center" AutomationProperties.Name="Apply Changes">
<StackPanel Orientation="Horizontal" VerticalAlignment="Center">
<TextBlock Text="Apply Changes" VerticalAlignment="Center" FontSize="16" Margin="0,0,0,2"/>
<TextBlock Text="&#xE73E;" FontFamily="Segoe MDL2 Assets" FontSize="16" Margin="8,0,0,0" VerticalAlignment="Center"/>
<TextBlock Text="&#xE73E;" FontFamily="Segoe MDL2 Assets" FontSize="20" FontWeight="SemiBold" VerticalAlignment="Center"/>
<TextBlock Text="Apply Changes" VerticalAlignment="Center" FontSize="18" FontWeight="SemiBold" Margin="8,0,0,4"/>
</StackPanel>
</Button>
</StackPanel>
@@ -756,15 +932,17 @@
</Grid.RowDefinitions>
<!-- Header -->
<StackPanel Grid.Row="0" Margin="20,10,20,10">
<TextBlock Text="Applying Changes" FontWeight="Bold" FontSize="20" Margin="0,0,0,10" Foreground="{DynamicResource FgColor}"/>
<TextBlock Text="Sit back and relax while Win11Debloat applies your selected changes" FontSize="13" Margin="0,0,0,10" Foreground="{DynamicResource FgColor}" TextWrapping="Wrap"/>
</StackPanel>
<Border DockPanel.Dock="Top" Padding="20,10,20,0">
<StackPanel Grid.Row="0">
<TextBlock Text="Applying Changes" FontWeight="Bold" FontSize="20" Margin="0,0,0,5" Foreground="{DynamicResource FgColor}"/>
<TextBlock Text="Sit back and relax while Win11Debloat applies your selected changes" FontSize="13" Margin="0,0,0,20" Foreground="{DynamicResource FgColor}" TextWrapping="Wrap"/>
</StackPanel>
</Border>
<!-- Console Output -->
<Border Grid.Row="1" BorderBrush="{DynamicResource BorderColor}" BorderThickness="1" CornerRadius="4" Background="#0C0C0C" Margin="20,0">
<ScrollViewer x:Name="ConsoleScrollViewer" VerticalScrollBarVisibility="Auto" Padding="10">
<TextBlock x:Name="ConsoleOutput" FontFamily="Consolas" FontSize="12" Foreground="#CCCCCC" TextWrapping="Wrap" Text=""/>
<TextBlock x:Name="ConsoleOutput" FontFamily="Consolas" FontSize="12" Foreground="#CCCCCC" TextWrapping="Wrap" Text="" AutomationProperties.LiveSetting="Polite"/>
</ScrollViewer>
</Border>
@@ -778,7 +956,7 @@
<!-- Status and Finish Button -->
<StackPanel Grid.Row="1" HorizontalAlignment="Center">
<Button x:Name="FinishBtn" Width="200" Height="48" Style="{StaticResource Win11Button}" Margin="0" IsEnabled="False">
<Button x:Name="FinishBtn" Width="200" Height="48" Style="{StaticResource Win11Button}" Margin="0" IsEnabled="False" AutomationProperties.Name="Finish">
<TextBlock x:Name="FinishBtnText" Text="Applying changes..." VerticalAlignment="Center" FontSize="16" Margin="0,0,0,1"/>
</Button>
</StackPanel>
@@ -796,7 +974,7 @@
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<Button x:Name="PreviousBtn" Grid.Column="0" Width="120" Height="36" Style="{StaticResource Win11ButtonSecondary}" Visibility="Collapsed" Margin="10,0,0,0">
<Button x:Name="PreviousBtn" Grid.Column="0" Width="120" Height="36" Style="{StaticResource Win11ButtonSecondary}" Visibility="Collapsed" Margin="10,0,0,0" AutomationProperties.Name="Previous">
<StackPanel Orientation="Horizontal" VerticalAlignment="Center">
<TextBlock Text="&#xE72B;" FontFamily="Segoe MDL2 Assets" FontSize="12" Margin="0,0,8,0" VerticalAlignment="Center"/>
<TextBlock Text="Previous" VerticalAlignment="Center" FontSize="14" Margin="0,0,0,1"/>
@@ -804,7 +982,7 @@
</Button>
<StackPanel Grid.Column="2" Orientation="Horizontal" HorizontalAlignment="Right">
<Button x:Name="NextBtn" Width="120" Height="36" Margin="0,0,10,0" Style="{StaticResource Win11Button}">
<Button x:Name="NextBtn" Width="120" Height="36" Margin="0,0,10,0" Style="{StaticResource Win11Button}" AutomationProperties.Name="Next">
<StackPanel Orientation="Horizontal" VerticalAlignment="Center">
<TextBlock Text="Next" VerticalAlignment="Center" FontSize="14" Margin="0,0,0,1"/>
<TextBlock Text="&#xE72A;" FontFamily="Segoe MDL2 Assets" FontSize="12" Margin="8,0,0,0" VerticalAlignment="Center"/>

14
Get.ps1
View File

@@ -23,7 +23,11 @@ param (
[switch]$DisableGameBarIntegration,
[switch]$DisableTelemetry,
[switch]$DisableFastStartup,
[switch]$DisableBitlockerAutoEncryption,
[switch]$DisableModernStandbyNetworking,
[switch]$DisableUpdateASAP,
[switch]$PreventUpdateAutoReboot,
[switch]$DisableDeliveryOptimization,
[switch]$DisableBing,
[switch]$DisableDesktopSpotlight,
[switch]$DisableLockscreenTips,
@@ -140,8 +144,16 @@ $arguments = $($PSBoundParameters.GetEnumerator() | ForEach-Object {
Write-Output ""
Write-Output "> Running Win11Debloat..."
# Minimize the powershell window when no parameters are provided
if ($arguments.Count -eq 0) {
$windowStyle = "Minimized"
}
else {
$windowStyle = "Normal"
}
# Run Win11Debloat script with the provided arguments
$debloatProcess = Start-Process powershell.exe -PassThru -ArgumentList "-executionpolicy bypass -File $env:TEMP\Win11Debloat\Win11Debloat.ps1 $arguments" -Verb RunAs
$debloatProcess = Start-Process powershell.exe -WindowStyle $windowStyle -PassThru -ArgumentList "-executionpolicy bypass -File $env:TEMP\Win11Debloat\Win11Debloat.ps1 $arguments" -Verb RunAs
# Wait for the process to finish before continuing
if ($null -ne $debloatProcess) {

View File

@@ -1,17 +1,3 @@
<div align="center" markdown="1">
<sup>Special thanks to:</sup>
<br>
<br>
<a href="https://www.warp.dev/windebloat">
<img alt="Warp sponsorship" width="400" src="https://github.com/user-attachments/assets/c21102f7-bab9-4344-a731-0cf6b341cab2">
</a>
### [Warp, the intelligent terminal for developers](https://www.warp.dev/windebloat)
[Available for MacOS, Linux, & Windows](https://www.warp.dev/windebloat)<br>
</div>
<hr>
# Win11Debloat
[![GitHub Release](https://img.shields.io/github/v/release/Raphire/Win11Debloat?style=for-the-badge&label=Latest%20release)](https://github.com/Raphire/Win11Debloat/releases/latest)
@@ -122,8 +108,15 @@ Below is an overview of the key features and functionality offered by Win11Deblo
- Turn off Enhance Pointer Precision, also known as mouse acceleration.
- Disable the Sticky Keys keyboard shortcut. (W11 only)
- Disable fast start-up to ensure a full shutdown.
- Disable BitLocker automatic device encryption.
- Disable network connectivity during Modern Standby to reduce battery drain. (W11 only)
#### Windows Update
- Prevent Windows from getting updates as soon as they're available.
- Prevent automatic restarts after updates while signed in.
- Disable sharing of downloaded updates with other PCs, also known as Delivery Optimization.
#### Appearance
- Enable dark mode for system and apps.

View File

@@ -0,0 +1,4 @@
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\BitLocker]
"PreventDeviceEncryption"=dword:00000001

View File

@@ -0,0 +1,5 @@
Windows Registry Editor Version 5.00
; Disable sharing downloaded updates with other PCs (Delivery Optimization)
[HKEY_USERS\S-1-5-20\Software\Microsoft\Windows\CurrentVersion\DeliveryOptimization\Settings]
"DownloadMode"=dword:00000000

View File

@@ -0,0 +1,5 @@
Windows Registry Editor Version 5.00
; Turn Off "Get the latest updates as soon as they're available"
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\WindowsUpdate\UX\Settings]
"IsContinuousInnovationOptedIn"=dword:00000000

View File

@@ -0,0 +1,5 @@
Windows Registry Editor Version 5.00
; Prevent automatic restarts after updates while signed in
[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU]
"NoAutoRebootWithLoggedOnUsers"=dword:00000001

View File

@@ -0,0 +1,4 @@
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\BitLocker]
"PreventDeviceEncryption"=dword:00000001

View File

@@ -0,0 +1,5 @@
Windows Registry Editor Version 5.00
; Disable sharing downloaded updates with other PCs (Delivery Optimization)
[HKEY_USERS\S-1-5-20\Software\Microsoft\Windows\CurrentVersion\DeliveryOptimization\Settings]
"DownloadMode"=dword:00000000

View File

@@ -0,0 +1,5 @@
Windows Registry Editor Version 5.00
; Turn Off "Get the latest updates as soon as they're available"
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\WindowsUpdate\UX\Settings]
"IsContinuousInnovationOptedIn"=dword:00000000

View File

@@ -0,0 +1,5 @@
Windows Registry Editor Version 5.00
; Prevent automatic restarts after updates while signed in
[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU]
"NoAutoRebootWithLoggedOnUsers"=dword:00000001

View File

@@ -0,0 +1,5 @@
Windows Registry Editor Version 5.00
; Allow automatic restarts after updates while signed in
[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU]
"NoAutoRebootWithLoggedOnUsers"=-

View File

@@ -0,0 +1,4 @@
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\BitLocker]
"PreventDeviceEncryption"=-

View File

@@ -0,0 +1,5 @@
Windows Registry Editor Version 5.00
; Enable sharing downloaded updates with other PCs (Delivery Optimization)
[HKEY_USERS\S-1-5-20\Software\Microsoft\Windows\CurrentVersion\DeliveryOptimization\Settings]
"DownloadMode"=dword:00000001

View File

@@ -17,4 +17,4 @@ Windows Registry Editor Version 5.00
"URL Protocol"=""
"NoOpenWith"=-
[-HKEY_CLASSES_ROOT\ms-gamebar\shell\open\command]
[-HKEY_CLASSES_ROOT\ms-gamebarservices\shell\open\command]

View File

@@ -0,0 +1,5 @@
Windows Registry Editor Version 5.00
; Turn On "Get the latest updates as soon as they're available"
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\WindowsUpdate\UX\Settings]
"IsContinuousInnovationOptedIn"=dword:00000001

View File

@@ -25,7 +25,11 @@ param (
[switch]$DisableGameBarIntegration,
[switch]$DisableTelemetry,
[switch]$DisableFastStartup,
[switch]$DisableBitlockerAutoEncryption,
[switch]$DisableModernStandbyNetworking,
[switch]$DisableUpdateASAP,
[switch]$PreventUpdateAutoReboot,
[switch]$DisableDeliveryOptimization,
[switch]$DisableBing,
[switch]$DisableDesktopSpotlight,
[switch]$DisableLockscreenTips,
@@ -101,6 +105,7 @@ $script:ControlParams = 'WhatIf', 'Confirm', 'Verbose', 'Debug', 'LogPath', 'Sil
$script:GuiConsoleOutput = $null
$script:GuiConsoleScrollViewer = $null
$script:GuiWindow = $null
$script:CancelRequested = $false
# Check if current powershell environment is limited by security policies
if ($ExecutionContext.SessionState.LanguageMode -ne "FullLanguage") {
@@ -555,7 +560,7 @@ function GetSystemUsesDarkMode {
# Initializes and opens the main GUI window
function OpenGUI {
Add-Type -AssemblyName PresentationFramework,PresentationCore,WindowsBase | Out-Null
Add-Type -AssemblyName PresentationFramework,PresentationCore,WindowsBase,System.Windows.Forms | Out-Null
# Get current Windows build version
$WinVersion = Get-ItemPropertyValue 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion' CurrentBuild
@@ -594,12 +599,140 @@ function OpenGUI {
$window.Close()
})
# Ensure closing the window via any means properly exits the script
# Ensure closing the main window stops all execution
$window.Add_Closing({
Stop-Transcript
Exit
$script:CancelRequested = $true
})
# Implement window resize functionality
$resizeLeft = $window.FindName('ResizeLeft')
$resizeRight = $window.FindName('ResizeRight')
$resizeTop = $window.FindName('ResizeTop')
$resizeBottom = $window.FindName('ResizeBottom')
$resizeTopLeft = $window.FindName('ResizeTopLeft')
$resizeTopRight = $window.FindName('ResizeTopRight')
$resizeBottomLeft = $window.FindName('ResizeBottomLeft')
$resizeBottomRight = $window.FindName('ResizeBottomRight')
$script:resizing = $false
$script:resizeEdges = $null
$script:resizeStart = $null
$script:windowStart = $null
$script:resizeElement = $null
$resizeHandler = {
param($sender, $e)
$script:resizing = $true
$script:resizeElement = $sender
$script:resizeStart = [System.Windows.Forms.Cursor]::Position
$script:windowStart = @{
Left = $window.Left
Top = $window.Top
Width = $window.ActualWidth
Height = $window.ActualHeight
}
# Parse direction tag into edge flags for cleaner resize logic
$direction = $sender.Tag
$script:resizeEdges = @{
Left = $direction -match 'Left'
Right = $direction -match 'Right'
Top = $direction -match 'Top'
Bottom = $direction -match 'Bottom'
}
$sender.CaptureMouse()
$e.Handled = $true
}
$moveHandler = {
param($sender, $e)
if (-not $script:resizing) { return }
$current = [System.Windows.Forms.Cursor]::Position
$deltaX = $current.X - $script:resizeStart.X
$deltaY = $current.Y - $script:resizeStart.Y
# Handle horizontal resize
if ($script:resizeEdges.Left) {
$newWidth = [Math]::Max($window.MinWidth, $script:windowStart.Width - $deltaX)
if ($newWidth -ne $window.Width) {
$window.Left = $script:windowStart.Left + ($script:windowStart.Width - $newWidth)
$window.Width = $newWidth
}
}
elseif ($script:resizeEdges.Right) {
$window.Width = [Math]::Max($window.MinWidth, $script:windowStart.Width + $deltaX)
}
# Handle vertical resize
if ($script:resizeEdges.Top) {
$newHeight = [Math]::Max($window.MinHeight, $script:windowStart.Height - $deltaY)
if ($newHeight -ne $window.Height) {
$window.Top = $script:windowStart.Top + ($script:windowStart.Height - $newHeight)
$window.Height = $newHeight
}
}
elseif ($script:resizeEdges.Bottom) {
$window.Height = [Math]::Max($window.MinHeight, $script:windowStart.Height + $deltaY)
}
$e.Handled = $true
}
$releaseHandler = {
param($sender, $e)
if ($script:resizing -and $script:resizeElement) {
$script:resizing = $false
$script:resizeEdges = $null
$script:resizeElement.ReleaseMouseCapture()
$script:resizeElement = $null
$e.Handled = $true
}
}
# Set tags and add event handlers for resize borders
$resizeLeft.Tag = 'Left'
$resizeLeft.Add_PreviewMouseLeftButtonDown($resizeHandler)
$resizeLeft.Add_MouseMove($moveHandler)
$resizeLeft.Add_MouseLeftButtonUp($releaseHandler)
$resizeRight.Tag = 'Right'
$resizeRight.Add_PreviewMouseLeftButtonDown($resizeHandler)
$resizeRight.Add_MouseMove($moveHandler)
$resizeRight.Add_MouseLeftButtonUp($releaseHandler)
$resizeTop.Tag = 'Top'
$resizeTop.Add_PreviewMouseLeftButtonDown($resizeHandler)
$resizeTop.Add_MouseMove($moveHandler)
$resizeTop.Add_MouseLeftButtonUp($releaseHandler)
$resizeBottom.Tag = 'Bottom'
$resizeBottom.Add_PreviewMouseLeftButtonDown($resizeHandler)
$resizeBottom.Add_MouseMove($moveHandler)
$resizeBottom.Add_MouseLeftButtonUp($releaseHandler)
$resizeTopLeft.Tag = 'TopLeft'
$resizeTopLeft.Add_PreviewMouseLeftButtonDown($resizeHandler)
$resizeTopLeft.Add_MouseMove($moveHandler)
$resizeTopLeft.Add_MouseLeftButtonUp($releaseHandler)
$resizeTopRight.Tag = 'TopRight'
$resizeTopRight.Add_PreviewMouseLeftButtonDown($resizeHandler)
$resizeTopRight.Add_MouseMove($moveHandler)
$resizeTopRight.Add_MouseLeftButtonUp($releaseHandler)
$resizeBottomLeft.Tag = 'BottomLeft'
$resizeBottomLeft.Add_PreviewMouseLeftButtonDown($resizeHandler)
$resizeBottomLeft.Add_MouseMove($moveHandler)
$resizeBottomLeft.Add_MouseLeftButtonUp($releaseHandler)
$resizeBottomRight.Tag = 'BottomRight'
$resizeBottomRight.Add_PreviewMouseLeftButtonDown($resizeHandler)
$resizeBottomRight.Add_MouseMove($moveHandler)
$resizeBottomRight.Add_MouseLeftButtonUp($releaseHandler)
# Integrated App Selection UI
$appsPanel = $window.FindName('AppSelectionPanel')
$onlyInstalledAppsBox = $window.FindName('OnlyInstalledAppsBox')
@@ -667,6 +800,7 @@ function OpenGUI {
$checkbox = New-Object System.Windows.Controls.CheckBox
$checkbox.Content = $labelText
$checkbox.Name = $comboName
$checkbox.SetValue([System.Windows.Automation.AutomationProperties]::NameProperty, $labelText)
$checkbox.IsChecked = $false
$checkbox.Style = $window.Resources["FeatureCheckboxStyle"]
$parent.Children.Add($checkbox) | Out-Null
@@ -684,17 +818,25 @@ function OpenGUI {
}
# Otherwise use a combobox for multiple options
# Wrap label in a Border for search highlighting
$lblBorder = New-Object System.Windows.Controls.Border
$lblBorder.Style = $window.Resources['LabelBorderStyle']
$lblBorderName = "$comboName`_LabelBorder"
$lblBorder.Name = $lblBorderName
$lbl = New-Object System.Windows.Controls.TextBlock
$lbl.Text = $labelText
$lbl.Style = $window.Resources['LabelStyle']
$labelName = "$comboName`_Label"
$lbl.Name = $labelName
$parent.Children.Add($lbl) | Out-Null
# Register the label with the window's name scope
$lblBorder.Child = $lbl
$parent.Children.Add($lblBorder) | Out-Null
# Register the label border with the window's name scope
try {
[System.Windows.NameScope]::SetNameScope($lbl, [System.Windows.NameScope]::GetNameScope($window))
$window.RegisterName($labelName, $lbl)
[System.Windows.NameScope]::SetNameScope($lblBorder, [System.Windows.NameScope]::GetNameScope($window))
$window.RegisterName($lblBorderName, $lblBorder)
}
catch {
# Name might already be registered, ignore
@@ -702,6 +844,7 @@ function OpenGUI {
$combo = New-Object System.Windows.Controls.ComboBox
$combo.Name = $comboName
$combo.SetValue([System.Windows.Automation.AutomationProperties]::NameProperty, $labelText)
foreach ($it in $items) { $cbItem = New-Object System.Windows.Controls.ComboBoxItem; $cbItem.Content = $it; $combo.Items.Add($cbItem) | Out-Null }
$combo.SelectedIndex = 0
$parent.Children.Add($combo) | Out-Null
@@ -718,13 +861,24 @@ function OpenGUI {
return $combo
}
function GetWikiUrlForCategory($category) {
if (-not $category) { return 'https://github.com/Raphire/Win11Debloat/wiki/Features' }
$slug = $category.ToLowerInvariant()
$slug = $slug -replace '&', ''
$slug = $slug -replace '[^a-z0-9\s-]', ''
$slug = $slug -replace '\s', '-'
return "https://github.com/Raphire/Win11Debloat/wiki/Features#$slug"
}
function GetOrCreateCategoryCard($category) {
if (-not $category) { $category = 'Other' }
if ($script:CategoryCardMap.ContainsKey($category)) { return $script:CategoryCardMap[$category] }
# Create a new card Border + StackPanel and add to shortest column
$target = $columns | Sort-Object { $_.Children.Count } | Select-Object -First 1
$target = $columns | Sort-Object @{Expression={$_.Children.Count}; Ascending=$true}, @{Expression={$columns.IndexOf($_)}; Ascending=$true} | Select-Object -First 1
$border = New-Object System.Windows.Controls.Border
$border.Style = $window.Resources['CategoryCardBorderStyle']
@@ -734,10 +888,30 @@ function OpenGUI {
$safe = ($category -replace '[^a-zA-Z0-9_]','_')
$panel.Name = "Category_{0}_Panel" -f $safe
$headerRow = New-Object System.Windows.Controls.StackPanel
$headerRow.Orientation = 'Horizontal'
$header = New-Object System.Windows.Controls.TextBlock
$header.Text = $category
$header.Style = $window.Resources['CategoryHeaderTextBlock']
$panel.Children.Add($header) | Out-Null
$headerRow.Children.Add($header) | Out-Null
$helpIcon = New-Object System.Windows.Controls.TextBlock
$helpIcon.Text = '(?)'
$helpIcon.Style = $window.Resources['CategoryHelpLinkTextStyle']
$helpBtn = New-Object System.Windows.Controls.Button
$helpBtn.Content = $helpIcon
$helpBtn.ToolTip = "Open wiki for more info on $category features"
$helpBtn.Tag = (GetWikiUrlForCategory -category $category)
$helpBtn.Style = $window.Resources['CategoryHelpLinkButtonStyle']
$helpBtn.Add_Click({
param($sender, $e)
if ($sender.Tag) { Start-Process $sender.Tag }
})
$headerRow.Children.Add($helpBtn) | Out-Null
$panel.Children.Add($headerRow) | Out-Null
$border.Child = $panel
$target.Children.Add($border) | Out-Null
@@ -846,6 +1020,7 @@ function OpenGUI {
$appsToAdd | Sort-Object -Property DisplayName | ForEach-Object {
$checkbox = New-Object System.Windows.Controls.CheckBox
$checkbox.Content = $_.DisplayName
$checkbox.SetValue([System.Windows.Automation.AutomationProperties]::NameProperty, $_.DisplayName)
$checkbox.Tag = $_.AppId
$checkbox.IsChecked = $_.IsChecked
$checkbox.ToolTip = $_.Description
@@ -982,21 +1157,74 @@ function OpenGUI {
}
})
# Shared search highlighting configuration
$script:SearchHighlightColor = [System.Windows.Media.SolidColorBrush]::new([System.Windows.Media.ColorConverter]::ConvertFromString("#FFF4CE"))
$script:SearchHighlightColorDark = [System.Windows.Media.SolidColorBrush]::new([System.Windows.Media.ColorConverter]::ConvertFromString("#4A4A2A"))
# Helper function to get the appropriate highlight brush based on theme
function GetSearchHighlightBrush {
if ($usesDarkMode) { return $script:SearchHighlightColorDark }
return $script:SearchHighlightColor
}
# Helper function to scroll to an item if it's not visible, centering it in the viewport
function ScrollToItemIfNotVisible {
param (
[System.Windows.Controls.ScrollViewer]$scrollViewer,
[System.Windows.UIElement]$item,
[System.Windows.UIElement]$container
)
if (-not $scrollViewer -or -not $item -or -not $container) { return }
try {
$itemPosition = $item.TransformToAncestor($container).Transform([System.Windows.Point]::new(0, 0)).Y
$viewportHeight = $scrollViewer.ViewportHeight
$itemHeight = $item.ActualHeight
$currentOffset = $scrollViewer.VerticalOffset
# Check if the item is currently visible in the viewport
$itemTop = $itemPosition - $currentOffset
$itemBottom = $itemTop + $itemHeight
$isVisible = ($itemTop -ge 0) -and ($itemBottom -le $viewportHeight)
# Only scroll if the item is not visible
if (-not $isVisible) {
# Center the item in the viewport
$targetOffset = $itemPosition - ($viewportHeight / 2) + ($itemHeight / 2)
$scrollViewer.ScrollToVerticalOffset([Math]::Max(0, $targetOffset))
}
}
catch {
# Fallback to simple bring into view
$item.BringIntoView()
}
}
# Helper function to find the parent ScrollViewer of an element
function FindParentScrollViewer {
param ([System.Windows.UIElement]$element)
$parent = [System.Windows.Media.VisualTreeHelper]::GetParent($element)
while ($null -ne $parent) {
if ($parent -is [System.Windows.Controls.ScrollViewer]) {
return $parent
}
$parent = [System.Windows.Media.VisualTreeHelper]::GetParent($parent)
}
return $null
}
# App Search Box functionality
$appSearchBox = $window.FindName('AppSearchBox')
$appSearchPlaceholder = $window.FindName('AppSearchPlaceholder')
$highlightColor = [System.Windows.Media.SolidColorBrush]::new([System.Windows.Media.ColorConverter]::ConvertFromString("#FFF4CE"))
$highlightColorDark = [System.Windows.Media.SolidColorBrush]::new([System.Windows.Media.ColorConverter]::ConvertFromString("#4A4A2A"))
$appSearchBox.Add_TextChanged({
$searchText = $appSearchBox.Text.ToLower().Trim()
# Show/hide placeholder
if ([string]::IsNullOrWhiteSpace($appSearchBox.Text)) {
$appSearchPlaceholder.Visibility = 'Visible'
} else {
$appSearchPlaceholder.Visibility = 'Collapsed'
}
$appSearchPlaceholder.Visibility = if ([string]::IsNullOrWhiteSpace($appSearchBox.Text)) { 'Visible' } else { 'Collapsed' }
# Clear all highlights first
foreach ($child in $appsPanel.Children) {
@@ -1005,57 +1233,154 @@ function OpenGUI {
}
}
if ([string]::IsNullOrWhiteSpace($searchText)) {
return
}
if ([string]::IsNullOrWhiteSpace($searchText)) { return }
# Find and highlight all matching apps
$firstMatch = $null
$highlightBrush = if ($usesDarkMode) { $highlightColorDark } else { $highlightColor }
$highlightBrush = GetSearchHighlightBrush
foreach ($child in $appsPanel.Children) {
if ($child -is [System.Windows.Controls.CheckBox]) {
# Only consider visible apps (not filtered out by installed filter)
if ($child.Visibility -eq 'Visible') {
$appName = $child.Content.ToString().ToLower()
if ($appName.Contains($searchText)) {
# Highlight the matching app
$child.Background = $highlightBrush
if ($child -is [System.Windows.Controls.CheckBox] -and $child.Visibility -eq 'Visible') {
if ($child.Content.ToString().ToLower().Contains($searchText)) {
$child.Background = $highlightBrush
if ($null -eq $firstMatch) { $firstMatch = $child }
}
}
}
# Scroll to first match if not visible
if ($firstMatch) {
$scrollViewer = FindParentScrollViewer -element $appsPanel
if ($scrollViewer) {
ScrollToItemIfNotVisible -scrollViewer $scrollViewer -item $firstMatch -container $appsPanel
}
}
})
# Tweak Search Box functionality
$tweakSearchBox = $window.FindName('TweakSearchBox')
$tweakSearchPlaceholder = $window.FindName('TweakSearchPlaceholder')
$tweakSearchBorder = $window.FindName('TweakSearchBorder')
$tweaksScrollViewer = $window.FindName('TweaksScrollViewer')
$tweaksGrid = $window.FindName('TweaksGrid')
$col0 = $window.FindName('Column0Panel')
$col1 = $window.FindName('Column1Panel')
$col2 = $window.FindName('Column2Panel')
# Monitor scrollbar visibility and adjust searchbar margin
$tweaksScrollViewer.Add_ScrollChanged({
if ($tweaksScrollViewer.ScrollableHeight -gt 0) {
# The 17px accounts for the scrollbar width + some padding
$tweakSearchBorder.Margin = [System.Windows.Thickness]::new(0, 0, 17, 0)
} else {
$tweakSearchBorder.Margin = [System.Windows.Thickness]::new(0, 0, 0, 0)
}
})
# Helper function to clear all tweak highlights
function ClearTweakHighlights {
$columns = @($col0, $col1, $col2) | Where-Object { $_ -ne $null }
foreach ($column in $columns) {
foreach ($card in $column.Children) {
if ($card -is [System.Windows.Controls.Border] -and $card.Child -is [System.Windows.Controls.StackPanel]) {
foreach ($control in $card.Child.Children) {
if ($control -is [System.Windows.Controls.CheckBox] -or
($control -is [System.Windows.Controls.Border] -and $control.Name -like '*_LabelBorder')) {
$control.Background = [System.Windows.Media.Brushes]::Transparent
}
}
}
}
}
}
# Helper function to check if a ComboBox contains matching items
function ComboBoxContainsMatch {
param ([System.Windows.Controls.ComboBox]$comboBox, [string]$searchText)
foreach ($item in $comboBox.Items) {
$itemText = if ($item -is [System.Windows.Controls.ComboBoxItem]) { $item.Content.ToString().ToLower() } else { $item.ToString().ToLower() }
if ($itemText.Contains($searchText)) { return $true }
}
return $false
}
$tweakSearchBox.Add_TextChanged({
$searchText = $tweakSearchBox.Text.ToLower().Trim()
# Show/hide placeholder
$tweakSearchPlaceholder.Visibility = if ([string]::IsNullOrWhiteSpace($tweakSearchBox.Text)) { 'Visible' } else { 'Collapsed' }
# Clear all highlights
ClearTweakHighlights
if ([string]::IsNullOrWhiteSpace($searchText)) { return }
# Find and highlight all matching tweaks
$firstMatch = $null
$highlightBrush = GetSearchHighlightBrush
$columns = @($col0, $col1, $col2) | Where-Object { $_ -ne $null }
foreach ($column in $columns) {
foreach ($card in $column.Children) {
if ($card -is [System.Windows.Controls.Border] -and $card.Child -is [System.Windows.Controls.StackPanel]) {
$controlsList = @($card.Child.Children)
for ($i = 0; $i -lt $controlsList.Count; $i++) {
$control = $controlsList[$i]
$matchFound = $false
$controlToHighlight = $null
# Remember first match for scrolling
if ($null -eq $firstMatch) {
$firstMatch = $child
if ($control -is [System.Windows.Controls.CheckBox]) {
if ($control.Content.ToString().ToLower().Contains($searchText)) {
$matchFound = $true
$controlToHighlight = $control
}
}
elseif ($control -is [System.Windows.Controls.Border] -and $control.Name -like '*_LabelBorder') {
$labelText = if ($control.Child) { $control.Child.Text.ToLower() } else { "" }
$comboBox = if ($i + 1 -lt $controlsList.Count -and $controlsList[$i + 1] -is [System.Windows.Controls.ComboBox]) { $controlsList[$i + 1] } else { $null }
# Check label text or combo box items
if ($labelText.Contains($searchText) -or ($comboBox -and (ComboBoxContainsMatch -comboBox $comboBox -searchText $searchText))) {
$matchFound = $true
$controlToHighlight = $control
}
}
if ($matchFound -and $controlToHighlight) {
$controlToHighlight.Background = $highlightBrush
if ($null -eq $firstMatch) { $firstMatch = $controlToHighlight }
}
}
}
}
}
# Scroll to first match - centered
if ($firstMatch) {
# Get the ScrollViewer that contains the apps panel
$scrollViewer = $null
$parent = [System.Windows.Media.VisualTreeHelper]::GetParent($appsPanel)
while ($null -ne $parent) {
if ($parent -is [System.Windows.Controls.ScrollViewer]) {
$scrollViewer = $parent
break
}
$parent = [System.Windows.Media.VisualTreeHelper]::GetParent($parent)
}
# Scroll to first match if not visible
if ($firstMatch -and $tweaksScrollViewer) {
ScrollToItemIfNotVisible -scrollViewer $tweaksScrollViewer -item $firstMatch -container $tweaksGrid
}
})
# Add Ctrl+F keyboard shortcut to focus search box on current tab
$window.Add_KeyDown({
param($sender, $e)
# Check if Ctrl+F was pressed
if ($e.Key -eq [System.Windows.Input.Key]::F -and
([System.Windows.Input.Keyboard]::Modifiers -band [System.Windows.Input.ModifierKeys]::Control)) {
if ($scrollViewer) {
# Calculate the position to scroll to for centering
$itemPosition = $firstMatch.TransformToAncestor($appsPanel).Transform([System.Windows.Point]::new(0, 0)).Y
$viewportHeight = $scrollViewer.ViewportHeight
$itemHeight = $firstMatch.ActualHeight
# Center the item in the viewport
$targetOffset = $itemPosition - ($viewportHeight / 2) + ($itemHeight / 2)
$scrollViewer.ScrollToVerticalOffset([Math]::Max(0, $targetOffset))
} else {
# Fallback to simple bring into view
$firstMatch.BringIntoView()
$currentTab = $tabControl.SelectedItem
# Focus AppSearchBox if on App Removal tab
if ($currentTab.Header -eq "App Removal" -and $appSearchBox) {
$appSearchBox.Focus()
$e.Handled = $true
}
# Focus TweakSearchBox if on Tweaks tab
elseif ($currentTab.Header -eq "Tweaks" -and $tweakSearchBox) {
$tweakSearchBox.Focus()
$e.Handled = $true
}
}
})
@@ -1416,25 +1741,18 @@ function OpenGUI {
try {
ExecuteAllChanges
if (-not $script:Params.ContainsKey("Sysprep") -and -not $script:Params.ContainsKey("User")) {
# Ask user if they want to restart Explorer now
$result = [System.Windows.MessageBox]::Show(
'Would you like to restart the Windows Explorer process now to apply all changes? Some changes may not take effect until a restart is performed.',
'Restart Windows Explorer?',
[System.Windows.MessageBoxButton]::YesNo,
[System.Windows.MessageBoxImage]::Question
)
if ($result -eq [System.Windows.MessageBoxResult]::Yes) {
RestartExplorer
}
else {
Write-ToConsole "Explorer process restart was skipped, please manually reboot your PC to apply all changes"
}
# Check if user wants to restart explorer (from checkbox)
$restartExplorerCheckBox = $window.FindName('RestartExplorerCheckBox')
if ($restartExplorerCheckBox -and $restartExplorerCheckBox.IsChecked -and -not $script:CancelRequested) {
RestartExplorer
}
Write-ToConsole ""
Write-ToConsole "All changes have been applied. Please check the output above for any errors."
if ($script:CancelRequested) {
Write-ToConsole "Script execution was cancelled by the user. Some changes may not have been applied."
} else {
Write-ToConsole "All changes have been applied. Please check the output above for any errors."
}
$finishBtn.Dispatcher.Invoke([action]{
$finishBtn.IsEnabled = $true
@@ -1457,6 +1775,33 @@ function OpenGUI {
LoadAppsIntoMainUI
# Update Current User label with username
if ($userSelectionCombo -and $userSelectionCombo.Items.Count -gt 0) {
$currentUserItem = $userSelectionCombo.Items[0]
if ($currentUserItem -is [System.Windows.Controls.ComboBoxItem]) {
$currentUserItem.Content = "Current User ($(GetUserName))"
}
}
# Disable Restart Explorer option if NoRestartExplorer parameter is set
$restartExplorerCheckBox = $window.FindName('RestartExplorerCheckBox')
if ($restartExplorerCheckBox -and $script:Params.ContainsKey("NoRestartExplorer")) {
$restartExplorerCheckBox.IsChecked = $false
$restartExplorerCheckBox.IsEnabled = $false
}
# Force Apply Changes To setting if Sysprep or User parameters are set
if ($script:Params.ContainsKey("Sysprep")) {
$userSelectionCombo.SelectedIndex = 2
$userSelectionCombo.IsEnabled = $false
}
elseif ($script:Params.ContainsKey("User")) {
$userSelectionCombo.SelectedIndex = 1
$userSelectionCombo.IsEnabled = $false
$otherUsernameTextBox.Text = $script:Params.Item("User")
$otherUsernameTextBox.IsEnabled = $false
}
UpdateNavigationButtons
})
@@ -1626,6 +1971,7 @@ function OpenAppSelectionWindow {
$appsToAdd | Sort-Object -Property DisplayName | ForEach-Object {
$checkbox = New-Object System.Windows.Controls.CheckBox
$checkbox.Content = $_.DisplayName
$checkbox.SetValue([System.Windows.Automation.AutomationProperties]::NameProperty, $_.DisplayName)
$checkbox.Tag = $_.AppId
$checkbox.IsChecked = $_.IsChecked
$checkbox.ToolTip = $_.Description
@@ -1875,6 +2221,10 @@ function RemoveApps {
)
Foreach ($app in $appsList) {
if ($script:CancelRequested) {
return
}
Write-ToConsole "Attempting to remove $app..."
# Use WinGet only to remove OneDrive and Edge
@@ -1899,10 +2249,21 @@ function RemoveApps {
If (($app -eq "Microsoft.Edge") -and (Select-String -InputObject $wingetOutput -Pattern "Uninstall failed with exit code")) {
Write-ToConsole "Unable to uninstall Microsoft Edge via WinGet" -ForegroundColor Red
Write-ToConsole ""
# Only prompt in CLI mode (not GUI)
if (-not $script:GuiConsoleOutput -and $( Read-Host -Prompt "Would you like to forcefully uninstall Microsoft Edge? NOT RECOMMENDED! (y/n)" ) -eq 'y') {
if ($script:GuiConsoleOutput) {
$result = [System.Windows.MessageBox]::Show(
'Unable to uninstall Microsoft Edge via WinGet. Would you like to forcefully uninstall it? NOT RECOMMENDED!',
'Force Uninstall Microsoft Edge?',
[System.Windows.MessageBoxButton]::YesNo,
[System.Windows.MessageBoxImage]::Warning
)
if ($result -eq [System.Windows.MessageBoxResult]::Yes) {
Write-ToConsole ""
ForceRemoveEdge
}
}
elseif ($( Read-Host -Prompt "Would you like to forcefully uninstall Microsoft Edge? NOT RECOMMENDED! (y/n)" ) -eq 'y') {
Write-ToConsole ""
ForceRemoveEdge
}
@@ -1953,7 +2314,7 @@ function ForceRemoveEdge {
$hklm = [Microsoft.Win32.RegistryKey]::OpenBaseKey([Microsoft.Win32.RegistryHive]::LocalMachine, $regView)
$hklm.CreateSubKey('SOFTWARE\Microsoft\EdgeUpdateDev').SetValue('AllowUninstall', '')
# Create stub (Creating this somehow allows uninstalling Edge)
# Create stub (This somehow allows uninstalling Edge)
$edgeStub = "$env:SystemRoot\SystemApps\Microsoft.MicrosoftEdge_8wekyb3d8bbwe"
New-Item $edgeStub -ItemType Directory | Out-Null
New-Item "$edgeStub\MicrosoftEdge.exe" | Out-Null
@@ -1995,11 +2356,8 @@ function ForceRemoveEdge {
Write-ToConsole "Microsoft Edge was uninstalled"
}
else {
Write-ToConsole ""
Write-ToConsole "Error: Unable to forcefully uninstall Microsoft Edge, uninstaller could not be found" -ForegroundColor Red
Write-ToConsole "Unable to forcefully uninstall Microsoft Edge, uninstaller could not be found" -ForegroundColor Red
}
Write-ToConsole ""
}
@@ -2100,12 +2458,12 @@ function GetUserDirectory {
$exitIfPathNotFound = $true
)
if (-not (CheckIfUserExists -userName $userName)) {
Write-Error "User $userName does not exist on this system"
AwaitKeyToExit
}
try {
if (-not (CheckIfUserExists -userName $userName) -and $userName -ne "*") {
Write-Error "User $userName does not exist on this system"
AwaitKeyToExit
}
$userDirectoryExists = Test-Path "$env:SystemDrive\Users\$userName"
$userPath = "$env:SystemDrive\Users\$userName\$fileName"
@@ -2612,10 +2970,15 @@ function ExecuteAllChanges {
if ($script:Params.ContainsKey("CreateRestorePoint")) {
Write-ToConsole "> Attempting to create a system restore point..."
CreateSystemRestorePoint
Write-ToConsole ""
}
# Execute all parameters
foreach ($paramKey in $script:Params.Keys) {
if ($script:CancelRequested) {
return
}
if ($script:ControlParams -contains $paramKey) {
continue
}
@@ -2707,8 +3070,6 @@ function CreateSystemRestorePoint {
Write-ToConsole $result.Message -ForegroundColor Red
}
}
Write-ToConsole ""
}