mirror of
https://github.com/Raphire/Win11Debloat.git
synced 2026-02-18 16:36:29 +00:00
Compare commits
10 Commits
2026.02.04
...
2026.02.12
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0e7b289d03 | ||
|
|
feef8f76b9 | ||
|
|
50db66bb5f | ||
|
|
b48fa24627 | ||
|
|
f8c2c6ddd7 | ||
|
|
1ea2c63522 | ||
|
|
675882cb3b | ||
|
|
ae4d19f59c | ||
|
|
327f4ee7ab | ||
|
|
3af62159a5 |
@@ -9,6 +9,7 @@
|
||||
"Taskbar",
|
||||
"Appearance",
|
||||
"File Explorer",
|
||||
"Multi-tasking",
|
||||
"Other",
|
||||
"Gaming"
|
||||
],
|
||||
@@ -74,6 +75,18 @@
|
||||
{ "Label": "Downloads", "FeatureIds": ["ExplorerToDownloads"] },
|
||||
{ "Label": "OneDrive", "FeatureIds": ["ExplorerToOneDrive"] }
|
||||
]
|
||||
},
|
||||
{
|
||||
"GroupId": "ShowTabsInAltTab",
|
||||
"Label": "Show tabs from apps when snapping or pressing Alt+Tab",
|
||||
"Category": "Multi-tasking",
|
||||
"Priority": 10,
|
||||
"Values": [
|
||||
{ "Label": "Don't show tabs", "FeatureIds": ["HideTabsInAltTab"] },
|
||||
{ "Label": "Show 3 most recent tabs", "FeatureIds": ["Show3TabsInAltTab"] },
|
||||
{ "Label": "Show 5 most recent tabs", "FeatureIds": ["Show5TabsInAltTab"] },
|
||||
{ "Label": "Show 20 most recent tabs", "FeatureIds": ["Show20TabsInAltTab"] }
|
||||
]
|
||||
}
|
||||
],
|
||||
"Features": [
|
||||
@@ -351,7 +364,7 @@
|
||||
"UndoAction": "Show",
|
||||
"RegistryUndoKey": "Enable_Start_Recommended.reg",
|
||||
"MinVersion": 22621,
|
||||
"MaxVersion": 26199
|
||||
"MaxVersion": null
|
||||
},
|
||||
{
|
||||
"FeatureId": "DisableBing",
|
||||
@@ -487,7 +500,7 @@
|
||||
},
|
||||
{
|
||||
"FeatureId": "DisableStickyKeys",
|
||||
"Label": "Sticky Keys keyboard shortcut",
|
||||
"Label": "Sticky Keys keyboard shortcut (5x shift)",
|
||||
"Category": "System",
|
||||
"Action": "Disable",
|
||||
"RegistryKey": "Disable_Sticky_Keys_Shortcut.reg",
|
||||
@@ -497,6 +510,93 @@
|
||||
"MinVersion": 26100,
|
||||
"MaxVersion": null
|
||||
},
|
||||
{
|
||||
"FeatureId": "DisableWindowSnapping",
|
||||
"Label": "window snapping",
|
||||
"Category": "Multi-tasking",
|
||||
"Priority": 1,
|
||||
"Action": "Disable",
|
||||
"RegistryKey": "Disable_Window_Snapping.reg",
|
||||
"ApplyText": "> Disabling window snapping...",
|
||||
"UndoAction": "Enable",
|
||||
"RegistryUndoKey": "Enable_Window_Snapping.reg",
|
||||
"MinVersion": null,
|
||||
"MaxVersion": null
|
||||
},
|
||||
{
|
||||
"FeatureId": "DisableSnapAssist",
|
||||
"Label": "showing app suggestions when snapping windows",
|
||||
"Category": "Multi-tasking",
|
||||
"Priority": 2,
|
||||
"Action": "Disable",
|
||||
"RegistryKey": "Disable_Snap_Assist.reg",
|
||||
"ApplyText": "> Disabling the Snap Assist suggestions...",
|
||||
"UndoAction": "Enable",
|
||||
"RegistryUndoKey": "Enable_Snap_Assist.reg",
|
||||
"MinVersion": 22000,
|
||||
"MaxVersion": null
|
||||
},
|
||||
{
|
||||
"FeatureId": "DisableSnapLayouts",
|
||||
"Label": "snap layout flyout at top of screen and on maximize button",
|
||||
"Category": "Multi-tasking",
|
||||
"Priority": 3,
|
||||
"Action": "Hide",
|
||||
"RegistryKey": "Disable_Snap_Layouts.reg",
|
||||
"ApplyText": "> Hiding snap layouts when dragging windows to top of the screen and on maximize button...",
|
||||
"UndoAction": "Show",
|
||||
"RegistryUndoKey": "Enable_Snap_Layouts.reg",
|
||||
"MinVersion": 22000,
|
||||
"MaxVersion": null
|
||||
},
|
||||
{
|
||||
"FeatureId": "HideTabsInAltTab",
|
||||
"Label": "tabs from apps when snapping or pressing Alt+Tab",
|
||||
"Category": "Multi-tasking",
|
||||
"Action": "Hide",
|
||||
"RegistryKey": "Hide_Tabs_In_Alt_Tab.reg",
|
||||
"ApplyText": "> Disable showing tabs from apps when snapping or pressing Alt+Tab...",
|
||||
"UndoAction": null,
|
||||
"RegistryUndoKey": null,
|
||||
"MinVersion": 22000,
|
||||
"MaxVersion": null
|
||||
},
|
||||
{
|
||||
"FeatureId": "Show3TabsInAltTab",
|
||||
"Label": "tabs from apps when snapping or pressing Alt+Tab",
|
||||
"Category": "Multi-tasking",
|
||||
"Action": "Show 3",
|
||||
"RegistryKey": "Show_3_Tabs_In_Alt_Tab.reg",
|
||||
"ApplyText": "> Enable showing 3 tabs from apps when snapping or pressing Alt+Tab...",
|
||||
"UndoAction": null,
|
||||
"RegistryUndoKey": null,
|
||||
"MinVersion": 22000,
|
||||
"MaxVersion": null
|
||||
},
|
||||
{
|
||||
"FeatureId": "Show5TabsInAltTab",
|
||||
"Label": "tabs from apps when snapping or pressing Alt+Tab",
|
||||
"Category": "Multi-tasking",
|
||||
"Action": "Show 5",
|
||||
"RegistryKey": "Show_5_Tabs_In_Alt_Tab.reg",
|
||||
"ApplyText": "> Enable showing 5 tabs from apps when snapping or pressing Alt+Tab...",
|
||||
"UndoAction": null,
|
||||
"RegistryUndoKey": null,
|
||||
"MinVersion": 22000,
|
||||
"MaxVersion": null
|
||||
},
|
||||
{
|
||||
"FeatureId": "Show20TabsInAltTab",
|
||||
"Label": "tabs from apps when snapping or pressing Alt+Tab",
|
||||
"Category": "Multi-tasking",
|
||||
"Action": "Show 20",
|
||||
"RegistryKey": "Show_20_Tabs_In_Alt_Tab.reg",
|
||||
"ApplyText": "> Enable showing 20 tabs from apps when snapping or pressing Alt+Tab...",
|
||||
"UndoAction": null,
|
||||
"RegistryUndoKey": null,
|
||||
"MinVersion": 22000,
|
||||
"MaxVersion": null
|
||||
},
|
||||
{
|
||||
"FeatureId": "TaskbarAlignLeft",
|
||||
"Label": "taskbar alignment",
|
||||
|
||||
@@ -159,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>
|
||||
@@ -238,21 +245,66 @@
|
||||
<!-- 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="Margin" Value="0,0,0,8"/>
|
||||
<Setter Property="FontSize" Value="12"/>
|
||||
<Setter Property="FontStyle" Value="Italic"/>
|
||||
<Setter Property="Margin" Value="0,8,0,0"/>
|
||||
</Style>
|
||||
|
||||
<Style x:Key="OverviewChangeBulletStyle" TargetType="TextBlock">
|
||||
<Setter Property="Foreground" Value="{DynamicResource FgColor}"/>
|
||||
<Setter Property="Margin" Value="0,8,0,0"/>
|
||||
<Setter Property="Margin" Value="0,0,0,8"/>
|
||||
<Setter Property="FontSize" Value="12"/>
|
||||
<Setter Property="TextWrapping" Value="Wrap"/>
|
||||
</Style>
|
||||
|
||||
@@ -261,6 +313,44 @@
|
||||
<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="Background" Value="{DynamicResource ComboBgColor}"/>
|
||||
<Setter Property="BorderBrush" Value="{DynamicResource ButtonBorderColor}"/>
|
||||
<Setter Property="BorderThickness" Value="1"/>
|
||||
<Setter Property="CornerRadius" Value="4"/>
|
||||
<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>
|
||||
<Trigger Property="IsMouseOver" Value="True">
|
||||
<Setter Property="Background" Value="{DynamicResource ComboHoverColor}"/>
|
||||
</Trigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
|
||||
<!-- CheckBox Style -->
|
||||
<Style TargetType="CheckBox">
|
||||
<Setter Property="Foreground" Value="{DynamicResource FgColor}"/>
|
||||
@@ -291,6 +381,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"/>
|
||||
@@ -560,10 +657,9 @@
|
||||
</TextBlock>
|
||||
|
||||
<!-- Start Button -->
|
||||
<Button x:Name="HomeStartBtn" Width="200" Height="48" Style="{StaticResource Win11Button}" HorizontalAlignment="Center" Margin="0,50,0,0" AutomationProperties.Name="Start">
|
||||
<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="" 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>
|
||||
@@ -601,7 +697,7 @@
|
||||
<Style TargetType="Border" BasedOn="{StaticResource SearchBoxBorderStyle}">
|
||||
<Style.Triggers>
|
||||
<DataTrigger Binding="{Binding ElementName=AppSearchBox, Path=IsFocused}" Value="True">
|
||||
<Setter Property="Background" Value="{DynamicResource SecondaryButtonHover}"/>
|
||||
<Setter Property="Background" Value="{DynamicResource InputFocusColor}"/>
|
||||
</DataTrigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
@@ -672,7 +768,7 @@
|
||||
<Style TargetType="Border" BasedOn="{StaticResource SearchBoxBorderStyle}">
|
||||
<Style.Triggers>
|
||||
<DataTrigger Binding="{Binding ElementName=TweakSearchBox, Path=IsFocused}" Value="True">
|
||||
<Setter Property="Background" Value="{DynamicResource SecondaryButtonHover}"/>
|
||||
<Setter Property="Background" Value="{DynamicResource InputFocusColor}"/>
|
||||
</DataTrigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
@@ -744,18 +840,36 @@
|
||||
<Grid>
|
||||
<ScrollViewer VerticalScrollBarVisibility="Auto" Margin="0,-20,0,0" Padding="20,10,20,0">
|
||||
<StackPanel Margin="0,10,0,5">
|
||||
<!-- 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="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" FontWeight="Bold" FontSize="14" Foreground="{DynamicResource FgColor}" Margin="0,0,0,8"/>
|
||||
<ComboBox x:Name="UserSelectionCombo" Margin="0,0,0,12" AutomationProperties.Name="Apply Changes To">
|
||||
<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 IsEnabled="{Binding ElementName=OtherUsernameTextBox, Path=IsEnabled}">
|
||||
<Border.Style>
|
||||
<Style TargetType="Border" BasedOn="{StaticResource UserTextBoxBorderStyle}">
|
||||
<Style.Triggers>
|
||||
<DataTrigger Binding="{Binding ElementName=OtherUsernameTextBox, Path=IsFocused}" Value="True">
|
||||
<Setter Property="Background" Value="{DynamicResource InputFocusColor}"/>
|
||||
</DataTrigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
</Border.Style>
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
@@ -763,36 +877,49 @@
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBlock Grid.Column="0" Text="" 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" AutomationProperties.Name="Enter username"/>
|
||||
<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">
|
||||
<!-- App Removal Scope -->
|
||||
<Border x:Name="AppRemovalScopeSection" BorderBrush="{DynamicResource BorderColor}" BorderThickness="1" CornerRadius="4" Background="{DynamicResource CardBgColor}" Padding="16,12" Margin="0,0,0,16">
|
||||
<StackPanel>
|
||||
<TextBlock Text="Selected Changes" FontWeight="Bold" FontSize="14" Foreground="{DynamicResource FgColor}"/>
|
||||
<StackPanel x:Name="OverviewChangesPanel"/>
|
||||
<TextBlock Text="Remove Apps From" Style="{StaticResource CategoryHeaderTextBlock}"/>
|
||||
<ComboBox x:Name="AppRemovalScopeCombo" Margin="0,0,0,6" AutomationProperties.Name="App Removal Scope">
|
||||
<ComboBoxItem x:Name="AppRemovalScopeAllUsers" Content="All users" IsSelected="True"/>
|
||||
<ComboBoxItem x:Name="AppRemovalScopeCurrentUser" Content="Current user only"/>
|
||||
<ComboBoxItem x:Name="AppRemovalScopeTargetUser" Content="Target user only" Visibility="Collapsed"/>
|
||||
</ComboBox>
|
||||
<TextBlock x:Name="AppRemovalScopeDescription" Text="Apps will be removed for all users and from the Windows image to prevent reinstallation for new users." Foreground="{DynamicResource FgColor}" FontSize="12" TextWrapping="Wrap" Margin="0,6,0,3"/>
|
||||
</StackPanel>
|
||||
</Border>
|
||||
|
||||
<!-- System Restore Point -->
|
||||
<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="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}" AutomationProperties.Name="Create system restore point"/>
|
||||
<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" AutomationProperties.Name="Apply Changes">
|
||||
<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="" FontFamily="Segoe MDL2 Assets" FontSize="16" Margin="8,0,0,0" VerticalAlignment="Center"/>
|
||||
<TextBlock Text="" 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>
|
||||
@@ -830,10 +957,12 @@
|
||||
</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">
|
||||
|
||||
5
Get.ps1
5
Get.ps1
@@ -12,6 +12,7 @@ param (
|
||||
[switch]$RunDefaultsLite,
|
||||
[switch]$RunSavedSettings,
|
||||
[string]$Apps,
|
||||
[string]$AppRemovalTarget,
|
||||
[switch]$RemoveApps,
|
||||
[switch]$RemoveAppsCustom,
|
||||
[switch]$RemoveGamingApps,
|
||||
@@ -68,6 +69,10 @@ param (
|
||||
[switch]$DisableDragTray,
|
||||
[switch]$DisableMouseAcceleration,
|
||||
[switch]$DisableStickyKeys,
|
||||
[switch]$DisableWindowSnapping,
|
||||
[switch]$DisableSnapAssist,
|
||||
[switch]$DisableSnapLayouts,
|
||||
[switch]$HideTabsInAltTab, [switch]$Show3TabsInAltTab, [switch]$Show5TabsInAltTab, [switch]$Show20TabsInAltTab,
|
||||
[switch]$HideHome,
|
||||
[switch]$HideGallery,
|
||||
[switch]$ExplorerToHome,
|
||||
|
||||
@@ -153,6 +153,13 @@ Below is an overview of the key features and functionality offered by Win11Deblo
|
||||
- Hide the 3D objects, music or OneDrive folder from the File Explorer navigation pane. (W10 only)
|
||||
- Hide the 'Include in library', 'Give access to' and 'Share' options from the context menu. (W10 only)
|
||||
|
||||
#### Multi-tasking
|
||||
|
||||
- Disable window snapping. (W11 only)
|
||||
- Disable Snap Assist suggestions when snapping a window. (W11 only)
|
||||
- Disable Snap Layout suggestions when dragging windows to the top of screen and when hovering on the maximize button. (W11 only)
|
||||
- Change if tabs are shown when snapping or pressing Alt+Tab. (W11 only)
|
||||
|
||||
#### Other
|
||||
|
||||
- Disable Xbox Game Bar integration & game/screen recording. This also disables `ms-gamingoverlay`/`ms-gamebar` popups if you uninstall the Xbox Game Bar.
|
||||
|
||||
Binary file not shown.
BIN
Regfiles/Disable_Snap_Assist.reg
Normal file
BIN
Regfiles/Disable_Snap_Assist.reg
Normal file
Binary file not shown.
BIN
Regfiles/Disable_Snap_Layouts.reg
Normal file
BIN
Regfiles/Disable_Snap_Layouts.reg
Normal file
Binary file not shown.
4
Regfiles/Disable_Window_Snapping.reg
Normal file
4
Regfiles/Disable_Window_Snapping.reg
Normal file
@@ -0,0 +1,4 @@
|
||||
Windows Registry Editor Version 5.00
|
||||
|
||||
[HKEY_CURRENT_USER\Control Panel\Desktop]
|
||||
"WindowArrangementActive"="0"
|
||||
4
Regfiles/Hide_Tabs_In_Alt_Tab.reg
Normal file
4
Regfiles/Hide_Tabs_In_Alt_Tab.reg
Normal file
@@ -0,0 +1,4 @@
|
||||
Windows Registry Editor Version 5.00
|
||||
|
||||
[HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced]
|
||||
"MultiTaskingAltTabFilter"=dword:00000003
|
||||
4
Regfiles/Show_20_Tabs_In_Alt_Tab.reg
Normal file
4
Regfiles/Show_20_Tabs_In_Alt_Tab.reg
Normal file
@@ -0,0 +1,4 @@
|
||||
Windows Registry Editor Version 5.00
|
||||
|
||||
[HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced]
|
||||
"MultiTaskingAltTabFilter"=dword:00000000
|
||||
4
Regfiles/Show_3_Tabs_In_Alt_Tab.reg
Normal file
4
Regfiles/Show_3_Tabs_In_Alt_Tab.reg
Normal file
@@ -0,0 +1,4 @@
|
||||
Windows Registry Editor Version 5.00
|
||||
|
||||
[HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced]
|
||||
"MultiTaskingAltTabFilter"=dword:00000002
|
||||
4
Regfiles/Show_5_Tabs_In_Alt_Tab.reg
Normal file
4
Regfiles/Show_5_Tabs_In_Alt_Tab.reg
Normal file
@@ -0,0 +1,4 @@
|
||||
Windows Registry Editor Version 5.00
|
||||
|
||||
[HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced]
|
||||
"MultiTaskingAltTabFilter"=dword:00000001
|
||||
Binary file not shown.
BIN
Regfiles/Sysprep/Disable_Snap_Assist.reg
Normal file
BIN
Regfiles/Sysprep/Disable_Snap_Assist.reg
Normal file
Binary file not shown.
BIN
Regfiles/Sysprep/Disable_Snap_Layouts.reg
Normal file
BIN
Regfiles/Sysprep/Disable_Snap_Layouts.reg
Normal file
Binary file not shown.
4
Regfiles/Sysprep/Disable_Window_Snapping.reg
Normal file
4
Regfiles/Sysprep/Disable_Window_Snapping.reg
Normal file
@@ -0,0 +1,4 @@
|
||||
Windows Registry Editor Version 5.00
|
||||
|
||||
[hkey_users\default\Control Panel\Desktop]
|
||||
"WindowArrangementActive"="0"
|
||||
4
Regfiles/Sysprep/Hide_Tabs_In_Alt_Tab.reg
Normal file
4
Regfiles/Sysprep/Hide_Tabs_In_Alt_Tab.reg
Normal file
@@ -0,0 +1,4 @@
|
||||
Windows Registry Editor Version 5.00
|
||||
|
||||
[hkey_users\default\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced]
|
||||
"MultiTaskingAltTabFilter"=dword:00000003
|
||||
4
Regfiles/Sysprep/Show_20_Tabs_In_Alt_Tab.reg
Normal file
4
Regfiles/Sysprep/Show_20_Tabs_In_Alt_Tab.reg
Normal file
@@ -0,0 +1,4 @@
|
||||
Windows Registry Editor Version 5.00
|
||||
|
||||
[hkey_users\default\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced]
|
||||
"MultiTaskingAltTabFilter"=dword:00000000
|
||||
4
Regfiles/Sysprep/Show_3_Tabs_In_Alt_Tab.reg
Normal file
4
Regfiles/Sysprep/Show_3_Tabs_In_Alt_Tab.reg
Normal file
@@ -0,0 +1,4 @@
|
||||
Windows Registry Editor Version 5.00
|
||||
|
||||
[hkey_users\default\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced]
|
||||
"MultiTaskingAltTabFilter"=dword:00000002
|
||||
4
Regfiles/Sysprep/Show_5_Tabs_In_Alt_Tab.reg
Normal file
4
Regfiles/Sysprep/Show_5_Tabs_In_Alt_Tab.reg
Normal file
@@ -0,0 +1,4 @@
|
||||
Windows Registry Editor Version 5.00
|
||||
|
||||
[hkey_users\default\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced]
|
||||
"MultiTaskingAltTabFilter"=dword:00000001
|
||||
Binary file not shown.
@@ -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]
|
||||
BIN
Regfiles/Undo/Enable_Snap_Assist.reg
Normal file
BIN
Regfiles/Undo/Enable_Snap_Assist.reg
Normal file
Binary file not shown.
BIN
Regfiles/Undo/Enable_Snap_Layouts.reg
Normal file
BIN
Regfiles/Undo/Enable_Snap_Layouts.reg
Normal file
Binary file not shown.
4
Regfiles/Undo/Enable_Window_Snapping.reg
Normal file
4
Regfiles/Undo/Enable_Window_Snapping.reg
Normal file
@@ -0,0 +1,4 @@
|
||||
Windows Registry Editor Version 5.00
|
||||
|
||||
[HKEY_CURRENT_USER\Control Panel\Desktop]
|
||||
"WindowArrangementActive"="1"
|
||||
302
Win11Debloat.ps1
302
Win11Debloat.ps1
@@ -14,6 +14,7 @@ param (
|
||||
[switch]$RunDefaultsLite,
|
||||
[switch]$RunSavedSettings,
|
||||
[string]$Apps,
|
||||
[string]$AppRemovalTarget,
|
||||
[switch]$RemoveApps,
|
||||
[switch]$RemoveAppsCustom,
|
||||
[switch]$RemoveGamingApps,
|
||||
@@ -70,6 +71,10 @@ param (
|
||||
[switch]$DisableDragTray,
|
||||
[switch]$DisableMouseAcceleration,
|
||||
[switch]$DisableStickyKeys,
|
||||
[switch]$DisableWindowSnapping,
|
||||
[switch]$DisableSnapAssist,
|
||||
[switch]$DisableSnapLayouts,
|
||||
[switch]$HideTabsInAltTab, [switch]$Show3TabsInAltTab, [switch]$Show5TabsInAltTab, [switch]$Show20TabsInAltTab,
|
||||
[switch]$HideHome,
|
||||
[switch]$HideGallery,
|
||||
[switch]$ExplorerToHome,
|
||||
@@ -99,12 +104,13 @@ $script:AppSelectionSchema = "$script:AssetsPath/Schemas/AppSelectionWindow.xaml
|
||||
$script:MainWindowSchema = "$script:AssetsPath/Schemas/MainWindow.xaml"
|
||||
$script:FeaturesFilePath = "$script:AssetsPath/Features.json"
|
||||
|
||||
$script:ControlParams = 'WhatIf', 'Confirm', 'Verbose', 'Debug', 'LogPath', 'Silent', 'Sysprep', 'User', 'NoRestartExplorer', 'RunDefaults', 'RunDefaultsLite', 'RunSavedSettings', 'RunAppsListGenerator', 'CLI'
|
||||
$script:ControlParams = 'WhatIf', 'Confirm', 'Verbose', 'Debug', 'LogPath', 'Silent', 'Sysprep', 'User', 'NoRestartExplorer', 'RunDefaults', 'RunDefaultsLite', 'RunSavedSettings', 'RunAppsListGenerator', 'CLI', 'AppRemovalTarget'
|
||||
|
||||
# Script-level variables for GUI elements
|
||||
$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") {
|
||||
@@ -510,6 +516,7 @@ function SetWindowThemeResources {
|
||||
$window.Resources.Add("SecondaryButtonPressed", [System.Windows.Media.SolidColorBrush]::new([System.Windows.Media.ColorConverter]::ConvertFromString("#1e1e1e")))
|
||||
$window.Resources.Add("SecondaryButtonDisabled", [System.Windows.Media.SolidColorBrush]::new([System.Windows.Media.ColorConverter]::ConvertFromString("#3b3b3b")))
|
||||
$window.Resources.Add("SecondaryButtonTextDisabled", [System.Windows.Media.SolidColorBrush]::new([System.Windows.Media.ColorConverter]::ConvertFromString("#787878")))
|
||||
$window.Resources.Add("InputFocusColor", [System.Windows.Media.SolidColorBrush]::new([System.Windows.Media.ColorConverter]::ConvertFromString("#1f1f1f")))
|
||||
$window.Resources.Add("ScrollBarThumbColor", [System.Windows.Media.SolidColorBrush]::new([System.Windows.Media.ColorConverter]::ConvertFromString("#3d3d3d")))
|
||||
$window.Resources.Add("ScrollBarThumbHoverColor", [System.Windows.Media.SolidColorBrush]::new([System.Windows.Media.ColorConverter]::ConvertFromString("#4b4b4b")))
|
||||
}
|
||||
@@ -535,6 +542,7 @@ function SetWindowThemeResources {
|
||||
$window.Resources.Add("SecondaryButtonPressed", [System.Windows.Media.SolidColorBrush]::new([System.Windows.Media.ColorConverter]::ConvertFromString("#f0f0f0")))
|
||||
$window.Resources.Add("SecondaryButtonDisabled", [System.Windows.Media.SolidColorBrush]::new([System.Windows.Media.ColorConverter]::ConvertFromString("#f7f7f7")))
|
||||
$window.Resources.Add("SecondaryButtonTextDisabled", [System.Windows.Media.SolidColorBrush]::new([System.Windows.Media.ColorConverter]::ConvertFromString("#b7b7b7")))
|
||||
$window.Resources.Add("InputFocusColor", [System.Windows.Media.SolidColorBrush]::new([System.Windows.Media.ColorConverter]::ConvertFromString("#fbfbfb")))
|
||||
$window.Resources.Add("ScrollBarThumbColor", [System.Windows.Media.SolidColorBrush]::new([System.Windows.Media.ColorConverter]::ConvertFromString("#b9b9b9")))
|
||||
$window.Resources.Add("ScrollBarThumbHoverColor", [System.Windows.Media.SolidColorBrush]::new([System.Windows.Media.ColorConverter]::ConvertFromString("#8b8b8b")))
|
||||
}
|
||||
@@ -598,10 +606,9 @@ 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
|
||||
@@ -861,6 +868,17 @@ 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' }
|
||||
|
||||
@@ -877,10 +895,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
|
||||
@@ -1364,6 +1402,11 @@ function OpenGUI {
|
||||
$otherUsernameTextBox = $window.FindName('OtherUsernameTextBox')
|
||||
$usernameTextBoxPlaceholder = $window.FindName('UsernameTextBoxPlaceholder')
|
||||
$usernameValidationMessage = $window.FindName('UsernameValidationMessage')
|
||||
$appRemovalScopeCombo = $window.FindName('AppRemovalScopeCombo')
|
||||
$appRemovalScopeDescription = $window.FindName('AppRemovalScopeDescription')
|
||||
$appRemovalScopeSection = $window.FindName('AppRemovalScopeSection')
|
||||
$appRemovalScopeCurrentUser = $window.FindName('AppRemovalScopeCurrentUser')
|
||||
$appRemovalScopeTargetUser = $window.FindName('AppRemovalScopeTargetUser')
|
||||
|
||||
# Navigation button handlers
|
||||
function UpdateNavigationButtons {
|
||||
@@ -1436,20 +1479,61 @@ function OpenGUI {
|
||||
$userSelectionDescription.Text = "Changes will be applied to the currently logged-in user profile."
|
||||
$otherUserPanel.Visibility = 'Collapsed'
|
||||
$usernameValidationMessage.Text = ""
|
||||
# Show "Current user only" option, hide "Target user only" option
|
||||
$appRemovalScopeCurrentUser.Visibility = 'Visible'
|
||||
$appRemovalScopeTargetUser.Visibility = 'Collapsed'
|
||||
# Enable app removal scope selection for current user
|
||||
$appRemovalScopeCombo.IsEnabled = $true
|
||||
$appRemovalScopeCombo.SelectedIndex = 0
|
||||
}
|
||||
1 {
|
||||
$userSelectionDescription.Text = "Changes will be applied to a different user profile on this system."
|
||||
$otherUserPanel.Visibility = 'Visible'
|
||||
$usernameValidationMessage.Text = ""
|
||||
# Hide "Current user only" option, show "Target user only" option
|
||||
$appRemovalScopeCurrentUser.Visibility = 'Collapsed'
|
||||
$appRemovalScopeTargetUser.Visibility = 'Visible'
|
||||
# Enable app removal scope selection for other user
|
||||
$appRemovalScopeCombo.IsEnabled = $true
|
||||
$appRemovalScopeCombo.SelectedIndex = 0
|
||||
}
|
||||
2 {
|
||||
$userSelectionDescription.Text = "Changes will be applied to the default user template, affecting all new users created after this point. Useful for Sysprep deployment."
|
||||
$otherUserPanel.Visibility = 'Collapsed'
|
||||
$usernameValidationMessage.Text = ""
|
||||
# Hide other user options since they don't apply to default user template
|
||||
$appRemovalScopeCurrentUser.Visibility = 'Collapsed'
|
||||
$appRemovalScopeTargetUser.Visibility = 'Collapsed'
|
||||
# Lock app removal scope to "All users" when applying to sysprep
|
||||
$appRemovalScopeCombo.IsEnabled = $false
|
||||
$appRemovalScopeCombo.SelectedIndex = 0
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
# Helper function to update app removal scope description
|
||||
function UpdateAppRemovalScopeDescription {
|
||||
$selectedItem = $appRemovalScopeCombo.SelectedItem
|
||||
if ($selectedItem) {
|
||||
switch ($selectedItem.Content) {
|
||||
"All users" {
|
||||
$appRemovalScopeDescription.Text = "Apps will be removed for all users and from the Windows image to prevent reinstallation for new users."
|
||||
}
|
||||
"Current user only" {
|
||||
$appRemovalScopeDescription.Text = "Apps will only be removed for the current user. Other users and new users will not be affected."
|
||||
}
|
||||
"Target user only" {
|
||||
$appRemovalScopeDescription.Text = "Apps will only be removed for the specified target user. Other users and new users will not be affected."
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
# Update app removal scope description
|
||||
$appRemovalScopeCombo.Add_SelectionChanged({
|
||||
UpdateAppRemovalScopeDescription
|
||||
})
|
||||
|
||||
$otherUsernameTextBox.Add_TextChanged({
|
||||
# Show/hide placeholder
|
||||
if ([string]::IsNullOrWhiteSpace($otherUsernameTextBox.Text)) {
|
||||
@@ -1516,6 +1600,22 @@ function OpenGUI {
|
||||
$changesList += "Remove $selectedAppsCount selected application(s)"
|
||||
}
|
||||
|
||||
# Update app removal scope section based on whether apps are selected
|
||||
if ($selectedAppsCount -gt 0) {
|
||||
# Enable app removal scope selection (unless locked by sysprep mode)
|
||||
if ($userSelectionCombo.SelectedIndex -ne 2) {
|
||||
$appRemovalScopeCombo.IsEnabled = $true
|
||||
}
|
||||
$appRemovalScopeSection.Opacity = 1.0
|
||||
UpdateAppRemovalScopeDescription
|
||||
}
|
||||
else {
|
||||
# Disable app removal scope selection when no apps selected
|
||||
$appRemovalScopeCombo.IsEnabled = $false
|
||||
$appRemovalScopeSection.Opacity = 0.5
|
||||
$appRemovalScopeDescription.Text = "No apps selected for removal."
|
||||
}
|
||||
|
||||
# Collect all ComboBox/CheckBox selections from dynamically created controls
|
||||
if ($script:UiControlMappings) {
|
||||
foreach ($mappingKey in $script:UiControlMappings.Keys) {
|
||||
@@ -1595,13 +1695,6 @@ function OpenGUI {
|
||||
return
|
||||
}
|
||||
|
||||
$controlParamsCount = 0
|
||||
foreach ($Param in $script:ControlParams) {
|
||||
if ($script:Params.ContainsKey($Param)) {
|
||||
$controlParamsCount++
|
||||
}
|
||||
}
|
||||
|
||||
# App Removal - collect selected apps from integrated UI
|
||||
$selectedApps = @()
|
||||
foreach ($child in $appsPanel.Children) {
|
||||
@@ -1627,6 +1720,23 @@ function OpenGUI {
|
||||
|
||||
AddParameter 'RemoveApps'
|
||||
AddParameter 'Apps' ($selectedApps -join ',')
|
||||
|
||||
# Add app removal target parameter based on selection
|
||||
$selectedScopeItem = $appRemovalScopeCombo.SelectedItem
|
||||
if ($selectedScopeItem) {
|
||||
switch ($selectedScopeItem.Content) {
|
||||
"All users" {
|
||||
AddParameter 'AppRemovalTarget' 'AllUsers'
|
||||
}
|
||||
"Current user only" {
|
||||
AddParameter 'AppRemovalTarget' 'CurrentUser'
|
||||
}
|
||||
"Target user only" {
|
||||
# Use the target username from Other User panel
|
||||
AddParameter 'AppRemovalTarget' ($otherUsernameTextBox.Text.Trim())
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
# Apply dynamic tweaks selections
|
||||
@@ -1663,12 +1773,19 @@ function OpenGUI {
|
||||
}
|
||||
}
|
||||
|
||||
$controlParamsCount = 0
|
||||
foreach ($Param in $script:ControlParams) {
|
||||
if ($script:Params.ContainsKey($Param)) {
|
||||
$controlParamsCount++
|
||||
}
|
||||
}
|
||||
|
||||
# Check if any changes were selected
|
||||
$totalChanges = $script:Params.Count - $controlParamsCount
|
||||
|
||||
# Apps parameter does not count as a change itself
|
||||
if ($script:Params.ContainsKey('Apps')) {
|
||||
$totalChanges--
|
||||
$totalChanges = $totalChanges - 1
|
||||
}
|
||||
|
||||
if ($totalChanges -eq 0) {
|
||||
@@ -1710,25 +1827,18 @@ function OpenGUI {
|
||||
try {
|
||||
ExecuteAllChanges
|
||||
|
||||
if (-not $script:Params.ContainsKey("Sysprep") -and -not $script:Params.ContainsKey("User") -and -not $script:Params.ContainsKey("NoRestartExplorer")) {
|
||||
# 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
|
||||
@@ -1751,6 +1861,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
|
||||
})
|
||||
|
||||
@@ -2163,13 +2300,42 @@ function GetInstalledAppsViaWinget {
|
||||
}
|
||||
|
||||
|
||||
# Removes apps specified during function call from all user accounts and from the OS image.
|
||||
# Target is determined from $script:Params["AppRemovalTarget"] or defaults to "AllUsers"
|
||||
# Target values: "AllUsers" (removes for all users + from image), "CurrentUser", or a specific username
|
||||
function GetTargetUserForAppRemoval {
|
||||
if ($script:Params.ContainsKey("AppRemovalTarget")) {
|
||||
return $script:Params["AppRemovalTarget"]
|
||||
}
|
||||
|
||||
return "AllUsers"
|
||||
}
|
||||
|
||||
|
||||
function GetFriendlyTargetUserName {
|
||||
$target = GetTargetUserForAppRemoval
|
||||
|
||||
switch ($target) {
|
||||
"AllUsers" { return "all users" }
|
||||
"CurrentUser" { return "the current user" }
|
||||
default { return "user $target" }
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
# Removes apps specified during function call based on the target scope.
|
||||
function RemoveApps {
|
||||
param (
|
||||
$appslist
|
||||
)
|
||||
|
||||
# Determine target from script-level params, defaulting to AllUsers
|
||||
$targetUser = GetTargetUserForAppRemoval
|
||||
|
||||
Foreach ($app in $appsList) {
|
||||
if ($script:CancelRequested) {
|
||||
return
|
||||
}
|
||||
|
||||
Write-ToConsole "Attempting to remove $app..."
|
||||
|
||||
# Use WinGet only to remove OneDrive and Edge
|
||||
@@ -2194,10 +2360,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
|
||||
}
|
||||
@@ -2208,31 +2385,38 @@ function RemoveApps {
|
||||
}
|
||||
|
||||
# Use Remove-AppxPackage to remove all other apps
|
||||
$app = '*' + $app + '*'
|
||||
$appPattern = '*' + $app + '*'
|
||||
|
||||
# Remove installed app for all existing users
|
||||
try {
|
||||
Get-AppxPackage -Name $app -AllUsers | Remove-AppxPackage -AllUsers -ErrorAction Continue
|
||||
switch ($targetUser) {
|
||||
"AllUsers" {
|
||||
# Remove installed app for all existing users
|
||||
Get-AppxPackage -Name $appPattern -AllUsers | Remove-AppxPackage -AllUsers -ErrorAction Continue
|
||||
|
||||
if ($DebugPreference -ne "SilentlyContinue") {
|
||||
Write-ToConsole "Removed $app for all users" -ForegroundColor DarkGray
|
||||
# Remove provisioned app from OS image, so the app won't be installed for any new users
|
||||
Get-AppxProvisionedPackage -Online | Where-Object { $_.PackageName -like $appPattern } | ForEach-Object { Remove-ProvisionedAppxPackage -Online -AllUsers -PackageName $_.PackageName }
|
||||
}
|
||||
"CurrentUser" {
|
||||
# Remove installed app for current user only
|
||||
Get-AppxPackage -Name $appPattern | Remove-AppxPackage -ErrorAction Continue
|
||||
}
|
||||
default {
|
||||
# Target is a specific username - remove app for that user only
|
||||
# Get the user's SID
|
||||
$userAccount = New-Object System.Security.Principal.NTAccount($targetUser)
|
||||
$userSid = $userAccount.Translate([System.Security.Principal.SecurityIdentifier]).Value
|
||||
|
||||
# Remove the app package for the specific user
|
||||
Get-AppxPackage -Name $appPattern -User $userSid | Remove-AppxPackage -User $userSid -ErrorAction Continue
|
||||
}
|
||||
}
|
||||
}
|
||||
catch {
|
||||
if ($DebugPreference -ne "SilentlyContinue") {
|
||||
Write-ToConsole "Unable to remove $app for all users" -ForegroundColor Yellow
|
||||
Write-ToConsole "Something went wrong while trying to remove $app" -ForegroundColor Yellow
|
||||
Write-Host $psitem.Exception.StackTrace -ForegroundColor Gray
|
||||
}
|
||||
}
|
||||
|
||||
# Remove provisioned app from OS image, so the app won't be installed for any new users
|
||||
try {
|
||||
Get-AppxProvisionedPackage -Online | Where-Object { $_.PackageName -like $app } | ForEach-Object { Remove-ProvisionedAppxPackage -Online -AllUsers -PackageName $_.PackageName }
|
||||
}
|
||||
catch {
|
||||
Write-ToConsole "Unable to remove $app from windows image" -ForegroundColor Yellow
|
||||
Write-Host $psitem.Exception.StackTrace -ForegroundColor Gray
|
||||
}
|
||||
}
|
||||
|
||||
Write-ToConsole ""
|
||||
@@ -2248,7 +2432,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
|
||||
@@ -2290,11 +2474,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 ""
|
||||
}
|
||||
|
||||
|
||||
@@ -2457,7 +2638,6 @@ function RegImport {
|
||||
reg load "HKU\Default" $userPath | Out-Null
|
||||
$regOutput = reg import "$script:RegfilesPath\Sysprep\$path" 2>&1
|
||||
reg unload "HKU\Default" | Out-Null
|
||||
|
||||
}
|
||||
else {
|
||||
$regOutput = reg import "$script:RegfilesPath\$path" 2>&1
|
||||
@@ -2823,7 +3003,7 @@ function ExecuteParameter {
|
||||
# Handle features without RegistryKey or with special logic
|
||||
switch ($paramKey) {
|
||||
'RemoveApps' {
|
||||
Write-ToConsole "> Removing selected apps..."
|
||||
Write-ToConsole "> Removing selected apps for $(GetFriendlyTargetUserName)..."
|
||||
$appsList = GenerateAppsList
|
||||
|
||||
if ($appsList.Count -eq 0) {
|
||||
@@ -2907,10 +3087,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
|
||||
}
|
||||
@@ -3002,8 +3187,6 @@ function CreateSystemRestorePoint {
|
||||
Write-ToConsole $result.Message -ForegroundColor Red
|
||||
}
|
||||
}
|
||||
|
||||
Write-ToConsole ""
|
||||
}
|
||||
|
||||
|
||||
@@ -3229,10 +3412,13 @@ if ($script:Params.ContainsKey("Sysprep")) {
|
||||
}
|
||||
}
|
||||
|
||||
# Make sure all requirements for User mode are met, if User is specified
|
||||
# Ensure that target user exists, if User or AppRemovalTarget parameter was provided
|
||||
if ($script:Params.ContainsKey("User")) {
|
||||
$userPath = GetUserDirectory -userName $script:Params.Item("User")
|
||||
}
|
||||
if ($script:Params.ContainsKey("AppRemovalTarget")) {
|
||||
$userPath = GetUserDirectory -userName $script:Params.Item("AppRemovalTarget")
|
||||
}
|
||||
|
||||
# Remove LastUsedSettings.json file if it exists and is empty
|
||||
if ((Test-Path $script:SavedSettingsFilePath) -and ([String]::IsNullOrWhiteSpace((Get-content $script:SavedSettingsFilePath)))) {
|
||||
|
||||
Reference in New Issue
Block a user