diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index 02eb934..5cc7eea 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -59,16 +59,16 @@ Understanding the project structure is essential for contributing effectively: ``` Win11Debloat/ -├── Win11Debloat.ps1 # Main PowerShell script -├── Apps.json # List of supported apps for removal -├── DefaultSettings.json # Default configuration preset -├── LastUsedSettings.json # Last used configuration (generated during use) -├── Assets/ -│ └── Features.json # All features with metadata -├── Regfiles/ # Registry files for each feature -├── Schemas/ # XAML Schemas for GUI elements -└── Scripts/ # Additional PowerShell scripts and functions - └── Get.ps1 # Script used for the quick launch method to automatically download and run Win11debloat +├── Win11Debloat.ps1 # Main PowerShell script +├── Scripts/ # Additional PowerShell scripts and functions +│ └── Get.ps1 # Script used for the quick launch method to automatically download and run Win11debloat +├── Config/ +│ ├── Apps.json # List of supported apps for removal +│ ├── DefaultSettings.json # Default configuration preset +│ ├── Features.json # All features with metadata +│ └── LastUsedSettings.json # Last used configuration (generated during use) +├── Regfiles/ # Registry files for each feature +└── Schemas/ # XAML Schemas for GUI elements ``` ### Best Practices @@ -131,7 +131,7 @@ To add a new app that can be removed via Win11Debloat: Get-AppxPackage | Select-Object Name, PackageFullName ``` -2. **Edit `Apps.json`**: Add a new entry to the `"Apps"` array: +2. **Edit `Config/Apps.json`**: Add a new entry to the `"Apps"` array: ```json { "FriendlyName": "Display Name", @@ -148,7 +148,7 @@ To add a new app that can be removed via Win11Debloat: ### Adding a New Feature -Features are defined in `Assets/Features.json` and can modify Windows settings via registry files or PowerShell commands. +Features are defined in `Config/Features.json` and can modify Windows settings via registry files or PowerShell commands. > [!NOTE] > For simple features that just include a registry change, no actual coding is required in the main script except for adding the corresponding command-line parameters. The GUI is automatically built using the information in the Features.json file. @@ -183,7 +183,7 @@ If your feature requires more than just applying a registry file, add custom log #### 2. Add Feature to Features.json -Add your feature to the `"Features"` array in `Assets/Features.json`: +Add your feature to the `"Features"` array in `Config/Features.json`: ```json { @@ -230,7 +230,7 @@ Add a corresponding parameter to both `Win11Debloat.ps1` AND `Scripts/Get.ps1`, > [!IMPORTANT] > The default preset is intentionally conservative. Features added to it should be thoroughly tested and widely beneficial. When in doubt, leave the feature out of the default preset. -The default preset (`DefaultSettings.json`) defines which features are automatically applied when users run Win11Debloat in "Default Mode" or with the `-RunDefaults` parameter. This preset should include features that are widely considered to improve the Windows experience without breaking functionality. +The default preset (`Config/DefaultSettings.json`) defines which features are automatically applied when users run Win11Debloat in "Default Mode" or with the `-RunDefaults` parameter. This preset should include features that are widely considered to improve the Windows experience without breaking functionality. **When to add a feature to the default preset:** - The feature removes obvious bloatware or distractions @@ -244,7 +244,7 @@ The default preset (`DefaultSettings.json`) defines which features are automatic - The feature is highly opinionated or preference-based - The feature is experimental or not thoroughly tested -To add your feature to the default preset, edit `DefaultSettings.json` and add a new entry to the `"Settings"` array: +To add your feature to the default preset, edit `Config/DefaultSettings.json` and add a new entry to the `"Settings"` array: ```json { @@ -282,7 +282,7 @@ To add your feature to the default preset, edit `DefaultSettings.json` and add a To add a new category for organizing features: -- Add a new category entry to the `"Categories"` array in `Assets/Features.json`: +- Add a new category entry to the `"Categories"` array in `Config/Features.json`: ```json { "Name": "Your Category Name", diff --git a/Apps.json b/Config/Apps.json similarity index 100% rename from Apps.json rename to Config/Apps.json diff --git a/DefaultSettings.json b/Config/DefaultSettings.json similarity index 100% rename from DefaultSettings.json rename to Config/DefaultSettings.json diff --git a/Assets/Features.json b/Config/Features.json similarity index 98% rename from Assets/Features.json rename to Config/Features.json index 9e7cb4f..72f559c 100644 --- a/Assets/Features.json +++ b/Config/Features.json @@ -575,6 +575,19 @@ "MinVersion": 22621, "MaxVersion": null }, + { + "FeatureId": "DisableStartAllApps", + "Label": "'All Apps' section in the start menu", + "ToolTip": "This will hide the 'All Apps' section in the start menu, which shows all installed apps. WARNING: Hiding this section may make it harder to find installed apps on your system. This feature uses policies, which will lock down certain settings.", + "Category": "Start Menu & Search", + "Action": "Hide", + "RegistryKey": "Disable_Start_All_Apps.reg", + "ApplyText": "Disabling the 'All Apps' section in the start menu...", + "UndoAction": "Show", + "RegistryUndoKey": "Enable_Start_All_Apps.reg", + "MinVersion": 26200, + "MaxVersion": null + }, { "FeatureId": "DisableStartPhoneLink", "Label": "Phone Link integration in the start menu", diff --git a/README.md b/README.md index 26eea6d..2a36508 100755 --- a/README.md +++ b/README.md @@ -129,8 +129,9 @@ Below is an overview of the key features and functionality offered by Win11Deblo #### Start Menu & Search -- Remove or replace all pinned apps from start for the current user, or for all existing & new users. (W11 only) -- Disable the recommended section in the start menu. (W11 only) +- Remove or replace all pinned apps from the start menu. (W11 only) +- Hide the recommended section in the start menu. (W11 only) +- Hide the 'All Apps' section in the start menu. (W11 only) - Disable the Phone Link mobile devices integration in the start menu. (W11 only) - Disable Bing web search & Copilot integration in Windows search. - Disable Microsoft Store app suggestions in Windows search. (W11 only) diff --git a/Regfiles/Disable_Start_All_Apps.reg b/Regfiles/Disable_Start_All_Apps.reg new file mode 100644 index 0000000..1b6ea54 --- /dev/null +++ b/Regfiles/Disable_Start_All_Apps.reg @@ -0,0 +1,4 @@ +Windows Registry Editor Version 5.00 + +[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer] +"NoStartMenuMorePrograms"=dword:00000001 diff --git a/Regfiles/Sysprep/Disable_Start_All_Apps.reg b/Regfiles/Sysprep/Disable_Start_All_Apps.reg new file mode 100644 index 0000000..3b565a0 --- /dev/null +++ b/Regfiles/Sysprep/Disable_Start_All_Apps.reg @@ -0,0 +1,4 @@ +Windows Registry Editor Version 5.00 + +[hkey_users\default\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer] +"NoStartMenuMorePrograms"=dword:00000001 diff --git a/Regfiles/Undo/Enable_Start_All_Apps.reg b/Regfiles/Undo/Enable_Start_All_Apps.reg new file mode 100644 index 0000000..b6ab02a --- /dev/null +++ b/Regfiles/Undo/Enable_Start_All_Apps.reg @@ -0,0 +1,7 @@ +Windows Registry Editor Version 5.00 + +[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer] +"NoStartMenuMorePrograms"=- + +[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer] +"NoStartMenuMorePrograms"=- diff --git a/Scripts/GUI/Show-ApplyModal.ps1 b/Scripts/GUI/Show-ApplyModal.ps1 index de0b0cc..b313b3f 100644 --- a/Scripts/GUI/Show-ApplyModal.ps1 +++ b/Scripts/GUI/Show-ApplyModal.ps1 @@ -87,6 +87,7 @@ function Show-ApplyModal { $script:ApplyStepNameEl.Text = "Preparing..." $script:ApplyStepCounterEl.Text = "Preparing..." $script:ApplyProgressBarEl.Value = 0 + $script:ApplyModalInErrorState = $false # Set up progress callback for ExecuteAllChanges $script:ApplyProgressCallback = { @@ -192,6 +193,23 @@ function Show-ApplyModal { $script:ApplyCompletionIconEl.Foreground = [System.Windows.Media.SolidColorBrush]::new([System.Windows.Media.ColorConverter]::ConvertFromString("#c42b1c")) $script:ApplyCompletionTitleEl.Text = "Error" $script:ApplyCompletionMessageEl.Text = "An error occurred while applying changes: $($_.Exception.Message)" + + # Set error state to change Kofi button to report link + $script:ApplyModalInErrorState = $true + + # Update Kofi button to be a report issue button + $applyKofiBtn.Content = $null + + $reportText = [System.Windows.Controls.TextBlock]::new() + $reportText.Text = 'Report a bug' + $reportText.VerticalAlignment = 'Center' + $reportText.FontSize = 14 + $reportText.Margin = [System.Windows.Thickness]::new(0, 0, 0, 1) + + $applyKofiBtn.Content = $reportText + + [System.Windows.Automation.AutomationProperties]::SetName($applyKofiBtn, 'Report a bug') + $applyWindow.Dispatcher.Invoke([System.Windows.Threading.DispatcherPriority]::Render, [action]{}) } finally { @@ -206,7 +224,11 @@ function Show-ApplyModal { }) $applyKofiBtn.Add_Click({ - Start-Process "https://ko-fi.com/raphire" + if ($script:ApplyModalInErrorState) { + Start-Process "https://github.com/Raphire/Win11Debloat/issues/new" + } else { + Start-Process "https://ko-fi.com/raphire" + } }) $applyCancelBtn.Add_Click({ diff --git a/Scripts/Get.ps1 b/Scripts/Get.ps1 index 9f43619..a3cba0d 100644 --- a/Scripts/Get.ps1 +++ b/Scripts/Get.ps1 @@ -57,6 +57,7 @@ param ( [switch]$HideSearchTb, [switch]$ShowSearchIconTb, [switch]$ShowSearchLabelTb, [switch]$ShowSearchBoxTb, [switch]$HideTaskview, [switch]$DisableStartRecommended, + [switch]$DisableStartAllApps, [switch]$DisableStartPhoneLink, [switch]$DisableCopilot, [switch]$DisableRecall, @@ -166,6 +167,12 @@ else { $windowStyle = "Normal" } +# Remove Powershell 7 modules from path to prevent module loading issues in the script +if ($PSVersionTable.PSVersion.Major -ge 7) { + $NewPSModulePath = $env:PSModulePath -split ';' | Where-Object -FilterScript { $_ -like '*WindowsPowerShell*' } + $env:PSModulePath = $NewPSModulePath -join ';' +} + # Run Win11Debloat script with the provided arguments $debloatProcess = Start-Process powershell.exe -WindowStyle $windowStyle -PassThru -ArgumentList "-executionpolicy bypass -File $env:TEMP\Win11Debloat\Win11Debloat.ps1 $arguments" -Verb RunAs diff --git a/Win11Debloat.ps1 b/Win11Debloat.ps1 index f08848a..31bcb1b 100755 --- a/Win11Debloat.ps1 +++ b/Win11Debloat.ps1 @@ -60,6 +60,7 @@ param ( [switch]$HideSearchTb, [switch]$ShowSearchIconTb, [switch]$ShowSearchLabelTb, [switch]$ShowSearchBoxTb, [switch]$HideTaskview, [switch]$DisableStartRecommended, + [switch]$DisableStartAllApps, [switch]$DisableStartPhoneLink, [switch]$DisableCopilot, [switch]$DisableRecall, @@ -102,11 +103,12 @@ param ( # Define script-level variables & paths -$script:Version = "2026.03.07" -$script:DefaultSettingsFilePath = "$PSScriptRoot/DefaultSettings.json" -$script:AppsListFilePath = "$PSScriptRoot/Apps.json" -$script:SavedSettingsFilePath = "$PSScriptRoot/LastUsedSettings.json" -$script:CustomAppsListFilePath = "$PSScriptRoot/CustomAppsList" +$script:Version = "2026.03.09" +$script:AppsListFilePath = "$PSScriptRoot/Config/Apps.json" +$script:DefaultSettingsFilePath = "$PSScriptRoot/Config/DefaultSettings.json" +$script:FeaturesFilePath = "$PSScriptRoot/Config/Features.json" +$script:SavedSettingsFilePath = "$PSScriptRoot/Config/LastUsedSettings.json" +$script:CustomAppsListFilePath = "$PSScriptRoot/Config/CustomAppsList" $script:DefaultLogPath = "$PSScriptRoot/Logs/Win11Debloat.log" $script:RegfilesPath = "$PSScriptRoot/Regfiles" $script:AssetsPath = "$PSScriptRoot/Assets" @@ -116,7 +118,6 @@ $script:MessageBoxSchema = "$PSScriptRoot/Schemas/MessageBoxWindow.xaml" $script:AboutWindowSchema = "$PSScriptRoot/Schemas/AboutWindow.xaml" $script:ApplyChangesWindowSchema = "$PSScriptRoot/Schemas/ApplyChangesWindow.xaml" $script:SharedStylesSchema = "$PSScriptRoot/Schemas/SharedStyles.xaml" -$script:FeaturesFilePath = "$script:AssetsPath/Features.json" $script:ControlParams = 'WhatIf', 'Confirm', 'Verbose', 'Debug', 'LogPath', 'Silent', 'Sysprep', 'User', 'NoRestartExplorer', 'RunDefaults', 'RunDefaultsLite', 'RunSavedSettings', 'RunAppsListGenerator', 'CLI', 'AppRemovalTarget'