diff --git a/Apps.json b/Apps.json new file mode 100644 index 0000000..e898eba --- /dev/null +++ b/Apps.json @@ -0,0 +1,833 @@ +{ + "Version": "1.0", + "Apps": [ + { + "FriendlyName": "Clipchamp", + "AppId": "Clipchamp.Clipchamp", + "Description": "Video editor from Microsoft", + "SelectedByDefault": true + }, + { + "FriendlyName": "3D Builder", + "AppId": "Microsoft.3DBuilder", + "Description": "Basic 3D modeling software", + "SelectedByDefault": true + }, + { + "FriendlyName": "Cortana", + "AppId": "Microsoft.549981C3F5F10", + "Description": "Microsoft Cortana voice assistant (Discontinued)", + "SelectedByDefault": true + }, + { + "FriendlyName": "Bing Finance", + "AppId": "Microsoft.BingFinance", + "Description": "Finance news and tracking via Bing (Discontinued)", + "SelectedByDefault": true + }, + { + "FriendlyName": "Bing Food And Drink", + "AppId": "Microsoft.BingFoodAndDrink", + "Description": "Recipes and food news via Bing (Discontinued)", + "SelectedByDefault": true + }, + { + "FriendlyName": "Bing Health And Fitness", + "AppId": "Microsoft.BingHealthAndFitness", + "Description": "Health and fitness tracking/news via Bing (Discontinued)", + "SelectedByDefault": true + }, + { + "FriendlyName": "Bing News", + "AppId": "Microsoft.BingNews", + "Description": "News aggregator via Bing (Replaced by Microsoft News/Start)", + "SelectedByDefault": true + }, + { + "FriendlyName": "Bing Sports", + "AppId": "Microsoft.BingSports", + "Description": "Sports news and scores via Bing (Discontinued)", + "SelectedByDefault": true + }, + { + "FriendlyName": "Bing Translator", + "AppId": "Microsoft.BingTranslator", + "Description": "Translation service via Bing", + "SelectedByDefault": true + }, + { + "FriendlyName": "Bing Travel", + "AppId": "Microsoft.BingTravel", + "Description": "Travel planning and news via Bing (Discontinued)", + "SelectedByDefault": true + }, + { + "FriendlyName": "Bing Weather", + "AppId": "Microsoft.BingWeather", + "Description": "Weather forecast via Bing", + "SelectedByDefault": true + }, + { + "FriendlyName": "Copilot", + "AppId": "Microsoft.Copilot", + "Description": "AI assistant integrated into Windows", + "SelectedByDefault": true + }, + { + "FriendlyName": "Get Started", + "AppId": "Microsoft.Getstarted", + "Description": "Tips and introductory guide for Windows (Cannot be uninstalled in Windows 11)", + "SelectedByDefault": true + }, + { + "FriendlyName": "Messaging", + "AppId": "Microsoft.Messaging", + "Description": "Messaging app, often integrates with Skype (Largely deprecated)", + "SelectedByDefault": true + }, + { + "FriendlyName": "3D Viewer", + "AppId": "Microsoft.Microsoft3DViewer", + "Description": "Viewer for 3D models", + "SelectedByDefault": true + }, + { + "FriendlyName": "Microsoft Journal", + "AppId": "Microsoft.MicrosoftJournal", + "Description": "Digital note-taking app optimized for pen input", + "SelectedByDefault": true + }, + { + "FriendlyName": "Office Hub", + "AppId": "Microsoft.MicrosoftOfficeHub", + "Description": "Hub to access Microsoft Office apps and documents (Precursor to Microsoft 365 app)", + "SelectedByDefault": true + }, + { + "FriendlyName": "Power BI", + "AppId": "Microsoft.MicrosoftPowerBIForWindows", + "Description": "Business analytics service client", + "SelectedByDefault": true + }, + { + "FriendlyName": "Solitaire Collection", + "AppId": "Microsoft.MicrosoftSolitaireCollection", + "Description": "Collection of solitaire card games", + "SelectedByDefault": true + }, + { + "FriendlyName": "Sticky Notes", + "AppId": "Microsoft.MicrosoftStickyNotes", + "Description": "Digital sticky notes app (Deprecated & replaced by OneNote)", + "SelectedByDefault": true + }, + { + "FriendlyName": "Mixed Reality Portal", + "AppId": "Microsoft.MixedReality.Portal", + "Description": "Portal for Windows Mixed Reality headsets", + "SelectedByDefault": true + }, + { + "FriendlyName": "Network Speed Test", + "AppId": "Microsoft.NetworkSpeedTest", + "Description": "Internet connection speed test utility", + "SelectedByDefault": true + }, + { + "FriendlyName": "Microsoft News", + "AppId": "Microsoft.News", + "Description": "News aggregator (Replaced Bing News, now part of Microsoft Start)", + "SelectedByDefault": true + }, + { + "FriendlyName": "OneNote", + "AppId": "Microsoft.Office.OneNote", + "Description": "Digital note-taking app (Universal Windows Platform version)", + "SelectedByDefault": true + }, + { + "FriendlyName": "Sway", + "AppId": "Microsoft.Office.Sway", + "Description": "Presentation and storytelling app", + "SelectedByDefault": true + }, + { + "FriendlyName": "One Connect", + "AppId": "Microsoft.OneConnect", + "Description": "Mobile Operator management app (Replaced by Mobile Plans)", + "SelectedByDefault": true + }, + { + "FriendlyName": "Print 3D", + "AppId": "Microsoft.Print3D", + "Description": "3D printing preparation software", + "SelectedByDefault": true + }, + { + "FriendlyName": "Power Automate", + "AppId": "Microsoft.PowerAutomateDesktop", + "Description": "Desktop automation tool (RPA)", + "SelectedByDefault": true + }, + { + "FriendlyName": "Skype (UWP)", + "AppId": "Microsoft.SkypeApp", + "Description": "Skype communication app, Universal Windows Platform version (Discontinued)", + "SelectedByDefault": true + }, + { + "FriendlyName": "Microsoft To Do", + "AppId": "Microsoft.Todos", + "Description": "To-do list and task management app", + "SelectedByDefault": true + }, + { + "FriendlyName": "Dev Home", + "AppId": "Microsoft.Windows.DevHome", + "Description": "Developer dashboard and tool configuration utility (Discontinued)", + "SelectedByDefault": true + }, + { + "FriendlyName": "Alarms & Clock", + "AppId": "Microsoft.WindowsAlarms", + "Description": "Alarms & Clock app", + "SelectedByDefault": true + }, + { + "FriendlyName": "Feedback Hub", + "AppId": "Microsoft.WindowsFeedbackHub", + "Description": "App for providing feedback to Microsoft on Windows", + "SelectedByDefault": true + }, + { + "FriendlyName": "Windows Maps", + "AppId": "Microsoft.WindowsMaps", + "Description": "Mapping and navigation app", + "SelectedByDefault": true + }, + { + "FriendlyName": "Sound Recorder", + "AppId": "Microsoft.WindowsSoundRecorder", + "Description": "Basic audio recording app", + "SelectedByDefault": true + }, + { + "FriendlyName": "Xbox Console Companion", + "AppId": "Microsoft.XboxApp", + "Description": "Old Xbox Console Companion App (Discontinued)", + "SelectedByDefault": true + }, + { + "FriendlyName": "Movies & TV", + "AppId": "Microsoft.ZuneVideo", + "Description": "Movies & TV app for renting/buying/playing video content (Rebranded as \"Films & TV\")", + "SelectedByDefault": true + }, + { + "FriendlyName": "Family Safety", + "AppId": "MicrosoftCorporationII.MicrosoftFamily", + "Description": "Family Safety App for managing family accounts and settings", + "SelectedByDefault": true + }, + { + "FriendlyName": "Quick Assist", + "AppId": "MicrosoftCorporationII.QuickAssist", + "Description": "Remote assistance tool", + "SelectedByDefault": true + }, + { + "FriendlyName": "MS Teams (Old)", + "AppId": "MicrosoftTeams", + "Description": "Old MS Teams personal (MS Store version)", + "SelectedByDefault": true + }, + { + "FriendlyName": "MS Teams (New)", + "AppId": "MSTeams", + "Description": "New MS Teams app (Work/School or Personal)", + "SelectedByDefault": true + }, + { + "FriendlyName": "ACG Media Player", + "AppId": "ACGMediaPlayer", + "Description": "Media player app", + "SelectedByDefault": true + }, + { + "FriendlyName": "Actipro Software", + "AppId": "ActiproSoftwareLLC", + "Description": "Potentially UI controls or software components, often bundled by OEMs", + "SelectedByDefault": true + }, + { + "FriendlyName": "Adobe Photoshop Express", + "AppId": "AdobeSystemsIncorporated.AdobePhotoshopExpress", + "Description": "Basic photo editing app from Adobe", + "SelectedByDefault": true + }, + { + "FriendlyName": "Amazon", + "AppId": "Amazon.com.Amazon", + "Description": "Amazon shopping app", + "SelectedByDefault": true + }, + { + "FriendlyName": "Prime Video", + "AppId": "AmazonVideo.PrimeVideo", + "Description": "Amazon Prime Video streaming service app", + "SelectedByDefault": true + }, + { + "FriendlyName": "Asphalt 8", + "AppId": "Asphalt8Airborne", + "Description": "Racing game", + "SelectedByDefault": true + }, + { + "FriendlyName": "Autodesk SketchBook", + "AppId": "AutodeskSketchBook", + "Description": "Digital drawing and sketching app", + "SelectedByDefault": true + }, + { + "FriendlyName": "Caesars Slots", + "AppId": "CaesarsSlotsFreeCasino", + "Description": "Casino slot machine game", + "SelectedByDefault": true + }, + { + "FriendlyName": "Cooking Fever", + "AppId": "COOKINGFEVER", + "Description": "Restaurant simulation game", + "SelectedByDefault": true + }, + { + "FriendlyName": "CyberLink Media Suite", + "AppId": "CyberLinkMediaSuiteEssentials", + "Description": "Multimedia software suite (often preinstalled by OEMs)", + "SelectedByDefault": true + }, + { + "FriendlyName": "Disney Magic Kingdoms", + "AppId": "DisneyMagicKingdoms", + "Description": "Disney theme park building game", + "SelectedByDefault": true + }, + { + "FriendlyName": "Disney", + "AppId": "Disney", + "Description": "General Disney content app (may vary by region/OEM, often Disney+)", + "SelectedByDefault": true + }, + { + "FriendlyName": "Drawboard PDF", + "AppId": "DrawboardPDF", + "Description": "PDF viewing and annotation app, often focused on pen input", + "SelectedByDefault": true + }, + { + "FriendlyName": "Duolingo", + "AppId": "Duolingo-LearnLanguagesforFree", + "Description": "Language learning app", + "SelectedByDefault": true + }, + { + "FriendlyName": "Eclipse Manager", + "AppId": "EclipseManager", + "Description": "Often related to specific OEM software or utilities (e.g., for managing screen settings)", + "SelectedByDefault": true + }, + { + "FriendlyName": "Facebook", + "AppId": "Facebook", + "Description": "Facebook social media app", + "SelectedByDefault": true + }, + { + "FriendlyName": "FarmVille 2", + "AppId": "FarmVille2CountryEscape", + "Description": "Farming simulation game", + "SelectedByDefault": true + }, + { + "FriendlyName": "Fitbit", + "AppId": "fitbit", + "Description": "Fitbit activity tracker companion app", + "SelectedByDefault": true + }, + { + "FriendlyName": "Flipboard", + "AppId": "Flipboard", + "Description": "News and social network aggregator styled as a magazine", + "SelectedByDefault": true + }, + { + "FriendlyName": "Hidden City", + "AppId": "HiddenCity", + "Description": "Hidden object puzzle adventure game", + "SelectedByDefault": true + }, + { + "FriendlyName": "Hulu", + "AppId": "HULULLC.HULUPLUS", + "Description": "Hulu streaming service app", + "SelectedByDefault": true + }, + { + "FriendlyName": "iHeartRadio", + "AppId": "iHeartRadio", + "Description": "Internet radio streaming app", + "SelectedByDefault": true + }, + { + "FriendlyName": "Instagram", + "AppId": "Instagram", + "Description": "Instagram social media app", + "SelectedByDefault": true + }, + { + "FriendlyName": "Bubble Witch 3", + "AppId": "king.com.BubbleWitch3Saga", + "Description": "Puzzle game from King", + "SelectedByDefault": true + }, + { + "FriendlyName": "Candy Crush Saga", + "AppId": "king.com.CandyCrushSaga", + "Description": "Puzzle game from King", + "SelectedByDefault": true + }, + { + "FriendlyName": "Candy Crush Soda", + "AppId": "king.com.CandyCrushSodaSaga", + "Description": "Puzzle game from King", + "SelectedByDefault": true + }, + { + "FriendlyName": "LinkedIn", + "AppId": "LinkedInforWindows", + "Description": "LinkedIn professional networking app", + "SelectedByDefault": true + }, + { + "FriendlyName": "March of Empires", + "AppId": "MarchofEmpires", + "Description": "Strategy game", + "SelectedByDefault": true + }, + { + "FriendlyName": "Netflix", + "AppId": "Netflix", + "Description": "Netflix streaming service app", + "SelectedByDefault": true + }, + { + "FriendlyName": "NYT Crossword", + "AppId": "NYTCrossword", + "Description": "New York Times crossword puzzle app", + "SelectedByDefault": true + }, + { + "FriendlyName": "One Calendar", + "AppId": "OneCalendar", + "Description": "Calendar aggregation app", + "SelectedByDefault": true + }, + { + "FriendlyName": "Pandora", + "AppId": "PandoraMediaInc", + "Description": "Pandora music streaming app", + "SelectedByDefault": true + }, + { + "FriendlyName": "Phototastic Collage", + "AppId": "PhototasticCollage", + "Description": "Photo collage creation app", + "SelectedByDefault": true + }, + { + "FriendlyName": "PicsArt", + "AppId": "PicsArt-PhotoStudio", + "Description": "Photo editing and creative app", + "SelectedByDefault": true + }, + { + "FriendlyName": "Plex", + "AppId": "Plex", + "Description": "Media server and player app", + "SelectedByDefault": true + }, + { + "FriendlyName": "Polarr Photo Editor", + "AppId": "PolarrPhotoEditorAcademicEdition", + "Description": "Photo editing app (Academic Edition)", + "SelectedByDefault": true + }, + { + "FriendlyName": "Royal Revolt", + "AppId": "Royal Revolt", + "Description": "Tower defense / strategy game", + "SelectedByDefault": true + }, + { + "FriendlyName": "Shazam", + "AppId": "Shazam", + "Description": "Music identification app", + "SelectedByDefault": true + }, + { + "FriendlyName": "Live Wallpaper", + "AppId": "Sidia.LiveWallpaper", + "Description": "Live wallpaper app", + "SelectedByDefault": true + }, + { + "FriendlyName": "Sling TV", + "AppId": "SlingTV", + "Description": "Live TV streaming service app", + "SelectedByDefault": true + }, + { + "FriendlyName": "Spotify", + "AppId": "Spotify", + "Description": "Spotify music streaming app", + "SelectedByDefault": true + }, + { + "FriendlyName": "TikTok", + "AppId": "TikTok", + "Description": "TikTok short-form video app", + "SelectedByDefault": true + }, + { + "FriendlyName": "TuneIn Radio", + "AppId": "TuneInRadio", + "Description": "Internet radio streaming app", + "SelectedByDefault": true + }, + { + "FriendlyName": "Twitter", + "AppId": "Twitter", + "Description": "Twitter (now X) social media app", + "SelectedByDefault": true + }, + { + "FriendlyName": "Viber", + "AppId": "Viber", + "Description": "Messaging and calling app", + "SelectedByDefault": true + }, + { + "FriendlyName": "WinZip", + "AppId": "WinZipUniversal", + "Description": "File compression and extraction utility (Universal Windows Platform version)", + "SelectedByDefault": true + }, + { + "FriendlyName": "Wunderlist", + "AppId": "Wunderlist", + "Description": "To-do list app (Acquired by Microsoft, functionality moved to Microsoft To Do)", + "SelectedByDefault": true + }, + { + "FriendlyName": "XING", + "AppId": "XING", + "Description": "Professional networking platform popular in German-speaking countries", + "SelectedByDefault": true + }, + { + "FriendlyName": "Bing Search", + "AppId": "Microsoft.BingSearch", + "Description": "Web Search from Microsoft Bing (Integrates into Windows Search)", + "SelectedByDefault": false + }, + { + "FriendlyName": "Microsoft Edge", + "AppId": "Microsoft.Edge", + "Description": "Edge browser (Can only be uninstalled in European Economic Area)", + "SelectedByDefault": false + }, + { + "FriendlyName": "Xbox Gaming App", + "AppId": "Microsoft.GamingApp", + "Description": "Modern Xbox Gaming App, required for installing some PC games", + "SelectedByDefault": false + }, + { + "FriendlyName": "Get Help", + "AppId": "Microsoft.GetHelp", + "Description": "Required for some Windows 11 Troubleshooters and support interactions", + "SelectedByDefault": false + }, + { + "FriendlyName": "Microsoft 365 Companions", + "AppId": "Microsoft.M365Companions", + "Description": "Microsoft 365 (Business) Calendar, Files and People mini-apps, these apps may be reinstalled if enabled by your Microsoft 365 admin", + "SelectedByDefault": false + }, + { + "FriendlyName": "Paint 3D", + "AppId": "Microsoft.MSPaint", + "Description": "Paint 3D (Modern paint application with 3D features)", + "SelectedByDefault": false + }, + { + "FriendlyName": "OneDrive", + "AppId": "Microsoft.OneDrive", + "Description": "OneDrive consumer cloud storage client", + "SelectedByDefault": false + }, + { + "FriendlyName": "Outlook for Windows", + "AppId": "Microsoft.OutlookForWindows", + "Description": "New Outlook for Windows mail client", + "SelectedByDefault": false + }, + { + "FriendlyName": "Paint", + "AppId": "Microsoft.Paint", + "Description": "Classic Paint (Traditional 2D paint application)", + "SelectedByDefault": false + }, + { + "FriendlyName": "People", + "AppId": "Microsoft.People", + "Description": "Required for & included with Mail & Calendar (Contacts management)", + "SelectedByDefault": false + }, + { + "FriendlyName": "Remote Desktop", + "AppId": "Microsoft.RemoteDesktop", + "Description": "Remote Desktop client app", + "SelectedByDefault": false + }, + { + "FriendlyName": "Snipping Tool", + "AppId": "Microsoft.ScreenSketch", + "Description": "Snipping Tool (Screenshot and annotation tool)", + "SelectedByDefault": false + }, + { + "FriendlyName": "Widgets Experience", + "AppId": "Microsoft.StartExperiencesApp", + "Description": "This app powers Windows Widgets My Feed", + "SelectedByDefault": false + }, + { + "FriendlyName": "Whiteboard", + "AppId": "Microsoft.Whiteboard", + "Description": "Digital collaborative whiteboard app", + "SelectedByDefault": false + }, + { + "FriendlyName": "Photos", + "AppId": "Microsoft.Windows.Photos", + "Description": "Default photo viewing and basic editing app", + "SelectedByDefault": false + }, + { + "FriendlyName": "Calculator", + "AppId": "Microsoft.WindowsCalculator", + "Description": "Calculator app", + "SelectedByDefault": false + }, + { + "FriendlyName": "Camera", + "AppId": "Microsoft.WindowsCamera", + "Description": "Camera app for using built-in or connected cameras", + "SelectedByDefault": false + }, + { + "FriendlyName": "Mail & Calendar", + "AppId": "Microsoft.windowscommunicationsapps", + "Description": "Mail & Calendar app suite (Discontinued)", + "SelectedByDefault": false + }, + { + "FriendlyName": "Notepad", + "AppId": "Microsoft.WindowsNotepad", + "Description": "Notepad text editor app", + "SelectedByDefault": false + }, + { + "FriendlyName": "Microsoft Store", + "AppId": "Microsoft.WindowsStore", + "Description": "Microsoft Store, WARNING: This app cannot be reinstalled easily if removed!", + "SelectedByDefault": false + }, + { + "FriendlyName": "Windows Terminal", + "AppId": "Microsoft.WindowsTerminal", + "Description": "Default terminal app in windows 11 (Command Prompt, PowerShell, WSL)", + "SelectedByDefault": false + }, + { + "FriendlyName": "Xbox TCUI Framework", + "AppId": "Microsoft.Xbox.TCUI", + "Description": "UI framework, seems to be required for MS store, photos and certain games", + "SelectedByDefault": false + }, + { + "FriendlyName": "Xbox Game Overlay", + "AppId": "Microsoft.XboxGameOverlay", + "Description": "Game overlay, required/useful for some games (Part of Xbox Game Bar)", + "SelectedByDefault": false + }, + { + "FriendlyName": "Xbox Gaming Overlay", + "AppId": "Microsoft.XboxGamingOverlay", + "Description": "Game overlay, required/useful for some games (Part of Xbox Game Bar)", + "SelectedByDefault": false + }, + { + "FriendlyName": "Xbox Identity Provider", + "AppId": "Microsoft.XboxIdentityProvider", + "Description": "Xbox sign-in framework, required for some games and Xbox services", + "SelectedByDefault": false + }, + { + "FriendlyName": "Xbox Speech To Text", + "AppId": "Microsoft.XboxSpeechToTextOverlay", + "Description": "Accessibility feature required for some games, WARNING: This app cannot be reinstalled easily!", + "SelectedByDefault": false + }, + { + "FriendlyName": "Phone Link", + "AppId": "Microsoft.YourPhone", + "Description": "Phone link (Connects Android/iOS phone to PC)", + "SelectedByDefault": false + }, + { + "FriendlyName": "Media Player", + "AppId": "Microsoft.ZuneMusic", + "Description": "Modern Media Player (Replaced Groove Music, plays local audio/video)", + "SelectedByDefault": false + }, + { + "FriendlyName": "Cross Device Experience", + "AppId": "MicrosoftWindows.CrossDevice", + "Description": "Phone integration within File Explorer, Camera and more (Part of Phone Link features)", + "SelectedByDefault": false + }, + { + "FriendlyName": "HP AI Experience Center", + "AppId": "AD2F1837.HPAIExperienceCenter", + "Description": "HP OEM software, AI-enhanced features and support", + "SelectedByDefault": false + }, + { + "FriendlyName": "HP Connected Music", + "AppId": "AD2F1837.HPConnectedMusic", + "Description": "HP OEM software for music (Potentially discontinued)", + "SelectedByDefault": false + }, + { + "FriendlyName": "HP Connected Photo", + "AppId": "AD2F1837.HPConnectedPhotopoweredbySnapfish", + "Description": "HP OEM software for photos, integrated with Snapfish (Potentially discontinued)", + "SelectedByDefault": false + }, + { + "FriendlyName": "HP Desktop Support Utilities", + "AppId": "AD2F1837.HPDesktopSupportUtilities", + "Description": "HP OEM software providing desktop support tools", + "SelectedByDefault": false + }, + { + "FriendlyName": "HP Easy Clean", + "AppId": "AD2F1837.HPEasyClean", + "Description": "HP OEM software for system cleaning or optimization", + "SelectedByDefault": false + }, + { + "FriendlyName": "HP File Viewer", + "AppId": "AD2F1837.HPFileViewer", + "Description": "HP OEM software for viewing specific file types", + "SelectedByDefault": false + }, + { + "FriendlyName": "HP JumpStarts", + "AppId": "AD2F1837.HPJumpStarts", + "Description": "HP OEM software for tutorials, app discovery, or quick access to HP features", + "SelectedByDefault": false + }, + { + "FriendlyName": "HP PC Hardware Diagnostics", + "AppId": "AD2F1837.HPPCHardwareDiagnosticsWindows", + "Description": "HP OEM software for PC hardware diagnostics", + "SelectedByDefault": false + }, + { + "FriendlyName": "HP Power Manager", + "AppId": "AD2F1837.HPPowerManager", + "Description": "HP OEM software for managing power settings and battery", + "SelectedByDefault": false + }, + { + "FriendlyName": "HP Printer Control", + "AppId": "AD2F1837.HPPrinterControl", + "Description": "HP OEM software for managing HP printers", + "SelectedByDefault": false + }, + { + "FriendlyName": "HP Privacy Settings", + "AppId": "AD2F1837.HPPrivacySettings", + "Description": "HP OEM software for managing privacy settings", + "SelectedByDefault": false + }, + { + "FriendlyName": "HP QuickDrop", + "AppId": "AD2F1837.HPQuickDrop", + "Description": "HP OEM software for quick file transfer between devices", + "SelectedByDefault": false + }, + { + "FriendlyName": "HP QuickTouch", + "AppId": "AD2F1837.HPQuickTouch", + "Description": "HP OEM software, possibly for touch-specific shortcuts or controls", + "SelectedByDefault": false + }, + { + "FriendlyName": "HP Registration", + "AppId": "AD2F1837.HPRegistration", + "Description": "HP OEM software for product registration", + "SelectedByDefault": false + }, + { + "FriendlyName": "HP Support Assistant", + "AppId": "AD2F1837.HPSupportAssistant", + "Description": "HP OEM software for support, updates, and troubleshooting", + "SelectedByDefault": false + }, + { + "FriendlyName": "HP Sure Shield AI", + "AppId": "AD2F1837.HPSureShieldAI", + "Description": "HP OEM security software, likely AI-based threat protection", + "SelectedByDefault": false + }, + { + "FriendlyName": "HP System Information", + "AppId": "AD2F1837.HPSystemInformation", + "Description": "HP OEM software for displaying system information", + "SelectedByDefault": false + }, + { + "FriendlyName": "HP Welcome", + "AppId": "AD2F1837.HPWelcome", + "Description": "HP OEM software providing a welcome experience or initial setup help", + "SelectedByDefault": false + }, + { + "FriendlyName": "HP WorkWell", + "AppId": "AD2F1837.HPWorkWell", + "Description": "HP OEM software focused on well-being, possibly with break reminders or ergonomic tips", + "SelectedByDefault": false + }, + { + "FriendlyName": "myHP", + "AppId": "AD2F1837.myHP", + "Description": "HP OEM central hub app for device info, support, and services", + "SelectedByDefault": false + } + ] +} diff --git a/Appslist.txt b/Appslist.txt deleted file mode 100644 index 57e40a0..0000000 --- a/Appslist.txt +++ /dev/null @@ -1,152 +0,0 @@ -# -------------------------------------------------------------------------------------------------------------- # -# The apps below this line WILL be uninstalled by default. Add a # character in front of any app you want to # -# KEEP installed by default. # -# -------------------------------------------------------------------------------------------------------------- # -Clipchamp.Clipchamp # Video editor from Microsoft -Microsoft.3DBuilder # Basic 3D modeling software -Microsoft.549981C3F5F10 # Cortana app (Voice assistant) -Microsoft.BingFinance # Finance news and tracking via Bing (Discontinued) -Microsoft.BingFoodAndDrink # Recipes and food news via Bing (Discontinued) -Microsoft.BingHealthAndFitness # Health and fitness tracking/news via Bing (Discontinued) -Microsoft.BingNews # News aggregator via Bing (Replaced by Microsoft News/Start) -Microsoft.BingSports # Sports news and scores via Bing (Discontinued) -Microsoft.BingTranslator # Translation service via Bing -Microsoft.BingTravel # Travel planning and news via Bing (Discontinued) -Microsoft.BingWeather # Weather forecast via Bing -Microsoft.Copilot # AI assistant integrated into Windows -Microsoft.Getstarted # Tips and introductory guide for Windows (Cannot be uninstalled in Windows 11) -Microsoft.Messaging # Messaging app, often integrates with Skype (Largely deprecated) -Microsoft.Microsoft3DViewer # Viewer for 3D models -Microsoft.MicrosoftJournal # Digital note-taking app optimized for pen input -Microsoft.MicrosoftOfficeHub # Hub to access Microsoft Office apps and documents (Precursor to Microsoft 365 app) -Microsoft.MicrosoftPowerBIForWindows # Business analytics service client -Microsoft.MicrosoftSolitaireCollection # Collection of solitaire card games -Microsoft.MicrosoftStickyNotes # Digital sticky notes app (Deprecated & replaced by OneNote) -Microsoft.MixedReality.Portal # Portal for Windows Mixed Reality headsets -Microsoft.NetworkSpeedTest # Internet connection speed test utility -Microsoft.News # News aggregator (Replaced Bing News, now part of Microsoft Start) -Microsoft.Office.OneNote # Digital note-taking app (Universal Windows Platform version) -Microsoft.Office.Sway # Presentation and storytelling app -Microsoft.OneConnect # Mobile Operator management app (Replaced by Mobile Plans) -Microsoft.Print3D # 3D printing preparation software -Microsoft.PowerAutomateDesktop # Desktop automation tool (RPA) -Microsoft.SkypeApp # Skype communication app (Universal Windows Platform version) -Microsoft.Todos # To-do list and task management app -Microsoft.Windows.DevHome # Developer dashboard and tool configuration utility, no longer supported -Microsoft.WindowsAlarms # Alarms & Clock app -Microsoft.WindowsFeedbackHub # App for providing feedback to Microsoft on Windows -Microsoft.WindowsMaps # Mapping and navigation app -Microsoft.WindowsSoundRecorder # Basic audio recording app -Microsoft.XboxApp # Old Xbox Console Companion App, no longer supported -Microsoft.ZuneVideo # Movies & TV app for renting/buying/playing video content (Rebranded as "Films & TV") -MicrosoftCorporationII.MicrosoftFamily # Family Safety App for managing family accounts and settings -MicrosoftCorporationII.QuickAssist # Remote assistance tool -MicrosoftTeams # Old MS Teams personal (MS Store version) -MSTeams # New MS Teams app (Work/School or Personal) - -ACGMediaPlayer # Media player app -ActiproSoftwareLLC # Potentially UI controls or software components, often bundled by OEMs -AdobeSystemsIncorporated.AdobePhotoshopExpress # Basic photo editing app from Adobe -Amazon.com.Amazon # Amazon shopping app -AmazonVideo.PrimeVideo # Amazon Prime Video streaming service app -Asphalt8Airborne # Racing game -AutodeskSketchBook # Digital drawing and sketching app -CaesarsSlotsFreeCasino # Casino slot machine game -COOKINGFEVER # Restaurant simulation game -CyberLinkMediaSuiteEssentials # Multimedia software suite (often preinstalled by OEMs) -DisneyMagicKingdoms # Disney theme park building game -Disney # General Disney content app (may vary by region/OEM, often Disney+) -DrawboardPDF # PDF viewing and annotation app, often focused on pen input -Duolingo-LearnLanguagesforFree # Language learning app -EclipseManager # Often related to specific OEM software or utilities (e.g., for managing screen settings) -Facebook # Facebook social media app -FarmVille2CountryEscape # Farming simulation game -fitbit # Fitbit activity tracker companion app -Flipboard # News and social network aggregator styled as a magazine -HiddenCity # Hidden object puzzle adventure game -HULULLC.HULUPLUS # Hulu streaming service app -iHeartRadio # Internet radio streaming app -Instagram # Instagram social media app -king.com.BubbleWitch3Saga # Puzzle game from King -king.com.CandyCrushSaga # Puzzle game from King -king.com.CandyCrushSodaSaga # Puzzle game from King -LinkedInforWindows # LinkedIn professional networking app -MarchofEmpires # Strategy game -Netflix # Netflix streaming service app -NYTCrossword # New York Times crossword puzzle app -OneCalendar # Calendar aggregation app -PandoraMediaInc # Pandora music streaming app -PhototasticCollage # Photo collage creation app -PicsArt-PhotoStudio # Photo editing and creative app -Plex # Media server and player app -PolarrPhotoEditorAcademicEdition # Photo editing app (Academic Edition) -Royal Revolt # Tower defense / strategy game -Shazam # Music identification app -Sidia.LiveWallpaper # Live wallpaper app -SlingTV # Live TV streaming service app -Spotify # Spotify music streaming app -TikTok # TikTok short-form video app -TuneInRadio # Internet radio streaming app -Twitter # Twitter (now X) social media app -Viber # Messaging and calling app -WinZipUniversal # File compression and extraction utility (Universal Windows Platform version) -Wunderlist # To-do list app (Acquired by Microsoft, functionality moved to Microsoft To Do) -XING # Professional networking platform popular in German-speaking countries - - - - -# ------------------------------------------------------------------------------------------------------------- # -# The apps below this line will NOT be uninstalled by default. Remove the # character in front of any app you # -# want to UNINSTALL by default. # -# ------------------------------------------------------------------------------------------------------------- # -#Microsoft.BingSearch # Web Search from Microsoft Bing (Integrates into Windows Search) -#Microsoft.Copilot # New Microsoft Copilot app (AI assistant) -#Microsoft.Edge # Edge browser (Can only be uninstalled in European Economic Area) -#Microsoft.GamingApp # Modern Xbox Gaming App, required for installing some PC games -#Microsoft.GetHelp # Required for some Windows 11 Troubleshooters and support interactions -#Microsoft.M365Companions # Microsoft 365 (Business) Calendar, Files and People mini-apps, these apps may be reinstalled if enabled by your Microsoft 365 admin -#Microsoft.MSPaint # Paint 3D (Modern paint application with 3D features) -#Microsoft.OneDrive # OneDrive consumer cloud storage client -#Microsoft.OutlookForWindows # New mail app: Outlook for Windows -#Microsoft.Paint # Classic Paint (Traditional 2D paint application) -#Microsoft.People # Required for & included with Mail & Calendar (Contacts management) -#Microsoft.RemoteDesktop # Remote Desktop client app -#Microsoft.ScreenSketch # Snipping Tool (Screenshot and annotation tool) -#Microsoft.StartExperiencesApp # This app powers Windows Widgets My Feed -#Microsoft.Whiteboard # Digital collaborative whiteboard app -#Microsoft.Windows.Photos # Default photo viewing and basic editing app -#Microsoft.WindowsCalculator # Calculator app -#Microsoft.WindowsCamera # Camera app for using built-in or connected cameras -#Microsoft.windowscommunicationsapps # Mail & Calendar app suite -#Microsoft.WindowsNotepad # Notepad text editor app -#Microsoft.WindowsStore # Microsoft Store, WARNING: This app cannot be reinstalled easily if removed! -#Microsoft.WindowsTerminal # New default terminal app in windows 11 (Command Prompt, PowerShell, WSL) -#Microsoft.Xbox.TCUI # UI framework, seems to be required for MS store, photos and certain games -#Microsoft.XboxGameOverlay # Game overlay, required/useful for some games (Part of Xbox Game Bar) -#Microsoft.XboxGamingOverlay # Game overlay, required/useful for some games (Part of Xbox Game Bar) -#Microsoft.XboxIdentityProvider # Xbox sign-in framework, required for some games and Xbox services -#Microsoft.XboxSpeechToTextOverlay # Might be required for some games, WARNING: This app cannot be reinstalled easily! (Accessibility feature) -#Microsoft.YourPhone # Phone link (Connects Android/iOS phone to PC) -#Microsoft.ZuneMusic # Modern Media Player (Replaced Groove Music, plays local audio/video) -#MicrosoftWindows.CrossDevice # Phone integration within File Explorer, Camera and more (Part of Phone Link features) -#AD2F1837.HPAIExperienceCenter # HP OEM software, AI-enhanced features and support -#AD2F1837.HPConnectedMusic # HP OEM software for music (Potentially discontinued) -#AD2F1837.HPConnectedPhotopoweredbySnapfish # HP OEM software for photos, integrated with Snapfish (Potentially discontinued) -#AD2F1837.HPDesktopSupportUtilities # HP OEM software providing desktop support tools -#AD2F1837.HPEasyClean # HP OEM software for system cleaning or optimization -#AD2F1837.HPFileViewer # HP OEM software for viewing specific file types -#AD2F1837.HPJumpStarts # HP OEM software for tutorials, app discovery, or quick access to HP features -#AD2F1837.HPPCHardwareDiagnosticsWindows # HP OEM software for PC hardware diagnostics -#AD2F1837.HPPowerManager # HP OEM software for managing power settings and battery -#AD2F1837.HPPrinterControl # HP OEM software for managing HP printers -#AD2F1837.HPPrivacySettings # HP OEM software for managing privacy settings -#AD2F1837.HPQuickDrop # HP OEM software for quick file transfer between devices -#AD2F1837.HPQuickTouch # HP OEM software, possibly for touch-specific shortcuts or controls -#AD2F1837.HPRegistration # HP OEM software for product registration -#AD2F1837.HPSupportAssistant # HP OEM software for support, updates, and troubleshooting -#AD2F1837.HPSureShieldAI # HP OEM security software, likely AI-based threat protection -#AD2F1837.HPSystemInformation # HP OEM software for displaying system information -#AD2F1837.HPWelcome # HP OEM software providing a welcome experience or initial setup help -#AD2F1837.HPWorkWell # HP OEM software focused on well-being, possibly with break reminders or ergonomic tips -#AD2F1837.myHP # HP OEM central hub app for device info, support, and services diff --git a/Assets/Features.json b/Assets/Features.json new file mode 100644 index 0000000..9263326 --- /dev/null +++ b/Assets/Features.json @@ -0,0 +1,998 @@ +{ + "Version": "1.0", + "Categories": [ + "Start Menu", + "System", + "Privacy & Suggested Content", + "Taskbar", + "Appearance", + "AI", + "Other", + "File Explorer", + "Gaming" + ], + "UiGroups": [ + { + "GroupId": "SearchIcon", + "Label": "Taskbar search style", + "Category": "Taskbar", + "Priority": 2, + "Values": [ + { "Label": "Hide", "FeatureIds": ["HideSearchTb"] }, + { "Label": "Show search icon only", "FeatureIds": ["ShowSearchIconTb"] }, + { "Label": "Show search icon and label", "FeatureIds": ["ShowSearchLabelTb"] }, + { "Label": "Show search box", "FeatureIds": ["ShowSearchBoxTb"] } + ] + }, + { + "GroupId": "MultiMon", + "Label": "Show taskbar apps on", + "Category": "Taskbar", + "Values": [ + { "Label": "All taskbars", "FeatureIds": ["MMTaskbarModeAll"] }, + { "Label": "Main taskbar and taskbar where window is open", "FeatureIds": ["MMTaskbarModeMainActive"] }, + { "Label": "Taskbar where window is open", "FeatureIds": ["MMTaskbarModeActive"] } + ] + }, + { + "GroupId": "CombineButtons", + "Label": "Combine taskbar buttons on the main display", + "Category": "Taskbar", + "Values": [ + { "Label": "Always", "FeatureIds": ["CombineTaskbarAlways"] }, + { "Label": "When taskbar is full", "FeatureIds": ["CombineTaskbarWhenFull"] }, + { "Label": "Never", "FeatureIds": ["CombineTaskbarNever"] } + ] + }, + { + "GroupId": "CombineMMButtons", + "Label": "Combine taskbar buttons on secondary displays", + "Category": "Taskbar", + "Values": [ + { "Label": "Always", "FeatureIds": ["CombineMMTaskbarAlways"] }, + { "Label": "When taskbar is full", "FeatureIds": ["CombineMMTaskbarWhenFull"] }, + { "Label": "Never", "FeatureIds": ["CombineMMTaskbarNever"] } + ] + }, + { + "GroupId": "ClearStart", + "Label": "Remove pinned apps from the start menu", + "Category": "Start Menu", + "Values": [ + { "Label": "Remove for the current user", "FeatureIds": ["ClearStart"] }, + { "Label": "Remove for all users", "FeatureIds": ["ClearStartAllUsers"] } + ] + }, + { + "GroupId": "ExplorerLocation", + "Label": "Open File Explorer to", + "Category": "File Explorer", + "Values": [ + { "Label": "Home", "FeatureIds": ["ExplorerToHome"] }, + { "Label": "This PC", "FeatureIds": ["ExplorerToThisPC"] }, + { "Label": "Downloads", "FeatureIds": ["ExplorerToDownloads"] }, + { "Label": "OneDrive", "FeatureIds": ["ExplorerToOneDrive"] } + ] + } + ], + "Features": [ + { + "FeatureId": "RemoveApps", + "Label": "Remove the apps specified in the 'Apps' parameter", + "Category": null, + "Action": "Remove Apps", + "RegistryKey": null, + "ApplyText": null, + "UndoAction": null, + "RegistryUndoKey": null, + "MinVersion": null, + "MaxVersion": null + }, + { + "FeatureId": "Apps", + "Label": "The selection of apps to remove, specified as a comma separated list. Use 'Default' (or omit) to use the default apps list", + "Category": null, + "Action": "Apps", + "RegistryKey": null, + "ApplyText": null, + "UndoAction": null, + "RegistryUndoKey": null, + "MinVersion": null, + "MaxVersion": null + }, + { + "FeatureId": "RemoveAppsCustom", + "Label": "Remove custom selection of apps", + "Category": null, + "Action": "Remove Custom Apps", + "RegistryKey": null, + "ApplyText": null, + "UndoAction": null, + "RegistryUndoKey": null, + "MinVersion": null, + "MaxVersion": null + }, + { + "FeatureId": "RemoveCommApps", + "Label": "Remove the Mail, Calendar, and People apps", + "Category": null, + "Action": "Remove Mail, Calendar & People", + "RegistryKey": null, + "ApplyText": null, + "UndoAction": null, + "RegistryUndoKey": null, + "MinVersion": null, + "MaxVersion": null + }, + { + "FeatureId": "RemoveW11Outlook", + "Label": "Remove the new Outlook for Windows app", + "Category": null, + "Action": "Remove Outlook for Windows", + "RegistryKey": null, + "ApplyText": null, + "UndoAction": null, + "RegistryUndoKey": null, + "MinVersion": null, + "MaxVersion": null + }, + { + "FeatureId": "RemoveGamingApps", + "Label": "Remove the Xbox App and Xbox Gamebar", + "Category": null, + "Action": "Remove Gaming Apps", + "RegistryKey": null, + "ApplyText": null, + "UndoAction": null, + "RegistryUndoKey": null, + "MinVersion": null, + "MaxVersion": null + }, + { + "FeatureId": "RemoveHPApps", + "Label": "Remove HP OEM applications", + "Category": null, + "Action": "Remove HP Apps", + "RegistryKey": null, + "ApplyText": null, + "UndoAction": null, + "RegistryUndoKey": null, + "MinVersion": null, + "MaxVersion": null + }, + { + "FeatureId": "CreateRestorePoint", + "Label": "Create a system restore point", + "Category": null, + "Action": "Create Restore Point", + "RegistryKey": null, + "ApplyText": null, + "UndoAction": null, + "RegistryUndoKey": null, + "MinVersion": null, + "MaxVersion": null + }, + { + "FeatureId": "DisableTelemetry", + "Label": "telemetry, tracking & targeted ads", + "Category": "Privacy & Suggested Content", + "Action": "Disable", + "RegistryKey": "Disable_Telemetry.reg", + "ApplyText": "> Disabling telemetry, diagnostic data, activity history, app-launch tracking and targeted ads...", + "UndoAction": "Enable", + "RegistryUndoKey": "Enable_Telemetry.reg", + "MinVersion": null, + "MaxVersion": null + }, + { + "FeatureId": "DisableSuggestions", + "Label": "tips, tricks & suggested content", + "Category": "Privacy & Suggested Content", + "Action": "Disable", + "RegistryKey": "Disable_Windows_Suggestions.reg", + "ApplyText": "> Disabling tips, tricks, suggestions and ads across Windows...", + "UndoAction": "Enable", + "RegistryUndoKey": "Enable_Windows_Suggestions.reg", + "MinVersion": null, + "MaxVersion": null + }, + { + "FeatureId": "DisableLockscreenTips", + "Label": "tips & tricks on the lock screen", + "Category": "Privacy & Suggested Content", + "Action": "Disable", + "RegistryKey": "Disable_Lockscreen_Tips.reg", + "ApplyText": "> Disabling tips & tricks on the lock screen...", + "UndoAction": "Enable", + "RegistryUndoKey": "Enable_Lockscreen_Tips.reg", + "MinVersion": null, + "MaxVersion": null + }, + { + "FeatureId": "DisableDesktopSpotlight", + "Label": "Windows Spotlight for desktop", + "Category": "Privacy & Suggested Content", + "Action": "Disable", + "RegistryKey": "Disable_Desktop_Spotlight.reg", + "ApplyText": "> Disabling the 'Windows Spotlight' desktop background option...", + "UndoAction": "Enable", + "RegistryUndoKey": "Enable_Desktop_Spotlight.reg", + "MinVersion": null, + "MaxVersion": null + }, + { + "FeatureId": "DisableEdgeAds", + "Label": "ads, suggestions and newsfeed in Edge", + "Category": "Privacy & Suggested Content", + "Action": "Disable", + "RegistryKey": "Disable_Edge_Ads_And_Suggestions.reg", + "ApplyText": "> Disabling ads, suggestions and the MSN news feed in Microsoft Edge...", + "UndoAction": "Enable", + "RegistryUndoKey": "Enable_Edge_Ads_And_Suggestions.reg", + "MinVersion": null, + "MaxVersion": null + }, + { + "FeatureId": "DisableCopilot", + "Label": "Microsoft Copilot", + "Category": "AI", + "Action": "Disable", + "RegistryKey": "Disable_Copilot.reg", + "ApplyText": "> Disabling Microsoft Copilot...", + "UndoAction": "Enable", + "RegistryUndoKey": "Enable_Copilot.reg", + "MinVersion": 22621, + "MaxVersion": null + }, + { + "FeatureId": "DisableRecall", + "Label": "Windows Recall", + "Category": "AI", + "Action": "Disable", + "RegistryKey": "Disable_AI_Recall.reg", + "ApplyText": "> Disabling Windows Recall...", + "UndoAction": "Enable", + "RegistryUndoKey": "Enable_AI_Recall.reg", + "MinVersion": 22621, + "MaxVersion": null + }, + { + "FeatureId": "DisableClickToDo", + "Label": "Click To Do, AI text & image analysis", + "Category": "AI", + "Action": "Disable", + "RegistryKey": "Disable_Click_to_Do.reg", + "ApplyText": "> Disabling Click to Do...", + "UndoAction": "Enable", + "RegistryUndoKey": "Enable_Click_to_Do.reg", + "MinVersion": 22621, + "MaxVersion": null + }, + { + "FeatureId": "DisableDVR", + "Label": "Xbox game/screen recording", + "Category": "Gaming", + "Action": "Disable", + "RegistryKey": "Disable_DVR.reg", + "ApplyText": "> Disabling Xbox game/screen recording...", + "UndoAction": "Enable", + "RegistryUndoKey": "Enable_DVR.reg", + "MinVersion": null, + "MaxVersion": null + }, + { + "FeatureId": "DisableGameBarIntegration", + "Label": "Game Bar integration", + "Category": "Gaming", + "Action": "Disable", + "RegistryKey": "Disable_Game_Bar_Integration.reg", + "ApplyText": "> Disabling Game Bar integration...", + "UndoAction": "Enable", + "RegistryUndoKey": "Enable_Game_Bar_Integration.reg", + "MinVersion": null, + "MaxVersion": null + }, + { + "FeatureId": "ClearStart", + "Action": "Clear Start Menu", + "Label": "Remove all pinned apps from the start menu for this user only", + "Category": "Start Menu", + "RegistryKey": null, + "ApplyText": null, + "UndoAction": null, + "RegistryUndoKey": null, + "MinVersion": 22621, + "MaxVersion": null + }, + { + "FeatureId": "ClearStartAllUsers", + "Action": "Clear Start Menu (All Users)", + "Label": "Remove all pinned apps from the start menu for all existing and new users", + "Category": "Start Menu", + "RegistryKey": null, + "ApplyText": null, + "UndoAction": null, + "RegistryUndoKey": null, + "MinVersion": 22621, + "MaxVersion": null + }, + { + "FeatureId": "ReplaceStart", + "Action": "Replace Start Menu", + "Label": "Replace the start menu layout for this user only with the provided template file", + "Category": null, + "RegistryKey": null, + "ApplyText": null, + "UndoAction": null, + "RegistryUndoKey": null, + "MinVersion": 22621, + "MaxVersion": null + }, + { + "FeatureId": "ReplaceStartAllUsers", + "Action": "Replace Start Menu (All Users)", + "Label": "Replace the start menu layout for all existing and new users with the provided template file", + "Category": null, + "RegistryKey": null, + "ApplyText": null, + "UndoAction": null, + "RegistryUndoKey": null, + "MinVersion": 22621, + "MaxVersion": null + }, + { + "FeatureId": "DisableStartRecommended", + "Label": "recommended section in the start menu", + "Category": "Start Menu", + "Action": "Hide", + "RegistryKey": "Disable_Start_Recommended.reg", + "ApplyText": "> Disabling the start menu recommended section...", + "UndoAction": "Show", + "RegistryUndoKey": "Enable_Start_Recommended.reg", + "MinVersion": 22621, + "MaxVersion": 26199 + }, + { + "FeatureId": "DisableBing", + "Label": "Bing web search & Copilot integration", + "Category": "Start Menu", + "Action": "Disable", + "RegistryKey": "Disable_Bing_Cortana_In_Search.reg", + "ApplyText": "> Disabling Bing web search & Copilot integration in Windows search...", + "UndoAction": "Enable", + "RegistryUndoKey": "Enable_Bing_Cortana_In_Search.reg", + "MinVersion": null, + "MaxVersion": null + }, + { + "FeatureId": "DisableStartPhoneLink", + "Label": "Phone Link integration in the start menu", + "Category": "Start Menu", + "Action": "Disable", + "RegistryKey": "Disable_Phone_Link_In_Start.reg", + "ApplyText": "> Disabling the Phone Link mobile devices integration in the start menu...", + "UndoAction": "Enable", + "RegistryUndoKey": "Enable_Phone_Link_In_Start.reg", + "MinVersion": 22621, + "MaxVersion": null + }, + { + "FeatureId": "DisableSettings365Ads", + "Label": "Microsoft 365 ads in Settings Home", + "Category": "Privacy & Suggested Content", + "Action": "Hide", + "RegistryKey": "Disable_Settings_365_Ads.reg", + "ApplyText": "> Disabling Microsoft 365 ads in Settings Home...", + "UndoAction": "Show", + "RegistryUndoKey": "Enable_Settings_365_Ads.reg", + "MinVersion": null, + "MaxVersion": null + }, + { + "FeatureId": "DisableSettingsHome", + "Label": "Settings 'Home' page", + "Category": "Privacy & Suggested Content", + "Action": "Hide", + "RegistryKey": "Disable_Settings_Home.reg", + "ApplyText": "> Disabling the Settings Home page...", + "UndoAction": "Show", + "RegistryUndoKey": "Enable_Settings_Home.reg", + "MinVersion": null, + "MaxVersion": null + }, + { + "FeatureId": "DisableEdgeAI", + "Label": "AI features in Microsoft Edge", + "Category": "AI", + "Action": "Disable", + "RegistryKey": "Disable_Edge_AI_Features.reg", + "ApplyText": "> Disabling AI features in Microsoft Edge...", + "UndoAction": "Enable", + "RegistryUndoKey": "Enable_Edge_AI_Features.reg", + "MinVersion": 22621, + "MaxVersion": null + }, + { + "FeatureId": "DisablePaintAI", + "Label": "AI features in Paint", + "Category": "AI", + "Action": "Disable", + "RegistryKey": "Disable_Paint_AI_Features.reg", + "ApplyText": "> Disabling AI features in Paint...", + "UndoAction": "Enable", + "RegistryUndoKey": "Enable_Paint_AI_Features.reg", + "MinVersion": 22621, + "MaxVersion": null + }, + { + "FeatureId": "DisableNotepadAI", + "Label": "AI features in Notepad", + "Category": "AI", + "Action": "Disable", + "RegistryKey": "Disable_Notepad_AI_Features.reg", + "ApplyText": "> Disabling AI features in Notepad...", + "UndoAction": "Enable", + "RegistryUndoKey": "Enable_Notepad_AI_Features.reg", + "MinVersion": 22621, + "MaxVersion": null + }, + { + "FeatureId": "EnableDarkMode", + "Label": "theme for system and apps", + "Category": "Appearance", + "Action": "Enable dark", + "RegistryKey": "Enable_Dark_Mode.reg", + "ApplyText": "> Enabling dark mode for system and apps...", + "UndoAction": "Disable light", + "RegistryUndoKey": "Enable_Light_Mode.reg", + "MinVersion": null, + "MaxVersion": null + }, + { + "FeatureId": "DisableDragTray", + "Label": "'Drag Tray' for sharing & moving files", + "Category": "System", + "Action": "Disable", + "RegistryKey": "Disable_Share_Drag_Tray.reg", + "ApplyText": "> Disabling Drag Tray...", + "UndoAction": "Enable", + "RegistryUndoKey": "Enable_Share_Drag_Tray.reg", + "MinVersion": 26200, + "MaxVersion": null + }, + { + "FeatureId": "RevertContextMenu", + "Label": "context menu style", + "Category": "System", + "Action": "Use classic Windows 10", + "RegistryKey": "Disable_Show_More_Options_Context_Menu.reg", + "ApplyText": "> Restoring the classic Windows 10 style context menu...", + "UndoAction": "Use modern Windows 11", + "RegistryUndoKey": "Enable_W11_Style_Context_Menu.reg", + "MinVersion": 22000, + "MaxVersion": null + }, + { + "FeatureId": "DisableMouseAcceleration", + "Label": "Enhance Pointer Precision (mouse acceleration)", + "Category": "System", + "Action": "Disable", + "RegistryKey": "Disable_Enhance_Pointer_Precision.reg", + "ApplyText": "> Turning off Enhanced Pointer Precision...", + "UndoAction": "Enable", + "RegistryUndoKey": "Enable_Enhance_Pointer_Precision.reg", + "MinVersion": null, + "MaxVersion": null + }, + { + "FeatureId": "DisableStickyKeys", + "Label": "Sticky Keys keyboard shortcut", + "Category": "System", + "Action": "Disable", + "RegistryKey": "Disable_Sticky_Keys_Shortcut.reg", + "ApplyText": "> Disabling the Sticky Keys keyboard shortcut...", + "UndoAction": "Enable", + "RegistryUndoKey": "Enable_Sticky_Keys_Shortcut.reg", + "MinVersion": 26100, + "MaxVersion": null + }, + { + "FeatureId": "TaskbarAlignLeft", + "Label": "taskbar alignment", + "Category": "Taskbar", + "Priority": 1, + "Action": "Left", + "RegistryKey": "Align_Taskbar_Left.reg", + "ApplyText": "> Aligning taskbar buttons to the left...", + "UndoAction": "Center", + "RegistryUndoKey": "Align_Taskbar_Center.reg", + "MinVersion": 22000, + "MaxVersion": null + }, + { + "FeatureId": "HideSearchTb", + "Label": "Hide search icon from the taskbar", + "Category": "Taskbar", + "Action": "Hide Search", + "RegistryKey": "Hide_Search_Taskbar.reg", + "ApplyText": "> Hiding the search icon from the taskbar...", + "UndoAction": "Show Search Box", + "RegistryUndoKey": "Show_Search_Box.reg", + "MinVersion": 22000, + "MaxVersion": null + }, + { + "FeatureId": "ShowSearchIconTb", + "Label": "Show search icon on the taskbar", + "Category": "Taskbar", + "Action": "Show Search Icon", + "RegistryKey": "Show_Search_Box.reg", + "ApplyText": "> Changing taskbar search to icon only...", + "UndoAction": "Show Search Box", + "RegistryUndoKey": "Show_Search_Box.reg", + "MinVersion": 22000, + "MaxVersion": null + }, + { + "FeatureId": "ShowSearchLabelTb", + "Label": "Show search icon with label on the taskbar", + "Category": "Taskbar", + "Action": "Show Search Label", + "RegistryKey": "Show_Search_Box.reg", + "ApplyText": "> Changing taskbar search to icon with label...", + "UndoAction": "Show Search Box", + "RegistryUndoKey": "Show_Search_Box.reg", + "MinVersion": 22000, + "MaxVersion": null + }, + { + "FeatureId": "ShowSearchBoxTb", + "Label": "Show search box on the taskbar", + "Category": "Taskbar", + "Action": "Show Search Box", + "RegistryKey": "Show_Search_Box.reg", + "ApplyText": "> Changing taskbar search to search box...", + "UndoAction": null, + "RegistryUndoKey": null, + "MinVersion": 22000, + "MaxVersion": null + }, + { + "FeatureId": "HideTaskview", + "Label": "'Task view' button on the taskbar", + "Category": "Taskbar", + "Priority": 3, + "Action": "Hide", + "RegistryKey": "Hide_Taskview_Taskbar.reg", + "ApplyText": "> Hiding the taskview button from the taskbar...", + "UndoAction": "Show", + "RegistryUndoKey": "Show_Taskview_Taskbar.reg", + "MinVersion": 22000, + "MaxVersion": null + }, + { + "FeatureId": "DisableWidgets", + "Label": "widgets on the taskbar & lock screen", + "Category": "Taskbar", + "Priority": 4, + "Action": "Disable", + "RegistryKey": "Disable_Widgets_Service.reg", + "ApplyText": "> Disabling widgets on the taskbar & lock screen...", + "UndoAction": "Enable", + "RegistryUndoKey": "Enable_Widgets_Service.reg", + "MinVersion": null, + "MaxVersion": null + }, + { + "FeatureId": "HideChat", + "Label": "Chat (meet now) icon on the taskbar", + "Category": "Taskbar", + "Priority": 5, + "Action": "Hide", + "RegistryKey": "Disable_Chat_Taskbar.reg", + "ApplyText": "> Hiding the chat icon from the taskbar...", + "UndoAction": "Show", + "RegistryUndoKey": "Enable_Chat_Taskbar.reg", + "MinVersion": null, + "MaxVersion": 22621 + }, + { + "FeatureId": "DisableFastStartup", + "Label": "fast start-up", + "Category": "System", + "Action": "Disable", + "RegistryKey": "Disable_Fast_Startup.reg", + "ApplyText": "> Disabling Fast Start-up...", + "UndoAction": "Enable", + "RegistryUndoKey": "Enable_Fast_Startup.reg", + "MinVersion": null, + "MaxVersion": null + }, + { + "FeatureId": "DisableModernStandbyNetworking", + "Label": "Modern Standby network connectivity", + "Category": "System", + "Action": "Disable", + "RegistryKey": "Disable_Modern_Standby_Networking.reg", + "ApplyText": "> Disabling network connectivity during Modern Standby...", + "UndoAction": "Enable", + "RegistryUndoKey": "Enable_Modern_Standby_Networking.reg", + "MinVersion": 22000, + "MaxVersion": null + }, + { + "FeatureId": "EnableEndTask", + "Label": "'End Task' option in taskbar context menu", + "Category": "Taskbar", + "Priority": 6, + "Action": "Show", + "RegistryKey": "Enable_End_Task.reg", + "ApplyText": "> Enabling the 'End Task' option in the taskbar right click menu...", + "UndoAction": "Hide", + "RegistryUndoKey": "Disable_End_Task.reg", + "MinVersion": 22631, + "MaxVersion": null + }, + { + "FeatureId": "EnableLastActiveClick", + "Label": "'Last Active Click' behavior for taskbar apps", + "Category": "Taskbar", + "Priority": 7, + "Action": "Enable", + "RegistryKey": "Enable_Last_Active_Click.reg", + "ApplyText": "> Enabling the 'Last Active Click' behavior in the taskbar app area...", + "UndoAction": "Disable", + "RegistryUndoKey": "Disable_Last_Active_Click.reg", + "MinVersion": 22000, + "MaxVersion": null + }, + { + "FeatureId": "CombineTaskbarAlways", + "Label": "Always combine taskbar buttons and hide labels for the main display", + "Category": "Taskbar", + "Action": "Combine Taskbar Always", + "RegistryKey": "Combine_Taskbar_Always.reg", + "ApplyText": "> Setting the taskbar on the main display to always combine buttons and hide labels...", + "UndoAction": null, + "RegistryUndoKey": null, + "MinVersion": 22000, + "MaxVersion": null + }, + { + "FeatureId": "CombineMMTaskbarAlways", + "Label": "Always combine taskbar buttons and hide labels for secondary displays", + "Category": "Taskbar", + "Action": "Combine Multi-Monitor Taskbar Always", + "RegistryKey": "Combine_MMTaskbar_Always.reg", + "ApplyText": "> Setting the taskbar on secondary displays to always combine buttons and hide labels...", + "UndoAction": null, + "RegistryUndoKey": null, + "MinVersion": 22000, + "MaxVersion": null + }, + { + "FeatureId": "CombineTaskbarWhenFull", + "Label": "Combine taskbar buttons and hide labels when taskbar is full for the main display", + "Category": "Taskbar", + "Action": "Combine Taskbar When Full", + "RegistryKey": "Combine_Taskbar_When_Full.reg", + "ApplyText": "> Setting the taskbar on the main display to only combine buttons and hide labels when the taskbar is full...", + "UndoAction": "Combine Taskbar Always", + "RegistryUndoKey": "Combine_Taskbar_Always.reg", + "MinVersion": 22000, + "MaxVersion": null + }, + { + "FeatureId": "CombineMMTaskbarWhenFull", + "Label": "Combine taskbar buttons and hide labels when taskbar is full for secondary displays", + "Category": "Taskbar", + "Action": "Combine Multi-Monitor Taskbar When Full", + "RegistryKey": "Combine_MMTaskbar_When_Full.reg", + "ApplyText": "> Setting the taskbar on secondary displays to only combine buttons and hide labels when the taskbar is full...", + "UndoAction": "Combine Multi-Monitor Taskbar Always", + "RegistryUndoKey": "Combine_MMTaskbar_Always.reg", + "MinVersion": 22000, + "MaxVersion": null + }, + { + "FeatureId": "CombineTaskbarNever", + "Label": "Never combine taskbar buttons and show labels for the main display", + "Category": "Taskbar", + "Action": "Never Combine Taskbar", + "RegistryKey": "Combine_Taskbar_Never.reg", + "ApplyText": "> Setting the taskbar on the main display to never combine buttons or hide labels...", + "UndoAction": "Combine Taskbar Always", + "RegistryUndoKey": "Combine_Taskbar_Always.reg", + "MinVersion": 22000, + "MaxVersion": null + }, + { + "FeatureId": "CombineMMTaskbarNever", + "Label": "Never combine taskbar buttons and show labels for secondary displays", + "Category": "Taskbar", + "Action": "Never Combine Multi-Monitor Taskbar", + "RegistryKey": "Combine_MMTaskbar_Never.reg", + "ApplyText": "> Setting the taskbar on secondary displays to never combine buttons or hide labels...", + "UndoAction": "Combine Multi-Monitor Taskbar Always", + "RegistryUndoKey": "Combine_MMTaskbar_Always.reg", + "MinVersion": 22000, + "MaxVersion": null + }, + { + "FeatureId": "MMTaskbarModeAll", + "Label": "Show app icons on all taskbars", + "Category": "Taskbar", + "Action": "Show All Taskbar Icons", + "RegistryKey": "MMTaskbarMode_All.reg", + "ApplyText": "> Setting the taskbar to show app icons on all taskbars...", + "UndoAction": null, + "RegistryUndoKey": null, + "MinVersion": 22000, + "MaxVersion": null + }, + { + "FeatureId": "MMTaskbarModeMainActive", + "Label": "Show app icons on main taskbar and on taskbar where the windows is open", + "Category": "Taskbar", + "Action": "Show Taskbar Icons Main + Active", + "RegistryKey": "MMTaskbarMode_Main_Active.reg", + "ApplyText": "> Setting the taskbar to show app icons on main taskbar and on taskbar where the windows is open...", + "UndoAction": "Show All Taskbar Icons", + "RegistryUndoKey": "MMTaskbarMode_All.reg", + "MinVersion": 22000, + "MaxVersion": null + }, + { + "FeatureId": "MMTaskbarModeActive", + "Label": "Show app icons only on taskbar where the window is open", + "Category": "Taskbar", + "Action": "Show Taskbar Icons Active Only", + "RegistryKey": "MMTaskbarMode_Active.reg", + "ApplyText": "> Setting the taskbar to only show app icons on the taskbar where the window is open...", + "UndoAction": "Show All Taskbar Icons", + "RegistryUndoKey": "MMTaskbarMode_All.reg", + "MinVersion": 22000, + "MaxVersion": null + }, + { + "FeatureId": "ExplorerToHome", + "Label": "Change the default location that File Explorer opens to 'Home'", + "Category": "File Explorer", + "Action": "Explorer to Home", + "RegistryKey": "Launch_File_Explorer_To_Home.reg", + "ApplyText": "> Changing the default location that File Explorer opens to, to 'Home'...", + "UndoAction": null, + "RegistryUndoKey": null, + "MinVersion": null, + "MaxVersion": null + }, + { + "FeatureId": "ExplorerToThisPC", + "Label": "Change the default location that File Explorer opens to 'This PC'", + "Category": "File Explorer", + "Action": "Explorer to This PC", + "RegistryKey": "Launch_File_Explorer_To_This_PC.reg", + "ApplyText": "> Changing the default location that File Explorer opens to, to 'This PC'...", + "UndoAction": "Explorer to Home", + "RegistryUndoKey": "Launch_File_Explorer_To_Home.reg", + "MinVersion": null, + "MaxVersion": null + }, + { + "FeatureId": "ExplorerToDownloads", + "Label": "Change the default location that File Explorer opens to 'Downloads'", + "Category": "File Explorer", + "Action": "Explorer to Downloads", + "RegistryKey": "Launch_File_Explorer_To_Downloads.reg", + "ApplyText": "> Changing the default location that File Explorer opens to, to 'Downloads'...", + "UndoAction": "Explorer to Home", + "RegistryUndoKey": "Launch_File_Explorer_To_Home.reg", + "MinVersion": null, + "MaxVersion": null + }, + { + "FeatureId": "ExplorerToOneDrive", + "Label": "Change the default location that File Explorer opens to 'OneDrive'", + "Category": "File Explorer", + "Action": "Explorer to OneDrive", + "RegistryKey": "Launch_File_Explorer_To_OneDrive.reg", + "ApplyText": "> Changing the default location that File Explorer opens to, to 'OneDrive'...", + "UndoAction": "Explorer to Home", + "RegistryUndoKey": "Launch_File_Explorer_To_Home.reg", + "MinVersion": null, + "MaxVersion": null + }, + { + "FeatureId": "ShowKnownFileExt", + "Label": "file extensions for known file types", + "Category": "File Explorer", + "Action": "Show", + "RegistryKey": "Show_Extensions_For_Known_File_Types.reg", + "ApplyText": "> Enabling file extensions for known file types...", + "UndoAction": "Hide", + "RegistryUndoKey": "Hide_Extensions_For_Known_File_Types.reg", + "MinVersion": null, + "MaxVersion": null + }, + { + "FeatureId": "ShowHiddenFolders", + "Label": "hidden files, folders and drives", + "Category": "File Explorer", + "Action": "Show", + "RegistryKey": "Show_Hidden_Folders.reg", + "ApplyText": "> Unhiding hidden files, folders and drives...", + "UndoAction": "Hide", + "RegistryUndoKey": "Hide_Hidden_Folders.reg", + "MinVersion": null, + "MaxVersion": null + }, + { + "FeatureId": "HideHome", + "Label": "'Home' from navigation pane", + "Category": "File Explorer", + "Action": "Hide", + "RegistryKey": "Hide_Home_from_Explorer.reg", + "ApplyText": "> Hiding the home section from the File Explorer navigation pane...", + "UndoAction": "Show", + "RegistryUndoKey": "Show_Home_in_Explorer.reg", + "MinVersion": 22000, + "MaxVersion": null + }, + { + "FeatureId": "HideGallery", + "Label": "'Gallery' from navigation pane", + "Category": "File Explorer", + "Action": "Hide", + "RegistryKey": "Hide_Gallery_from_Explorer.reg", + "ApplyText": "> Hiding the gallery section from the File Explorer navigation pane...", + "UndoAction": "Show", + "RegistryUndoKey": "Show_Gallery_in_Explorer.reg", + "MinVersion": 22000, + "MaxVersion": null + }, + { + "FeatureId": "HideDupliDrive", + "Label": "duplicate removable drive entries", + "Category": "File Explorer", + "Action": "Hide", + "RegistryKey": "Hide_duplicate_removable_drives_from_navigation_pane_of_File_Explorer.reg", + "ApplyText": "> Hiding duplicate removable drive entries from the File Explorer navigation pane...", + "UndoAction": "Show", + "RegistryUndoKey": "Show_duplicate_removable_drives_in_navigation_pane_of_File_Explorer.reg", + "MinVersion": null, + "MaxVersion": null + }, + { + "FeatureId": "AddFoldersToThisPC", + "Label": "common folders back to 'This PC' page", + "Category": "File Explorer", + "Action": "Add", + "RegistryKey": "Add_All_Folders_Under_This_PC.reg", + "ApplyText": "> Adding all common folders (Desktop, Downloads, etc.) back to 'This PC' in File Explorer...", + "UndoAction": "Remove", + "RegistryUndoKey": "Remove_All_Folders_Under_This_PC.reg", + "MinVersion": 22000, + "MaxVersion": null + }, + { + "FeatureId": "DisableTransparency", + "Label": "transparency effects", + "Category": "Appearance", + "Action": "Disable", + "RegistryKey": "Disable_Transparency.reg", + "ApplyText": "> Disabling transparency effects...", + "UndoAction": "Enable", + "RegistryUndoKey": "Enable_Transparency.reg", + "MinVersion": null, + "MaxVersion": null + }, + { + "FeatureId": "DisableAnimations", + "Label": "animations and visual effects", + "Category": "Appearance", + "Action": "Disable", + "RegistryKey": "Disable_Animations.reg", + "ApplyText": "> Disabling animations and visual effects...", + "UndoAction": "Enable", + "RegistryUndoKey": "Enable_Animations.reg", + "MinVersion": null, + "MaxVersion": null + }, + { + "FeatureId": "ForceRemoveEdge", + "Label": "Forcefully uninstall Microsoft Edge. NOT RECOMMENDED!", + "Category": null, + "Action": "Force Remove Edge", + "RegistryKey": null, + "ApplyText": null, + "UndoAction": null, + "RegistryUndoKey": null, + "MinVersion": null, + "MaxVersion": null + }, + { + "FeatureId": "HideIncludeInLibrary", + "Label": "'Include in library' option in the context menu", + "Category": "File Explorer", + "Action": "Hide", + "RegistryKey": "Disable_Include_in_library_from_context_menu.reg", + "ApplyText": "> Hiding 'Include in library' in the context menu...", + "UndoAction": "Show", + "RegistryUndoKey": "Enable_Include_in_library_in_context_menu.reg", + "MinVersion": null, + "MaxVersion": 21999 + }, + { + "FeatureId": "HideGiveAccessTo", + "Label": "'Give access to' option in the context menu", + "Category": "File Explorer", + "Action": "Hide", + "RegistryKey": "Disable_Give_access_to_context_menu.reg", + "ApplyText": "> Hiding 'Give access to' in the context menu...", + "UndoAction": "Show", + "RegistryUndoKey": "Enable_Give_access_to_context_menu.reg", + "MinVersion": null, + "MaxVersion": 21999 + }, + { + "FeatureId": "HideShare", + "Label": "'Share' option in the context menu", + "Category": "File Explorer", + "Action": "Hide", + "RegistryKey": "Disable_Share_from_context_menu.reg", + "ApplyText": "> Hiding 'Share' in the context menu...", + "UndoAction": "Show", + "RegistryUndoKey": "Enable_Share_in_context_menu.reg", + "MinVersion": null, + "MaxVersion": 21999 + }, + { + "FeatureId": "HideOnedrive", + "Label": "'OneDrive' folder from navigation pane", + "Category": "File Explorer", + "Action": "Hide", + "RegistryKey": "Hide_Onedrive_Folder.reg", + "ApplyText": "> Hiding the OneDrive folder from the File Explorer navigation pane...", + "UndoAction": "Show", + "RegistryUndoKey": "Show_Onedrive_Folder.reg", + "MinVersion": null, + "MaxVersion": 21999 + }, + { + "FeatureId": "Hide3dObjects", + "Label": "'3D objects' folder under 'This PC'", + "Category": "File Explorer", + "Action": "Hide", + "RegistryKey": "Hide_3D_Objects_Folder.reg", + "ApplyText": "> Hiding the 3D objects folder from the File Explorer navigation pane...", + "UndoAction": "Show", + "RegistryUndoKey": "Show_3D_Objects_Folder.reg", + "MinVersion": null, + "MaxVersion": 21999 + }, + { + "FeatureId": "HideMusic", + "Label": "'Music' folder under 'This PC'", + "Category": "File Explorer", + "Action": "Hide", + "RegistryKey": "Hide_Music_Folder.reg", + "ApplyText": "> Hiding the music folder from the File Explorer navigation pane...", + "UndoAction": "Show", + "RegistryUndoKey": "Show_Music_Folder.reg", + "MinVersion": null, + "MaxVersion": 21999 + }, + { + "FeatureId": "DisableBraveBloat", + "Label": "bloat in Brave browser (AI, Crypto, etc.)", + "Category": "Other", + "Action": "Disable", + "RegistryKey": "Disable_Brave_Bloat.reg", + "ApplyText": "> Disabling Brave AI, Crypto, News, Rewards, Talk and VPN in Brave browser...", + "UndoAction": "Enable", + "RegistryUndoKey": "Enable_Brave_Bloat.reg", + "MinVersion": null, + "MaxVersion": null + } + ] +} diff --git a/Assets/Images/menu.png b/Assets/Images/menu.png new file mode 100644 index 0000000..c9332e5 Binary files /dev/null and b/Assets/Images/menu.png differ diff --git a/Assets/Images/wiki.png b/Assets/Images/wiki.png new file mode 100644 index 0000000..87e7e0c Binary files /dev/null and b/Assets/Images/wiki.png differ diff --git a/Assets/Menus/Info b/Assets/Menus/Info deleted file mode 100755 index 16cc4de..0000000 --- a/Assets/Menus/Info +++ /dev/null @@ -1,87 +0,0 @@ -Win11Debloat is a lightweight, easy to use PowerShell script that allows you to quickly -declutter and improve your Windows experience. It can remove pre-installed bloatware apps, -disable telemetry, remove intrusive interface elements and much more. - -------------------------------------------------------------------------------------------- - All Features -------------------------------------------------------------------------------------------- -App Removal -- Remove a wide variety of preinstalled apps. -- Remove or replace all pinned apps from start for the current user, or for all existing & new users. (W11 only) - -Telemetry, Tracking & Suggested Content -- Disable telemetry, diagnostic data, activity history, app-launch tracking & targeted ads. -- Disable tips, tricks, suggestions & ads across Windows. -- Disable ads, suggestions and the MSN news feed in Microsoft Edge. -- Disable the 'Windows Spotlight' desktop background option. - -Bing Web Search, Copilot & AI Features -- Disable & remove Bing web search, Bing AI and Cortana from Windows search. -- Disable & remove Microsoft Copilot. -- Disable Windows Recall. (W11 only) -- Disable Click to Do, AI text & image analysis tool. (W11 only) -- Disable AI Features in Edge. (W11 only) -- Disable AI Features in Paint. (W11 only) -- Disable AI Features in Notepad. (W11 only) - -Personalisation -- Enable dark mode for system and apps. -- Disable transparency, animations and visual effects. -- Turn off Enhance Pointer Precision, also known as mouse acceleration. -- Disable the Sticky Keys keyboard shortcut. (W11 only) -- Restore the old Windows 10 style context menu. (W11 only) -- Hide the 'Include in library', 'Give access to' and 'Share' options from the context menu. (W10 only) - -File Explorer -- Change the default location that File Explorer opens to. -- Show hidden files, folders and drives. -- Show file extensions for known file types. -- Add all common folders (Desktop, Downloads, Etc.) back to 'This PC' in File Explorer. (W11 only) -- Hide the Home or Gallery section from the File Explorer navigation pane. (W11 only) -- Hide the 3D objects, music or OneDrive folder from the File Explorer navigation pane. (W10 only) -- Hide duplicate removable drive entries from the File Explorer navigation pane. - -Taskbar -- Align taskbar icons to the left. (W11 only) -- Choose combine mode for taskbar buttons and labels. (W11 only) -- Choose how app icons are shown on the taskbar when using multiple monitors. (W11 only) -- Hide or change the search icon/box on the taskbar. (W11 only) -- Hide the taskview button from the taskbar. (W11 only) -- Disable widgets on the taskbar & lockscreen. -- Hide the chat (meet now) icon from the taskbar. (W10 only) -- Enable the 'End Task' option in the taskbar right click menu. (W11 only) -- Enable the 'Last Active Click' behavior in the taskbar app area. - -Start -- Disable the recommended section in the start menu. (W11 only) -- Disable the Phone Link mobile devices integration in the start menu. (W11 only) - -Other -- Disable Xbox Game Bar integration & game/screen recording. This also disables `ms-gamingoverlay`/`ms-gamebar` popups. -- Disable Fast Start-up to ensure a full shutdown. -- Disable network connectivity during Modern Standby to reduce battery drain. (W11 only) - -Advanced Features -- Option to apply changes to a different user, instead of the currently logged in user. -- Sysprep mode to apply changes to the Windows Default user profile. - -------------------------------------------------------------------------------------------- - Default mode -------------------------------------------------------------------------------------------- -The default mode applies the changes that are recommended for most users. This includes: -- Remove the default selection or your custom selection of apps. -- Disable telemetry, diagnostic data, app-launch tracking & targeted ads. -- Disable tips, tricks, suggestions & ads across Windows. -- Disable ads, suggestions and the MSN news feed in Microsoft Edge. -- Disable & remove Bing web search, Bing AI and Cortana from Windows search. -- Disable & remove Microsoft Copilot. -- Disable Windows Recall. (W11 only) -- Disable Click to Do, AI text & image analysis tool. (W11 only) -- Disable Fast Start-up to ensure a full shutdown. -- Disable network connectivity during Modern Standby to reduce battery drain. (W11 only) -- Show file extensions for known file types. -- Hide the 3D objects folder in Windows Explorer. (W10 only) -- Disable widgets on the taskbar & lockscreen. -- Hide the Chat (meet now) icon from the taskbar. (W10 only) - - diff --git a/Assets/Schemas/AppSelectionWindow.xaml b/Assets/Schemas/AppSelectionWindow.xaml new file mode 100644 index 0000000..b188c60 --- /dev/null +++ b/Assets/Schemas/AppSelectionWindow.xaml @@ -0,0 +1,278 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Assets/menu.png b/Assets/menu.png deleted file mode 100644 index ff76d6f..0000000 Binary files a/Assets/menu.png and /dev/null differ diff --git a/DefaultSettings.json b/DefaultSettings.json index 875ba25..48648c8 100644 --- a/DefaultSettings.json +++ b/DefaultSettings.json @@ -49,6 +49,10 @@ "Name": "ShowKnownFileExt", "Value": true }, + { + "Name": "DisableDragTray", + "Value": true + }, { "Name": "DisableFastStartup", "Value": true @@ -60,202 +64,6 @@ { "Name": "DisableModernStandbyNetworking", "Value": true - }, - { - "Name": "DisableDVR", - "Value": false - }, - { - "Name": "DisableGameBarIntegration", - "Value": false - }, - { - "Name": "ClearStart", - "Value": false - }, - { - "Name": "ClearStartAllUsers", - "Value": false - }, - { - "Name": "DisableStartRecommended", - "Value": false - }, - { - "Name": "DisableStartPhoneLink", - "Value": false - }, - { - "Name": "DisableSettings365Ads", - "Value": false - }, - { - "Name": "DisableEdgeAI", - "Value": false - }, - { - "Name": "DisablePaintAI", - "Value": false - }, - { - "Name": "DisableNotepadAI", - "Value": false - }, - { - "Name": "EnableDarkMode", - "Value": false - }, - { - "Name": "RevertContextMenu", - "Value": false - }, - { - "Name": "DisableMouseAcceleration", - "Value": false - }, - { - "Name": "DisableStickyKeys", - "Value": false - }, - { - "Name": "DisableDesktopSpotlight", - "Value": false - }, - { - "Name": "TaskbarAlignLeft", - "Value": false - }, - { - "Name": "CombineTaskbarAlways", - "Value": false - }, - { - "Name": "CombineMMTaskbarAlways", - "Value": false - }, - { - "Name": "CombineTaskbarWhenFull", - "Value": false - }, - { - "Name": "CombineMMTaskbarWhenFull", - "Value": false - }, - { - "Name": "CombineTaskbarNever", - "Value": false - }, - { - "Name": "CombineMMTaskbarNever", - "Value": false - }, - { - "Name": "MMTaskbarModeAll", - "Value": false - }, - { - "Name": "MMTaskbarModeMainActive", - "Value": false - }, - { - "Name": "MMTaskbarModeActive", - "Value": false - }, - { - "Name": "HideSearchTb", - "Value": false - }, - { - "Name": "ShowSearchIconTb", - "Value": false - }, - { - "Name": "ShowSearchLabelTb", - "Value": false - }, - { - "Name": "ShowSearchBoxTb", - "Value": false - }, - { - "Name": "HideTaskview", - "Value": false - }, - { - "Name": "EnableEndTask", - "Value": false - }, - { - "Name": "EnableLastActiveClick", - "Value": false - }, - { - "Name": "ShowHiddenFolders", - "Value": false - }, - { - "Name": "ExplorerToHome", - "Value": false - }, - { - "Name": "ExplorerToThisPC", - "Value": false - }, - { - "Name": "ExplorerToDownloads", - "Value": false - }, - { - "Name": "ExplorerToOneDrive", - "Value": false - }, - { - "Name": "AddFoldersToThisPC", - "Value": false - }, - { - "Name": "HideHome", - "Value": false - }, - { - "Name": "HideGallery", - "Value": false - }, - { - "Name": "HideDupliDrive", - "Value": false - }, - { - "Name": "DisableTransparency", - "Value": false - }, - { - "Name": "DisableAnimations", - "Value": false - }, - { - "Name": "ForceRemoveEdge", - "Value": false - }, - { - "Name": "HideIncludeInLibrary", - "Value": false - }, - { - "Name": "HideGiveAccessTo", - "Value": false - }, - { - "Name": "HideShare", - "Value": false - }, - { - "Name": "HideOnedrive", - "Value": false - }, - { - "Name": "HideMusic", - "Value": false } ] } \ No newline at end of file diff --git a/Get.ps1 b/Get.ps1 index 8c4342c..d2ffe45 100644 --- a/Get.ps1 +++ b/Get.ps1 @@ -1,4 +1,5 @@ param ( + [switch]$CLI, [switch]$Silent, [switch]$Verbose, [switch]$Sysprep, @@ -6,7 +7,7 @@ param ( [string]$User, [switch]$NoRestartExplorer, [switch]$CreateRestorePoint, - [switch]$RunAppsListGenerator, [switch]$RunAppConfigurator, + [switch]$RunAppsListGenerator, [switch]$RunDefaults, [switch]$RunDefaultsLite, [switch]$RunSavedSettings, @@ -23,11 +24,12 @@ param ( [switch]$DisableTelemetry, [switch]$DisableFastStartup, [switch]$DisableModernStandbyNetworking, - [switch]$DisableBingSearches, [switch]$DisableBing, + [switch]$DisableBing, [switch]$DisableDesktopSpotlight, - [switch]$DisableLockscrTips, [switch]$DisableLockscreenTips, - [switch]$DisableWindowsSuggestions, [switch]$DisableSuggestions, + [switch]$DisableLockscreenTips, + [switch]$DisableSuggestions, [switch]$DisableEdgeAds, + [switch]$DisableBraveBloat, [switch]$DisableSettings365Ads, [switch]$DisableSettingsHome, [switch]$ShowHiddenFolders, @@ -50,8 +52,8 @@ param ( [switch]$DisablePaintAI, [switch]$DisableNotepadAI, [switch]$DisableEdgeAI, - [switch]$DisableWidgets, [switch]$HideWidgets, - [switch]$DisableChat, [switch]$HideChat, + [switch]$DisableWidgets, + [switch]$HideChat, [switch]$EnableEndTask, [switch]$EnableLastActiveClick, [switch]$ClearStart, @@ -59,6 +61,7 @@ param ( [switch]$ClearStartAllUsers, [string]$ReplaceStartAllUsers, [switch]$RevertContextMenu, + [switch]$DisableDragTray, [switch]$DisableMouseAcceleration, [switch]$DisableStickyKeys, [switch]$HideHome, @@ -68,12 +71,12 @@ param ( [switch]$ExplorerToDownloads, [switch]$ExplorerToOneDrive, [switch]$AddFoldersToThisPC, - [switch]$DisableOnedrive, [switch]$HideOnedrive, - [switch]$Disable3dObjects, [switch]$Hide3dObjects, - [switch]$DisableMusic, [switch]$HideMusic, - [switch]$DisableIncludeInLibrary, [switch]$HideIncludeInLibrary, - [switch]$DisableGiveAccessTo, [switch]$HideGiveAccessTo, - [switch]$DisableShare, [switch]$HideShare + [switch]$HideOnedrive, + [switch]$Hide3dObjects, + [switch]$HideMusic, + [switch]$HideIncludeInLibrary, + [switch]$HideGiveAccessTo, + [switch]$HideShare ) # Show error if current powershell environment does not have LanguageMode set to FullLanguage diff --git a/README.md b/README.md index 556e35c..d87f707 100755 --- a/README.md +++ b/README.md @@ -22,7 +22,7 @@ The script also includes many features that system administrators and power users will enjoy. Such as support for Windows Audit mode, the option to make changes to other Windows users and the ability to access all of Win11Debloat's features right from the command-line. Please refer to our [wiki](https://github.com/Raphire/Win11Debloat/wiki/) for more details. -![Win11Debloat Menu](/Assets/menu.png) +![Win11Debloat Menu](/Assets/Images/menu.png) #### Did this script help you? Please consider buying me a cup of coffee to support my work @@ -88,7 +88,7 @@ This method supports command-line parameters to customize the behaviour of the s ## Features -Below is an overview of the key features and functionality offered by Win11Debloat. For more information about what features are included in the default mode please refer to [this section](#default-settings) below. +Below is an overview of the key features and functionality offered by Win11Debloat. Please refer to [the wiki](https://github.com/Raphire/Win11Debloat/wiki/Default-Settings) for more information about the default settings preset. > [!Tip] > All of the changes made by Win11Debloat can easily be reverted and almost all of the apps can be reinstalled through the Microsoft Store. A full guide on how to revert changes can be found [here](https://github.com/Raphire/Win11Debloat/wiki/Reverting-Changes). @@ -96,18 +96,17 @@ Below is an overview of the key features and functionality offered by Win11Deblo #### App Removal - Remove a wide variety of preinstalled apps. Click [here](https://github.com/Raphire/Win11Debloat/wiki/App-Removal) for more info. -- Remove or replace all pinned apps from start for the current user, or for all existing & new users. (W11 only) -#### Telemetry, Tracking & Suggested Content +#### Privacy & Suggested Content - Disable telemetry, diagnostic data, activity history, app-launch tracking & targeted ads. - Disable tips, tricks, suggestions & ads across Windows. +- Disable 'Windows Spotlight' and tips & tricks on the lock screen. +- Disable 'Windows Spotlight' desktop background option. - Disable ads, suggestions and the MSN news feed in Microsoft Edge. -- Disable the 'Windows Spotlight' desktop background option. -#### Bing Web Search, Copilot & AI Features +#### AI Features -- Disable & remove Bing web search, Bing AI and Cortana from Windows search. - Disable & remove Microsoft Copilot. - Disable Windows Recall. (W11 only) - Disable Click to Do, AI text & image analysis tool. (W11 only) @@ -115,244 +114,61 @@ Below is an overview of the key features and functionality offered by Win11Deblo - Disable AI Features in Paint. (W11 only) - Disable AI Features in Notepad. (W11 only) -#### Personalisation +#### System -- Enable dark mode for system and apps. -- Disable transparency, animations and visual effects. +- Disable the Drag Tray for sharing & moving files. (W11 only) +- Restore the old Windows 10 style context menu. (W11 only) - Turn off Enhance Pointer Precision, also known as mouse acceleration. - Disable the Sticky Keys keyboard shortcut. (W11 only) -- Restore the old Windows 10 style context menu. (W11 only) -- Hide the 'Include in library', 'Give access to' and 'Share' options from the context menu. (W10 only) +- Disable fast start-up to ensure a full shutdown. +- Disable network connectivity during Modern Standby to reduce battery drain. (W11 only) + +#### Appearance + +- Enable dark mode for system and apps. +- Disable transparency effects +- Disable animations and visual effects. #### File Explorer - Change the default location that File Explorer opens to. -- Show hidden files, folders and drives. - Show file extensions for known file types. -- Add all common folders (Desktop, Downloads, etc.) back to 'This PC' in File Explorer. (W11 only) +- Show hidden files, folders and drives. - Hide the Home or Gallery section from the File Explorer navigation pane. (W11 only) -- Hide the 3D objects, music or OneDrive folder from the File Explorer navigation pane. (W10 only) - Hide duplicate removable drive entries from the File Explorer navigation pane, so only the entry under 'This PC' remains. +- Add all common folders (Desktop, Downloads, etc.) back to 'This PC' in File Explorer. (W11 only) +- 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) #### Taskbar - Align taskbar icons to the left. (W11 only) -- Choose combine mode for taskbar buttons and labels. (W11 only) -- Choose how app icons are shown on the taskbar when using multiple monitors. (W11 only) - Hide or change the search icon/box on the taskbar. (W11 only) - Hide the taskview button from the taskbar. (W11 only) -- Disable widgets on the taskbar & lockscreen. +- Disable widgets on the taskbar & lock screen. - Hide the chat (meet now) icon from the taskbar. (W10 only) - Enable the 'End Task' option in the taskbar right click menu. (W11 only) - Enable the 'Last Active Click' behavior in the taskbar app area. This allows you to repeatedly click on an application's icon in the taskbar to switch focus between the open windows of that application. +- Choose how app icons are shown on the taskbar when using multiple monitors. (W11 only) +- Choose combine mode for taskbar buttons and labels. (W11 only) #### Start +- 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) +- Disable Bing web search & Copilot integration in Windows search. - Disable the Phone Link mobile devices integration in the start menu. (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. -- Disable Fast Start-up to ensure a full shutdown. -- Disable network connectivity during Modern Standby to reduce battery drain. (W11 only) +- Disable bloat in Brave browser (AI, Crypto, News, etc.) #### Advanced Features - Option to [apply changes to a different user](https://github.com/Raphire/Win11Debloat/wiki/Advanced-Features#running-as-another-user), instead of the currently logged in user. - [Sysprep mode](https://github.com/Raphire/Win11Debloat/wiki/Advanced-Features#sysprep-mode) to apply changes to the Windows Default user profile. Which ensures, all new users will have the changes automatically applied to them. -### Default Settings - -Win11Debloat's default mode allows you to quickly and easily apply the changes that are recommended for most people. This includes removing many annoying distractions, disabling telemetry and tracking and optionally uninstalling the default or your custom selection of apps. To apply the default settings, launch the script as you normally would and select option `1` in the script menu. - -Alternatively, you can launch the script with the `-RunDefaults` or `-RunDefaultsLite` parameters to immediately run the defaults without going through the menu or the app removal options. Using the `-RunDefaults` parameter will run the script in default mode and remove the default selection of apps. While using the `-RunDefaultsLite` parameter will run the script in default mode without removing any apps. Example: -```Powershell -& ([scriptblock]::Create((irm "https://debloat.raphi.re/"))) -RunDefaults -``` - -#### Changes included in the default mode -- Remove the default or your custom selection of apps. (See below for the default selection of apps) -- Disable telemetry, diagnostic data, activity history, app-launch tracking & targeted ads. -- Disable tips, tricks, suggestions & ads across Windows. -- Disable ads, suggestions and the MSN news feed in Microsoft Edge. -- Disable & remove Bing web search, Bing AI and Cortana from Windows search. -- Disable & remove Microsoft Copilot. -- Disable Windows Recall. (W11 only) -- Disable Click to Do, AI text & image analysis tool. (W11 only) -- Disable Fast Start-up to ensure a full shutdown. -- Disable network connectivity during Modern Standby to reduce battery drain. (W11 only) -- Show file extensions for known file types. -- Hide the 3D objects folder under 'This pc' from File Explorer. (W10 only) -- Disable widgets on the taskbar & lockscreen. -- Hide the Chat (meet now) icon from the taskbar. (W10 only) - -#### Apps that ARE removed by default - -These apps are uninstalled when you opt to remove the default selection of apps. - -
- Click to expand -
- - Microsoft apps: - - Clipchamp.Clipchamp (Video editor from Microsoft) - - Microsoft.3DBuilder (Basic 3D modeling software) - - Microsoft.549981C3F5F10 (Cortana app, discontinued) - - Microsoft.BingFinance (Finance news and tracking via Bing, discontinued) - - Microsoft.BingFoodAndDrink (Recipes and food news via Bing, discontinued) - - Microsoft.BingHealthAndFitness (Health and fitness tracking/news via Bing, discontinued) - - Microsoft.BingNews (News aggregator via Bing, replaced by Microsoft News/Start) - - Microsoft.BingSports (Sports news and scores via Bing, discontinued) - - Microsoft.BingTranslator (Translation service via Bing) - - Microsoft.BingTravel (Travel planning and news via Bing, discontinued) - - Microsoft.BingWeather (Weather forecast via Bing) - - Microsoft.Copilot (AI assistant integrated into Windows) - - Microsoft.Getstarted (Tips and introductory guide for Windows, cannot be uninstalled in Windows 11) - - Microsoft.Messaging (Messaging app, often integrates with Skype, largely deprecated) - - Microsoft.Microsoft3DViewer (Viewer for 3D models) - - Microsoft.MicrosoftJournal (Digital note-taking app optimized for pen input) - - Microsoft.MicrosoftOfficeHub (Hub to access Microsoft Office apps and documents, precursor to Microsoft 365 app) - - Microsoft.MicrosoftPowerBIForWindows (Business analytics service client) - - Microsoft.MicrosoftSolitaireCollection (Collection of solitaire card games) - - Microsoft.MicrosoftStickyNotes (Digital sticky notes app, deprecated & replaced by OneNote) - - Microsoft.MixedReality.Portal (Portal for Windows Mixed Reality headsets) - - Microsoft.NetworkSpeedTest (Internet connection speed test utility) - - Microsoft.News (News aggregator. Replaced Bing News and now part of Microsoft Start) - - Microsoft.Office.OneNote (Digital note-taking app, Universal Windows Platform version) - - Microsoft.Office.Sway (Presentation and storytelling app) - - Microsoft.OneConnect (Mobile Operator management app, replaced by Mobile Plans) - - Microsoft.PowerAutomateDesktop (Desktop automation tool) - - Microsoft.Print3D (3D printing preparation software) - - Microsoft.SkypeApp (Skype communication app, Universal Windows Platform version) - - Microsoft.Todos (To-do list and task management app) - - Microsoft.Windows.DevHome (Developer dashboard and tool configuration utility, no longer supported) - - Microsoft.WindowsAlarms (Alarms & Clock app) - - Microsoft.WindowsFeedbackHub (App for providing feedback to Microsoft on Windows) - - Microsoft.WindowsMaps (Mapping and navigation app) - - Microsoft.WindowsSoundRecorder (Basic audio recording app) - - Microsoft.XboxApp (Old Xbox Console Companion App, no longer supported) - - Microsoft.ZuneVideo (Movies & TV app for renting/buying/playing video content. Rebranded as "Films & TV") - - MicrosoftCorporationII.MicrosoftFamily (Family Safety App for managing family accounts and settings) - - MicrosoftCorporationII.QuickAssist (Remote assistance tool) - - MicrosoftTeams (Old MS Teams personal, MS Store version) - - MSTeams (New MS Teams app. Work/School or Personal) - - Third party apps: - - ACGMediaPlayer - - ActiproSoftwareLLC - - AdobeSystemsIncorporated.AdobePhotoshopExpress - - Amazon.com.Amazon - - AmazonVideo.PrimeVideo - - Asphalt8Airborne - - AutodeskSketchBook - - CaesarsSlotsFreeCasino - - COOKINGFEVER - - CyberLinkMediaSuiteEssentials - - DisneyMagicKingdoms - - Disney - - DrawboardPDF - - Duolingo-LearnLanguagesforFree - - EclipseManager - - Facebook - - FarmVille2CountryEscape - - fitbit - - Flipboard - - HiddenCity - - HULULLC.HULUPLUS - - iHeartRadio - - Instagram - - king.com.BubbleWitch3Saga - - king.com.CandyCrushSaga - - king.com.CandyCrushSodaSaga - - LinkedInforWindows - - MarchofEmpires - - Netflix - - NYTCrossword - - OneCalendar - - PandoraMediaInc - - PhototasticCollage - - PicsArt-PhotoStudio - - Plex - - PolarrPhotoEditorAcademicEdition - - Royal Revolt - - Shazam - - Sidia.LiveWallpaper - - SlingTV - - Spotify - - TikTok - - TuneInRadio - - Twitter - - Viber - - WinZipUniversal - - Wunderlist - - XING -
-
- -#### Apps that are NOT removed by default - -These apps will not be removed by Win11Debloat unless explicitly selected by the user. - -
- Click to expand -
- - Miscellaneous apps: - - Microsoft.Edge (Edge browser, only removeable in the EEA) - - Microsoft.GetHelp (Required for some Windows 11 Troubleshooters) - - Microsoft.M365Companions (Microsoft 365 Business Calendar, Files and People mini-apps, these apps may be reinstalled if enabled by your Microsoft 365 admin) - - Microsoft.MSPaint (Paint 3D) - - Microsoft.OutlookForWindows (New mail app) - - Microsoft.OneDrive (OneDrive consumer) - - Microsoft.Paint (Classic Paint) - - Microsoft.People (Required for & included with Mail & Calendar) - - Microsoft.RemoteDesktop - - Microsoft.ScreenSketch (Snipping Tool) - - Microsoft.Whiteboard (Only preinstalled on devices with touchscreen and/or pen support) - - Microsoft.Windows.Photos - - Microsoft.WindowsCalculator - - Microsoft.WindowsCamera - - Microsoft.WindowsNotepad - - Microsoft.windowscommunicationsapps (Mail & Calendar) - - Microsoft.WindowsStore (Microsoft Store, NOTE: This app cannot be reinstalled!) - - Microsoft.WindowsTerminal (New default terminal app in Windows 11) - - Microsoft.YourPhone (Phone Link) - - Microsoft.Xbox.TCUI (UI framework, removing this may break MS store, photos and certain games) - - Microsoft.ZuneMusic (Modern Media Player) - - MicrosoftWindows.CrossDevice (Phone integration within File Explorer, Camera and more) - - Gaming related apps: - - Microsoft.GamingApp (Modern Xbox Gaming App, required for installing some games) - - Microsoft.XboxGameOverlay (Game overlay, required for some games) - - Microsoft.XboxGamingOverlay (Game overlay, required for some games) - - Microsoft.XboxIdentityProvider (Xbox sign-in framework, required for some games) - - Microsoft.XboxSpeechToTextOverlay (Might be required for some games, NOTE: This app cannot be reinstalled!) - - HP apps: - - AD2F1837.HPAIExperienceCenter - - AD2F1837.HPConnectedMusic - - AD2F1837.HPConnectedPhotopoweredbySnapfish - - AD2F1837.HPDesktopSupportUtilities - - AD2F1837.HPEasyClean - - AD2F1837.HPFileViewer - - AD2F1837.HPJumpStarts - - AD2F1837.HPPCHardwareDiagnosticsWindows - - AD2F1837.HPPowerManager - - AD2F1837.HPPrinterControl - - AD2F1837.HPPrivacySettings - - AD2F1837.HPQuickDrop - - AD2F1837.HPQuickTouch - - AD2F1837.HPRegistration - - AD2F1837.HPSupportAssistant - - AD2F1837.HPSureShieldAI - - AD2F1837.HPSystemInformation - - AD2F1837.HPWelcome - - AD2F1837.HPWorkWell - - AD2F1837.myHP -
-
- ## License Win11Debloat is licensed under the MIT license. See the LICENSE file for more information. diff --git a/Regfiles/Disable_Brave_Bloat.reg b/Regfiles/Disable_Brave_Bloat.reg new file mode 100644 index 0000000..f9ae730 --- /dev/null +++ b/Regfiles/Disable_Brave_Bloat.reg @@ -0,0 +1,9 @@ +Windows Registry Editor Version 5.00 + +[HKEY_LOCAL_MACHINE\Software\Policies\BraveSoftware\Brave] +"BraveVPNDisabled"=dword:00000001 +"BraveWalletDisabled"=dword:00000001 +"BraveAIChatEnabled"=dword:00000000 +"BraveRewardsDisabled"=dword:00000001 +"BraveTalkDisabled"=dword:00000001 +"BraveNewsDisabled"=dword:00000001 diff --git a/Regfiles/Disable_Share_Drag_Tray.reg b/Regfiles/Disable_Share_Drag_Tray.reg new file mode 100644 index 0000000..33267cb --- /dev/null +++ b/Regfiles/Disable_Share_Drag_Tray.reg @@ -0,0 +1,4 @@ +Windows Registry Editor Version 5.00 + +[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\CDP] +"DragTrayEnabled"=dword:00000000 \ No newline at end of file diff --git a/Regfiles/Sysprep/Combine_MMTaskbar_Always.reg b/Regfiles/Sysprep/Combine_MMTaskbar_Always.reg new file mode 100644 index 0000000..c150060 Binary files /dev/null and b/Regfiles/Sysprep/Combine_MMTaskbar_Always.reg differ diff --git a/Regfiles/Sysprep/Combine_MMTaskbar_Never.reg b/Regfiles/Sysprep/Combine_MMTaskbar_Never.reg new file mode 100644 index 0000000..5b21ca0 Binary files /dev/null and b/Regfiles/Sysprep/Combine_MMTaskbar_Never.reg differ diff --git a/Regfiles/Sysprep/Combine_MMTaskbar_When_Full.reg b/Regfiles/Sysprep/Combine_MMTaskbar_When_Full.reg new file mode 100644 index 0000000..0536ae7 Binary files /dev/null and b/Regfiles/Sysprep/Combine_MMTaskbar_When_Full.reg differ diff --git a/Regfiles/Sysprep/Disable_Brave_Bloat.reg b/Regfiles/Sysprep/Disable_Brave_Bloat.reg new file mode 100644 index 0000000..f9ae730 --- /dev/null +++ b/Regfiles/Sysprep/Disable_Brave_Bloat.reg @@ -0,0 +1,9 @@ +Windows Registry Editor Version 5.00 + +[HKEY_LOCAL_MACHINE\Software\Policies\BraveSoftware\Brave] +"BraveVPNDisabled"=dword:00000001 +"BraveWalletDisabled"=dword:00000001 +"BraveAIChatEnabled"=dword:00000000 +"BraveRewardsDisabled"=dword:00000001 +"BraveTalkDisabled"=dword:00000001 +"BraveNewsDisabled"=dword:00000001 diff --git a/Regfiles/Sysprep/Disable_Share_Drag_Tray.reg b/Regfiles/Sysprep/Disable_Share_Drag_Tray.reg new file mode 100644 index 0000000..c1502d7 --- /dev/null +++ b/Regfiles/Sysprep/Disable_Share_Drag_Tray.reg @@ -0,0 +1,4 @@ +Windows Registry Editor Version 5.00 + +[hkey_users\default\Software\Microsoft\Windows\CurrentVersion\CDP] +"DragTrayEnabled"=dword:00000000 \ No newline at end of file diff --git a/Regfiles/Sysprep/MMTaskbarMode_Active.reg b/Regfiles/Sysprep/MMTaskbarMode_Active.reg new file mode 100644 index 0000000..ae8a4ce Binary files /dev/null and b/Regfiles/Sysprep/MMTaskbarMode_Active.reg differ diff --git a/Regfiles/Sysprep/MMTaskbarMode_All.reg b/Regfiles/Sysprep/MMTaskbarMode_All.reg new file mode 100644 index 0000000..d2cb15f Binary files /dev/null and b/Regfiles/Sysprep/MMTaskbarMode_All.reg differ diff --git a/Regfiles/Sysprep/MMTaskbarMode_Main_Active.reg b/Regfiles/Sysprep/MMTaskbarMode_Main_Active.reg new file mode 100644 index 0000000..93c3193 Binary files /dev/null and b/Regfiles/Sysprep/MMTaskbarMode_Main_Active.reg differ diff --git a/Regfiles/Undo/Enable_Brave_Bloat.reg b/Regfiles/Undo/Enable_Brave_Bloat.reg new file mode 100644 index 0000000..01ddd65 --- /dev/null +++ b/Regfiles/Undo/Enable_Brave_Bloat.reg @@ -0,0 +1,4 @@ +Windows Registry Editor Version 5.00 + +; Remove all Brave Browser Policies +[-HKEY_LOCAL_MACHINE\Software\Policies\BraveSoftware\Brave] diff --git a/Regfiles/Undo/Enable_Include_in_library_to_context_menu.reg b/Regfiles/Undo/Enable_Include_in_library_in_context_menu.reg similarity index 100% rename from Regfiles/Undo/Enable_Include_in_library_to_context_menu.reg rename to Regfiles/Undo/Enable_Include_in_library_in_context_menu.reg diff --git a/Regfiles/Undo/Enable_Share_Drag_Tray.reg b/Regfiles/Undo/Enable_Share_Drag_Tray.reg new file mode 100644 index 0000000..6de5839 --- /dev/null +++ b/Regfiles/Undo/Enable_Share_Drag_Tray.reg @@ -0,0 +1,4 @@ +Windows Registry Editor Version 5.00 + +[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\CDP] +"DragTrayEnabled"=dword:00000001 \ No newline at end of file diff --git a/Regfiles/Undo/Enable_Share_to_context_menu.reg b/Regfiles/Undo/Enable_Share_in_context_menu.reg similarity index 100% rename from Regfiles/Undo/Enable_Share_to_context_menu.reg rename to Regfiles/Undo/Enable_Share_in_context_menu.reg diff --git a/Regfiles/Undo/Show_Home_from_Explorer.reg b/Regfiles/Undo/Show_Home_in_Explorer.reg similarity index 100% rename from Regfiles/Undo/Show_Home_from_Explorer.reg rename to Regfiles/Undo/Show_Home_in_Explorer.reg diff --git a/Regfiles/Undo/Show_duplicate_removable_drives_from_navigation_pane_of_File_Explorer.reg b/Regfiles/Undo/Show_duplicate_removable_drives_in_navigation_pane_of_File_Explorer.reg similarity index 100% rename from Regfiles/Undo/Show_duplicate_removable_drives_from_navigation_pane_of_File_Explorer.reg rename to Regfiles/Undo/Show_duplicate_removable_drives_in_navigation_pane_of_File_Explorer.reg diff --git a/Run.bat b/Run.bat index b9fac5e..e766580 100644 --- a/Run.bat +++ b/Run.bat @@ -1,14 +1,45 @@ @echo off +setlocal EnableDelayedExpansion + :: Set Windows Terminal installation paths. (Default and Scoop installation) set "wtDefaultPath=%LOCALAPPDATA%\Microsoft\WindowsApps\wt.exe" set "wtScoopPath=%USERPROFILE%\scoop\apps\windows-terminal\current\wt.exe" +set "logFile=%~dp0Win11Debloat.log" -:: Launch the script in Windows Terminal if installed, otherwise use default PowerShell. +:: Determine which terminal exists if exist "%wtDefaultPath%" ( - PowerShell -Command "Start-Process -FilePath '%wtDefaultPath%' -ArgumentList 'PowerShell -NoProfile -ExecutionPolicy Bypass -File ""%~dp0Win11Debloat.ps1""' -Verb RunAs" + set "wtPath=%wtDefaultPath%" ) else if exist "%wtScoopPath%" ( - PowerShell -Command "Start-Process -FilePath '%wtScoopPath%' -ArgumentList 'PowerShell -NoProfile -ExecutionPolicy Bypass -File ""%~dp0Win11Debloat.ps1""' -Verb RunAs" + set "wtPath=%wtScoopPath%" ) else ( - echo Windows Terminal not found, using default PowerShell... - PowerShell -ExecutionPolicy Bypass -Command "& {Start-Process PowerShell -ArgumentList '-NoProfile -ExecutionPolicy Bypass -File ""%~dp0Win11Debloat.ps1""' -Verb RunAs}" + echo Windows Terminal not found. Using default PowerShell instead. + set "wtPath=" ) + +:: Launch script +if defined wtPath ( + call :Log Launching Win11Debloat.ps1 with Windows Terminal... + PowerShell -Command "Start-Process -FilePath '%wtPath%' -ArgumentList 'PowerShell -NoProfile -ExecutionPolicy Bypass -File ""%~dp0Win11Debloat.ps1""' -Verb RunAs" >> "%logFile%" || call :Error "PowerShell command failed" + call :Log Script execution passed successfully to Win11Debloat.ps1 +) else ( + echo Windows Terminal not found. Using default PowerShell instead... + call :Log Windows Terminal not found. Using default PowerShell to launch Win11Debloat.ps1... + PowerShell -ExecutionPolicy Bypass -Command "& {Start-Process PowerShell -ArgumentList '-NoProfile -ExecutionPolicy Bypass -File ""%~dp0Win11Debloat.ps1""' -Verb RunAs}" >> "%logFile%" || call :Error "PowerShell command failed" + call :Log Script execution passed successfully to Win11Debloat.ps1 +) + +echo. +echo If you need further assistance, please open an issue at: +echo https://github.com/Raphire/Win11Debloat/issues +goto :EOF + +:: Logging Function +:Log +echo %* >> "%logFile%" +goto :EOF +:: Error Handler +:Error +echo ERROR: %* +echo Logged in %logFile% +pause +goto :EOF diff --git a/Win11Debloat.ps1 b/Win11Debloat.ps1 index 2c66b02..ff4ab21 100755 --- a/Win11Debloat.ps1 +++ b/Win11Debloat.ps1 @@ -2,13 +2,14 @@ [CmdletBinding(SupportsShouldProcess)] param ( + [switch]$CLI, [switch]$Silent, [switch]$Sysprep, [string]$LogPath, [string]$User, [switch]$NoRestartExplorer, [switch]$CreateRestorePoint, - [switch]$RunAppsListGenerator, [switch]$RunAppConfigurator, + [switch]$RunAppsListGenerator, [switch]$RunDefaults, [switch]$RunDefaultsLite, [switch]$RunSavedSettings, @@ -25,11 +26,12 @@ param ( [switch]$DisableTelemetry, [switch]$DisableFastStartup, [switch]$DisableModernStandbyNetworking, - [switch]$DisableBing, [switch]$DisableBingSearches, + [switch]$DisableBing, [switch]$DisableDesktopSpotlight, - [switch]$DisableLockscreenTips, [switch]$DisableLockscrTips, - [switch]$DisableSuggestions, [switch]$DisableWindowsSuggestions, + [switch]$DisableLockscreenTips, + [switch]$DisableSuggestions, [switch]$DisableEdgeAds, + [switch]$DisableBraveBloat, [switch]$DisableSettings365Ads, [switch]$DisableSettingsHome, [switch]$ShowHiddenFolders, @@ -52,8 +54,8 @@ param ( [switch]$DisablePaintAI, [switch]$DisableNotepadAI, [switch]$DisableEdgeAI, - [switch]$DisableWidgets, [switch]$HideWidgets, - [switch]$HideChat, [switch]$DisableChat, + [switch]$DisableWidgets, + [switch]$HideChat, [switch]$EnableEndTask, [switch]$EnableLastActiveClick, [switch]$ClearStart, @@ -61,6 +63,7 @@ param ( [switch]$ClearStartAllUsers, [string]$ReplaceStartAllUsers, [switch]$RevertContextMenu, + [switch]$DisableDragTray, [switch]$DisableMouseAcceleration, [switch]$DisableStickyKeys, [switch]$HideHome, @@ -70,102 +73,34 @@ param ( [switch]$ExplorerToDownloads, [switch]$ExplorerToOneDrive, [switch]$AddFoldersToThisPC, - [switch]$HideOnedrive, [switch]$DisableOnedrive, - [switch]$Hide3dObjects, [switch]$Disable3dObjects, - [switch]$HideMusic, [switch]$DisableMusic, - [switch]$HideIncludeInLibrary, [switch]$DisableIncludeInLibrary, - [switch]$HideGiveAccessTo, [switch]$DisableGiveAccessTo, - [switch]$HideShare, [switch]$DisableShare + [switch]$HideOnedrive, + [switch]$Hide3dObjects, + [switch]$HideMusic, + [switch]$HideIncludeInLibrary, + [switch]$HideGiveAccessTo, + [switch]$HideShare ) # Define script-level variables & paths $script:DefaultSettingsFilePath = "$PSScriptRoot/DefaultSettings.json" -$script:AppsListFilePath = "$PSScriptRoot/Appslist.txt" +$script:AppsListFilePath = "$PSScriptRoot/Apps.json" $script:SavedSettingsFilePath = "$PSScriptRoot/LastUsedSettings.json" $script:CustomAppsListFilePath = "$PSScriptRoot/CustomAppsList" $script:DefaultLogPath = "$PSScriptRoot/Win11Debloat.log" $script:RegfilesPath = "$PSScriptRoot/Regfiles" $script:AssetsPath = "$PSScriptRoot/Assets" +$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' -$script:Features = @{ - "RemoveApps" = "Remove the apps specified in the 'Apps' parameter" - "Apps" = "The selection of apps to remove, specified as a comma separated list. Use 'Default' (or omit) to use the default apps list" - "RemoveAppsCustom" = "Remove custom selection of apps" - "RemoveCommApps" = "Remove the Mail, Calendar, and People apps" - "RemoveW11Outlook" = "Remove the new Outlook for Windows app" - "RemoveGamingApps" = "Remove the Xbox App and Xbox Gamebar" - "RemoveHPApps" = "Remove HP OEM applications" - "CreateRestorePoint" = "Create a system restore point" - "DisableTelemetry" = "Disable telemetry, diagnostic data, activity history, app-launch tracking & targeted ads" - "DisableSuggestions" = "Disable tips, tricks, suggestions and ads in start, settings, notifications and File Explorer" - "DisableEdgeAds" = "Disable ads, suggestions and the MSN news feed in Microsoft Edge" - "DisableLockscreenTips" = "Disable tips & tricks on the lockscreen" - "DisableBing" = "Disable & remove Bing web search, Bing AI and Cortana from Windows search" - "DisableCopilot" = "Disable & remove Microsoft Copilot" - "DisableRecall" = "Disable Windows Recall (Windows 11 only)" - "DisableClickToDo" = "Disable Click to Do, AI text & image analysis (Windows 11 only)" - "DisableWidgets" = "Disable widgets on the taskbar & lockscreen" - "HideChat" = "Hide the chat (meet now) icon from the taskbar (Windows 10 only)" - "ShowKnownFileExt" = "Show file extensions for known file types" - "DisableFastStartup" = "Disable Fast Start-up" - "Hide3dObjects" = "Hide the 3D objects folder under 'This PC' in File Explorer (Windows 10 only)" - "DisableModernStandbyNetworking" = "Disable network connectivity during Modern Standby (If supported)" - "DisableDVR" = "Disable Xbox game/screen recording" - "DisableGameBarIntegration" = "Disable Game Bar integration" - "ClearStart" = "Remove all pinned apps from the start menu for this user only" - "ClearStartAllUsers" = "Remove all pinned apps from the start menu for all existing and new users" - "ReplaceStart" = "Replace the start menu layout for this user only with the provided template file" - "ReplaceStartAllUsers" = "Replace the start menu layout for all existing and new users with the provided template file" - "DisableStartRecommended" = "Disable the recommended section in the start menu (Windows 11 only)" - "DisableStartPhoneLink" = "Disable the Phone Link mobile devices integration in the start menu" - "DisableSettings365Ads" = "Disable Microsoft 365 ads in Settings Home (Windows 11 only)" - "DisableSettingsHome" = "Completely hide the Settings 'Home' page (Windows 11 only)" - "DisableEdgeAI" = "Disable AI features in Microsoft Edge (Windows 11 only)" - "DisablePaintAI" = "Disable AI features in Paint (Windows 11 only)" - "DisableNotepadAI" = "Disable AI features in Notepad (Windows 11 only)" - "EnableDarkMode" = "Enable dark mode for system and apps" - "RevertContextMenu" = "Restore the old Windows 10 style context menu (Windows 11 only)" - "DisableMouseAcceleration" = "Turn off Enhance Pointer Precision (mouse acceleration)" - "DisableStickyKeys" = "Disable the Sticky Keys keyboard shortcut (Windows 11 only)" - "DisableDesktopSpotlight" = "Disable the Windows Spotlight desktop background option" - "TaskbarAlignLeft" = "Align taskbar icons to the left (Windows 11 only)" - "CombineTaskbarAlways" = "Always combine taskbar buttons and hide labels for the main display (Windows 11 only)" - "CombineMMTaskbarAlways" = "Always combine taskbar buttons and hide labels for secondary displays (Windows 11 only)" - "CombineTaskbarWhenFull" = "Combine taskbar buttons and hide labels when taskbar is full for the main display (Windows 11 only)" - "CombineMMTaskbarWhenFull" = "Combine taskbar buttons and hide labels when taskbar is full for secondary displays (Windows 11 only)" - "CombineTaskbarNever" = "Never combine taskbar buttons and show labels for the main display (Windows 11 only)" - "CombineMMTaskbarNever" = "Never combine taskbar buttons and show labels for secondary displays (Windows 11 only)" - "MMTaskbarModeAll" = "Show app icons on all taskbars (Windows 11 only)" - "MMTaskbarModeMainActive" = "Show app icons on main taskbar and on taskbar where the windows is open (Windows 11 only)" - "MMTaskbarModeActive" = "Show app icons only on taskbar where the window is open (Windows 11 only)" - "HideSearchTb" = "Hide search icon from the taskbar (Windows 11 only)" - "ShowSearchIconTb" = "Show search icon on the taskbar (Windows 11 only)" - "ShowSearchLabelTb" = "Show search icon with label on the taskbar (Windows 11 only)" - "ShowSearchBoxTb" = "Show search box on the taskbar (Windows 11 only)" - "HideTaskview" = "Hide the taskview button from the taskbar (Windows 11 only)" - "EnableEndTask" = "Enable the 'End Task' option in the taskbar right click menu (Windows 11 only)" - "EnableLastActiveClick" = "Enable the 'Last Active Click' behavior in the taskbar app area" - "ShowHiddenFolders" = "Show hidden files, folders and drives" - "ExplorerToHome" = "Change the default location that File Explorer opens to 'Home'" - "ExplorerToThisPC" = "Change the default location that File Explorer opens to 'This PC'" - "ExplorerToDownloads" = "Change the default location that File Explorer opens to 'Downloads'" - "ExplorerToOneDrive" = "Change the default location that File Explorer opens to 'OneDrive'" - "AddFoldersToThisPC" = "Add all common folders (Desktop, Downloads, etc.) back to 'This PC' in File Explorer" - "HideHome" = "Hide the Home section from the File Explorer sidepanel (Windows 11 only)" - "HideGallery" = "Hide the Gallery section from the File Explorer sidepanel (Windows 11 only)" - "HideDupliDrive" = "Hide duplicate removable drive entries from the File Explorer sidepanel" - "DisableTransparency" = "Disable transparency effects" - "DisableAnimations" = "Disable animations and visual effects" - "ForceRemoveEdge" = "Forcefully uninstall Microsoft Edge. NOT RECOMMENDED!" - "HideIncludeInLibrary" = "Hide the 'Include in library' option in the context menu (Windows 10 only)" - "HideGiveAccessTo" = "Hide the 'Give access to' option in the context menu (Windows 10 only)" - "HideShare" = "Hide the 'Share' option in the context menu (Windows 10 only)" - "HideOnedrive" = "Hide the OneDrive folder in the File Explorer sidepanel (Windows 10 only)" - "HideMusic" = "Hide the music folder under 'This PC' in File Explorer (Windows 10 only)" -} +$script:ControlParams = 'WhatIf', 'Confirm', 'Verbose', 'Debug', 'LogPath', 'Silent', 'Sysprep', 'User', 'NoRestartExplorer', 'RunDefaults', 'RunDefaultsLite', 'RunSavedSettings', 'RunAppsListGenerator', 'CLI' + +# Script-level variables for GUI elements +$script:GuiConsoleOutput = $null +$script:GuiConsoleScrollViewer = $null +$script:GuiWindow = $null # Check if current powershell environment is limited by security policies if ($ExecutionContext.SessionState.LanguageMode -ne "FullLanguage") { @@ -175,13 +110,28 @@ if ($ExecutionContext.SessionState.LanguageMode -ne "FullLanguage") { Exit } -# Check if script does not see file dependencies -if (-not ((Test-Path $script:DefaultSettingsFilePath) -and (Test-Path $script:AppsListFilePath) -and (Test-Path $script:RegfilesPath) -and (Test-Path $script:AssetsPath))) { - Write-Error "Win11Debloat is unable to find required files, please ensure all script files are present" - Write-Output "Press any key to exit..." - $null = [System.Console]::ReadKey() - Exit -} +# Display ASCII art launch logo in CLI +Clear-Host +Write-Host "" +Write-Host "" +Write-Host " " -NoNewline; Write-Host " ^" -ForegroundColor Blue +Write-Host " " -NoNewline; Write-Host " / \" -ForegroundColor Blue +Write-Host " " -NoNewline; Write-Host " / \" -ForegroundColor Blue +Write-Host " " -NoNewline; Write-Host " / \" -ForegroundColor Blue +Write-Host " " -NoNewline; Write-Host " / ===== \" -ForegroundColor Blue +Write-Host " " -NoNewline; Write-Host " |" -ForegroundColor Blue -NoNewline; Write-Host " --- " -ForegroundColor White -NoNewline; Write-Host "|" -ForegroundColor Blue +Write-Host " " -NoNewline; Write-Host " |" -ForegroundColor Blue -NoNewline; Write-Host " ( O ) " -ForegroundColor DarkCyan -NoNewline; Write-Host "|" -ForegroundColor Blue +Write-Host " " -NoNewline; Write-Host " |" -ForegroundColor Blue -NoNewline; Write-Host " --- " -ForegroundColor White -NoNewline; Write-Host "|" -ForegroundColor Blue +Write-Host " " -NoNewline; Write-Host " | |" -ForegroundColor Blue +Write-Host " " -NoNewline; Write-Host " /| |\" -ForegroundColor Blue +Write-Host " " -NoNewline; Write-Host "/ | | \" -ForegroundColor Blue +Write-Host " " -NoNewline; Write-Host " | " -ForegroundColor DarkGray -NoNewline; Write-Host "'''" -ForegroundColor Red -NoNewline; Write-Host " |" -ForegroundColor DarkGray -NoNewline; Write-Host " *" -ForegroundColor Yellow +Write-Host " " -NoNewline; Write-Host " (" -ForegroundColor Yellow -NoNewline; Write-Host "'''" -ForegroundColor Red -NoNewline; Write-Host ") " -ForegroundColor Yellow -NoNewline; Write-Host " * *" -ForegroundColor DarkYellow +Write-Host " " -NoNewline; Write-Host " ( " -ForegroundColor DarkYellow -NoNewline; Write-Host "'" -ForegroundColor Red -NoNewline; Write-Host " ) " -ForegroundColor DarkYellow -NoNewline; Write-Host "*" -ForegroundColor Yellow +Write-Host "" +Write-Host " Win11Debloat is launching..." -ForegroundColor White +Write-Host " Leave this window open" -ForegroundColor DarkGray +Write-Host "" # Log script output to 'Win11Debloat.log' at the specified path if ($LogPath -and (Test-Path $LogPath)) { @@ -191,6 +141,52 @@ else { Start-Transcript -Path $script:DefaultLogPath -Append -IncludeInvocationHeader -Force | Out-Null } +# Check if script has all required files +if (-not ((Test-Path $script:DefaultSettingsFilePath) -and (Test-Path $script:AppsListFilePath) -and (Test-Path $script:RegfilesPath) -and (Test-Path $script:AssetsPath) -and (Test-Path $script:AppSelectionSchema) -and (Test-Path $script:FeaturesFilePath))) { + Write-Error "Win11Debloat is unable to find required files, please ensure all script files are present" + Write-Output "" + Write-Output "Press any key to exit..." + $null = [System.Console]::ReadKey() + Exit +} + +# Load feature info from file +$script:Features = @{} +try { + $featuresData = Get-Content -Path $script:FeaturesFilePath -Raw | ConvertFrom-Json + foreach ($feature in $featuresData.Features) { + $script:Features[$feature.FeatureId] = $feature + } +} +catch { + Write-Error "Failed to load feature info from Features.json file" + Write-Output "" + Write-Output "Press any key to exit..." + $null = [System.Console]::ReadKey() + Exit +} + +# Check if WinGet is installed & if it is, check if the version is at least v1.4 +try { + if ([int](((winget -v) -replace 'v','').split('.')[0..1] -join '') -gt 14) { + $script:WingetInstalled = $true + } + else { + $script:WingetInstalled = $false + } +} +catch { + $script:WingetInstalled = $false +} + +# Show WinGet warning that requires user confirmation, Suppress confirmation if Silent parameter was passed +if (-not $script:WingetInstalled -and -not $Silent) { + Write-Warning "WinGet is not installed or outdated, this may prevent Win11Debloat from removing certain apps" + Write-Output "" + Write-Output "Press any key to continue anyway..." + $null = [System.Console]::ReadKey() +} + ################################################################################################################## @@ -201,283 +197,1542 @@ else { -# Shows application selection form that allows the user to select what apps they want to remove or keep -function ShowAppSelectionForm { - [reflection.assembly]::loadwithpartialname("System.Windows.Forms") | Out-Null - [reflection.assembly]::loadwithpartialname("System.Drawing") | Out-Null +# Writes to both GUI console output and standard console +function Write-ToConsole { + param( + [string]$message, + [string]$ForegroundColor = $null + ) + + if ($script:GuiConsoleOutput) { + # GUI mode + $timestamp = Get-Date -Format "HH:mm:ss" + $script:GuiConsoleOutput.Dispatcher.Invoke([System.Windows.Threading.DispatcherPriority]::Send, [action]{ + try { + $runText = "[$timestamp] $message`n" + $run = New-Object System.Windows.Documents.Run $runText - # Initialise form objects - $form = New-Object System.Windows.Forms.Form - $label = New-Object System.Windows.Forms.Label - $button1 = New-Object System.Windows.Forms.Button - $button2 = New-Object System.Windows.Forms.Button - $selectionBox = New-Object System.Windows.Forms.CheckedListBox - $loadingLabel = New-Object System.Windows.Forms.Label - $onlyInstalledCheckBox = New-Object System.Windows.Forms.CheckBox - $checkUncheckCheckBox = New-Object System.Windows.Forms.CheckBox - $initialFormWindowState = New-Object System.Windows.Forms.FormWindowState + if ($ForegroundColor) { + try { + $colorObj = [System.Windows.Media.ColorConverter]::ConvertFromString($ForegroundColor) + if ($colorObj) { + $brush = [System.Windows.Media.SolidColorBrush]::new($colorObj) + $run.Foreground = $brush + } + } + catch { + # Invalid color string - ignore and fall back to default + } + } - $script:SelectionBoxIndex = -1 + $script:GuiConsoleOutput.Inlines.Add($run) + if ($script:GuiConsoleScrollViewer) { $script:GuiConsoleScrollViewer.ScrollToEnd() } + } + catch { + # If any UI update fails, fall back to simple text append + try { $script:GuiConsoleOutput.Text += "[$timestamp] $message`n" } catch {} + } + }) - # saveButton eventHandler - $handler_saveButton_Click= - { - if ($selectionBox.CheckedItems -contains "Microsoft.WindowsStore" -and -not $Silent) { - $warningSelection = [System.Windows.Forms.Messagebox]::Show('Are you sure you wish to uninstall the Microsoft Store? This app cannot easily be reinstalled.', 'Are you sure?', 'YesNo', 'Warning') + # Force UI to process pending updates for real-time display + if ($script:GuiWindow) { + $script:GuiWindow.Dispatcher.Invoke([System.Windows.Threading.DispatcherPriority]::Background, [action]{}) + } + } - if ($warningSelection -eq 'No') { + try { + if ($ForegroundColor) { + Write-Host $message -ForegroundColor $ForegroundColor + } + else { + Write-Host $message + } + } + catch { + Write-Host $message + } +} + + +# Loads a JSON file from the specified path and returns the parsed object +# Returns $null if the file doesn't exist or if parsing fails +function LoadJsonFile { + param ( + [string]$filePath, + [string]$expectedVersion = $null, + [switch]$optionalFile + ) + + if (-not (Test-Path $filePath)) { + if (-not $optionalFile) { + Write-Error "File not found: $filePath" + } + return $null + } + + try { + $jsonContent = Get-Content -Path $filePath -Raw | ConvertFrom-Json + + # Validate version if specified + if ($expectedVersion -and $jsonContent.Version -and $jsonContent.Version -ne $expectedVersion) { + Write-Error "$(Split-Path $filePath -Leaf) version mismatch (expected $expectedVersion, found $($jsonContent.Version))" + return $null + } + + return $jsonContent + } + catch { + Write-Error "Failed to parse JSON file: $filePath" + return $null + } +} + + +# Loads settings from a JSON file and adds them to script params +# Used by command-line modes (ShowDefaultModeOptions, LoadAndShowLastUsedSettings) +function LoadSettingsToParams { + param ( + [string]$filePath, + [string]$expectedVersion = "1.0" + ) + + $settingsJson = LoadJsonFile -filePath $filePath -expectedVersion $expectedVersion + + if (-not $settingsJson -or -not $settingsJson.Settings) { + throw "Failed to load settings from $(Split-Path $filePath -Leaf)" + } + + # Get current Windows build version + $WinVersion = Get-ItemPropertyValue 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion' CurrentBuild + + foreach ($setting in $settingsJson.Settings) { + if ($setting.Value -eq $false) { + continue + } + + $feature = $script:Features[$setting.Name] + + # Check version and feature compatibility using Features.json + if (($feature.MinVersion -and $WinVersion -lt $feature.MinVersion) -or ($feature.MaxVersion -and $WinVersion -gt $feature.MaxVersion) -or ($feature.FeatureId -eq 'DisableModernStandbyNetworking' -and (-not $script:ModernStandbySupported))) { + continue + } + + AddParameter $setting.Name $setting.Value + } +} + + +# Applies settings from a JSON object to UI controls (checkboxes and comboboxes) +# Used by LoadDefaultsBtn and LoadLastUsedBtn in the UI +function ApplySettingsToUiControls { + param ( + $window, + $settingsJson, + $uiControlMappings + ) + + if (-not $settingsJson -or -not $settingsJson.Settings) { + return $false + } + + # First, reset all tweaks to "No Change" (index 0) or unchecked + if ($uiControlMappings) { + foreach ($comboName in $uiControlMappings.Keys) { + $control = $window.FindName($comboName) + if ($control -is [System.Windows.Controls.CheckBox]) { + $control.IsChecked = $false + } + elseif ($control -is [System.Windows.Controls.ComboBox]) { + $control.SelectedIndex = 0 + } + } + } + + # Also uncheck RestorePointCheckBox + $restorePointCheckBox = $window.FindName('RestorePointCheckBox') + if ($restorePointCheckBox) { + $restorePointCheckBox.IsChecked = $false + } + + # Apply settings from JSON + foreach ($setting in $settingsJson.Settings) { + if ($setting.Value -ne $true) { continue } + $paramName = $setting.Name + + # Handle RestorePointCheckBox separately + if ($paramName -eq 'CreateRestorePoint') { + if ($restorePointCheckBox) { $restorePointCheckBox.IsChecked = $true } + continue + } + + if ($uiControlMappings) { + foreach ($comboName in $uiControlMappings.Keys) { + $mapping = $uiControlMappings[$comboName] + if ($mapping.Type -eq 'group') { + $i = 1 + foreach ($val in $mapping.Values) { + if ($val.FeatureIds -contains $paramName) { + $control = $window.FindName($comboName) + if ($control -and $control.Visibility -eq 'Visible') { + if ($control -is [System.Windows.Controls.ComboBox]) { + $control.SelectedIndex = $i + } + } + break + } + $i++ + } + } + elseif ($mapping.Type -eq 'feature') { + if ($mapping.FeatureId -eq $paramName) { + $control = $window.FindName($comboName) + if ($control -and $control.Visibility -eq 'Visible') { + if ($control -is [System.Windows.Controls.CheckBox]) { + $control.IsChecked = $true + } + elseif ($control -is [System.Windows.Controls.ComboBox]) { + $control.SelectedIndex = 1 + } + } + } + } + } + } + } + + return $true +} + + +# Attaches shift-click selection behavior to a checkbox in an apps panel +# Parameters: +# - $checkbox: The checkbox to attach the behavior to +# - $appsPanel: The StackPanel containing checkbox items +# - $lastSelectedCheckboxRef: A reference to a variable storing the last clicked checkbox +# - $updateStatusCallback: Optional callback to update selection status +function AttachShiftClickBehavior { + param ( + [System.Windows.Controls.CheckBox]$checkbox, + [System.Windows.Controls.StackPanel]$appsPanel, + [ref]$lastSelectedCheckboxRef, + [scriptblock]$updateStatusCallback = $null + ) + + # Use a closure to capture the parameters + $checkbox.Add_PreviewMouseLeftButtonDown({ + param( + $sender, + $e + ) + + $isShiftPressed = [System.Windows.Input.Keyboard]::IsKeyDown([System.Windows.Input.Key]::LeftShift) -or + [System.Windows.Input.Keyboard]::IsKeyDown([System.Windows.Input.Key]::RightShift) + + if ($isShiftPressed -and $null -ne $lastSelectedCheckboxRef.Value) { + # Get all visible checkboxes in the panel + $visibleCheckboxes = @() + foreach ($child in $appsPanel.Children) { + if ($child -is [System.Windows.Controls.CheckBox] -and $child.Visibility -eq 'Visible') { + $visibleCheckboxes += $child + } + } + + # Find indices of the last selected and current checkbox + $lastIndex = -1 + $currentIndex = -1 + + for ($i = 0; $i -lt $visibleCheckboxes.Count; $i++) { + if ($visibleCheckboxes[$i] -eq $lastSelectedCheckboxRef.Value) { + $lastIndex = $i + } + if ($visibleCheckboxes[$i] -eq $sender) { + $currentIndex = $i + } + } + + if ($lastIndex -ge 0 -and $currentIndex -ge 0 -and $lastIndex -ne $currentIndex) { + $startIndex = [Math]::Min($lastIndex, $currentIndex) + $endIndex = [Math]::Max($lastIndex, $currentIndex) + + $shouldDeselect = $sender.IsChecked + + # Set all checkboxes in the range to the appropriate state + for ($i = $startIndex; $i -le $endIndex; $i++) { + $visibleCheckboxes[$i].IsChecked = -not $shouldDeselect + } + + if ($updateStatusCallback) { + & $updateStatusCallback + } + + # Mark the event as handled to prevent the default toggle behavior + $e.Handled = $true return } } - $script:SelectedApps = $selectionBox.CheckedItems - - # Close form without saving if no apps were selected - if ($script:SelectedApps.Count -eq 0) { - $form.Close() - return - } - - # Create file that stores selected apps if it doesn't exist - if (-not (Test-Path $script:CustomAppsListFilePath)) { - $null = New-Item $script:CustomAppsListFilePath - } - - Set-Content -Path $script:CustomAppsListFilePath -Value $script:SelectedApps - - $form.DialogResult = [System.Windows.Forms.DialogResult]::OK - $form.Close() - } - - # cancelButton eventHandler - $handler_cancelButton_Click= - { - $form.Close() - } - - $selectionBox_SelectedIndexChanged= - { - $script:SelectionBoxIndex = $selectionBox.SelectedIndex - } - - $selectionBox_MouseDown= - { - if ($_.Button -eq [System.Windows.Forms.MouseButtons]::Left) { - if ([System.Windows.Forms.Control]::ModifierKeys -eq [System.Windows.Forms.Keys]::Shift) { - if ($script:SelectionBoxIndex -ne -1) { - $topIndex = $script:SelectionBoxIndex - - if ($selectionBox.SelectedIndex -gt $topIndex) { - for (($i = ($topIndex)); $i -le $selectionBox.SelectedIndex; $i++) { - $selectionBox.SetItemChecked($i, $selectionBox.GetItemChecked($topIndex)) - } - } - elseif ($topIndex -gt $selectionBox.SelectedIndex) { - for (($i = ($selectionBox.SelectedIndex)); $i -le $topIndex; $i++) { - $selectionBox.SetItemChecked($i, $selectionBox.GetItemChecked($topIndex)) - } - } - } - } - elseif ($script:SelectionBoxIndex -ne $selectionBox.SelectedIndex) { - $selectionBox.SetItemChecked($selectionBox.SelectedIndex, -not $selectionBox.GetItemChecked($selectionBox.SelectedIndex)) - } - } - } - - $check_All= - { - for (($i = 0); $i -lt $selectionBox.Items.Count; $i++) { - $selectionBox.SetItemChecked($i, $checkUncheckCheckBox.Checked) - } - } - - $load_Apps= - { - # Correct the initial state of the form to prevent the .Net maximized form issue - $form.WindowState = $initialFormWindowState - - # Reset state to default before loading appslist again - $script:SelectionBoxIndex = -1 - $checkUncheckCheckBox.Checked = $False - - # Show loading indicator - $loadingLabel.Visible = $true - $form.Refresh() - - # Clear selectionBox before adding any new items - $selectionBox.Items.Clear() - - $listOfApps = "" - - if ($onlyInstalledCheckBox.Checked -and ($script:WingetInstalled -eq $true)) { - # Attempt to get a list of installed apps via winget, times out after 10 seconds - $job = Start-Job { return winget list --accept-source-agreements --disable-interactivity } - $jobDone = $job | Wait-Job -TimeOut 10 - - if (-not $jobDone) { - # Show error that the script was unable to get list of apps from winget - [System.Windows.MessageBox]::Show('Unable to load list of installed apps via winget, some apps may not be displayed in the list.', 'Error', 'Ok', 'Error') - } - else { - # Add output of job (list of apps) to $listOfApps - $listOfApps = Receive-Job -Job $job - } - } - - # Go through appslist and add items one by one to the selectionBox - Foreach ($app in (Get-Content -Path $script:AppsListFilePath | Where-Object { $_ -notmatch '^\s*$' -and $_ -notmatch '^# .*' -and $_ -notmatch '^# -* #' } )) { - $appChecked = $true - - # Remove first # if it exists and set appChecked to false - if ($app.StartsWith('#')) { - $app = $app.TrimStart("#") - $appChecked = $false - } - - # Remove any comments from the Appname - if (-not ($app.IndexOf('#') -eq -1)) { - $app = $app.Substring(0, $app.IndexOf('#')) - } - - # Remove leading and trailing spaces and `*` characters from Appname - $app = $app.Trim() - $appString = $app.Trim('*') - - # Make sure appString is not empty - if ($appString.length -gt 0) { - if ($onlyInstalledCheckBox.Checked) { - # onlyInstalledCheckBox is checked, check if app is installed before adding it to selectionBox - if (-not ($listOfApps -like ("*$appString*")) -and -not (Get-AppxPackage -Name $app)) { - # App is not installed, continue with next item - continue - } - if (($appString -eq "Microsoft.Edge") -and -not ($listOfApps -like "* Microsoft.Edge *")) { - # App is not installed, continue with next item - continue - } - } - - # Add the app to the selectionBox and set its checked status - $selectionBox.Items.Add($appString, $appChecked) | Out-Null - } - } - - # Hide loading indicator - $loadingLabel.Visible = $False - - # Sort selectionBox alphabetically - $selectionBox.Sorted = $True - } - - $form.Text = "Win11Debloat Application Selection" - $form.Name = "appSelectionForm" - $form.DataBindings.DefaultDataSourceUpdateMode = 0 - $form.ClientSize = New-Object System.Drawing.Size(400,502) - $form.FormBorderStyle = 'FixedDialog' - $form.MaximizeBox = $False - - $button1.TabIndex = 4 - $button1.Name = "saveButton" - $button1.UseVisualStyleBackColor = $True - $button1.Text = "Confirm" - $button1.Location = New-Object System.Drawing.Point(27,472) - $button1.Size = New-Object System.Drawing.Size(75,23) - $button1.DataBindings.DefaultDataSourceUpdateMode = 0 - $button1.add_Click($handler_saveButton_Click) - - $form.Controls.Add($button1) - - $button2.TabIndex = 5 - $button2.Name = "cancelButton" - $button2.DialogResult = [System.Windows.Forms.DialogResult]::Cancel - $button2.UseVisualStyleBackColor = $True - $button2.Text = "Cancel" - $button2.Location = New-Object System.Drawing.Point(129,472) - $button2.Size = New-Object System.Drawing.Size(75,23) - $button2.DataBindings.DefaultDataSourceUpdateMode = 0 - $button2.add_Click($handler_cancelButton_Click) - - $form.Controls.Add($button2) - - $label.Location = New-Object System.Drawing.Point(13,5) - $label.Size = New-Object System.Drawing.Size(400,14) - $Label.Font = 'Microsoft Sans Serif,8' - $label.Text = 'Check apps that you wish to remove, uncheck apps that you wish to keep' - - $form.Controls.Add($label) - - $loadingLabel.Location = New-Object System.Drawing.Point(16,46) - $loadingLabel.Size = New-Object System.Drawing.Size(300,418) - $loadingLabel.Text = 'Loading apps...' - $loadingLabel.BackColor = "White" - $loadingLabel.Visible = $false - - $form.Controls.Add($loadingLabel) - - $onlyInstalledCheckBox.TabIndex = 6 - $onlyInstalledCheckBox.Location = New-Object System.Drawing.Point(230,474) - $onlyInstalledCheckBox.Size = New-Object System.Drawing.Size(150,20) - $onlyInstalledCheckBox.Text = 'Only show installed apps' - $onlyInstalledCheckBox.add_CheckedChanged($load_Apps) - - $form.Controls.Add($onlyInstalledCheckBox) - - $checkUncheckCheckBox.TabIndex = 7 - $checkUncheckCheckBox.Location = New-Object System.Drawing.Point(16,22) - $checkUncheckCheckBox.Size = New-Object System.Drawing.Size(150,20) - $checkUncheckCheckBox.Text = 'Check/Uncheck all' - $checkUncheckCheckBox.add_CheckedChanged($check_All) - - $form.Controls.Add($checkUncheckCheckBox) - - $selectionBox.FormattingEnabled = $True - $selectionBox.DataBindings.DefaultDataSourceUpdateMode = 0 - $selectionBox.Name = "selectionBox" - $selectionBox.Location = New-Object System.Drawing.Point(13,43) - $selectionBox.Size = New-Object System.Drawing.Size(374,424) - $selectionBox.TabIndex = 3 - $selectionBox.add_SelectedIndexChanged($selectionBox_SelectedIndexChanged) - $selectionBox.add_Click($selectionBox_MouseDown) - - $form.Controls.Add($selectionBox) - - # Save the initial state of the form - $initialFormWindowState = $form.WindowState - - # Load apps into selectionBox - $form.add_Load($load_Apps) - - # Focus selectionBox when form opens - $form.Add_Shown({$form.Activate(); $selectionBox.Focus()}) - - # Show the Form - return $form.ShowDialog() + # Update the last selected checkbox reference for next time + $lastSelectedCheckboxRef.Value = $sender + }.GetNewClosure()) } -# Returns a validated list of apps based on the provided appsList and the supported apps from Appslist.txt +# Sets resource colors for a WPF window based on dark mode preference +function SetWindowThemeResources { + param ( + $window, + [bool]$usesDarkMode + ) + + if ($usesDarkMode) { + $window.Resources.Add("BgColor", [System.Windows.Media.SolidColorBrush]::new([System.Windows.Media.ColorConverter]::ConvertFromString("#202020"))) + $window.Resources.Add("FgColor", [System.Windows.Media.SolidColorBrush]::new([System.Windows.Media.ColorConverter]::ConvertFromString("#FFFFFF"))) + $window.Resources.Add("CardBgColor", [System.Windows.Media.SolidColorBrush]::new([System.Windows.Media.ColorConverter]::ConvertFromString("#2b2b2b"))) + $window.Resources.Add("BorderColor", [System.Windows.Media.SolidColorBrush]::new([System.Windows.Media.ColorConverter]::ConvertFromString("#404040"))) + $window.Resources.Add("ButtonBorderColor", [System.Windows.Media.SolidColorBrush]::new([System.Windows.Media.ColorConverter]::ConvertFromString("#404040"))) + $window.Resources.Add("CheckBoxBgColor", [System.Windows.Media.SolidColorBrush]::new([System.Windows.Media.ColorConverter]::ConvertFromString("#272727"))) + $window.Resources.Add("CheckBoxBorderColor", [System.Windows.Media.SolidColorBrush]::new([System.Windows.Media.ColorConverter]::ConvertFromString("#808080"))) + $window.Resources.Add("CheckBoxHoverColor", [System.Windows.Media.SolidColorBrush]::new([System.Windows.Media.ColorConverter]::ConvertFromString("#343434"))) + $window.Resources.Add("ComboBgColor", [System.Windows.Media.SolidColorBrush]::new([System.Windows.Media.ColorConverter]::ConvertFromString("#373737"))) + $window.Resources.Add("ComboHoverColor", [System.Windows.Media.SolidColorBrush]::new([System.Windows.Media.ColorConverter]::ConvertFromString("#434343"))) + $window.Resources.Add("ComboItemBgColor", [System.Windows.Media.SolidColorBrush]::new([System.Windows.Media.ColorConverter]::ConvertFromString("#2c2c2c"))) + $window.Resources.Add("ComboItemHoverColor", [System.Windows.Media.SolidColorBrush]::new([System.Windows.Media.ColorConverter]::ConvertFromString("#383838"))) + $window.Resources.Add("ComboItemSelectedColor", [System.Windows.Media.SolidColorBrush]::new([System.Windows.Media.ColorConverter]::ConvertFromString("#343434"))) + $window.Resources.Add("AccentColor", [System.Windows.Media.SolidColorBrush]::new([System.Windows.Media.ColorConverter]::ConvertFromString("#FFD700"))) + $window.Resources.Add("ButtonDisabled", [System.Windows.Media.SolidColorBrush]::new([System.Windows.Media.ColorConverter]::ConvertFromString("#434343"))) + $window.Resources.Add("ButtonTextDisabled", [System.Windows.Media.SolidColorBrush]::new([System.Windows.Media.ColorConverter]::ConvertFromString("#989898"))) + $window.Resources.Add("SecondaryButtonBg", [System.Windows.Media.SolidColorBrush]::new([System.Windows.Media.ColorConverter]::ConvertFromString("#393939"))) + $window.Resources.Add("SecondaryButtonHover", [System.Windows.Media.SolidColorBrush]::new([System.Windows.Media.ColorConverter]::ConvertFromString("#2a2a2a"))) + $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("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"))) + } + else { + $window.Resources.Add("BgColor", [System.Windows.Media.SolidColorBrush]::new([System.Windows.Media.ColorConverter]::ConvertFromString("#f3f3f3"))) + $window.Resources.Add("FgColor", [System.Windows.Media.SolidColorBrush]::new([System.Windows.Media.ColorConverter]::ConvertFromString("#000000"))) + $window.Resources.Add("CardBgColor", [System.Windows.Media.SolidColorBrush]::new([System.Windows.Media.ColorConverter]::ConvertFromString("#fbfbfb"))) + $window.Resources.Add("BorderColor", [System.Windows.Media.SolidColorBrush]::new([System.Windows.Media.ColorConverter]::ConvertFromString("#ededed"))) + $window.Resources.Add("ButtonBorderColor", [System.Windows.Media.SolidColorBrush]::new([System.Windows.Media.ColorConverter]::ConvertFromString("#d3d3d3"))) + $window.Resources.Add("CheckBoxBgColor", [System.Windows.Media.SolidColorBrush]::new([System.Windows.Media.ColorConverter]::ConvertFromString("#f5f5f5"))) + $window.Resources.Add("CheckBoxBorderColor", [System.Windows.Media.SolidColorBrush]::new([System.Windows.Media.ColorConverter]::ConvertFromString("#898989"))) + $window.Resources.Add("CheckBoxHoverColor", [System.Windows.Media.SolidColorBrush]::new([System.Windows.Media.ColorConverter]::ConvertFromString("#ececec"))) + $window.Resources.Add("ComboBgColor", [System.Windows.Media.SolidColorBrush]::new([System.Windows.Media.ColorConverter]::ConvertFromString("#FFFFFF"))) + $window.Resources.Add("ComboHoverColor", [System.Windows.Media.SolidColorBrush]::new([System.Windows.Media.ColorConverter]::ConvertFromString("#f8f8f8"))) + $window.Resources.Add("ComboItemBgColor", [System.Windows.Media.SolidColorBrush]::new([System.Windows.Media.ColorConverter]::ConvertFromString("#f9f9f9"))) + $window.Resources.Add("ComboItemHoverColor", [System.Windows.Media.SolidColorBrush]::new([System.Windows.Media.ColorConverter]::ConvertFromString("#f0f0f0"))) + $window.Resources.Add("ComboItemSelectedColor", [System.Windows.Media.SolidColorBrush]::new([System.Windows.Media.ColorConverter]::ConvertFromString("#f3f3f3"))) + $window.Resources.Add("AccentColor", [System.Windows.Media.SolidColorBrush]::new([System.Windows.Media.ColorConverter]::ConvertFromString("#ffae00"))) + $window.Resources.Add("ButtonDisabled", [System.Windows.Media.SolidColorBrush]::new([System.Windows.Media.ColorConverter]::ConvertFromString("#bfbfbf"))) + $window.Resources.Add("ButtonTextDisabled", [System.Windows.Media.SolidColorBrush]::new([System.Windows.Media.ColorConverter]::ConvertFromString("#ffffff"))) + $window.Resources.Add("SecondaryButtonBg", [System.Windows.Media.SolidColorBrush]::new([System.Windows.Media.ColorConverter]::ConvertFromString("#fbfbfb"))) + $window.Resources.Add("SecondaryButtonHover", [System.Windows.Media.SolidColorBrush]::new([System.Windows.Media.ColorConverter]::ConvertFromString("#f6f6f6"))) + $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("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"))) + } + + $window.Resources.Add("ButtonBg", [System.Windows.Media.SolidColorBrush]::new([System.Windows.Media.ColorConverter]::ConvertFromString("#0067c0"))) + $window.Resources.Add("ButtonHover", [System.Windows.Media.SolidColorBrush]::new([System.Windows.Media.ColorConverter]::ConvertFromString("#1E88E5"))) + $window.Resources.Add("ButtonPressed", [System.Windows.Media.SolidColorBrush]::new([System.Windows.Media.ColorConverter]::ConvertFromString("#3284cc"))) + $window.Resources.Add("CloseHover", [System.Windows.Media.SolidColorBrush]::new([System.Windows.Media.ColorConverter]::ConvertFromString("#c42b1c"))) +} + + +# Checks if the system is set to use dark mode for apps +function GetSystemUsesDarkMode { + try { + return (Get-ItemProperty -Path 'HKCU:\Software\Microsoft\Windows\CurrentVersion\Themes\Personalize' -Name 'AppsUseLightTheme').AppsUseLightTheme -eq 0 + } + catch { + return $false + } +} + + +# Initializes and opens the main GUI window +function OpenGUI { + Add-Type -AssemblyName PresentationFramework,PresentationCore,WindowsBase | Out-Null + + # Get current Windows build version + $WinVersion = Get-ItemPropertyValue 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion' CurrentBuild + + $usesDarkMode = GetSystemUsesDarkMode + + # Load XAML from file + $xaml = Get-Content -Path $script:MainWindowSchema -Raw + $reader = [System.Xml.XmlReader]::Create([System.IO.StringReader]::new($xaml)) + try { + $window = [System.Windows.Markup.XamlReader]::Load($reader) + } + finally { + $reader.Close() + } + + SetWindowThemeResources -window $window -usesDarkMode $usesDarkMode + + # Get named elements + $titleBar = $window.FindName('TitleBar') + $helpBtn = $window.FindName('HelpBtn') + $closeBtn = $window.FindName('CloseBtn') + + # Title bar event handlers + $titleBar.Add_MouseLeftButtonDown({ + if ($_.OriginalSource -is [System.Windows.Controls.Grid] -or $_.OriginalSource -is [System.Windows.Controls.Border] -or $_.OriginalSource -is [System.Windows.Controls.TextBlock]) { + $window.DragMove() + } + }) + + $helpBtn.Add_Click({ + Start-Process "https://github.com/Raphire/Win11Debloat/wiki" + }) + + $closeBtn.Add_Click({ + $window.Close() + }) + + # Ensure closing the window via any means properly exits the script + $window.Add_Closing({ + Stop-Transcript + Exit + }) + + # Integrated App Selection UI + $appsPanel = $window.FindName('AppSelectionPanel') + $onlyInstalledAppsBox = $window.FindName('OnlyInstalledAppsBox') + $loadingAppsIndicator = $window.FindName('LoadingAppsIndicator') + $appSelectionStatus = $window.FindName('AppSelectionStatus') + $defaultAppsBtn = $window.FindName('DefaultAppsBtn') + $clearAppSelectionBtn = $window.FindName('ClearAppSelectionBtn') + + # Track the last selected checkbox for shift-click range selection + $script:MainWindowLastSelectedCheckbox = $null + + # Track current app loading operation to prevent race conditions + $script:CurrentAppLoadTimer = $null + $script:CurrentAppLoadJob = $null + $script:CurrentAppLoadJobStartTime = $null + + # Apply Tab UI Elements + $consoleOutput = $window.FindName('ConsoleOutput') + $consoleScrollViewer = $window.FindName('ConsoleScrollViewer') + $finishBtn = $window.FindName('FinishBtn') + $finishBtnText = $window.FindName('FinishBtnText') + + # Set script-level variables for Write-ToConsole function + $script:GuiConsoleOutput = $consoleOutput + $script:GuiConsoleScrollViewer = $consoleScrollViewer + $script:GuiWindow = $window + + # Updates app selection status text in the App Selection tab + function UpdateAppSelectionStatus { + $selectedCount = 0 + foreach ($child in $appsPanel.Children) { + if ($child -is [System.Windows.Controls.CheckBox] -and $child.IsChecked) { + $selectedCount++ + } + } + $appSelectionStatus.Text = "$selectedCount app(s) selected for removal" + } + + # Dynamically builds Tweaks UI from Features.json + function BuildDynamicTweaks { + $featuresJson = LoadJsonFile -filePath $script:FeaturesFilePath -expectedVersion "1.0" + + if (-not $featuresJson) { + [System.Windows.MessageBox]::Show("Unable to load Features.json file!","Error",[System.Windows.MessageBoxButton]::OK,[System.Windows.MessageBoxImage]::Error) | Out-Null + Exit + } + + # Column containers + $col0 = $window.FindName('Column0Panel') + $col1 = $window.FindName('Column1Panel') + $col2 = $window.FindName('Column2Panel') + $columns = @($col0, $col1, $col2) | Where-Object { $_ -ne $null } + + # Clear all columns for fully dynamic panel creation + foreach ($col in $columns) { + if ($col) { $col.Children.Clear() } + } + + $script:UiControlMappings = @{} + $script:CategoryCardMap = @{} + + function CreateLabeledCombo($parent, $labelText, $comboName, $items) { + # If only 2 items (No Change + one option), use a checkbox instead + if ($items.Count -eq 2) { + $checkbox = New-Object System.Windows.Controls.CheckBox + $checkbox.Content = $labelText + $checkbox.Name = $comboName + $checkbox.IsChecked = $false + $checkbox.Style = $window.Resources["FeatureCheckboxStyle"] + $parent.Children.Add($checkbox) | Out-Null + + # Register the checkbox with the window's name scope + try { + [System.Windows.NameScope]::SetNameScope($checkbox, [System.Windows.NameScope]::GetNameScope($window)) + $window.RegisterName($comboName, $checkbox) + } + catch { + # Name might already be registered, ignore + } + + return $checkbox + } + + # Otherwise use a combobox for multiple options + $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 + try { + [System.Windows.NameScope]::SetNameScope($lbl, [System.Windows.NameScope]::GetNameScope($window)) + $window.RegisterName($labelName, $lbl) + } + catch { + # Name might already be registered, ignore + } + + $combo = New-Object System.Windows.Controls.ComboBox + $combo.Name = $comboName + 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 + + # Register the combo box with the window's name scope + try { + [System.Windows.NameScope]::SetNameScope($combo, [System.Windows.NameScope]::GetNameScope($window)) + $window.RegisterName($comboName, $combo) + } + catch { + # Name might already be registered, ignore + } + + return $combo + } + + 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 + + $border = New-Object System.Windows.Controls.Border + $border.Style = $window.Resources['CategoryCardBorderStyle'] + $border.Tag = 'DynamicCategory' + + $panel = New-Object System.Windows.Controls.StackPanel + $safe = ($category -replace '[^a-zA-Z0-9_]','_') + $panel.Name = "Category_{0}_Panel" -f $safe + + $header = New-Object System.Windows.Controls.TextBlock + $header.Text = $category + $header.Style = $window.Resources['CategoryHeaderTextBlock'] + $panel.Children.Add($header) | Out-Null + + $border.Child = $panel + $target.Children.Add($border) | Out-Null + + $script:CategoryCardMap[$category] = $panel + return $panel + } + + # Determine categories present (from lists and features) + $categoriesPresent = @{} + if ($featuresJson.UiGroups) { + foreach ($g in $featuresJson.UiGroups) { if ($g.Category) { $categoriesPresent[$g.Category] = $true } } + } + foreach ($f in $featuresJson.Features) { if ($f.Category) { $categoriesPresent[$f.Category] = $true } } + + # Create cards in the order defined in Features.json Categories (if present) + $orderedCategories = @() + if ($featuresJson.Categories) { + foreach ($c in $featuresJson.Categories) { if ($categoriesPresent.ContainsKey($c)) { $orderedCategories += $c } } + } else { + $orderedCategories = $categoriesPresent.Keys + } + + foreach ($category in $orderedCategories) { + # Create/get card for this category + $panel = GetOrCreateCategoryCard -category $category + if (-not $panel) { continue } + + # Collect groups and features for this category, then sort by priority + $categoryItems = @() + + # Add any groups for this category + if ($featuresJson.UiGroups) { + $groupIndex = 0 + foreach ($group in $featuresJson.UiGroups) { + if ($group.Category -ne $category) { $groupIndex++; continue } + $categoryItems += [PSCustomObject]@{ + Type = 'group' + Data = $group + Priority = if ($null -ne $group.Priority) { $group.Priority } else { [int]::MaxValue } + OriginalIndex = $groupIndex + } + $groupIndex++ + } + } + + # Add individual features for this category + $featureIndex = 0 + foreach ($feature in $featuresJson.Features) { + if ($feature.Category -ne $category) { $featureIndex++; continue } + + # Check version and feature compatibility using Features.json + if (($feature.MinVersion -and $WinVersion -lt $feature.MinVersion) -or ($feature.MaxVersion -and $WinVersion -gt $feature.MaxVersion) -or ($feature.FeatureId -eq 'DisableModernStandbyNetworking' -and (-not $script:ModernStandbySupported))) { + $featureIndex++; continue + } + + # Skip if feature part of a group + $inGroup = $false + if ($featuresJson.UiGroups) { + foreach ($g in $featuresJson.UiGroups) { foreach ($val in $g.Values) { if ($val.FeatureIds -contains $feature.FeatureId) { $inGroup = $true; break } }; if ($inGroup) { break } } + } + if ($inGroup) { $featureIndex++; continue } + + $categoryItems += [PSCustomObject]@{ + Type = 'feature' + Data = $feature + Priority = if ($null -ne $feature.Priority) { $feature.Priority } else { [int]::MaxValue } + OriginalIndex = $featureIndex + } + $featureIndex++ + } + + # Sort by priority first, then by original index for items with same/no priority + $sortedItems = $categoryItems | Sort-Object -Property Priority, OriginalIndex + + # Render sorted items + foreach ($item in $sortedItems) { + if ($item.Type -eq 'group') { + $group = $item.Data + $items = @('No Change') + ($group.Values | ForEach-Object { $_.Label }) + $comboName = 'Group_{0}Combo' -f $group.GroupId + $combo = CreateLabeledCombo -parent $panel -labelText $group.Label -comboName $comboName -items $items + $script:UiControlMappings[$comboName] = @{ Type='group'; Values = $group.Values; Label = $group.Label } + } + elseif ($item.Type -eq 'feature') { + $feature = $item.Data + $opt = 'Apply' + if ($feature.FeatureId -match '^Disable') { $opt = 'Disable' } elseif ($feature.FeatureId -match '^Enable') { $opt = 'Enable' } + $items = @('No Change', $opt) + $comboName = ("Feature_{0}_Combo" -f $feature.FeatureId) -replace '[^a-zA-Z0-9_]','' + $combo = CreateLabeledCombo -parent $panel -labelText ($feature.Action + ' ' + $feature.Label) -comboName $comboName -items $items + $script:UiControlMappings[$comboName] = @{ Type='feature'; FeatureId = $feature.FeatureId; Action = $feature.Action } + } + } + } + } + + # Helper function to complete app loading with the WinGet list + function script:LoadAppsWithList($listOfApps) { + $appsToAdd = GetAppsFromJson -OnlyInstalled:$onlyInstalledAppsBox.IsChecked -InstalledList $listOfApps -InitialCheckedFromJson:$false + + # Reset the last selected checkbox when loading a new list + $script:MainWindowLastSelectedCheckbox = $null + + # Sort apps alphabetically and add to panel + $appsToAdd | Sort-Object -Property DisplayName | ForEach-Object { + $checkbox = New-Object System.Windows.Controls.CheckBox + $checkbox.Content = $_.DisplayName + $checkbox.Tag = $_.AppId + $checkbox.IsChecked = $_.IsChecked + $checkbox.ToolTip = $_.Description + $checkbox.Style = $window.Resources["AppsPanelCheckBoxStyle"] + + # Store metadata in checkbox for later use + Add-Member -InputObject $checkbox -MemberType NoteProperty -Name "SelectedByDefault" -Value $_.SelectedByDefault + + # Add event handler to update status + $checkbox.Add_Checked({ UpdateAppSelectionStatus }) + $checkbox.Add_Unchecked({ UpdateAppSelectionStatus }) + + # Attach shift-click behavior for range selection + AttachShiftClickBehavior -checkbox $checkbox -appsPanel $appsPanel -lastSelectedCheckboxRef ([ref]$script:MainWindowLastSelectedCheckbox) -updateStatusCallback { UpdateAppSelectionStatus } + + $appsPanel.Children.Add($checkbox) | Out-Null + } + + # Hide loading indicator and navigation blocker, update status + $loadingAppsIndicator.Visibility = 'Collapsed' + + UpdateAppSelectionStatus + } + + # Loads apps into the UI + function LoadAppsIntoMainUI { + # Cancel any existing load operation to prevent race conditions + if ($script:CurrentAppLoadTimer -and $script:CurrentAppLoadTimer.IsEnabled) { + $script:CurrentAppLoadTimer.Stop() + } + if ($script:CurrentAppLoadJob) { + Remove-Job -Job $script:CurrentAppLoadJob -Force -ErrorAction SilentlyContinue + } + $script:CurrentAppLoadTimer = $null + $script:CurrentAppLoadJob = $null + $script:CurrentAppLoadJobStartTime = $null + + # Show loading indicator and navigation blocker, clear existing apps immediately + $loadingAppsIndicator.Visibility = 'Visible' + $appsPanel.Children.Clear() + + # Update navigation buttons to disable Next/Previous + UpdateNavigationButtons + + # Force UI to update and render all changes (loading indicator, blocker, disabled buttons) + $window.Dispatcher.Invoke([System.Windows.Threading.DispatcherPriority]::Render, [action]{}) + + # Schedule the actual loading work to run after UI has updated + $window.Dispatcher.BeginInvoke([System.Windows.Threading.DispatcherPriority]::Background, [action]{ + $listOfApps = "" + + if ($onlyInstalledAppsBox.IsChecked -and ($script:WingetInstalled -eq $true)) { + # Start job to get list of installed apps via WinGet (async helper) + $asyncJob = GetInstalledAppsViaWinget -Async + $script:CurrentAppLoadJob = $asyncJob.Job + $script:CurrentAppLoadJobStartTime = $asyncJob.StartTime + + # Create timer to poll job status without blocking UI + $script:CurrentAppLoadTimer = New-Object System.Windows.Threading.DispatcherTimer + $script:CurrentAppLoadTimer.Interval = [TimeSpan]::FromMilliseconds(100) + + $script:CurrentAppLoadTimer.Add_Tick({ + # Check if this timer was cancelled (another load started) + if (-not $script:CurrentAppLoadJob -or -not $script:CurrentAppLoadTimer -or -not $script:CurrentAppLoadJobStartTime) { + if ($script:CurrentAppLoadTimer) { $script:CurrentAppLoadTimer.Stop() } + return + } + + $elapsed = (Get-Date) - $script:CurrentAppLoadJobStartTime + + # Check if job is complete or timed out (10 seconds) + if ($script:CurrentAppLoadJob.State -eq 'Completed') { + $script:CurrentAppLoadTimer.Stop() + $listOfApps = Receive-Job -Job $script:CurrentAppLoadJob + Remove-Job -Job $script:CurrentAppLoadJob -ErrorAction SilentlyContinue + $script:CurrentAppLoadJob = $null + $script:CurrentAppLoadTimer = $null + $script:CurrentAppLoadJobStartTime = $null + + # Continue with loading apps + LoadAppsWithList $listOfApps + } + elseif ($elapsed.TotalSeconds -gt 10 -or $script:CurrentAppLoadJob.State -eq 'Failed') { + $script:CurrentAppLoadTimer.Stop() + Remove-Job -Job $script:CurrentAppLoadJob -Force -ErrorAction SilentlyContinue + $script:CurrentAppLoadJob = $null + $script:CurrentAppLoadTimer = $null + $script:CurrentAppLoadJobStartTime = $null + + # Show error that the script was unable to get list of apps from WinGet + [System.Windows.MessageBox]::Show('Unable to load list of installed apps via WinGet.', 'Error', 'OK', 'Error') | Out-Null + $onlyInstalledAppsBox.IsChecked = $false + + # Continue with loading all apps (unchecked now) + LoadAppsWithList "" + } + }) + + $script:CurrentAppLoadTimer.Start() + return # Exit here, timer will continue the work + } + + # If checkbox is not checked or winget not installed, load all apps immediately + LoadAppsWithList $listOfApps + }) | Out-Null + } + + # Event handlers for app selection + $onlyInstalledAppsBox.Add_Checked({ + LoadAppsIntoMainUI + }) + $onlyInstalledAppsBox.Add_Unchecked({ + LoadAppsIntoMainUI + }) + + # Quick selection buttons - only select apps actually in those categories + $defaultAppsBtn.Add_Click({ + foreach ($child in $appsPanel.Children) { + if ($child -is [System.Windows.Controls.CheckBox]) { + if ($child.SelectedByDefault -eq $true) { + $child.IsChecked = $true + } else { + $child.IsChecked = $false + } + } + } + }) + + $clearAppSelectionBtn.Add_Click({ + foreach ($child in $appsPanel.Children) { + if ($child -is [System.Windows.Controls.CheckBox]) { + $child.IsChecked = $false + } + } + }) + + # 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' + } + + # Clear all highlights first + foreach ($child in $appsPanel.Children) { + if ($child -is [System.Windows.Controls.CheckBox]) { + $child.Background = [System.Windows.Media.Brushes]::Transparent + } + } + + if ([string]::IsNullOrWhiteSpace($searchText)) { + return + } + + # Find and highlight all matching apps + $firstMatch = $null + $highlightBrush = if ($usesDarkMode) { $highlightColorDark } else { $highlightColor } + + 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 + + # Remember first match for scrolling + if ($null -eq $firstMatch) { + $firstMatch = $child + } + } + } + } + } + + # 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) + } + + 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() + } + } + }) + + # Wizard Navigation + $tabControl = $window.FindName('MainTabControl') + $previousBtn = $window.FindName('PreviousBtn') + $nextBtn = $window.FindName('NextBtn') + $userSelectionCombo = $window.FindName('UserSelectionCombo') + $userSelectionDescription = $window.FindName('UserSelectionDescription') + $otherUserPanel = $window.FindName('OtherUserPanel') + $otherUsernameTextBox = $window.FindName('OtherUsernameTextBox') + $usernameTextBoxPlaceholder = $window.FindName('UsernameTextBoxPlaceholder') + $usernameValidationMessage = $window.FindName('UsernameValidationMessage') + + # Navigation button handlers + function UpdateNavigationButtons { + $currentIndex = $tabControl.SelectedIndex + $totalTabs = $tabControl.Items.Count + + $homeIndex = 0 + $overviewIndex = $totalTabs - 2 + $applyIndex = $totalTabs - 1 + + # Navigation button visibility + if ($currentIndex -eq $homeIndex) { + $nextBtn.Visibility = 'Collapsed' + $previousBtn.Visibility = 'Collapsed' + } elseif ($currentIndex -eq $overviewIndex) { + $nextBtn.Visibility = 'Collapsed' + $previousBtn.Visibility = 'Visible' + } elseif ($currentIndex -eq $applyIndex) { + $nextBtn.Visibility = 'Collapsed' + $previousBtn.Visibility = 'Collapsed' + } else { + $nextBtn.Visibility = 'Visible' + $previousBtn.Visibility = 'Visible' + } + + # Update progress indicators + # Tab indices: 0=Home, 1=App Removal, 2=Tweaks, 3=Overview, 4=Apply + $blueColor = "#0067c0" + $greyColor = "#808080" + + $progressIndicator1 = $window.FindName('ProgressIndicator1') # App Removal + $progressIndicator2 = $window.FindName('ProgressIndicator2') # Tweaks + $progressIndicator3 = $window.FindName('ProgressIndicator3') # Overview + $bottomNavGrid = $window.FindName('BottomNavGrid') + + # Hide bottom navigation on home page and apply tab + if ($currentIndex -eq 0 -or $currentIndex -eq $applyIndex) { + $bottomNavGrid.Visibility = 'Collapsed' + } else { + $bottomNavGrid.Visibility = 'Visible' + } + + # Update indicator colors based on current tab + # Indicator 1 (App Removal) - tab index 1 + if ($currentIndex -ge 1) { + $progressIndicator1.Fill = $blueColor + } else { + $progressIndicator1.Fill = $greyColor + } + + # Indicator 2 (Tweaks) - tab index 2 + if ($currentIndex -ge 2) { + $progressIndicator2.Fill = $blueColor + } else { + $progressIndicator2.Fill = $greyColor + } + + # Indicator 3 (Overview) - tab index 3 + if ($currentIndex -ge 3) { + $progressIndicator3.Fill = $blueColor + } else { + $progressIndicator3.Fill = $greyColor + } + } + + # Update user selection description and show/hide other user panel + $userSelectionCombo.Add_SelectionChanged({ + switch ($userSelectionCombo.SelectedIndex) { + 0 { + $userSelectionDescription.Text = "Changes will be applied to the currently logged-in user profile." + $otherUserPanel.Visibility = 'Collapsed' + $usernameValidationMessage.Text = "" + } + 1 { + $userSelectionDescription.Text = "Changes will be applied to a different user profile on this system." + $otherUserPanel.Visibility = 'Visible' + $usernameValidationMessage.Text = "" + } + 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 = "" + } + } + }) + + $otherUsernameTextBox.Add_TextChanged({ + # Show/hide placeholder + if ([string]::IsNullOrWhiteSpace($otherUsernameTextBox.Text)) { + $usernameTextBoxPlaceholder.Visibility = 'Visible' + } else { + $usernameTextBoxPlaceholder.Visibility = 'Collapsed' + } + + ValidateOtherUsername + }) + + function ValidateOtherUsername { + # Only validate if "Other User" is selected + if ($userSelectionCombo.SelectedIndex -ne 1) { + return $true + } + + $username = $otherUsernameTextBox.Text.Trim() + + $errorBrush = [System.Windows.Media.SolidColorBrush]::new([System.Windows.Media.ColorConverter]::ConvertFromString("#c42b1c")) + $successBrush = [System.Windows.Media.SolidColorBrush]::new([System.Windows.Media.ColorConverter]::ConvertFromString("#28a745")) + + if ($username.Length -eq 0) { + $usernameValidationMessage.Text = "[X] Please enter a username" + $usernameValidationMessage.Foreground = $errorBrush + return $false + } + + if ($username -eq $env:USERNAME) { + $usernameValidationMessage.Text = "[X] Cannot enter your own username, use 'Current User' option instead" + $usernameValidationMessage.Foreground = $errorBrush + return $false + } + + $userExists = CheckIfUserExists -Username $username + + if ($userExists) { + $usernameValidationMessage.Text = "[OK] User found: $username" + $usernameValidationMessage.Foreground = $successBrush + return $true + } + + $usernameValidationMessage.Text = "[X] User not found, please enter a valid username" + $usernameValidationMessage.Foreground = $errorBrush + return $false + } + + function GenerateOverview { + # Load Features.json + $featuresJson = LoadJsonFile -filePath $script:FeaturesFilePath -expectedVersion "1.0" + $overviewChangesPanel = $window.FindName('OverviewChangesPanel') + $overviewChangesPanel.Children.Clear() + + $changesList = @() + + # Collect selected apps + $selectedAppsCount = 0 + foreach ($child in $appsPanel.Children) { + if ($child -is [System.Windows.Controls.CheckBox] -and $child.IsChecked) { + $selectedAppsCount++ + } + } + if ($selectedAppsCount -gt 0) { + $changesList += "Remove $selectedAppsCount selected application(s)" + } + + # Collect all ComboBox/CheckBox selections from dynamically created controls + if ($script:UiControlMappings) { + foreach ($mappingKey in $script:UiControlMappings.Keys) { + $control = $window.FindName($mappingKey) + $isSelected = $false + + # Check if it's a checkbox or combobox + if ($control -is [System.Windows.Controls.CheckBox]) { + $isSelected = $control.IsChecked -eq $true + } + elseif ($control -is [System.Windows.Controls.ComboBox]) { + $isSelected = $control.SelectedIndex -gt 0 + } + + if ($control -and $isSelected) { + $mapping = $script:UiControlMappings[$mappingKey] + if ($mapping.Type -eq 'group') { + # For combobox: SelectedIndex 0 = No Change, so subtract 1 to index into Values + $selectedValue = $mapping.Values[$control.SelectedIndex - 1] + foreach ($fid in $selectedValue.FeatureIds) { + $feature = $featuresJson.Features | Where-Object { $_.FeatureId -eq $fid } + if ($feature) { $changesList += ($feature.Action + ' ' + $feature.Label) } + } + } + elseif ($mapping.Type -eq 'feature') { + $feature = $featuresJson.Features | Where-Object { $_.FeatureId -eq $mapping.FeatureId } + if ($feature) { $changesList += ($feature.Action + ' ' + $feature.Label) } + } + } + } + } + + if ($changesList.Count -eq 0) { + $textBlock = New-Object System.Windows.Controls.TextBlock + $textBlock.Text = "No changes selected" + $textBlock.Style = $window.Resources["OverviewNoChangesTextStyle"] + $overviewChangesPanel.Children.Add($textBlock) | Out-Null + } + else { + foreach ($change in $changesList) { + $bullet = New-Object System.Windows.Controls.TextBlock + $bullet.Text = "- $change" + $bullet.Style = $window.Resources["OverviewChangeBulletStyle"] + $overviewChangesPanel.Children.Add($bullet) | Out-Null + } + } + } + + $previousBtn.Add_Click({ + if ($tabControl.SelectedIndex -gt 0) { + $tabControl.SelectedIndex-- + UpdateNavigationButtons + } + }) + + $nextBtn.Add_Click({ + if ($tabControl.SelectedIndex -lt ($tabControl.Items.Count - 1)) { + $tabControl.SelectedIndex++ + + UpdateNavigationButtons + } + }) + + # Handle Home Start button + $homeStartBtn = $window.FindName('HomeStartBtn') + $homeStartBtn.Add_Click({ + # Navigate to first tab after home (App Removal) + $tabControl.SelectedIndex = 1 + UpdateNavigationButtons + }) + + # Handle Overview Apply Changes button - validates and immediately starts applying changes + $overviewApplyBtn = $window.FindName('OverviewApplyBtn') + $overviewApplyBtn.Add_Click({ + if (-not (ValidateOtherUsername)) { + [System.Windows.MessageBox]::Show("Please enter a valid username.", "Invalid Username", [System.Windows.MessageBoxButton]::OK, [System.Windows.MessageBoxImage]::Warning) | Out-Null + 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) { + if ($child -is [System.Windows.Controls.CheckBox] -and $child.IsChecked) { + $selectedApps += $child.Tag + } + } + + if ($selectedApps.Count -gt 0) { + # Check if Microsoft Store is selected + if ($selectedApps -contains "Microsoft.WindowsStore") { + $result = [System.Windows.MessageBox]::Show( + 'Are you sure you wish to uninstall the Microsoft Store? This app cannot easily be reinstalled.', + 'Are you sure?', + [System.Windows.MessageBoxButton]::YesNo, + [System.Windows.MessageBoxImage]::Warning + ) + + if ($result -eq [System.Windows.MessageBoxResult]::No) { + return + } + } + + AddParameter 'RemoveApps' + AddParameter 'Apps' ($selectedApps -join ',') + } + + # Apply dynamic tweaks selections + if ($script:UiControlMappings) { + foreach ($mappingKey in $script:UiControlMappings.Keys) { + $control = $window.FindName($mappingKey) + $isSelected = $false + $selectedIndex = 0 + + # Check if it's a checkbox or combobox + if ($control -is [System.Windows.Controls.CheckBox]) { + $isSelected = $control.IsChecked -eq $true + $selectedIndex = if ($isSelected) { 1 } else { 0 } + } + elseif ($control -is [System.Windows.Controls.ComboBox]) { + $isSelected = $control.SelectedIndex -gt 0 + $selectedIndex = $control.SelectedIndex + } + + if ($control -and $isSelected) { + $mapping = $script:UiControlMappings[$mappingKey] + if ($mapping.Type -eq 'group') { + if ($selectedIndex -gt 0 -and $selectedIndex -le $mapping.Values.Count) { + $selectedValue = $mapping.Values[$selectedIndex - 1] + foreach ($fid in $selectedValue.FeatureIds) { + AddParameter $fid + } + } + } + elseif ($mapping.Type -eq 'feature') { + AddParameter $mapping.FeatureId + } + } + } + } + + # 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-- + } + + if ($totalChanges -eq 0) { + [System.Windows.MessageBox]::Show( + 'No changes have been selected, please select at least one item to proceed.', + 'No Changes Selected', + [System.Windows.MessageBoxButton]::OK, + [System.Windows.MessageBoxImage]::Information + ) + return + } + + # Check RestorePointCheckBox + $restorePointCheckBox = $window.FindName('RestorePointCheckBox') + if ($restorePointCheckBox -and $restorePointCheckBox.IsChecked) { + AddParameter 'CreateRestorePoint' + } + + # Store selected user mode + switch ($userSelectionCombo.SelectedIndex) { + 1 { AddParameter User ($otherUsernameTextBox.Text.Trim()) } + 2 { AddParameter Sysprep } + } + + SaveSettings + + # Navigate to Apply tab (last tab) and start applying changes + $tabControl.SelectedIndex = $tabControl.Items.Count - 1 + + # Clear console and set initial status + $consoleOutput.Text = "" + + Write-ToConsole "Applying changes to $(if ($script:Params.ContainsKey("Sysprep")) { "default user template" } else { "user $(GetUserName)" })" + Write-ToConsole "Total changes to apply: $totalChanges" + Write-ToConsole "" + + # Run changes in background to keep UI responsive + $window.Dispatcher.BeginInvoke([System.Windows.Threading.DispatcherPriority]::Background, [action]{ + 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" + } + } + + Write-ToConsole "" + Write-ToConsole "All changes have been applied. Please check the output above for any errors." + + $finishBtn.Dispatcher.Invoke([action]{ + $finishBtn.IsEnabled = $true + $finishBtnText.Text = "Close Win11Debloat" + }) + } + catch { + Write-ToConsole "Error: $($_.Exception.Message)" + $finishBtn.Dispatcher.Invoke([action]{ + $finishBtn.IsEnabled = $true + $finishBtnText.Text = "Close Win11Debloat" + }) + } + }) + }) + + # Initialize UI elements on window load + $window.Add_Loaded({ + BuildDynamicTweaks + + LoadAppsIntoMainUI + + UpdateNavigationButtons + }) + + # Add event handler for tab changes + $tabControl.Add_SelectionChanged({ + # Regenerate overview when switching to Overview tab + if ($tabControl.SelectedIndex -eq ($tabControl.Items.Count - 2)) { + GenerateOverview + } + UpdateNavigationButtons + }) + + # Handle Load Defaults button + $loadDefaultsBtn = $window.FindName('LoadDefaultsBtn') + $loadDefaultsBtn.Add_Click({ + $defaultsJson = LoadJsonFile -filePath $script:DefaultSettingsFilePath -expectedVersion "1.0" + + if (-not $defaultsJson) { + [System.Windows.MessageBox]::Show("Failed to load default settings file", "Error", [System.Windows.MessageBoxButton]::OK, [System.Windows.MessageBoxImage]::Error) + return + } + + ApplySettingsToUiControls -window $window -settingsJson $defaultsJson -uiControlMappings $script:UiControlMappings + }) + + # Handle Load Last Used settings and Load Last Used apps + $loadLastUsedBtn = $window.FindName('LoadLastUsedBtn') + $loadLastUsedAppsBtn = $window.FindName('LoadLastUsedAppsBtn') + + $lastUsedSettingsJson = LoadJsonFile -filePath $script:SavedSettingsFilePath -expectedVersion "1.0" -optionalFile + + $hasSettings = $false + $appsSetting = $null + if ($lastUsedSettingsJson -and $lastUsedSettingsJson.Settings) { + foreach ($s in $lastUsedSettingsJson.Settings) { + # Only count as hasSettings if a setting other than RemoveApps/Apps is present and true + if ($s.Value -eq $true -and $s.Name -ne 'RemoveApps' -and $s.Name -ne 'Apps') { $hasSettings = $true } + if ($s.Name -eq 'Apps' -and $s.Value) { $appsSetting = $s.Value } + } + } + + # Show option to load last used settings if they exist + if ($hasSettings) { + $loadLastUsedBtn.Add_Click({ + try { + ApplySettingsToUiControls -window $window -settingsJson $lastUsedSettingsJson -uiControlMappings $script:UiControlMappings + } + catch { + [System.Windows.MessageBox]::Show("Failed to load last used settings: $_", "Error", [System.Windows.MessageBoxButton]::OK, [System.Windows.MessageBoxImage]::Error) + } + }) + } + else { + $loadLastUsedBtn.Visibility = 'Collapsed' + } + + # Show option to load last used apps if they exist + if ($appsSetting -and $appsSetting.ToString().Trim().Length -gt 0) { + $loadLastUsedAppsBtn.Add_Click({ + try { + $savedApps = @() + if ($appsSetting -is [string]) { $savedApps = $appsSetting.Split(',') } + elseif ($appsSetting -is [array]) { $savedApps = $appsSetting } + $savedApps = $savedApps | ForEach-Object { $_.Trim() } | Where-Object { $_ -ne '' } + + foreach ($child in $appsPanel.Children) { + if ($child -is [System.Windows.Controls.CheckBox]) { + if ($savedApps -contains $child.Tag) { $child.IsChecked = $true } else { $child.IsChecked = $false } + } + } + } + catch { + [System.Windows.MessageBox]::Show("Failed to load last used app selection: $_", "Error", [System.Windows.MessageBoxButton]::OK, [System.Windows.MessageBoxImage]::Error) + } + }) + } + else { + $loadLastUsedAppsBtn.Visibility = 'Collapsed' + } + + # Clear All Tweaks button + $clearAllTweaksBtn = $window.FindName('ClearAllTweaksBtn') + $clearAllTweaksBtn.Add_Click({ + # Reset all ComboBoxes to index 0 (No Change) and uncheck all CheckBoxes + if ($script:UiControlMappings) { + foreach ($comboName in $script:UiControlMappings.Keys) { + $control = $window.FindName($comboName) + if ($control -is [System.Windows.Controls.CheckBox]) { + $control.IsChecked = $false + } + elseif ($control -is [System.Windows.Controls.ComboBox]) { + $control.SelectedIndex = 0 + } + } + } + + # Also uncheck RestorePointCheckBox + $restorePointCheckBox = $window.FindName('RestorePointCheckBox') + if ($restorePointCheckBox) { + $restorePointCheckBox.IsChecked = $false + } + }) + + # Finish (Close Win11Debloat) button handler + $finishBtn.Add_Click({ + $window.Close() + }) + + # Show the window + return $window.ShowDialog() +} + + +# Shows application selection window that allows the user to select what apps they want to remove or keep +function OpenAppSelectionWindow { + Add-Type -AssemblyName PresentationFramework,PresentationCore,WindowsBase | Out-Null + + $usesDarkMode = GetSystemUsesDarkMode + + # Load XAML from file + $xaml = Get-Content -Path $script:AppSelectionSchema -Raw + $reader = [System.Xml.XmlReader]::Create([System.IO.StringReader]::new($xaml)) + try { + $window = [System.Windows.Markup.XamlReader]::Load($reader) + } + finally { + $reader.Close() + } + + SetWindowThemeResources -window $window -usesDarkMode $usesDarkMode + + $appsPanel = $window.FindName('AppsPanel') + $checkAllBox = $window.FindName('CheckAllBox') + $onlyInstalledBox = $window.FindName('OnlyInstalledBox') + $confirmBtn = $window.FindName('ConfirmBtn') + $loadingIndicator = $window.FindName('LoadingAppsIndicator') + $titleBar = $window.FindName('TitleBar') + + # Track the last selected checkbox for shift-click range selection + $script:AppSelectionWindowLastSelectedCheckbox = $null + + # Loads apps into the apps UI + function LoadApps { + # Show loading indicator + $loadingIndicator.Visibility = 'Visible' + $window.Dispatcher.Invoke([System.Windows.Threading.DispatcherPriority]::Background, [action]{}) + + $appsPanel.Children.Clear() + $listOfApps = "" + + if ($onlyInstalledBox.IsChecked -and ($script:WingetInstalled -eq $true)) { + # Attempt to get a list of installed apps via WinGet, times out after 10 seconds + $listOfApps = GetInstalledAppsViaWinget -TimeOut 10 + if (-not $listOfApps) { + # Show error that the script was unable to get list of apps from WinGet + [System.Windows.MessageBox]::Show('Unable to load list of installed apps via WinGet.', 'Error', 'OK', 'Error') | Out-Null + $onlyInstalledBox.IsChecked = $false + } + } + + $appsToAdd = GetAppsFromJson -OnlyInstalled:$onlyInstalledBox.IsChecked -InstalledList $listOfApps -InitialCheckedFromJson + + # Reset the last selected checkbox when loading a new list + $script:AppSelectionWindowLastSelectedCheckbox = $null + + # Sort apps alphabetically and add to panel + $appsToAdd | Sort-Object -Property DisplayName | ForEach-Object { + $checkbox = New-Object System.Windows.Controls.CheckBox + $checkbox.Content = $_.DisplayName + $checkbox.Tag = $_.AppId + $checkbox.IsChecked = $_.IsChecked + $checkbox.ToolTip = $_.Description + $checkbox.Style = $window.Resources["AppsPanelCheckBoxStyle"] + + # Attach shift-click behavior for range selection + AttachShiftClickBehavior -checkbox $checkbox -appsPanel $appsPanel -lastSelectedCheckboxRef ([ref]$script:AppSelectionWindowLastSelectedCheckbox) + + $appsPanel.Children.Add($checkbox) | Out-Null + } + + # Hide loading indicator + $loadingIndicator.Visibility = 'Collapsed' + } + + # Event handlers + $titleBar.Add_MouseLeftButtonDown({ + $window.DragMove() + }) + + $checkAllBox.Add_Checked({ + foreach ($child in $appsPanel.Children) { + if ($child -is [System.Windows.Controls.CheckBox]) { + $child.IsChecked = $true + } + } + }) + + $checkAllBox.Add_Unchecked({ + foreach ($child in $appsPanel.Children) { + if ($child -is [System.Windows.Controls.CheckBox]) { + $child.IsChecked = $false + } + } + }) + + $onlyInstalledBox.Add_Checked({ LoadApps }) + $onlyInstalledBox.Add_Unchecked({ LoadApps }) + + $confirmBtn.Add_Click({ + $selectedApps = @() + foreach ($child in $appsPanel.Children) { + if ($child -is [System.Windows.Controls.CheckBox] -and $child.IsChecked) { + $selectedApps += $child.Tag + } + } + + # Close form without saving if no apps were selected + if ($selectedApps.Count -eq 0) { + $window.Close() + return + } + + if ($selectedApps -contains "Microsoft.WindowsStore" -and -not $Silent) { + $result = [System.Windows.MessageBox]::Show( + 'Are you sure you wish to uninstall the Microsoft Store? This app cannot easily be reinstalled.', + 'Are you sure?', + [System.Windows.MessageBoxButton]::YesNo, + [System.Windows.MessageBoxImage]::Warning + ) + + if ($result -eq [System.Windows.MessageBoxResult]::No) { + return + } + } + + SaveCustomAppsListToFile -appsList $selectedApps + + $window.DialogResult = $true + }) + + # Load apps after window is shown (allows UI to render first) + $window.Add_ContentRendered({ + $window.Dispatcher.Invoke([System.Windows.Threading.DispatcherPriority]::Background, [action]{ LoadApps }) + }) + + # Show the window and return dialog result + return $window.ShowDialog() +} + + +# Saves the provided appsList to the CustomAppsList file +function SaveCustomAppsListToFile { + param ( + $appsList + ) + + $script:SelectedApps = $appsList + + # Create file that stores selected apps if it doesn't exist + if (-not (Test-Path $script:CustomAppsListFilePath)) { + $null = New-Item $script:CustomAppsListFilePath -ItemType File + } + + Set-Content -Path $script:CustomAppsListFilePath -Value $script:SelectedApps +} + + +# Returns a validated list of apps based on the provided appsList and the supported apps from Apps.json function ValidateAppslist { param ( $appsList ) - $supportedAppsList = @() + $supportedAppsList = (GetAppsFromJson | ForEach-Object { $_.AppId }) $validatedAppsList = @() - # Generate a list of supported apps from AppsList.txt - Foreach ($app in (Get-Content -Path $script:AppsListFilePath | Where-Object { $_ -notmatch '^\s*$' -and $_ -notmatch '^# .*' -and $_ -notmatch '^# -* #' } )) { - $app = $app.TrimStart("#") - - if (-not ($app.IndexOf('#') -eq -1)) { - $app = $app.Substring(0, $app.IndexOf('#')) - } - - $app = $app.Trim() - $appString = $app.Trim('*') - $supportedAppsList += $appString - } - # Validate provided appsList against supportedAppsList Foreach ($app in $appsList) { $app = $app.Trim() @@ -507,17 +1762,109 @@ function ReadAppslistFromFile { return $appsList } - Foreach ($app in (Get-Content -Path $appsFilePath | Where-Object { $_ -notmatch '^#.*' -and $_ -notmatch '^\s*$' } )) { - if (-not ($app.IndexOf('#') -eq -1)) { - $app = $app.Substring(0, $app.IndexOf('#')) + try { + # Check if file is JSON or text format + if ($appsFilePath -like "*.json") { + # JSON file format + $jsonContent = Get-Content -Path $appsFilePath -Raw | ConvertFrom-Json + Foreach ($appData in $jsonContent.Apps) { + $appId = $appData.AppId.Trim() + $selectedByDefault = $appData.SelectedByDefault + if ($selectedByDefault -and $appId.length -gt 0) { + $appsList += $appId + } + } + } + else { + # Legacy text file format + Foreach ($app in (Get-Content -Path $appsFilePath | Where-Object { $_ -notmatch '^#.*' -and $_ -notmatch '^\s*$' } )) { + if (-not ($app.IndexOf('#') -eq -1)) { + $app = $app.Substring(0, $app.IndexOf('#')) + } + + $app = $app.Trim() + $appString = $app.Trim('*') + $appsList += $appString + } } - $app = $app.Trim() - $appString = $app.Trim('*') - $appsList += $appString + return $appsList + } + catch { + Write-Error "Unable to read apps list from file: $appsFilePath" + AwaitKeyToExit + } +} + +# Read Apps.json and return list of app objects with optional filtering +function GetAppsFromJson { + param ( + [switch]$OnlyInstalled, + [string]$InstalledList = "", + [switch]$InitialCheckedFromJson + ) + + $apps = @() + try { + $jsonContent = Get-Content -Path $script:AppsListFilePath -Raw | ConvertFrom-Json + } + catch { + Write-Error "Failed to read Apps.json: $_" + return $apps } - return $appsList + foreach ($appData in $jsonContent.Apps) { + $appId = $appData.AppId.Trim() + if ($appId.length -eq 0) { continue } + + if ($OnlyInstalled) { + if (-not ($InstalledList -like ("*$appId*")) -and -not (Get-AppxPackage -Name $appId)) { + continue + } + if (($appId -eq "Microsoft.Edge") -and -not ($InstalledList -like "* Microsoft.Edge *")) { + continue + } + } + + $displayName = if ($appData.FriendlyName) { "$($appData.FriendlyName) ($appId)" } else { $appId } + $isChecked = if ($InitialCheckedFromJson) { $appData.SelectedByDefault } else { $false } + + $apps += [PSCustomObject]@{ + AppId = $appId + DisplayName = $displayName + IsChecked = $isChecked + Description = $appData.Description + SelectedByDefault = $appData.SelectedByDefault + } + } + + return $apps +} + +# Run winget list and return installed apps (sync or async) +function GetInstalledAppsViaWinget { + param ( + [int]$TimeOut = 10, + [switch]$Async + ) + + if (-not $script:WingetInstalled) { return $null } + + if ($Async) { + $wingetListJob = Start-Job { return winget list --accept-source-agreements --disable-interactivity } + return @{ Job = $wingetListJob; StartTime = Get-Date } + } + else { + $wingetListJob = Start-Job { return winget list --accept-source-agreements --disable-interactivity } + $jobDone = $wingetListJob | Wait-Job -TimeOut $TimeOut + if (-not $jobDone) { + Remove-Job -Job $wingetListJob -Force -ErrorAction SilentlyContinue + return $null + } + $result = Receive-Job -Job $wingetListJob + Remove-Job -Job $wingetListJob -ErrorAction SilentlyContinue + return $result + } } @@ -528,34 +1875,35 @@ function RemoveApps { ) Foreach ($app in $appsList) { - Write-Output "Attempting to remove $app..." + Write-ToConsole "Attempting to remove $app..." - # Use winget only to remove OneDrive and Edge + # Use WinGet only to remove OneDrive and Edge if (($app -eq "Microsoft.OneDrive") -or ($app -eq "Microsoft.Edge")) { if ($script:WingetInstalled -eq $false) { - Write-Host "WinGet is either not installed or is outdated, $app could not be removed" -ForegroundColor Red + Write-ToConsole "WinGet is either not installed or is outdated, $app could not be removed" -ForegroundColor Red continue } $appName = $app -replace '\.', '_' - # Uninstall app via winget, or create a scheduled task to uninstall it later + # Uninstall app via WinGet, or create a scheduled task to uninstall it later if ($script:Params.ContainsKey("User")) { RegImport "Adding scheduled task to uninstall $app for user $(GetUserName)..." "Uninstall_$($appName).reg" } elseif ($script:Params.ContainsKey("Sysprep")) { - RegImport "Adding scheduled task to uninstall $app after new users log in..." "Uninstall_$($appName).reg" + RegImport "Adding scheduled task to uninstall $app after for new users..." "Uninstall_$($appName).reg" } else { - # Uninstall app via winget, with any progress indicators removed from the output + # Uninstall app via WinGet, with any progress indicators removed from the output StripProgress -ScriptBlock { winget uninstall --accept-source-agreements --disable-interactivity --id $app } | Tee-Object -Variable wingetOutput If (($app -eq "Microsoft.Edge") -and (Select-String -InputObject $wingetOutput -Pattern "Uninstall failed with exit code")) { - Write-Host "Unable to uninstall Microsoft Edge via Winget" -ForegroundColor Red - Write-Output "" + Write-ToConsole "Unable to uninstall Microsoft Edge via WinGet" -ForegroundColor Red + Write-ToConsole "" - if ($( Read-Host -Prompt "Would you like to forcefully uninstall Microsoft Edge? NOT RECOMMENDED! (y/n)" ) -eq 'y') { - Write-Output "" + # 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') { + Write-ToConsole "" ForceRemoveEdge } } @@ -572,12 +1920,12 @@ function RemoveApps { Get-AppxPackage -Name $app -AllUsers | Remove-AppxPackage -AllUsers -ErrorAction Continue if ($DebugPreference -ne "SilentlyContinue") { - Write-Host "Removed $app for all users" -ForegroundColor DarkGray + Write-ToConsole "Removed $app for all users" -ForegroundColor DarkGray } } catch { if ($DebugPreference -ne "SilentlyContinue") { - Write-Host "Unable to remove $app for all users" -ForegroundColor Yellow + Write-ToConsole "Unable to remove $app for all users" -ForegroundColor Yellow Write-Host $psitem.Exception.StackTrace -ForegroundColor Gray } } @@ -587,19 +1935,19 @@ function RemoveApps { Get-AppxProvisionedPackage -Online | Where-Object { $_.PackageName -like $app } | ForEach-Object { Remove-ProvisionedAppxPackage -Online -AllUsers -PackageName $_.PackageName } } catch { - Write-Host "Unable to remove $app from windows image" -ForegroundColor Yellow + Write-ToConsole "Unable to remove $app from windows image" -ForegroundColor Yellow Write-Host $psitem.Exception.StackTrace -ForegroundColor Gray } } - Write-Output "" + Write-ToConsole "" } # Forcefully removes Microsoft Edge using its uninstaller # Credit: Based on work from loadstring1 & ave9858 function ForceRemoveEdge { - Write-Output "> Forcefully uninstalling Microsoft Edge..." + Write-ToConsole "> Forcefully uninstalling Microsoft Edge..." $regView = [Microsoft.Win32.RegistryView]::Registry32 $hklm = [Microsoft.Win32.RegistryKey]::OpenBaseKey([Microsoft.Win32.RegistryHive]::LocalMachine, $regView) @@ -613,11 +1961,11 @@ function ForceRemoveEdge { # Remove edge $uninstallRegKey = $hklm.OpenSubKey('SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Microsoft Edge') if ($null -ne $uninstallRegKey) { - Write-Output "Running uninstaller..." + Write-ToConsole "Running uninstaller..." $uninstallString = $uninstallRegKey.GetValue('UninstallString') + ' --force-uninstall' Start-Process cmd.exe "/c $uninstallString" -WindowStyle Hidden -Wait - Write-Output "Removing leftover files..." + Write-ToConsole "Removing leftover files..." $edgePaths = @( "$env:ProgramData\Microsoft\Windows\Start Menu\Programs\Microsoft Edge.lnk", @@ -632,11 +1980,11 @@ function ForceRemoveEdge { foreach ($path in $edgePaths) { if (Test-Path -Path $path) { Remove-Item -Path $path -Force -Recurse -ErrorAction SilentlyContinue - Write-Host " Removed $path" -ForegroundColor DarkGray + Write-ToConsole " Removed $path" -ForegroundColor DarkGray } } - Write-Output "Cleaning up registry..." + Write-ToConsole "Cleaning up registry..." # Remove MS Edge from autostart reg delete "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run" /v "MicrosoftEdgeAutoLaunch_A9F6DCE4ABADF4F51CF45CD7129E3C6C" /f *>$null @@ -644,14 +1992,14 @@ function ForceRemoveEdge { reg delete "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\StartupApproved\Run" /v "MicrosoftEdgeAutoLaunch_A9F6DCE4ABADF4F51CF45CD7129E3C6C" /f *>$null reg delete "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\StartupApproved\Run" /v "Microsoft Edge Update" /f *>$null - Write-Output "Microsoft Edge was uninstalled" + Write-ToConsole "Microsoft Edge was uninstalled" } else { - Write-Output "" - Write-Host "Error: Unable to forcefully uninstall Microsoft Edge, uninstaller could not be found" -ForegroundColor Red + Write-ToConsole "" + Write-ToConsole "Error: Unable to forcefully uninstall Microsoft Edge, uninstaller could not be found" -ForegroundColor Red } - Write-Output "" + Write-ToConsole "" } @@ -710,6 +2058,40 @@ function CheckModernStandbySupport { } +function CheckIfUserExists { + param ( + $userName + ) + + if ($userName -match '[<>:"|?*]') { + return $false + } + + if ([string]::IsNullOrWhiteSpace($userName)) { + return $false + } + + try { + $userExists = Test-Path "$env:SystemDrive\Users\$userName" + + if ($userExists) { + return $true + } + + $userExists = Test-Path ($env:USERPROFILE -Replace ('\\' + $env:USERNAME + '$'), "\$userName") + + if ($userExists) { + return $true + } + } + catch { + Write-Error "Something went wrong when trying to find the user directory path for user $userName. Please ensure the user exists on this system" + } + + return $false +} + + # Returns the directory path of the specified user, exits script if user path can't be found function GetUserDirectory { param ( @@ -718,6 +2100,11 @@ function GetUserDirectory { $exitIfPathNotFound = $true ) + if (-not (CheckIfUserExists -userName $userName)) { + Write-Error "User $userName does not exist on this system" + AwaitKeyToExit + } + try { $userDirectoryExists = Test-Path "$env:SystemDrive\Users\$userName" $userPath = "$env:SystemDrive\Users\$userName\$fileName" @@ -750,60 +2137,90 @@ function RegImport { $path ) - Write-Output $message + Write-ToConsole $message + + # Validate that the regfile exists in both locations + if (-not (Test-Path "$script:RegfilesPath\$path") -or -not (Test-Path "$script:RegfilesPath\Sysprep\$path")) { + Write-ToConsole "Error: Unable to find registry file: $path" -ForegroundColor Red + Write-ToConsole "" + return + } + + # Reset exit code before running reg.exe for reliable success detection + $global:LASTEXITCODE = 0 if ($script:Params.ContainsKey("Sysprep")) { $defaultUserPath = GetUserDirectory -userName "Default" -fileName "NTUSER.DAT" reg load "HKU\Default" $defaultUserPath | Out-Null - reg import "$script:RegfilesPath\Sysprep\$path" + $regOutput = reg import "$script:RegfilesPath\Sysprep\$path" 2>&1 reg unload "HKU\Default" | Out-Null } elseif ($script:Params.ContainsKey("User")) { $userPath = GetUserDirectory -userName $script:Params.Item("User") -fileName "NTUSER.DAT" reg load "HKU\Default" $userPath | Out-Null - reg import "$script:RegfilesPath\Sysprep\$path" + $regOutput = reg import "$script:RegfilesPath\Sysprep\$path" 2>&1 reg unload "HKU\Default" | Out-Null } else { - reg import "$script:RegfilesPath\$path" + $regOutput = reg import "$script:RegfilesPath\$path" 2>&1 } - Write-Output "" + $hasSuccess = $LASTEXITCODE -eq 0 + + if ($regOutput) { + foreach ($line in $regOutput) { + $lineText = if ($line -is [System.Management.Automation.ErrorRecord]) { $line.Exception.Message } else { $line.ToString() } + if ($lineText -and $lineText.Length -gt 0) { + if ($hasSuccess) { + Write-ToConsole $lineText + } + else { + Write-ToConsole $lineText -ForegroundColor Red + } + } + } + } + + if (-not $hasSuccess) { + Write-ToConsole "Failed importing registry file: $path" -ForegroundColor Red + } + + Write-ToConsole "" } # Restart the Windows Explorer process function RestartExplorer { - Write-Output "> Attempting to restart the Windows Explorer process to apply all changes..." + Write-ToConsole "> Attempting to restart the Windows Explorer process to apply all changes..." if ($script:Params.ContainsKey("Sysprep") -or $script:Params.ContainsKey("User") -or $script:Params.ContainsKey("NoRestartExplorer")) { - Write-Host "Process restart was skipped, please manually reboot your PC to apply all changes" -ForegroundColor Yellow + Write-ToConsole "Explorer process restart was skipped, please manually reboot your PC to apply all changes" -ForegroundColor Yellow return } if ($script:Params.ContainsKey("DisableMouseAcceleration")) { - Write-Host "Warning: Changes to the Enhance Pointer Precision setting will only take effect after a reboot" -ForegroundColor Yellow + Write-ToConsole "Warning: Changes to the Enhance Pointer Precision setting will only take effect after a reboot" -ForegroundColor Yellow } if ($script:Params.ContainsKey("DisableStickyKeys")) { - Write-Host "Warning: Changes to the Sticky Keys setting will only take effect after a reboot" -ForegroundColor Yellow + Write-ToConsole "Warning: Changes to the Sticky Keys setting will only take effect after a reboot" -ForegroundColor Yellow } if ($script:Params.ContainsKey("DisableAnimations")) { - Write-Host "Warning: Animations will only be disabled after a reboot" -ForegroundColor Yellow + Write-ToConsole "Warning: Animations will only be disabled after a reboot" -ForegroundColor Yellow } # Only restart if the powershell process matches the OS architecture. # Restarting explorer from a 32bit PowerShell window will fail on a 64bit OS if ([Environment]::Is64BitProcess -eq [Environment]::Is64BitOperatingSystem) { - Write-Output "Restarting the Windows Explorer process... (This may cause your screen to flicker)" + Write-ToConsole "Restarting the Windows Explorer process... (This may cause your screen to flicker)" Stop-Process -processName: Explorer -Force } else { - Write-Host "Unable to restart Windows Explorer process, please manually reboot your PC to apply all changes" -ForegroundColor Yellow + Write-ToConsole "Unable to restart Windows Explorer process, please manually reboot your PC to apply all changes" -ForegroundColor Yellow } } @@ -815,12 +2232,12 @@ function ReplaceStartMenuForAllUsers { $startMenuTemplate = "$script:AssetsPath/Start/start2.bin" ) - Write-Output "> Removing all pinned apps from the start menu for all users..." + Write-ToConsole "> Removing all pinned apps from the start menu for all users..." # Check if template bin file exists if (-not (Test-Path $startMenuTemplate)) { - Write-Host "Error: Unable to clear start menu, start2.bin file missing from script folder" -ForegroundColor Red - Write-Output "" + Write-ToConsole "Error: Unable to clear start menu, start2.bin file missing from script folder" -ForegroundColor Red + Write-ToConsole "" return } @@ -839,13 +2256,13 @@ function ReplaceStartMenuForAllUsers { # Create folder if it doesn't exist if (-not (Test-Path $defaultStartMenuPath)) { new-item $defaultStartMenuPath -ItemType Directory -Force | Out-Null - Write-Output "Created LocalState folder for default user profile" + Write-ToConsole "Created LocalState folder for default user profile" } # Copy template to default profile Copy-Item -Path $startMenuTemplate -Destination $defaultStartMenuPath -Force - Write-Output "Replaced start menu for the default user profile" - Write-Output "" + Write-ToConsole "Replaced start menu for the default user profile" + Write-ToConsole "" } @@ -864,12 +2281,12 @@ function ReplaceStartMenu { # Check if template bin file exists if (-not (Test-Path $startMenuTemplate)) { - Write-Host "Error: Unable to replace start menu, template file not found" -ForegroundColor Red + Write-ToConsole "Error: Unable to replace start menu, template file not found" -ForegroundColor Red return } if ([IO.Path]::GetExtension($startMenuTemplate) -ne ".bin" ) { - Write-Host "Error: Unable to replace start menu, template file is not a valid .bin file" -ForegroundColor Red + Write-ToConsole "Error: Unable to replace start menu, template file is not a valid .bin file" -ForegroundColor Red return } @@ -882,14 +2299,14 @@ function ReplaceStartMenu { Move-Item -Path $startMenuBinFile -Destination $backupBinFile -Force } else { - Write-Host "Unable to find original start2.bin file for user $userName, no backup was created for this user" -ForegroundColor Yellow + Write-ToConsole "Unable to find original start2.bin file for user $userName, no backup was created for this user" -ForegroundColor Yellow New-Item -ItemType File -Path $startMenuBinFile -Force } # Copy template file Copy-Item -Path $startMenuTemplate -Destination $startMenuBinFile -Force - Write-Output "Replaced start menu for user $userName" + Write-ToConsole "Replaced start menu for user $userName" } @@ -960,33 +2377,12 @@ function PrintHeader { } -# Prints the contents of a file to the console -function PrintFromFile { - param ( - $path, - $title, - $printHeader = $true - ) - - if ($printHeader) { - Clear-Host - - PrintHeader $title - } - - # Get & print script menu from file - Foreach ($line in (Get-Content -Path $path )) { - Write-Host $line - } -} - - # Prints all pending changes that will be made by the script function PrintPendingChanges { Write-Output "Win11Debloat will make the following changes:" if ($script:Params['CreateRestorePoint']) { - Write-Output "- $($script:Features['CreateRestorePoint'])" + Write-Output "- $($script:Features['CreateRestorePoint'].Label)" } foreach ($parameterName in $script:Params.Keys) { if ($script:ControlParams -contains $parameterName) { @@ -1029,8 +2425,9 @@ function PrintPendingChanges { } default { if ($script:Features -and $script:Features.ContainsKey($parameterName)) { - $message = $script:Features[$parameterName] - Write-Output "- $message" + $action = $script:Features[$parameterName].Action + $message = $script:Features[$parameterName].Label + Write-Output "- $action $message" } else { # Fallback: show the parameter name if no feature description is available @@ -1092,35 +2489,176 @@ function GetUserName { } -function CreateSystemRestorePoint { - Write-Output "> Attempting to create a system restore point..." +# Executes a single parameter/feature based on its key +# Parameters: +# $paramKey - The parameter name to execute +function ExecuteParameter { + param ( + [string]$paramKey + ) + + # Check if this feature has metadata in Features.json + $feature = $null + if ($script:Features.ContainsKey($paramKey)) { + $feature = $script:Features[$paramKey] + } + + # If feature has RegistryKey and ApplyText, use dynamic RegImport + if ($feature -and $feature.RegistryKey -and $feature.ApplyText) { + RegImport $feature.ApplyText $feature.RegistryKey + + # Handle special cases that have additional logic after RegImport + switch ($paramKey) { + 'DisableBing' { + # Also remove the app package for Bing search + RemoveApps 'Microsoft.BingSearch' + } + 'DisableCopilot' { + # Also remove the app package for Copilot + RemoveApps 'Microsoft.Copilot' + } + 'DisableWidgets' { + # Also remove the app package for Widgets + RemoveApps 'Microsoft.StartExperiencesApp' + } + } + return + } + + # Handle features without RegistryKey or with special logic + switch ($paramKey) { + 'RemoveApps' { + Write-ToConsole "> Removing selected apps..." + $appsList = GenerateAppsList + if ($appsList.Count -eq 0) { + Write-ToConsole "No valid apps were selected for removal" -ForegroundColor Yellow + Write-ToConsole "" + return + } + + Write-ToConsole "$($appsList.Count) apps selected for removal" + RemoveApps $appsList + } + 'RemoveAppsCustom' { + Write-ToConsole "> Removing selected apps..." + $appsList = ReadAppslistFromFile $script:CustomAppsListFilePath + + if ($appsList.Count -eq 0) { + Write-ToConsole "No valid apps were selected for removal" -ForegroundColor Yellow + Write-ToConsole "" + return + } + + Write-ToConsole "$($appsList.Count) apps selected for removal" + RemoveApps $appsList + } + 'RemoveCommApps' { + $appsList = 'Microsoft.windowscommunicationsapps', 'Microsoft.People' + Write-ToConsole "> Removing Mail, Calendar and People apps..." + RemoveApps $appsList + return + } + 'RemoveW11Outlook' { + $appsList = 'Microsoft.OutlookForWindows' + Write-ToConsole "> Removing new Outlook for Windows app..." + RemoveApps $appsList + return + } + 'RemoveGamingApps' { + $appsList = 'Microsoft.GamingApp', 'Microsoft.XboxGameOverlay', 'Microsoft.XboxGamingOverlay' + Write-ToConsole "> Removing gaming related apps..." + RemoveApps $appsList + return + } + 'RemoveHPApps' { + $appsList = 'AD2F1837.HPAIExperienceCenter', 'AD2F1837.HPJumpStarts', 'AD2F1837.HPPCHardwareDiagnosticsWindows', 'AD2F1837.HPPowerManager', 'AD2F1837.HPPrivacySettings', 'AD2F1837.HPSupportAssistant', 'AD2F1837.HPSureShieldAI', 'AD2F1837.HPSystemInformation', 'AD2F1837.HPQuickDrop', 'AD2F1837.HPWorkWell', 'AD2F1837.myHP', 'AD2F1837.HPDesktopSupportUtilities', 'AD2F1837.HPQuickTouch', 'AD2F1837.HPEasyClean', 'AD2F1837.HPConnectedMusic', 'AD2F1837.HPFileViewer', 'AD2F1837.HPRegistration', 'AD2F1837.HPWelcome', 'AD2F1837.HPConnectedPhotopoweredbySnapfish', 'AD2F1837.HPPrinterControl' + Write-ToConsole "> Removing HP apps..." + RemoveApps $appsList + return + } + "ForceRemoveEdge" { + ForceRemoveEdge + return + } + 'ClearStart' { + Write-ToConsole "> Removing all pinned apps from the start menu for user $(GetUserName)..." + ReplaceStartMenu + Write-ToConsole "" + return + } + 'ReplaceStart' { + Write-ToConsole "> Replacing the start menu for user $(GetUserName)..." + ReplaceStartMenu $script:Params.Item("ReplaceStart") + Write-ToConsole "" + return + } + 'ClearStartAllUsers' { + ReplaceStartMenuForAllUsers + return + } + 'ReplaceStartAllUsers' { + ReplaceStartMenuForAllUsers $script:Params.Item("ReplaceStartAllUsers") + return + } + } +} + + +# Executes all selected parameters/features +# Parameters: +function ExecuteAllChanges { + # Create restore point if requested (CLI only - GUI handles this separately) + if ($script:Params.ContainsKey("CreateRestorePoint")) { + Write-ToConsole "> Attempting to create a system restore point..." + CreateSystemRestorePoint + } + + # Execute all parameters + foreach ($paramKey in $script:Params.Keys) { + if ($script:ControlParams -contains $paramKey) { + continue + } + + ExecuteParameter -paramKey $paramKey + } +} + + +function CreateSystemRestorePoint { $SysRestore = Get-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SystemRestore" -Name "RPSessionInterval" if ($SysRestore.RPSessionInterval -eq 0) { - if ($Silent -or $( Read-Host -Prompt "System restore is disabled, would you like to enable it and create a restore point? (y/n)") -eq 'y') { + # In GUI mode, skip the prompt and just try to enable it + if ($script:GuiConsoleOutput -or $Silent -or $( Read-Host -Prompt "System restore is disabled, would you like to enable it and create a restore point? (y/n)") -eq 'y') { $enableSystemRestoreJob = Start-Job { try { Enable-ComputerRestore -Drive "$env:SystemDrive" } catch { - Write-Host "Error: Failed to enable System Restore: $_" -ForegroundColor Red - return + return "Error: Failed to enable System Restore: $_" } + return $null } $enableSystemRestoreJobDone = $enableSystemRestoreJob | Wait-Job -TimeOut 20 if (-not $enableSystemRestoreJobDone) { - Write-Host "Error: Failed to enable system restore and create restore point, operation timed out" -ForegroundColor Red + Remove-Job -Job $enableSystemRestoreJob -Force -ErrorAction SilentlyContinue + Write-ToConsole "Error: Failed to enable system restore and create restore point, operation timed out" -ForegroundColor Red return } else { - Receive-Job $enableSystemRestoreJob + $result = Receive-Job $enableSystemRestoreJob + Remove-Job -Job $enableSystemRestoreJob -ErrorAction SilentlyContinue + if ($result) { + Write-ToConsole $result -ForegroundColor Red + return + } } } else { - Write-Output "" + Write-ToConsole "" return } } @@ -1131,73 +2669,75 @@ function CreateSystemRestorePoint { $recentRestorePoints = Get-ComputerRestorePoint | Where-Object { (Get-Date) - [System.Management.ManagementDateTimeConverter]::ToDateTime($_.CreationTime) -le (New-TimeSpan -Hours 24) } } catch { - Write-Host "Error: Unable to retrieve existing restore points: $_" -ForegroundColor Red - return + return @{ Success = $false; Message = "Error: Unable to retrieve existing restore points: $_" } } if ($recentRestorePoints.Count -eq 0) { try { Checkpoint-Computer -Description "Restore point created by Win11Debloat" -RestorePointType "MODIFY_SETTINGS" - Write-Output "System restore point created successfully" + return @{ Success = $true; Message = "System restore point created successfully" } } catch { - Write-Host "Error: Unable to create restore point: $_" -ForegroundColor Red + return @{ Success = $false; Message = "Error: Unable to create restore point: $_" } } } else { - Write-Host "A recent restore point already exists, no new restore point was created" -ForegroundColor Yellow + return @{ Success = $true; Message = "A recent restore point already exists, no new restore point was created"; Warning = $true } } } $createRestorePointJobDone = $createRestorePointJob | Wait-Job -TimeOut 20 if (-not $createRestorePointJobDone) { - Write-Host "Error: Failed to create system restore point, operation timed out" -ForegroundColor Red + Remove-Job -Job $createRestorePointJob -Force -ErrorAction SilentlyContinue + Write-ToConsole "Error: Failed to create system restore point, operation timed out" -ForegroundColor Red } else { - Receive-Job $createRestorePointJob + $result = Receive-Job $createRestorePointJob + Remove-Job -Job $createRestorePointJob -ErrorAction SilentlyContinue + if ($result.Success) { + if ($result.Warning) { + Write-ToConsole $result.Message -ForegroundColor Yellow + } + else { + Write-ToConsole $result.Message + } + } + else { + Write-ToConsole $result.Message -ForegroundColor Red + } } - Write-Output "" + Write-ToConsole "" } function ShowScriptMenuOptions { Do { - $ModeSelectionMessage = "Please select an option (1/2/3/0)" + $ModeSelectionMessage = "Please select an option (1/2)" PrintHeader 'Menu' Write-Host "(1) Default mode: Quickly apply the recommended changes" - Write-Host "(2) Custom mode: Manually select what changes to make" - Write-Host "(3) App removal mode: Select & remove apps, without making other changes" + Write-Host "(2) App removal mode: Select & remove apps, without making other changes" # Only show this option if SavedSettings file exists if (Test-Path $script:SavedSettingsFilePath) { - Write-Host "(4) Quickly apply your last used settings" + Write-Host "(3) Quickly apply your last used settings" - $ModeSelectionMessage = "Please select an option (1/2/3/4/0)" + $ModeSelectionMessage = "Please select an option (1/2/3)" } - Write-Host "" - Write-Host "(0) Show more information" Write-Host "" Write-Host "" $Mode = Read-Host $ModeSelectionMessage - if ($Mode -eq '0') { - # Print information screen from file - PrintFromFile "$script:AssetsPath/Menus/Info" "Information" - - Write-Host "Press any key to go back..." - $null = [System.Console]::ReadKey() - } - elseif (($Mode -eq '4') -and -not (Test-Path $script:SavedSettingsFilePath)) { + if (($Mode -eq '3') -and -not (Test-Path $script:SavedSettingsFilePath)) { $Mode = $null } } - while ($Mode -ne '1' -and $Mode -ne '2' -and $Mode -ne '3' -and $Mode -ne '4') + while ($Mode -ne '1' -and $Mode -ne '2' -and $Mode -ne '3') return $Mode } @@ -1224,12 +2764,6 @@ function ShowDefaultModeOptions { # Add default settings based on user input try { - $defaultSettings = (Get-Content -Path $script:DefaultSettingsFilePath -Raw | ConvertFrom-Json) - if (-not $defaultSettings.Version -or $defaultSettings.Version -ne "1.0") { - Write-Error "DefaultSettings.json version mismatch (expected 1.0, found $($defaultSettings.Version))" - AwaitKeyToExit - } - # Select app removal options based on user input switch ($RemoveAppsInput) { '1' { @@ -1246,16 +2780,11 @@ function ShowDefaultModeOptions { } } - Foreach ($setting in $defaultSettings.Settings) { - if ($setting.Value -eq $false) { - continue - } - - AddParameter $setting.Name $setting.Value - } + # Load settings from DefaultSettings.json and add to params + LoadSettingsToParams -filePath $script:DefaultSettingsFilePath -expectedVersion "1.0" } catch { - Write-Error "Failed to load settings from DefaultSettings.json file" + Write-Error "Failed to load settings from DefaultSettings.json file: $_" AwaitKeyToExit } @@ -1286,9 +2815,9 @@ function ShowDefaultModeAppRemovalOptions { # Show app selection form if user entered option 3 if ($RemoveAppsInput -eq '2') { - $result = ShowAppSelectionForm + $result = OpenAppSelectionWindow - if ($result -ne [System.Windows.Forms.DialogResult]::OK) { + if ($result -ne $true) { # User cancelled or closed app selection, change RemoveAppsInput so the menu will be shown again Write-Host "" Write-Host "Cancelled application selection, please try again" -ForegroundColor Red @@ -1305,517 +2834,14 @@ function ShowDefaultModeAppRemovalOptions { } -function ShowCustomModeOptions { - # Get current Windows build version to compare against features - $WinVersion = Get-ItemPropertyValue 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion' CurrentBuild - - PrintHeader 'Custom Mode' - - AddParameter 'CreateRestorePoint' - - # Show options for removing apps, only continue on valid input - Do { - Write-Host "Options:" -ForegroundColor Yellow - Write-Host " (n) Don't remove any apps" -ForegroundColor Yellow - Write-Host " (1) Only remove the default selection of apps" -ForegroundColor Yellow - Write-Host " (2) Remove the default selection of apps, as well as mail & calendar apps and gaming related apps" -ForegroundColor Yellow - Write-Host " (3) Manually select which apps to remove" -ForegroundColor Yellow - $RemoveAppsInput = Read-Host "Do you want to remove any apps? Apps will be removed for all users (n/1/2/3)" - - # Show app selection form if user entered option 3 - if ($RemoveAppsInput -eq '3') { - $result = ShowAppSelectionForm - - if ($result -ne [System.Windows.Forms.DialogResult]::OK) { - # User cancelled or closed app selection, change RemoveAppsInput so the menu will be shown again - Write-Output "" - Write-Host "Cancelled application selection, please try again" -ForegroundColor Red - - $RemoveAppsInput = 'c' - } - - Write-Output "" - } - } - while ($RemoveAppsInput -ne 'n' -and $RemoveAppsInput -ne '0' -and $RemoveAppsInput -ne '1' -and $RemoveAppsInput -ne '2' -and $RemoveAppsInput -ne '3') - - # Select correct option based on user input - switch ($RemoveAppsInput) { - '1' { - AddParameter 'RemoveApps' - AddParameter 'Apps' 'Default' - } - '2' { - AddParameter 'RemoveApps' - AddParameter 'Apps' 'Default' - AddParameter 'RemoveCommApps' - AddParameter 'RemoveW11Outlook' - AddParameter 'RemoveGamingApps' - - Write-Output "" - - if ($(Read-Host -Prompt "Disable Game Bar integration and game/screen recording? This also stops ms-gamingoverlay and ms-gamebar popups (y/n)" ) -eq 'y') { - AddParameter 'DisableDVR' - AddParameter 'DisableGameBarIntegration' - } - } - '3' { - Write-Output "You have selected $($script:SelectedApps.Count) apps for removal" - - AddParameter 'RemoveAppsCustom' - - Write-Output "" - - if ($(Read-Host -Prompt "Disable Game Bar integration and game/screen recording? This also stops ms-gamingoverlay and ms-gamebar popups (y/n)" ) -eq 'y') { - AddParameter 'DisableDVR' - AddParameter 'DisableGameBarIntegration' - } - } - } - - Write-Output "" - - if ($( Read-Host -Prompt "Disable telemetry, diagnostic data, activity history, app-launch tracking and targeted ads? (y/n)" ) -eq 'y') { - AddParameter 'DisableTelemetry' - } - - Write-Output "" - - if ($( Read-Host -Prompt "Disable tips, tricks, suggestions and ads in start, settings, notifications, explorer, lockscreen and Edge? (y/n)" ) -eq 'y') { - AddParameter 'DisableSuggestions' - AddParameter 'DisableEdgeAds' - AddParameter 'DisableSettings365Ads' - AddParameter 'DisableLockscreenTips' - } - - Write-Output "" - - if ($( Read-Host -Prompt "Disable & remove Bing web search, Bing AI and Cortana from Windows search? (y/n)" ) -eq 'y') { - AddParameter 'DisableBing' - } - - # Only show this option for Windows 11 users running build 22621 or later - if ($WinVersion -ge 22621) { - Write-Output "" - - # Show options for disabling/removing AI features, only continue on valid input - Do { - Write-Host "Options:" -ForegroundColor Yellow - Write-Host " (n) Don't disable any AI features" -ForegroundColor Yellow - Write-Host " (1) Disable Microsoft Copilot, Windows Recall and Click to Do" -ForegroundColor Yellow - Write-Host " (2) Disable Microsoft Copilot, Windows Recall, Click to Do and AI features in Microsoft Edge, Paint and Notepad" -ForegroundColor Yellow - $DisableAIInput = Read-Host "Do you want to disable any AI features? This applies to all users (n/1/2)" - } - while ($DisableAIInput -ne 'n' -and $DisableAIInput -ne '0' -and $DisableAIInput -ne '1' -and $DisableAIInput -ne '2') - - # Select correct option based on user input - switch ($DisableAIInput) { - '1' { - AddParameter 'DisableCopilot' - AddParameter 'DisableRecall' - AddParameter 'DisableClickToDo' - } - '2' { - AddParameter 'DisableCopilot' - AddParameter 'DisableRecall' - AddParameter 'DisableClickToDo' - AddParameter 'DisableEdgeAI' - AddParameter 'DisablePaintAI' - AddParameter 'DisableNotepadAI' - } - } - } - - Write-Output "" - - if ($( Read-Host -Prompt "Disable Windows Spotlight background on desktop? (y/n)" ) -eq 'y') { - AddParameter 'DisableDesktopSpotlight' - } - - Write-Output "" - - if ($( Read-Host -Prompt "Enable dark mode for system and apps? (y/n)" ) -eq 'y') { - AddParameter 'EnableDarkMode' - } - - Write-Output "" - - if ($( Read-Host -Prompt "Disable transparency, animations and visual effects? (y/n)" ) -eq 'y') { - AddParameter 'DisableTransparency' - AddParameter 'DisableAnimations' - } - - # Only show this option for Windows 11 users running build 22000 or later - if ($WinVersion -ge 22000) { - Write-Output "" - - if ($( Read-Host -Prompt "Restore the old Windows 10 style context menu? (y/n)" ) -eq 'y') { - AddParameter 'RevertContextMenu' - } - } - - Write-Output "" - - if ($( Read-Host -Prompt "Turn off Enhance Pointer Precision, also known as mouse acceleration? (y/n)" ) -eq 'y') { - AddParameter 'DisableMouseAcceleration' - } - - # Only show this option for Windows 11 users running build 26100 or later - if ($WinVersion -ge 26100) { - Write-Output "" - - if ($( Read-Host -Prompt "Disable the Sticky Keys keyboard shortcut? (y/n)" ) -eq 'y') { - AddParameter 'DisableStickyKeys' - } - } - - Write-Output "" - - if ($( Read-Host -Prompt "Disable Fast Start-up? This applies to all users (y/n)" ) -eq 'y') { - AddParameter 'DisableFastStartup' - } - - # Only show this option for Windows 11 users running build 22000 or later, and if the machine has at least one battery - if (($WinVersion -ge 22000) -and $script:ModernStandbySupported) { - Write-Output "" - - if ($( Read-Host -Prompt "Disable network connectivity during Modern Standby? This applies to all users (y/n)" ) -eq 'y') { - AddParameter 'DisableModernStandbyNetworking' - } - } - - # Only show option for disabling context menu items for Windows 10 users or if the user opted to restore the Windows 10 context menu - if ((get-ciminstance -query "select caption from win32_operatingsystem where caption like '%Windows 10%'") -or $script:Params.ContainsKey('RevertContextMenu')) { - Write-Output "" - - if ($( Read-Host -Prompt "Do you want to disable any context menu options? (y/n)" ) -eq 'y') { - Write-Output "" - - if ($( Read-Host -Prompt " Hide the 'Include in library' option in the context menu? (y/n)" ) -eq 'y') { - AddParameter 'HideIncludeInLibrary' - } - - Write-Output "" - - if ($( Read-Host -Prompt " Hide the 'Give access to' option in the context menu? (y/n)" ) -eq 'y') { - AddParameter 'HideGiveAccessTo' - } - - Write-Output "" - - if ($( Read-Host -Prompt " Hide the 'Share' option in the context menu? (y/n)" ) -eq 'y') { - AddParameter 'HideShare' - } - } - } - - # Only show this option for Windows 11 users running build 22621 or later - if ($WinVersion -ge 22621) { - Write-Output "" - - if ($( Read-Host -Prompt "Do you want to make any changes to the start menu? (y/n)" ) -eq 'y') { - Write-Output "" - - if ($script:Params.ContainsKey("Sysprep")) { - if ($( Read-Host -Prompt "Remove all pinned apps from the start menu for all existing and new users? (y/n)" ) -eq 'y') { - AddParameter 'ClearStartAllUsers' - } - } - else { - Do { - Write-Host " Options:" -ForegroundColor Yellow - Write-Host " (n) Don't remove any pinned apps from the start menu" -ForegroundColor Yellow - Write-Host " (1) Remove all pinned apps from the start menu for this user only ($(GetUserName))" -ForegroundColor Yellow - Write-Host " (2) Remove all pinned apps from the start menu for all existing and new users" -ForegroundColor Yellow - $ClearStartInput = Read-Host " Remove all pinned apps from the start menu? (n/1/2)" - } - while ($ClearStartInput -ne 'n' -and $ClearStartInput -ne '0' -and $ClearStartInput -ne '1' -and $ClearStartInput -ne '2') - - # Select correct option based on user input - switch ($ClearStartInput) { - '1' { - AddParameter 'ClearStart' - } - '2' { - AddParameter 'ClearStartAllUsers' - } - } - } - - # Don't show option for users running build 26200 and above, as this setting was removed in this build - if ($WinVersion -lt 26200) { - Write-Output "" - - if ($( Read-Host -Prompt " Disable the recommended section in the start menu? This applies to all users (y/n)" ) -eq 'y') { - AddParameter 'DisableStartRecommended' - } - } - - Write-Output "" - - if ($( Read-Host -Prompt " Disable the Phone Link mobile devices integration in the start menu? (y/n)" ) -eq 'y') { - AddParameter 'DisableStartPhoneLink' - } - } - } - - Write-Output "" - - if ($( Read-Host -Prompt "Do you want to make any changes to the taskbar and related services? (y/n)" ) -eq 'y') { - # Only show these specific options for Windows 11 users running build 22000 or later - if ($WinVersion -ge 22000) { - Write-Output "" - - if ($( Read-Host -Prompt " Align taskbar buttons to the left side? (y/n)" ) -eq 'y') { - AddParameter 'TaskbarAlignLeft' - } - - # Show options for search icon on taskbar, only continue on valid input - Do { - Write-Output "" - Write-Host " Options:" -ForegroundColor Yellow - Write-Host " (n) No change" -ForegroundColor Yellow - Write-Host " (1) Hide search icon from the taskbar" -ForegroundColor Yellow - Write-Host " (2) Show search icon on the taskbar" -ForegroundColor Yellow - Write-Host " (3) Show search icon with label on the taskbar" -ForegroundColor Yellow - Write-Host " (4) Show search box on the taskbar" -ForegroundColor Yellow - $TbSearchInput = Read-Host " Hide or change the search icon on the taskbar? (n/1/2/3/4)" - } - while ($TbSearchInput -ne 'n' -and $TbSearchInput -ne '0' -and $TbSearchInput -ne '1' -and $TbSearchInput -ne '2' -and $TbSearchInput -ne '3' -and $TbSearchInput -ne '4') - - # Select correct taskbar search option based on user input - switch ($TbSearchInput) { - '1' { - AddParameter 'HideSearchTb' - } - '2' { - AddParameter 'ShowSearchIconTb' - } - '3' { - AddParameter 'ShowSearchLabelTb' - } - '4' { - AddParameter 'ShowSearchBoxTb' - } - } - - Write-Output "" - - if ($( Read-Host -Prompt " Hide the taskview button from the taskbar? (y/n)" ) -eq 'y') { - AddParameter 'HideTaskview' - } - } - - Write-Output "" - - if ($( Read-Host -Prompt " Disable the widgets service to remove widgets on the taskbar & lockscreen? (y/n)" ) -eq 'y') { - AddParameter 'DisableWidgets' - } - - # Only show this options for Windows users running build 22621 or earlier - if ($WinVersion -le 22621) { - Write-Output "" - - if ($( Read-Host -Prompt " Hide the chat (meet now) icon from the taskbar? (y/n)" ) -eq 'y') { - AddParameter 'HideChat' - } - } - - # Only show this options for Windows users running build 22631 or later - if ($WinVersion -ge 22631) { - Write-Output "" - - if ($( Read-Host -Prompt " Enable the 'End Task' option in the taskbar right click menu? (y/n)" ) -eq 'y') { - AddParameter 'EnableEndTask' - } - } - - Write-Output "" - - if ($( Read-Host -Prompt " Enable the 'Last Active Click' behavior in the taskbar app area? (y/n)" ) -eq 'y') { - AddParameter 'EnableLastActiveClick' - } - - # Only show these specific options for Windows 11 users running build 22000 or later - if ($WinVersion -ge 22000) { - # Show options for combine icon on taskbar, only continue on valid input - Do { - Write-Output "" - Write-Host " Options:" -ForegroundColor Yellow - Write-Host " (n) No change" -ForegroundColor Yellow - Write-Host " (1) Always" -ForegroundColor Yellow - Write-Host " (2) When taskbar is full" -ForegroundColor Yellow - Write-Host " (3) Never" -ForegroundColor Yellow - $TbCombineTaskbar = Read-Host " Combine taskbar buttons and hide labels? (n/1/2/3)" - } - while ($TbCombineTaskbar -ne 'n' -and $TbCombineTaskbar -ne '0' -and $TbCombineTaskbar -ne '1' -and $TbCombineTaskbar -ne '2' -and $TbCombineTaskbar -ne '3') - - # Select correct taskbar goup option based on user input - switch ($TbCombineTaskbar) { - '1' { - AddParameter 'CombineTaskbarAlways' - AddParameter 'CombineMMTaskbarAlways' - } - '2' { - AddParameter 'CombineTaskbarWhenFull' - AddParameter 'CombineMMTaskbarWhenFull' - } - '3' { - AddParameter 'CombineTaskbarNever' - AddParameter 'CombineMMTaskbarNever' - } - } - - # Show options for changing on what taskbar(s) app icons are shown, only continue on valid input - Do { - Write-Output "" - Write-Host " Options:" -ForegroundColor Yellow - Write-Host " (n) No change" -ForegroundColor Yellow - Write-Host " (1) Show app icons on all taskbars" -ForegroundColor Yellow - Write-Host " (2) Show app icons on main taskbar and on taskbar where the windows is open" -ForegroundColor Yellow - Write-Host " (3) Show app icons only on taskbar where the window is open" -ForegroundColor Yellow - $TbCombineTaskbar = Read-Host " Change how to show app icons on the taskbar when using multiple monitors? (n/1/2/3)" - } - while ($TbCombineTaskbar -ne 'n' -and $TbCombineTaskbar -ne '0' -and $TbCombineTaskbar -ne '1' -and $TbCombineTaskbar -ne '2' -and $TbCombineTaskbar -ne '3') - - # Select correct taskbar goup option based on user input - switch ($TbCombineTaskbar) { - '1' { - AddParameter 'MMTaskbarModeAll' - } - '2' { - AddParameter 'MMTaskbarModeMainActive' - } - '3' { - AddParameter 'MMTaskbarModeActive' - } - } - } - } - - Write-Output "" - - if ($( Read-Host -Prompt "Do you want to make any changes to File Explorer? (y/n)" ) -eq 'y') { - # Show options for changing the File Explorer default location - Do { - Write-Output "" - Write-Host " Options:" -ForegroundColor Yellow - Write-Host " (n) No change" -ForegroundColor Yellow - Write-Host " (1) Open File Explorer to 'Home'" -ForegroundColor Yellow - Write-Host " (2) Open File Explorer to 'This PC'" -ForegroundColor Yellow - Write-Host " (3) Open File Explorer to 'Downloads'" -ForegroundColor Yellow - Write-Host " (4) Open File Explorer to 'OneDrive'" -ForegroundColor Yellow - $ExplSearchInput = Read-Host " Change the default location that File Explorer opens to? (n/1/2/3/4)" - } - while ($ExplSearchInput -ne 'n' -and $ExplSearchInput -ne '0' -and $ExplSearchInput -ne '1' -and $ExplSearchInput -ne '2' -and $ExplSearchInput -ne '3' -and $ExplSearchInput -ne '4') - - # Select correct taskbar search option based on user input - switch ($ExplSearchInput) { - '1' { - AddParameter 'ExplorerToHome' - } - '2' { - AddParameter 'ExplorerToThisPC' - } - '3' { - AddParameter 'ExplorerToDownloads' - } - '4' { - AddParameter 'ExplorerToOneDrive' - } - } - - Write-Output "" - - if ($( Read-Host -Prompt " Show hidden files, folders and drives? (y/n)" ) -eq 'y') { - AddParameter 'ShowHiddenFolders' - } - - Write-Output "" - - if ($( Read-Host -Prompt " Show file extensions for known file types? (y/n)" ) -eq 'y') { - AddParameter 'ShowKnownFileExt' - } - - # Only show this option for Windows 11 users running build 22000 or later - if ($WinVersion -ge 22000) { - Write-Output "" - - if ($( Read-Host -Prompt " Add all common folders (Desktop, Downloads, etc.) back to 'This PC' in File Explorer? (y/n)" ) -eq 'y') { - AddParameter 'AddFoldersToThisPC' - } - - Write-Output "" - - if ($( Read-Host -Prompt " Hide the Home section from the File Explorer sidepanel? (y/n)" ) -eq 'y') { - AddParameter 'HideHome' - } - - Write-Output "" - - if ($( Read-Host -Prompt " Hide the Gallery section from the File Explorer sidepanel? (y/n)" ) -eq 'y') { - AddParameter 'HideGallery' - } - } - - Write-Output "" - - if ($( Read-Host -Prompt " Hide duplicate removable drive entries from the File Explorer sidepanel so they only show under 'This PC'? (y/n)" ) -eq 'y') { - AddParameter 'HideDupliDrive' - } - - # Only show option for disabling these specific folders for Windows 10 users - if (get-ciminstance -query "select caption from win32_operatingsystem where caption like '%Windows 10%'") { - Write-Output "" - - if ($( Read-Host -Prompt "Do you want to hide any folders from the File Explorer sidepanel? (y/n)" ) -eq 'y') { - Write-Output "" - - if ($( Read-Host -Prompt " Hide the OneDrive folder from the File Explorer sidepanel? (y/n)" ) -eq 'y') { - AddParameter 'HideOnedrive' - } - - Write-Output "" - - if ($( Read-Host -Prompt " Hide the 3D objects folder from the File Explorer sidepanel? (y/n)" ) -eq 'y') { - AddParameter 'Hide3dObjects' - } - - Write-Output "" - - if ($( Read-Host -Prompt " Hide the music folder from the File Explorer sidepanel? (y/n)" ) -eq 'y') { - AddParameter 'HideMusic' - } - } - } - } - - # Only save settings if any changes were selected by the user - if ($script:Params.Keys.Count -gt 1) { - SaveSettings - } - - # Suppress prompt if Silent parameter was passed - if (-not $Silent) { - Write-Output "" - Write-Output "" - Write-Output "" - Write-Output "Press enter to confirm your choices and execute the script or press CTRL+C to quit..." - Read-Host | Out-Null - } - - PrintHeader 'Custom Mode' -} - - function ShowAppRemoval { PrintHeader "App Removal" Write-Output "> Opening app selection form..." - $result = ShowAppSelectionForm + $result = OpenAppSelectionWindow - if ($result -eq [System.Windows.Forms.DialogResult]::OK) { + if ($result -eq $true) { Write-Output "You have selected $($script:SelectedApps.Count) apps for removal" AddParameter 'RemoveAppsCustom' @@ -1841,37 +2867,11 @@ function LoadAndShowLastUsedSettings { PrintHeader 'Custom Mode' try { - $savedSettings = (Get-Content -Path $script:SavedSettingsFilePath -Raw | ConvertFrom-Json) - if ($savedSettings.Version -and $savedSettings.Version -ne "1.0") { - Write-Error "LastUsedSettings.json version mismatch (expected 1.0, found $($savedSettings.Version))" - AwaitKeyToExit - } - - if (-not $savedSettings.Settings) { - throw - } - - # Add settings from LastUsedSettings.json to Params - Foreach ($parameter in $savedSettings.Settings) { - $parameterName = $parameter.Name - $value = $parameter.Value - - # Skip parameters that are set to false in the config - if ($value -eq $false) { - continue - } - - # Add parameter to Params - if (-not $script:Params.ContainsKey($parameterName)) { - $script:Params.Add($parameterName, $value) - } - else { - $script:Params[$parameterName] = $value - } - } + # Load settings from LastUsedSettings.json and add to params + LoadSettingsToParams -filePath $script:SavedSettingsFilePath -expectedVersion "1.0" } catch { - Write-Error "Failed to load settings from LastUsedSettings.json file" + Write-Error "Failed to load settings from LastUsedSettings.json file: $_" AwaitKeyToExit } @@ -1889,23 +2889,7 @@ function LoadAndShowLastUsedSettings { -# Check if winget is installed & if it is, check if the version is at least v1.4 -if ((Get-AppxPackage -Name "*Microsoft.DesktopAppInstaller*") -and ([int](((winget -v) -replace 'v','').split('.')[0..1] -join '') -gt 14)) { - $script:WingetInstalled = $true -} -else { - $script:WingetInstalled = $false - - # Show warning that requires user confirmation, Suppress confirmation if Silent parameter was passed - if (-not $Silent) { - Write-Warning "Winget is not installed or outdated, this may prevent Win11Debloat from removing certain apps" - Write-Output "" - Write-Output "Press any key to continue anyway..." - $null = [System.Console]::ReadKey() - } -} - -# Get current Windows build version to compare against features +# Get current Windows build version $WinVersion = Get-ItemPropertyValue 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion' CurrentBuild # Check if the machine supports Modern Standby, this is used to determine if the DisableModernStandbyNetworking option can be used @@ -1961,13 +2945,13 @@ if ((Test-Path $script:SavedSettingsFilePath) -and ([String]::IsNullOrWhiteSpace } # Only run the app selection form if the 'RunAppsListGenerator' parameter was passed to the script -if ($RunAppConfigurator -or $RunAppsListGenerator) { +if ($RunAppsListGenerator) { PrintHeader "Custom Apps List Generator" - $result = ShowAppSelectionForm + $result = OpenAppSelectionWindow # Show different message based on whether the app selection was saved or cancelled - if ($result -ne [System.Windows.Forms.DialogResult]::OK) { + if ($result -ne $true) { Write-Host "Application selection window was closed without saving." -ForegroundColor Red } else { @@ -1981,7 +2965,7 @@ if ($RunAppConfigurator -or $RunAppsListGenerator) { # Change script execution based on provided parameters or user input if ((-not $script:Params.Count) -or $RunDefaults -or $RunDefaultsLite -or $RunSavedSettings -or ($controlParamsCount -eq $script:Params.Count)) { if ($RunDefaults -or $RunDefaultsLite) { - $Mode = '1' + ShowDefaultModeOptions } elseif ($RunSavedSettings) { if (-not (Test-Path $script:SavedSettingsFilePath)) { @@ -1990,10 +2974,24 @@ if ((-not $script:Params.Count) -or $RunDefaults -or $RunDefaultsLite -or $RunSa AwaitKeyToExit } - $Mode = '4' + LoadAndShowLastUsedSettings } else { - $Mode = ShowScriptMenuOptions + if ($CLI) { + $Mode = ShowScriptMenuOptions + } + else { + try { + $result = OpenGUI + + Stop-Transcript + Exit + } + catch { + Write-Warning "Unable to load WPF GUI (not supported in this environment), falling back to CLI mode" + $Mode = ShowScriptMenuOptions + } + } } # Add execution parameters based on the mode @@ -2003,24 +3001,19 @@ if ((-not $script:Params.Count) -or $RunDefaults -or $RunDefaultsLite -or $RunSa ShowDefaultModeOptions } - # Custom mode, shows all available options for user selection - '2' { - ShowCustomModeOptions - } - # App removal, remove apps based on user selection - '3' { + '2' { ShowAppRemoval } # Load last used options from the "LastUsedSettings.json" file - '4' { + '3' { LoadAndShowLastUsedSettings } } } else { - PrintHeader 'Custom Mode' + PrintHeader 'Configuration' } # If the number of keys in ControlParams equals the number of keys in Params then no modifications/changes were selected @@ -2030,381 +3023,9 @@ if (($controlParamsCount -eq $script:Params.Keys.Count) -or ($script:Params.Keys AwaitKeyToExit } -# Create a system restore point if the CreateRestorePoint parameter was passed -if ($script:Params.ContainsKey("CreateRestorePoint")) { - CreateSystemRestorePoint -} - -# Execute all selected/provided parameters -switch ($script:Params.Keys) { - 'RemoveApps' { - Write-Output "> Removing selected apps..." - $appsList = GenerateAppsList - - if ($appsList.Count -eq 0) { - Write-Host "No valid apps were selected for removal" -ForegroundColor Yellow - Write-Output "" - continue - } - - Write-Output "$($appsList.Count) apps selected for removal" - RemoveApps $appsList - continue - } - 'RemoveAppsCustom' { - Write-Output "> Removing selected apps..." - $appsList = ReadAppslistFromFile $script:CustomAppsListFilePath - - if ($appsList.Count -eq 0) { - Write-Host "No valid apps were selected for removal" -ForegroundColor Yellow - Write-Output "" - continue - } - - Write-Output "$($appsList.Count) apps selected for removal" - RemoveApps $appsList - continue - } - 'RemoveCommApps' { - $appsList = 'Microsoft.windowscommunicationsapps', 'Microsoft.People' - Write-Output "> Removing Mail, Calendar and People apps..." - RemoveApps $appsList - continue - } - 'RemoveW11Outlook' { - $appsList = 'Microsoft.OutlookForWindows' - Write-Output "> Removing new Outlook for Windows app..." - RemoveApps $appsList - continue - } - 'RemoveGamingApps' { - $appsList = 'Microsoft.GamingApp', 'Microsoft.XboxGameOverlay', 'Microsoft.XboxGamingOverlay' - Write-Output "> Removing gaming related apps..." - RemoveApps $appsList - continue - } - 'RemoveHPApps' { - $appsList = 'AD2F1837.HPAIExperienceCenter', 'AD2F1837.HPJumpStarts', 'AD2F1837.HPPCHardwareDiagnosticsWindows', 'AD2F1837.HPPowerManager', 'AD2F1837.HPPrivacySettings', 'AD2F1837.HPSupportAssistant', 'AD2F1837.HPSureShieldAI', 'AD2F1837.HPSystemInformation', 'AD2F1837.HPQuickDrop', 'AD2F1837.HPWorkWell', 'AD2F1837.myHP', 'AD2F1837.HPDesktopSupportUtilities', 'AD2F1837.HPQuickTouch', 'AD2F1837.HPEasyClean', 'AD2F1837.HPConnectedMusic', 'AD2F1837.HPFileViewer', 'AD2F1837.HPRegistration', 'AD2F1837.HPWelcome', 'AD2F1837.HPConnectedPhotopoweredbySnapfish', 'AD2F1837.HPPrinterControl' - Write-Output "> Removing HP apps..." - RemoveApps $appsList - continue - } - "ForceRemoveEdge" { - ForceRemoveEdge - continue - } - 'DisableDVR' { - RegImport "> Disabling Xbox game/screen recording..." "Disable_DVR.reg" - continue - } - 'DisableGameBarIntegration' { - RegImport "> Disabling Game Bar integration..." "Disable_Game_Bar_Integration.reg" - continue - } - 'DisableTelemetry' { - RegImport "> Disabling telemetry, diagnostic data, activity history, app-launch tracking and targeted ads..." "Disable_Telemetry.reg" - continue - } - {$_ -in "DisableSuggestions", "DisableWindowsSuggestions"} { - RegImport "> Disabling tips, tricks, suggestions and ads across Windows..." "Disable_Windows_Suggestions.reg" - continue - } - 'DisableEdgeAds' { - RegImport "> Disabling ads, suggestions and the MSN news feed in Microsoft Edge..." "Disable_Edge_Ads_And_Suggestions.reg" - continue - } - {$_ -in "DisableLockscrTips", "DisableLockscreenTips"} { - RegImport "> Disabling tips & tricks on the lockscreen..." "Disable_Lockscreen_Tips.reg" - continue - } - 'DisableDesktopSpotlight' { - RegImport "> Disabling the 'Windows Spotlight' desktop background option..." "Disable_Desktop_Spotlight.reg" - continue - } - 'DisableSettings365Ads' { - RegImport "> Disabling Microsoft 365 ads in Settings Home..." "Disable_Settings_365_Ads.reg" - continue - } - 'DisableSettingsHome' { - RegImport "> Disabling the Settings Home page..." "Disable_Settings_Home.reg" - continue - } - {$_ -in "DisableBingSearches", "DisableBing"} { - RegImport "> Disabling Bing web search, Bing AI and Cortana from Windows search..." "Disable_Bing_Cortana_In_Search.reg" - - # Also remove the app package for Bing search - $appsList = 'Microsoft.BingSearch' - RemoveApps $appsList - continue - } - 'DisableCopilot' { - RegImport "> Disabling Microsoft Copilot..." "Disable_Copilot.reg" - - # Also remove the app package for Copilot - $appsList = 'Microsoft.Copilot' - RemoveApps $appsList - continue - } - 'DisableRecall' { - if ($WinVersion -lt 22000) { - Write-Output "> Disabling Windows Recall..." - Write-Host "Feature is not available on Windows 10" -ForegroundColor Yellow - Write-Output "" - continue - } - - RegImport "> Disabling Windows Recall..." "Disable_AI_Recall.reg" - continue - } - 'DisableClickToDo' { - if ($WinVersion -lt 22000) { - Write-Output "> Disabling Click to Do..." - Write-Host "Feature is not available on Windows 10" -ForegroundColor Yellow - Write-Output "" - continue - } - - RegImport "> Disabling Click to Do..." "Disable_Click_to_Do.reg" - continue - } - 'DisableEdgeAI' { - RegImport "> Disabling AI features in Microsoft Edge..." "Disable_Edge_AI_Features.reg" - continue - } - 'DisablePaintAI' { - RegImport "> Disabling AI features in Paint..." "Disable_Paint_AI_Features.reg" - continue - } - 'DisableNotepadAI' { - RegImport "> Disabling AI features in Notepad..." "Disable_Notepad_AI_Features.reg" - continue - } - 'RevertContextMenu' { - RegImport "> Restoring the old Windows 10 style context menu..." "Disable_Show_More_Options_Context_Menu.reg" - continue - } - 'DisableMouseAcceleration' { - RegImport "> Turning off Enhanced Pointer Precision..." "Disable_Enhance_Pointer_Precision.reg" - continue - } - 'DisableStickyKeys' { - RegImport "> Disabling the Sticky Keys keyboard shortcut..." "Disable_Sticky_Keys_Shortcut.reg" - continue - } - 'DisableFastStartup' { - RegImport "> Disabling Fast Start-up..." "Disable_Fast_Startup.reg" - continue - } - 'DisableModernStandbyNetworking' { - if (-not $script:ModernStandbySupported) { - Write-Output "> Disabling network connectivity during Modern Standby..." - Write-Host "Device does not support modern standby" -ForegroundColor Yellow - Write-Output "" - continue - } - - RegImport "> Disabling network connectivity during Modern Standby..." "Disable_Modern_Standby_Networking.reg" - continue - } - 'ClearStart' { - Write-Output "> Removing all pinned apps from the start menu for user $(GetUserName)..." - ReplaceStartMenu - Write-Output "" - continue - } - 'ReplaceStart' { - Write-Output "> Replacing the start menu for user $(GetUserName)..." - ReplaceStartMenu $script:Params.Item("ReplaceStart") - Write-Output "" - continue - } - 'ClearStartAllUsers' { - ReplaceStartMenuForAllUsers - continue - } - 'ReplaceStartAllUsers' { - ReplaceStartMenuForAllUsers $script:Params.Item("ReplaceStartAllUsers") - continue - } - 'DisableStartRecommended' { - RegImport "> Disabling the start menu recommended section..." "Disable_Start_Recommended.reg" - continue - } - 'DisableStartPhoneLink' { - RegImport "> Disabling the Phone Link mobile devices integration in the start menu..." "Disable_Phone_Link_In_Start.reg" - continue - } - 'EnableDarkMode' { - RegImport "> Enabling dark mode for system and apps..." "Enable_Dark_Mode.reg" - continue - } - 'DisableTransparency' { - RegImport "> Disabling transparency effects..." "Disable_Transparency.reg" - continue - } - 'DisableAnimations' { - RegImport "> Disabling animations and visual effects..." "Disable_Animations.reg" - continue - } - 'TaskbarAlignLeft' { - RegImport "> Aligning taskbar buttons to the left..." "Align_Taskbar_Left.reg" - continue - } - 'CombineTaskbarAlways' { - RegImport "> Setting the taskbar on the main display to always combine buttons and hide labels..." "Combine_Taskbar_Always.reg" - continue - } - 'CombineTaskbarWhenFull' { - RegImport "> Setting the taskbar on the main display to only combine buttons and hide labels when the taskbar is full..." "Combine_Taskbar_When_Full.reg" - continue - } - 'CombineTaskbarNever' { - RegImport "> Setting the taskbar on the main display to never combine buttons or hide labels..." "Combine_Taskbar_Never.reg" - continue - } - 'CombineMMTaskbarAlways' { - RegImport "> Setting the taskbar on secondary displays to always combine buttons and hide labels..." "Combine_MMTaskbar_Always.reg" - continue - } - 'CombineMMTaskbarWhenFull' { - RegImport "> Setting the taskbar on secondary displays to only combine buttons and hide labels when the taskbar is full..." "Combine_MMTaskbar_When_Full.reg" - continue - } - 'CombineMMTaskbarNever' { - RegImport "> Setting the taskbar on secondary displays to never combine buttons or hide labels..." "Combine_MMTaskbar_Never.reg" - continue - } - 'MMTaskbarModeAll' { - RegImport "> Setting the taskbar to only show app icons on main taskbar..." "MMTaskbarMode_All.reg" - continue - } - 'MMTaskbarModeMainActive' { - RegImport "> Setting the taskbar to show app icons on all taskbars..." "MMTaskbarMode_Main_Active.reg" - continue - } - 'MMTaskbarModeActive' { - RegImport "> Setting the taskbar to only show app icons on the taskbar where the window is open..." "MMTaskbarMode_Active.reg" - continue - } - 'HideSearchTb' { - RegImport "> Hiding the search icon from the taskbar..." "Hide_Search_Taskbar.reg" - continue - } - 'ShowSearchIconTb' { - RegImport "> Changing taskbar search to icon only..." "Show_Search_Icon.reg" - continue - } - 'ShowSearchLabelTb' { - RegImport "> Changing taskbar search to icon with label..." "Show_Search_Icon_And_Label.reg" - continue - } - 'ShowSearchBoxTb' { - RegImport "> Changing taskbar search to search box..." "Show_Search_Box.reg" - continue - } - 'HideTaskview' { - RegImport "> Hiding the taskview button from the taskbar..." "Hide_Taskview_Taskbar.reg" - continue - } - {$_ -in "HideWidgets", "DisableWidgets"} { - RegImport "> Disabling widgets on the taskbar & lockscreen..." "Disable_Widgets_Service.reg" - - # Also remove the app package for Widgets - $appsList = 'Microsoft.StartExperiencesApp' - RemoveApps $appsList - continue - } - {$_ -in "HideChat", "DisableChat"} { - if ($WinVersion -ge 22000) { - Write-Output "> Hiding the chat icon from the taskbar..." - Write-Host "Feature is not available on Windows 11" -ForegroundColor Yellow - Write-Output "" - continue - } - - RegImport "> Hiding the chat icon from the taskbar..." "Disable_Chat_Taskbar.reg" - continue - } - 'EnableEndTask' { - RegImport "> Enabling the 'End Task' option in the taskbar right click menu..." "Enable_End_Task.reg" - continue - } - 'EnableLastActiveClick' { - RegImport "> Enabling the 'Last Active Click' behavior in the taskbar app area..." "Enable_Last_Active_Click.reg" - continue - } - 'ExplorerToHome' { - RegImport "> Changing the default location that File Explorer opens to `Home`..." "Launch_File_Explorer_To_Home.reg" - continue - } - 'ExplorerToThisPC' { - RegImport "> Changing the default location that File Explorer opens to `This PC`..." "Launch_File_Explorer_To_This_PC.reg" - continue - } - 'ExplorerToDownloads' { - RegImport "> Changing the default location that File Explorer opens to `Downloads`..." "Launch_File_Explorer_To_Downloads.reg" - continue - } - 'ExplorerToOneDrive' { - RegImport "> Changing the default location that File Explorer opens to `OneDrive`..." "Launch_File_Explorer_To_OneDrive.reg" - continue - } - 'ShowHiddenFolders' { - RegImport "> Unhiding hidden files, folders and drives..." "Show_Hidden_Folders.reg" - continue - } - 'ShowKnownFileExt' { - RegImport "> Enabling file extensions for known file types..." "Show_Extensions_For_Known_File_Types.reg" - continue - } - 'AddFoldersToThisPC' { - RegImport "> Adding all common folders (Desktop, Downloads, etc.) back to `This PC` in File Explorer..." "Add_All_Folders_Under_This_PC.reg" - continue - } - 'HideHome' { - RegImport "> Hiding the home section from the File Explorer navigation pane..." "Hide_Home_from_Explorer.reg" - continue - } - 'HideGallery' { - RegImport "> Hiding the gallery section from the File Explorer navigation pane..." "Hide_Gallery_from_Explorer.reg" - continue - } - 'HideDupliDrive' { - RegImport "> Hiding duplicate removable drive entries from the File Explorer navigation pane..." "Hide_duplicate_removable_drives_from_navigation_pane_of_File_Explorer.reg" - continue - } - {$_ -in "HideOnedrive", "DisableOnedrive"} { - RegImport "> Hiding the OneDrive folder from the File Explorer navigation pane..." "Hide_Onedrive_Folder.reg" - continue - } - {$_ -in "Hide3dObjects", "Disable3dObjects"} { - if ($WinVersion -ge 22000) { - Write-Output "> Hiding the 3D objects folder from the File Explorer navigation pane..." - Write-Host "Feature is not available on Windows 11" -ForegroundColor Yellow - Write-Output "" - continue - } - - RegImport "> Hiding the 3D objects folder from the File Explorer navigation pane..." "Hide_3D_Objects_Folder.reg" - continue - } - {$_ -in "HideMusic", "DisableMusic"} { - RegImport "> Hiding the music folder from the File Explorer navigation pane..." "Hide_Music_folder.reg" - continue - } - {$_ -in "HideIncludeInLibrary", "DisableIncludeInLibrary"} { - RegImport "> Hiding 'Include in library' in the context menu..." "Disable_Include_in_library_from_context_menu.reg" - continue - } - {$_ -in "HideGiveAccessTo", "DisableGiveAccessTo"} { - RegImport "> Hiding 'Give access to' in the context menu..." "Disable_Give_access_to_context_menu.reg" - continue - } - {$_ -in "HideShare", "DisableShare"} { - RegImport "> Hiding 'Share' in the context menu..." "Disable_Share_from_context_menu.reg" - continue - } -} +# Execute all selected/provided parameters using the consolidated function +# (This also handles restore point creation if requested) +ExecuteAllChanges RestartExplorer