Improve & simplify the overview/apply changes pages (#505)

This commit is contained in:
Jeffrey
2026-03-07 14:49:29 +01:00
committed by GitHub
parent b5b67290de
commit a1907c2a78
13 changed files with 1072 additions and 924 deletions

View File

@@ -352,7 +352,7 @@
"Category": "Privacy & Suggested Content",
"Action": "Disable",
"RegistryKey": "Disable_Telemetry.reg",
"ApplyText": "> Disabling telemetry, diagnostic data, activity history, app-launch tracking and targeted ads...",
"ApplyText": "Disabling telemetry, diagnostic data, activity history, app-launch tracking and targeted ads...",
"UndoAction": "Enable",
"RegistryUndoKey": "Enable_Telemetry.reg",
"MinVersion": null,
@@ -365,7 +365,7 @@
"Category": "Privacy & Suggested Content",
"Action": "Disable",
"RegistryKey": "Disable_Windows_Suggestions.reg",
"ApplyText": "> Disabling tips, tricks, suggestions and ads throughout Windows...",
"ApplyText": "Disabling tips, tricks, suggestions and ads throughout Windows...",
"UndoAction": "Enable",
"RegistryUndoKey": "Enable_Windows_Suggestions.reg",
"MinVersion": null,
@@ -378,7 +378,7 @@
"Category": "Privacy & Suggested Content",
"Action": "Disable",
"RegistryKey": "Disable_Location_Services.reg",
"ApplyText": "> Disabling Windows location services and app location access...",
"ApplyText": "Disabling Windows location services and app location access...",
"UndoAction": "Enable",
"RegistryUndoKey": "Enable_Location_Services.reg",
"MinVersion": null,
@@ -391,7 +391,7 @@
"Category": "Privacy & Suggested Content",
"Action": "Disable",
"RegistryKey": "Disable_Search_History.reg",
"ApplyText": "> Disabling search history...",
"ApplyText": "Disabling search history...",
"UndoAction": "Enable",
"RegistryUndoKey": "Enable_Search_History.reg",
"MinVersion": null,
@@ -404,7 +404,7 @@
"Category": "Privacy & Suggested Content",
"Action": "Disable",
"RegistryKey": "Disable_Lockscreen_Tips.reg",
"ApplyText": "> Disabling tips & tricks on the lock screen...",
"ApplyText": "Disabling tips & tricks on the lock screen...",
"UndoAction": "Enable",
"RegistryUndoKey": "Enable_Lockscreen_Tips.reg",
"MinVersion": null,
@@ -417,7 +417,7 @@
"Category": "Privacy & Suggested Content",
"Action": "Disable",
"RegistryKey": "Disable_Desktop_Spotlight.reg",
"ApplyText": "> Disabling the 'Windows Spotlight' desktop background option...",
"ApplyText": "Disabling the 'Windows Spotlight' desktop background option...",
"UndoAction": "Enable",
"RegistryUndoKey": "Enable_Desktop_Spotlight.reg",
"MinVersion": null,
@@ -430,7 +430,7 @@
"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...",
"ApplyText": "Disabling ads, suggestions and the MSN news feed in Microsoft Edge...",
"UndoAction": "Enable",
"RegistryUndoKey": "Enable_Edge_Ads_And_Suggestions.reg",
"MinVersion": null,
@@ -443,7 +443,7 @@
"Category": "AI",
"Action": "Disable",
"RegistryKey": "Disable_Copilot.reg",
"ApplyText": "> Disabling Microsoft Copilot...",
"ApplyText": "Disabling Microsoft Copilot...",
"UndoAction": "Enable",
"RegistryUndoKey": "Enable_Copilot.reg",
"MinVersion": 22621,
@@ -456,7 +456,7 @@
"Category": "AI",
"Action": "Disable",
"RegistryKey": "Disable_AI_Recall.reg",
"ApplyText": "> Disabling Windows Recall...",
"ApplyText": "Disabling Windows Recall...",
"UndoAction": "Enable",
"RegistryUndoKey": "Enable_AI_Recall.reg",
"MinVersion": 22621,
@@ -469,7 +469,7 @@
"Category": "AI",
"Action": "Disable",
"RegistryKey": "Disable_Click_to_Do.reg",
"ApplyText": "> Disabling Click to Do...",
"ApplyText": "Disabling Click to Do...",
"UndoAction": "Enable",
"RegistryUndoKey": "Enable_Click_to_Do.reg",
"MinVersion": 22621,
@@ -482,7 +482,7 @@
"Category": "Gaming",
"Action": "Disable",
"RegistryKey": "Disable_DVR.reg",
"ApplyText": "> Disabling Xbox game/screen recording...",
"ApplyText": "Disabling Xbox game/screen recording...",
"UndoAction": "Enable",
"RegistryUndoKey": "Enable_DVR.reg",
"MinVersion": null,
@@ -495,7 +495,7 @@
"Category": "Gaming",
"Action": "Disable",
"RegistryKey": "Disable_Game_Bar_Integration.reg",
"ApplyText": "> Disabling Game Bar integration...",
"ApplyText": "Disabling Game Bar integration...",
"UndoAction": "Enable",
"RegistryUndoKey": "Enable_Game_Bar_Integration.reg",
"MinVersion": null,
@@ -556,7 +556,7 @@
"Category": "Start Menu",
"Action": "Hide",
"RegistryKey": "Disable_Start_Recommended.reg",
"ApplyText": "> Disabling the start menu recommended section...",
"ApplyText": "Disabling the start menu recommended section...",
"UndoAction": "Show",
"RegistryUndoKey": "Enable_Start_Recommended.reg",
"MinVersion": 22621,
@@ -569,7 +569,7 @@
"Category": "Start Menu",
"Action": "Disable",
"RegistryKey": "Disable_Bing_Cortana_In_Search.reg",
"ApplyText": "> Disabling Bing web search & Copilot integration in Windows search...",
"ApplyText": "Disabling Bing web search & Copilot integration in Windows search...",
"UndoAction": "Enable",
"RegistryUndoKey": "Enable_Bing_Cortana_In_Search.reg",
"MinVersion": null,
@@ -582,7 +582,7 @@
"Category": "Start Menu",
"Action": "Disable",
"RegistryKey": "Disable_Phone_Link_In_Start.reg",
"ApplyText": "> Disabling the Phone Link mobile devices integration in the start menu...",
"ApplyText": "Disabling the Phone Link mobile devices integration in the start menu...",
"UndoAction": "Enable",
"RegistryUndoKey": "Enable_Phone_Link_In_Start.reg",
"MinVersion": 22621,
@@ -595,7 +595,7 @@
"Category": "Privacy & Suggested Content",
"Action": "Hide",
"RegistryKey": "Disable_Settings_365_Ads.reg",
"ApplyText": "> Disabling Microsoft 365 Copilot ads in Settings Home...",
"ApplyText": "Disabling Microsoft 365 Copilot ads in Settings Home...",
"UndoAction": "Show",
"RegistryUndoKey": "Enable_Settings_365_Ads.reg",
"MinVersion": null,
@@ -608,7 +608,7 @@
"Category": "Other",
"Action": "Hide",
"RegistryKey": "Disable_Settings_Home.reg",
"ApplyText": "> Disabling the Settings Home page...",
"ApplyText": "Disabling the Settings Home page...",
"UndoAction": "Show",
"RegistryUndoKey": "Enable_Settings_Home.reg",
"MinVersion": null,
@@ -621,7 +621,7 @@
"Category": "AI",
"Action": "Disable",
"RegistryKey": "Disable_Edge_AI_Features.reg",
"ApplyText": "> Disabling AI features in Microsoft Edge...",
"ApplyText": "Disabling AI features in Microsoft Edge...",
"UndoAction": "Enable",
"RegistryUndoKey": "Enable_Edge_AI_Features.reg",
"MinVersion": 22621,
@@ -634,7 +634,7 @@
"Category": "AI",
"Action": "Disable",
"RegistryKey": "Disable_Paint_AI_Features.reg",
"ApplyText": "> Disabling AI features in Paint...",
"ApplyText": "Disabling AI features in Paint...",
"UndoAction": "Enable",
"RegistryUndoKey": "Enable_Paint_AI_Features.reg",
"MinVersion": 22621,
@@ -647,7 +647,7 @@
"Category": "AI",
"Action": "Disable",
"RegistryKey": "Disable_Notepad_AI_Features.reg",
"ApplyText": "> Disabling AI features in Notepad...",
"ApplyText": "Disabling AI features in Notepad...",
"UndoAction": "Enable",
"RegistryUndoKey": "Enable_Notepad_AI_Features.reg",
"MinVersion": 22621,
@@ -660,7 +660,7 @@
"Category": "Appearance",
"Action": "Enable dark",
"RegistryKey": "Enable_Dark_Mode.reg",
"ApplyText": "> Enabling dark mode for system and apps...",
"ApplyText": "Enabling dark mode for system and apps...",
"UndoAction": "Disable light",
"RegistryUndoKey": "Enable_Light_Mode.reg",
"MinVersion": null,
@@ -673,7 +673,7 @@
"Category": "System",
"Action": "Disable",
"RegistryKey": "Disable_Share_Drag_Tray.reg",
"ApplyText": "> Disabling Drag Tray...",
"ApplyText": "Disabling Drag Tray...",
"UndoAction": "Enable",
"RegistryUndoKey": "Enable_Share_Drag_Tray.reg",
"MinVersion": 26200,
@@ -686,7 +686,7 @@
"Category": "System",
"Action": "Use classic Windows 10",
"RegistryKey": "Disable_Show_More_Options_Context_Menu.reg",
"ApplyText": "> Restoring the classic Windows 10 style context menu...",
"ApplyText": "Restoring the classic Windows 10 style context menu...",
"UndoAction": "Use modern Windows 11",
"RegistryUndoKey": "Enable_W11_Style_Context_Menu.reg",
"MinVersion": 22000,
@@ -699,7 +699,7 @@
"Category": "System",
"Action": "Disable",
"RegistryKey": "Disable_Enhance_Pointer_Precision.reg",
"ApplyText": "> Turning off Enhanced Pointer Precision...",
"ApplyText": "Turning off Enhanced Pointer Precision...",
"UndoAction": "Enable",
"RegistryUndoKey": "Enable_Enhance_Pointer_Precision.reg",
"MinVersion": null,
@@ -712,7 +712,7 @@
"Category": "System",
"Action": "Disable",
"RegistryKey": "Disable_Sticky_Keys_Shortcut.reg",
"ApplyText": "> Disabling the Sticky Keys keyboard shortcut...",
"ApplyText": "Disabling the Sticky Keys keyboard shortcut...",
"UndoAction": "Enable",
"RegistryUndoKey": "Enable_Sticky_Keys_Shortcut.reg",
"MinVersion": 26100,
@@ -726,7 +726,7 @@
"Priority": 1,
"Action": "Disable",
"RegistryKey": "Disable_Window_Snapping.reg",
"ApplyText": "> Disabling window snapping...",
"ApplyText": "Disabling window snapping...",
"UndoAction": "Enable",
"RegistryUndoKey": "Enable_Window_Snapping.reg",
"MinVersion": null,
@@ -740,7 +740,7 @@
"Priority": 2,
"Action": "Disable",
"RegistryKey": "Disable_Snap_Assist.reg",
"ApplyText": "> Disabling the Snap Assist suggestions...",
"ApplyText": "Disabling the Snap Assist suggestions...",
"UndoAction": "Enable",
"RegistryUndoKey": "Enable_Snap_Assist.reg",
"MinVersion": 22000,
@@ -754,7 +754,7 @@
"Priority": 3,
"Action": "Hide",
"RegistryKey": "Disable_Snap_Layouts.reg",
"ApplyText": "> Hiding snap layouts when dragging windows to top of the screen and on maximize button...",
"ApplyText": "Hiding snap layouts when dragging windows to top of the screen and on maximize button...",
"UndoAction": "Show",
"RegistryUndoKey": "Enable_Snap_Layouts.reg",
"MinVersion": 22000,
@@ -766,7 +766,7 @@
"Category": "Multi-tasking",
"Action": "Hide",
"RegistryKey": "Hide_Tabs_In_Alt_Tab.reg",
"ApplyText": "> Disable showing tabs from apps when snapping or pressing Alt+Tab...",
"ApplyText": "Disable showing tabs from apps when snapping or pressing Alt+Tab...",
"UndoAction": null,
"RegistryUndoKey": null,
"MinVersion": 22000,
@@ -778,7 +778,7 @@
"Category": "Multi-tasking",
"Action": "Show 3",
"RegistryKey": "Show_3_Tabs_In_Alt_Tab.reg",
"ApplyText": "> Enable showing 3 tabs from apps when snapping or pressing Alt+Tab...",
"ApplyText": "Enable showing 3 tabs from apps when snapping or pressing Alt+Tab...",
"UndoAction": null,
"RegistryUndoKey": null,
"MinVersion": 22000,
@@ -790,7 +790,7 @@
"Category": "Multi-tasking",
"Action": "Show 5",
"RegistryKey": "Show_5_Tabs_In_Alt_Tab.reg",
"ApplyText": "> Enable showing 5 tabs from apps when snapping or pressing Alt+Tab...",
"ApplyText": "Enable showing 5 tabs from apps when snapping or pressing Alt+Tab...",
"UndoAction": null,
"RegistryUndoKey": null,
"MinVersion": 22000,
@@ -802,7 +802,7 @@
"Category": "Multi-tasking",
"Action": "Show 20",
"RegistryKey": "Show_20_Tabs_In_Alt_Tab.reg",
"ApplyText": "> Enable showing 20 tabs from apps when snapping or pressing Alt+Tab...",
"ApplyText": "Enable showing 20 tabs from apps when snapping or pressing Alt+Tab...",
"UndoAction": null,
"RegistryUndoKey": null,
"MinVersion": 22000,
@@ -816,7 +816,7 @@
"Priority": 1,
"Action": "Left",
"RegistryKey": "Align_Taskbar_Left.reg",
"ApplyText": "> Aligning taskbar buttons to the left...",
"ApplyText": "Aligning taskbar buttons to the left...",
"UndoAction": "Center",
"RegistryUndoKey": "Align_Taskbar_Center.reg",
"MinVersion": 22000,
@@ -828,7 +828,7 @@
"Category": "Taskbar",
"Action": "Hide Search",
"RegistryKey": "Hide_Search_Taskbar.reg",
"ApplyText": "> Hiding the search icon from the taskbar...",
"ApplyText": "Hiding the search icon from the taskbar...",
"UndoAction": "Show Search Box",
"RegistryUndoKey": "Show_Search_Box.reg",
"MinVersion": 22000,
@@ -840,7 +840,7 @@
"Category": "Taskbar",
"Action": "Show Search Icon",
"RegistryKey": "Show_Search_Icon.reg",
"ApplyText": "> Changing taskbar search to icon only...",
"ApplyText": "Changing taskbar search to icon only...",
"UndoAction": "Show Search Box",
"RegistryUndoKey": "Show_Search_Box.reg",
"MinVersion": 22000,
@@ -852,7 +852,7 @@
"Category": "Taskbar",
"Action": "Show Search Label",
"RegistryKey": "Show_Search_Icon_And_Label.reg",
"ApplyText": "> Changing taskbar search to icon with label...",
"ApplyText": "Changing taskbar search to icon with label...",
"UndoAction": "Show Search Box",
"RegistryUndoKey": "Show_Search_Box.reg",
"MinVersion": 22000,
@@ -864,7 +864,7 @@
"Category": "Taskbar",
"Action": "Show Search Box",
"RegistryKey": "Show_Search_Box.reg",
"ApplyText": "> Changing taskbar search to search box...",
"ApplyText": "Changing taskbar search to search box...",
"UndoAction": null,
"RegistryUndoKey": null,
"MinVersion": 22000,
@@ -878,7 +878,7 @@
"Priority": 3,
"Action": "Hide",
"RegistryKey": "Hide_Taskview_Taskbar.reg",
"ApplyText": "> Hiding the taskview button from the taskbar...",
"ApplyText": "Hiding the taskview button from the taskbar...",
"UndoAction": "Show",
"RegistryUndoKey": "Show_Taskview_Taskbar.reg",
"MinVersion": 22000,
@@ -892,7 +892,7 @@
"Priority": 4,
"Action": "Disable",
"RegistryKey": "Disable_Widgets_Service.reg",
"ApplyText": "> Disabling widgets on the taskbar & lock screen...",
"ApplyText": "Disabling widgets on the taskbar & lock screen...",
"UndoAction": "Enable",
"RegistryUndoKey": "Enable_Widgets_Service.reg",
"MinVersion": null,
@@ -906,7 +906,7 @@
"Priority": 5,
"Action": "Hide",
"RegistryKey": "Disable_Chat_Taskbar.reg",
"ApplyText": "> Hiding the chat icon from the taskbar...",
"ApplyText": "Hiding the chat icon from the taskbar...",
"UndoAction": "Show",
"RegistryUndoKey": "Enable_Chat_Taskbar.reg",
"MinVersion": null,
@@ -919,7 +919,7 @@
"Category": "System",
"Action": "Disable",
"RegistryKey": "Disable_Fast_Startup.reg",
"ApplyText": "> Disabling Fast Start-up...",
"ApplyText": "Disabling Fast Start-up...",
"UndoAction": "Enable",
"RegistryUndoKey": "Enable_Fast_Startup.reg",
"MinVersion": null,
@@ -932,7 +932,7 @@
"Category": "System",
"Action": "Disable",
"RegistryKey": "Disable_Bitlocker_Auto_Encryption.reg",
"ApplyText": "> Disabling BitLocker automatic device encryption...",
"ApplyText": "Disabling BitLocker automatic device encryption...",
"UndoAction": "Enable",
"RegistryUndoKey": "Enable_Bitlocker_Auto_Encryption.reg",
"MinVersion": 22000,
@@ -945,7 +945,7 @@
"Category": "System",
"Action": "Disable",
"RegistryKey": "Disable_Modern_Standby_Networking.reg",
"ApplyText": "> Disabling network connectivity during Modern Standby...",
"ApplyText": "Disabling network connectivity during Modern Standby...",
"UndoAction": "Enable",
"RegistryUndoKey": "Enable_Modern_Standby_Networking.reg",
"MinVersion": 22000,
@@ -959,7 +959,7 @@
"Priority": 6,
"Action": "Show",
"RegistryKey": "Enable_End_Task.reg",
"ApplyText": "> Enabling the 'End Task' option in the taskbar right click menu...",
"ApplyText": "Enabling the 'End Task' option in the taskbar right click menu...",
"UndoAction": "Hide",
"RegistryUndoKey": "Disable_End_Task.reg",
"MinVersion": 22631,
@@ -973,7 +973,7 @@
"Priority": 7,
"Action": "Enable",
"RegistryKey": "Enable_Last_Active_Click.reg",
"ApplyText": "> Enabling the 'Last Active Click' behavior in the taskbar app area...",
"ApplyText": "Enabling the 'Last Active Click' behavior in the taskbar app area...",
"UndoAction": "Disable",
"RegistryUndoKey": "Disable_Last_Active_Click.reg",
"MinVersion": 22000,
@@ -985,7 +985,7 @@
"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...",
"ApplyText": "Setting the taskbar on the main display to always combine buttons and hide labels...",
"UndoAction": null,
"RegistryUndoKey": null,
"MinVersion": 22000,
@@ -997,7 +997,7 @@
"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...",
"ApplyText": "Setting the taskbar on secondary displays to always combine buttons and hide labels...",
"UndoAction": null,
"RegistryUndoKey": null,
"MinVersion": 22000,
@@ -1009,7 +1009,7 @@
"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...",
"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,
@@ -1021,7 +1021,7 @@
"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...",
"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,
@@ -1033,7 +1033,7 @@
"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...",
"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,
@@ -1045,7 +1045,7 @@
"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...",
"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,
@@ -1057,7 +1057,7 @@
"Category": "Taskbar",
"Action": "Show All Taskbar Icons",
"RegistryKey": "MMTaskbarMode_All.reg",
"ApplyText": "> Setting the taskbar to show app icons on all taskbars...",
"ApplyText": "Setting the taskbar to show app icons on all taskbars...",
"UndoAction": null,
"RegistryUndoKey": null,
"MinVersion": 22000,
@@ -1069,7 +1069,7 @@
"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...",
"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,
@@ -1081,7 +1081,7 @@
"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...",
"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,
@@ -1093,7 +1093,7 @@
"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'...",
"ApplyText": "Changing the default location that File Explorer opens to, to 'Home'...",
"UndoAction": null,
"RegistryUndoKey": null,
"MinVersion": null,
@@ -1105,7 +1105,7 @@
"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'...",
"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,
@@ -1117,7 +1117,7 @@
"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'...",
"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,
@@ -1129,7 +1129,7 @@
"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'...",
"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,
@@ -1142,7 +1142,7 @@
"Category": "File Explorer",
"Action": "Show",
"RegistryKey": "Show_Extensions_For_Known_File_Types.reg",
"ApplyText": "> Enabling file extensions for known file types...",
"ApplyText": "Enabling file extensions for known file types...",
"UndoAction": "Hide",
"RegistryUndoKey": "Hide_Extensions_For_Known_File_Types.reg",
"MinVersion": null,
@@ -1155,7 +1155,7 @@
"Category": "File Explorer",
"Action": "Show",
"RegistryKey": "Show_Hidden_Folders.reg",
"ApplyText": "> Unhiding hidden files, folders and drives...",
"ApplyText": "Unhiding hidden files, folders and drives...",
"UndoAction": "Hide",
"RegistryUndoKey": "Hide_Hidden_Folders.reg",
"MinVersion": null,
@@ -1168,7 +1168,7 @@
"Category": "File Explorer",
"Action": "Hide",
"RegistryKey": "Hide_Home_from_Explorer.reg",
"ApplyText": "> Hiding the home section from the File Explorer navigation pane...",
"ApplyText": "Hiding the home section from the File Explorer navigation pane...",
"UndoAction": "Show",
"RegistryUndoKey": "Show_Home_in_Explorer.reg",
"MinVersion": 22000,
@@ -1181,7 +1181,7 @@
"Category": "File Explorer",
"Action": "Hide",
"RegistryKey": "Hide_Gallery_from_Explorer.reg",
"ApplyText": "> Hiding the gallery section from the File Explorer navigation pane...",
"ApplyText": "Hiding the gallery section from the File Explorer navigation pane...",
"UndoAction": "Show",
"RegistryUndoKey": "Show_Gallery_in_Explorer.reg",
"MinVersion": 22000,
@@ -1194,7 +1194,7 @@
"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...",
"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,
@@ -1207,7 +1207,7 @@
"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...",
"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,
@@ -1220,7 +1220,7 @@
"Category": "Appearance",
"Action": "Disable",
"RegistryKey": "Disable_Transparency.reg",
"ApplyText": "> Disabling transparency effects...",
"ApplyText": "Disabling transparency effects...",
"UndoAction": "Enable",
"RegistryUndoKey": "Enable_Transparency.reg",
"MinVersion": null,
@@ -1233,7 +1233,7 @@
"Category": "Appearance",
"Action": "Disable",
"RegistryKey": "Disable_Animations.reg",
"ApplyText": "> Disabling animations and visual effects...",
"ApplyText": "Disabling animations and visual effects...",
"UndoAction": "Enable",
"RegistryUndoKey": "Enable_Animations.reg",
"MinVersion": null,
@@ -1246,7 +1246,7 @@
"Category": "Windows Update",
"Action": "Prevent getting",
"RegistryKey": "Disable_Update_ASAP.reg",
"ApplyText": "> Preventing Windows from getting updates as soon as they are available...",
"ApplyText": "Preventing Windows from getting updates as soon as they are available...",
"UndoAction": "Get",
"RegistryUndoKey": "Enable_Update_ASAP.reg",
"MinVersion": null,
@@ -1259,7 +1259,7 @@
"Category": "Windows Update",
"Action": "Prevent",
"RegistryKey": "Prevent_Auto_Reboot.reg",
"ApplyText": "> Preventing automatic restarts after updates while signed in...",
"ApplyText": "Preventing automatic restarts after updates while signed in...",
"UndoAction": "Allow",
"RegistryUndoKey": "Allow_Auto_Reboot.reg",
"MinVersion": null,
@@ -1272,7 +1272,7 @@
"Category": "Windows Update",
"Action": "Disable",
"RegistryKey": "Disable_Delivery_Optimization.reg",
"ApplyText": "> Disabling sharing of downloaded updates with other PCs...",
"ApplyText": "Disabling sharing of downloaded updates with other PCs...",
"UndoAction": "Enable",
"RegistryUndoKey": "Enable_Delivery_Optimization.reg",
"MinVersion": null,
@@ -1297,7 +1297,7 @@
"Category": "File Explorer",
"Action": "Hide",
"RegistryKey": "Disable_Include_in_library_from_context_menu.reg",
"ApplyText": "> Hiding 'Include in library' in the context menu...",
"ApplyText": "Hiding 'Include in library' in the context menu...",
"UndoAction": "Show",
"RegistryUndoKey": "Enable_Include_in_library_in_context_menu.reg",
"MinVersion": null,
@@ -1310,7 +1310,7 @@
"Category": "File Explorer",
"Action": "Hide",
"RegistryKey": "Disable_Give_access_to_context_menu.reg",
"ApplyText": "> Hiding 'Give access to' in the context menu...",
"ApplyText": "Hiding 'Give access to' in the context menu...",
"UndoAction": "Show",
"RegistryUndoKey": "Enable_Give_access_to_context_menu.reg",
"MinVersion": null,
@@ -1323,7 +1323,7 @@
"Category": "File Explorer",
"Action": "Hide",
"RegistryKey": "Disable_Share_from_context_menu.reg",
"ApplyText": "> Hiding 'Share' in the context menu...",
"ApplyText": "Hiding 'Share' in the context menu...",
"UndoAction": "Show",
"RegistryUndoKey": "Enable_Share_in_context_menu.reg",
"MinVersion": null,
@@ -1336,7 +1336,7 @@
"Category": "File Explorer",
"Action": "Hide",
"RegistryKey": "Hide_Onedrive_Folder.reg",
"ApplyText": "> Hiding the OneDrive folder from the File Explorer navigation pane...",
"ApplyText": "Hiding the OneDrive folder from the File Explorer navigation pane...",
"UndoAction": "Show",
"RegistryUndoKey": "Show_Onedrive_Folder.reg",
"MinVersion": null,
@@ -1349,7 +1349,7 @@
"Category": "File Explorer",
"Action": "Hide",
"RegistryKey": "Hide_3D_Objects_Folder.reg",
"ApplyText": "> Hiding the 3D objects folder from the File Explorer navigation pane...",
"ApplyText": "Hiding the 3D objects folder from the File Explorer navigation pane...",
"UndoAction": "Show",
"RegistryUndoKey": "Show_3D_Objects_Folder.reg",
"MinVersion": null,
@@ -1362,7 +1362,7 @@
"Category": "File Explorer",
"Action": "Hide",
"RegistryKey": "Hide_Music_Folder.reg",
"ApplyText": "> Hiding the music folder from the File Explorer navigation pane...",
"ApplyText": "Hiding the music folder from the File Explorer navigation pane...",
"UndoAction": "Show",
"RegistryUndoKey": "Show_Music_Folder.reg",
"MinVersion": null,
@@ -1375,7 +1375,7 @@
"Category": "Other",
"Action": "Disable",
"RegistryKey": "Disable_Brave_Bloat.reg",
"ApplyText": "> Disabling Brave AI, Crypto, News, Rewards, Talk and VPN in Brave browser...",
"ApplyText": "Disabling Brave AI, Crypto, News, Rewards, Talk and VPN in Brave browser...",
"UndoAction": "Enable",
"RegistryUndoKey": "Enable_Brave_Bloat.reg",
"MinVersion": null,
@@ -1388,7 +1388,7 @@
"Category": "Optional Windows Features",
"Action": "Enable",
"RegistryKey": null,
"ApplyText": "> Enabling Windows Sandbox...",
"ApplyText": "Enabling Windows Sandbox...",
"UndoAction": null,
"RegistryUndoKey": null,
"MinVersion": 22483,
@@ -1401,7 +1401,7 @@
"Category": "Optional Windows Features",
"Action": "Enable",
"RegistryKey": null,
"ApplyText": "> Enabling Windows Subsystem for Linux...",
"ApplyText": "Enabling Windows Subsystem for Linux...",
"UndoAction": null,
"RegistryUndoKey": null,
"MinVersion": 22000,

View File

@@ -4,96 +4,12 @@
Width="500"
SizeToContent="Height"
ResizeMode="NoResize"
WindowStartupLocation="CenterScreen"
WindowStartupLocation="CenterOwner"
WindowStyle="None"
AllowsTransparency="True"
Background="Transparent"
Topmost="True"
ShowInTaskbar="False">
<Window.Resources>
<Style x:Key="HyperlinkStyle" TargetType="TextBlock">
<Setter Property="Foreground" Value="{DynamicResource ButtonBg}"/>
<Setter Property="Cursor" Value="Hand"/>
<Style.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Foreground" Value="{DynamicResource ButtonHover}"/>
</Trigger>
</Style.Triggers>
</Style>
<!-- Button Style -->
<Style x:Key="MessageBoxButton" TargetType="Button">
<Setter Property="Background" Value="{DynamicResource SecondaryButtonBg}"/>
<Setter Property="Foreground" Value="{DynamicResource FgColor}"/>
<Setter Property="BorderThickness" Value="1"/>
<Setter Property="BorderBrush" Value="{DynamicResource ButtonBorderColor}"/>
<Setter Property="Padding" Value="0"/>
<Setter Property="FontSize" Value="14"/>
<Setter Property="Height" Value="32"/>
<Setter Property="MinWidth" Value="80"/>
<Setter Property="Margin" Value="4,0"/>
<Setter Property="FontWeight" Value="Normal"/>
<Setter Property="Cursor" Value="Hand"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="Button">
<Border x:Name="Border"
Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
CornerRadius="4"
Padding="{TemplateBinding Padding}">
<ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center" Margin="0,0,0,1"/>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter TargetName="Border" Property="Background" Value="{DynamicResource SecondaryButtonHover}"/>
</Trigger>
<Trigger Property="IsPressed" Value="True">
<Setter TargetName="Border" Property="Background" Value="{DynamicResource SecondaryButtonPressed}"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<!-- Primary Button Style -->
<Style x:Key="PrimaryMessageBoxButton" TargetType="Button" BasedOn="{StaticResource MessageBoxButton}">
<Setter Property="Background" Value="{DynamicResource ButtonBg}"/>
<Setter Property="Foreground" Value="white"/>
<Setter Property="BorderBrush" Value="{DynamicResource ButtonBg}"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="Button">
<Border Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
CornerRadius="4"
Padding="{TemplateBinding Padding}">
<ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center" Margin="0,0,0,1"/>
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
<Style.Triggers>
<Trigger Property="IsEnabled" Value="False">
<Setter Property="Background" Value="{DynamicResource ButtonDisabled}"/>
<Setter Property="BorderBrush" Value="{DynamicResource ButtonDisabled}"/>
<Setter Property="Foreground" Value="{DynamicResource ButtonTextDisabled}"/>
</Trigger>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Background" Value="{DynamicResource ButtonHover}"/>
<Setter Property="BorderBrush" Value="{DynamicResource ButtonHover}"/>
</Trigger>
<Trigger Property="IsPressed" Value="True">
<Setter Property="Background" Value="{DynamicResource ButtonPressed}"/>
<Setter Property="BorderBrush" Value="{DynamicResource ButtonPressed}"/>
</Trigger>
</Style.Triggers>
</Style>
</Window.Resources>
<Border BorderBrush="{DynamicResource BorderColor}"
BorderThickness="1"
@@ -183,7 +99,7 @@
Grid.Row="2" Grid.Column="1"
Text="https://github.com/Raphire/Win11Debloat"
FontSize="14"
Style="{StaticResource HyperlinkStyle}"
Style="{DynamicResource HyperlinkStyle}"
Margin="0,0,0,0"/>
</Grid>
@@ -212,7 +128,7 @@
<TextBlock x:Name="KofiLinkIcon"
Grid.Column="0"
FontSize="16"
Style="{StaticResource HyperlinkStyle}"
Style="{DynamicResource HyperlinkStyle}"
HorizontalAlignment="Center"
VerticalAlignment="Center"
FontWeight="SemiBold"
@@ -224,7 +140,7 @@
<TextBlock x:Name="KofiLink"
Grid.Column="1"
FontSize="16"
Style="{StaticResource HyperlinkStyle}"
Style="{DynamicResource HyperlinkStyle}"
HorizontalAlignment="Center"
VerticalAlignment="Center"
FontWeight="SemiBold"
@@ -245,7 +161,8 @@
HorizontalAlignment="Right">
<Button x:Name="CloseButton"
Content="Close"
Style="{StaticResource MessageBoxButton}"/>
Height="32" MinWidth="80" Margin="4,0"
Style="{DynamicResource SecondaryButtonStyle}"/>
</StackPanel>
</Border>
</Grid>

View File

@@ -9,43 +9,6 @@
Background="Transparent"
Foreground="{DynamicResource FgColor}">
<Window.Resources>
<!-- ScrollBar Style -->
<Style TargetType="{x:Type ScrollBar}">
<Setter Property="Background" Value="Transparent"/>
<Setter Property="Width" Value="8"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type ScrollBar}">
<Grid>
<Track Name="PART_Track" IsDirectionReversed="true">
<Track.Thumb>
<Thumb>
<Thumb.Style>
<Style TargetType="Thumb">
<Setter Property="Background" Value="{DynamicResource ScrollBarThumbColor}"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="Thumb">
<Border Background="{TemplateBinding Background}" CornerRadius="4"/>
</ControlTemplate>
</Setter.Value>
</Setter>
<Style.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Background" Value="{DynamicResource ScrollBarThumbHoverColor}"/>
</Trigger>
</Style.Triggers>
</Style>
</Thumb.Style>
</Thumb>
</Track.Thumb>
</Track>
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<!-- CheckBox Style -->
<Style TargetType="CheckBox">
<Setter Property="Foreground" Value="{DynamicResource FgColor}"/>
@@ -94,84 +57,6 @@
<Style x:Key="AppsPanelCheckBoxStyle" TargetType="CheckBox" BasedOn="{StaticResource {x:Type CheckBox}}">
<Setter Property="Margin" Value="2,3,2,3"/>
</Style>
<!-- Button Style -->
<Style x:Key="Win11Button" TargetType="Button">
<Setter Property="Background" Value="{DynamicResource ButtonBg}"/>
<Setter Property="Foreground" Value="white"/>
<Setter Property="BorderBrush" Value="{DynamicResource ButtonBg}"/>
<Setter Property="BorderThickness" Value="1"/>
<Setter Property="Padding" Value="0"/>
<Setter Property="FontSize" Value="14"/>
<Setter Property="Cursor" Value="Hand"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="Button">
<Border Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
CornerRadius="4"
Padding="{TemplateBinding Padding}">
<ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
<Style.Triggers>
<Trigger Property="IsEnabled" Value="False">
<Setter Property="Background" Value="{DynamicResource ButtonDisabled}"/>
<Setter Property="BorderBrush" Value="{DynamicResource ButtonDisabled}"/>
<Setter Property="Foreground" Value="{DynamicResource ButtonTextDisabled}"/>
</Trigger>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Background" Value="{DynamicResource ButtonHover}"/>
<Setter Property="BorderBrush" Value="{DynamicResource ButtonHover}"/>
</Trigger>
<Trigger Property="IsPressed" Value="True">
<Setter Property="Background" Value="{DynamicResource ButtonPressed}"/>
<Setter Property="BorderBrush" Value="{DynamicResource ButtonPressed}"/>
</Trigger>
</Style.Triggers>
</Style>
<!-- Secondary Button Style -->
<Style x:Key="Win11ButtonSecondary" TargetType="Button">
<Setter Property="Background" Value="{DynamicResource SecondaryButtonBg}"/>
<Setter Property="Foreground" Value="{DynamicResource FgColor}"/>
<Setter Property="BorderBrush" Value="{DynamicResource ButtonBorderColor}"/>
<Setter Property="BorderThickness" Value="1"/>
<Setter Property="Padding" Value="0"/>
<Setter Property="FontSize" Value="14"/>
<Setter Property="Cursor" Value="Hand"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="Button">
<Border Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
CornerRadius="4"
Padding="{TemplateBinding Padding}">
<ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center" Margin="0,0,0,1"/>
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
<Style.Triggers>
<Trigger Property="IsEnabled" Value="False">
<Setter Property="Background" Value="{DynamicResource SecondaryButtonDisabled}"/>
<Setter Property="BorderBrush" Value="{DynamicResource BorderColor}"/>
<Setter Property="Foreground" Value="{DynamicResource SecondaryButtonTextDisabled}"/>
</Trigger>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Background" Value="{DynamicResource SecondaryButtonHover}"/>
<Setter Property="BorderBrush" Value="{DynamicResource ButtonBorderColor}"/>
</Trigger>
<Trigger Property="IsPressed" Value="True">
<Setter Property="Background" Value="{DynamicResource SecondaryButtonPressed}"/>
<Setter Property="BorderBrush" Value="{DynamicResource ButtonBorderColor}"/>
</Trigger>
</Style.Triggers>
</Style>
<!-- Title Bar Button Style -->
<Style x:Key="TitleBarButton" TargetType="Button">
@@ -276,8 +161,8 @@
<Grid Margin="0,8,10,10">
<CheckBox x:Name="OnlyInstalledBox" Content="Only show installed apps" Foreground="{DynamicResource FgColor}" AutomationProperties.Name="Only show installed apps"/>
</Grid>
<Button x:Name="ConfirmBtn" Width="80" Height="32" Margin="0,0,10,0" Content="Confirm" Style="{StaticResource Win11Button}" AutomationProperties.Name="Confirm"/>
<Button x:Name="CancelBtn" Width="80" Height="32" Content="Cancel" Style="{StaticResource Win11ButtonSecondary}" IsCancel="True" AutomationProperties.Name="Cancel"/>
<Button x:Name="ConfirmBtn" Width="80" Height="32" Margin="0,0,10,0" Content="Confirm" Style="{DynamicResource PrimaryButtonStyle}" AutomationProperties.Name="Confirm"/>
<Button x:Name="CancelBtn" Width="80" Height="32" Content="Cancel" Style="{DynamicResource SecondaryButtonStyle}" IsCancel="True" AutomationProperties.Name="Cancel"/>
</StackPanel>
</Grid>
</Grid>

View File

@@ -0,0 +1,177 @@
<Window xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="Apply Changes"
Width="500"
SizeToContent="Height"
ResizeMode="NoResize"
WindowStartupLocation="CenterOwner"
WindowStyle="None"
AllowsTransparency="True"
Background="Transparent"
Topmost="True"
ShowInTaskbar="False">
<Border BorderBrush="{DynamicResource BorderColor}"
BorderThickness="1"
CornerRadius="8"
Background="{DynamicResource CardBgColor}"
Margin="25">
<Border.Effect>
<DropShadowEffect Color="Black"
Opacity="0.15"
BlurRadius="20"
ShadowDepth="0"
Direction="0"/>
</Border.Effect>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<!-- Close/Cancel button (top right) -->
<Button x:Name="ApplyCancelBtn" Grid.Row="0"
HorizontalAlignment="Right" VerticalAlignment="Top"
Width="36" Height="32"
BorderThickness="0"
Cursor="Hand"
ToolTip="Cancel"
AutomationProperties.Name="Cancel">
<Button.Template>
<ControlTemplate TargetType="Button">
<Border Background="{TemplateBinding Background}" BorderThickness="0" CornerRadius="0,8,0,0">
<ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
</Border>
</ControlTemplate>
</Button.Template>
<Button.Style>
<Style TargetType="Button">
<Setter Property="Background" Value="Transparent"/>
<Setter Property="Foreground" Value="{DynamicResource FgColor}"/>
<Style.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Background" Value="{DynamicResource CloseHover}"/>
</Trigger>
</Style.Triggers>
</Style>
</Button.Style>
<TextBlock Text="&#xE8BB;" FontFamily="Segoe Fluent Icons" FontSize="10"/>
</Button>
<StackPanel Grid.Row="0" Grid.RowSpan="2">
<!-- In-progress content -->
<StackPanel x:Name="ApplyInProgressPanel">
<StackPanel Margin="32,24">
<!-- Loading icon (spinning) -->
<TextBlock x:Name="ApplySpinnerIcon"
Text="&#xE895;"
FontFamily="Segoe Fluent Icons"
FontSize="36"
Foreground="{DynamicResource ButtonBg}"
HorizontalAlignment="Center"
Margin="0,0,0,16"
RenderTransformOrigin="0.5,0.5">
<TextBlock.RenderTransform>
<RotateTransform x:Name="SpinnerRotation" Angle="0"/>
</TextBlock.RenderTransform>
<TextBlock.Triggers>
<EventTrigger RoutedEvent="Loaded">
<BeginStoryboard>
<Storyboard>
<DoubleAnimation Storyboard.TargetName="SpinnerRotation"
Storyboard.TargetProperty="Angle"
From="0" To="360"
Duration="0:0:1.5"
RepeatBehavior="Forever"/>
</Storyboard>
</BeginStoryboard>
</EventTrigger>
</TextBlock.Triggers>
</TextBlock>
<TextBlock Text="Applying Changes"
Style="{DynamicResource ModalTitleStyle}"/>
<!-- Current step name -->
<TextBlock x:Name="ApplyStepName"
Text="Preparing..."
Style="{DynamicResource ModalSubtextStyle}"
TextTrimming="CharacterEllipsis"
MaxWidth="430"/>
</StackPanel>
<Border Background="{DynamicResource BgColor}"
BorderBrush="{DynamicResource BorderColor}"
BorderThickness="0,1,0,0"
Padding="16,12"
CornerRadius="0,0,8,8">
<StackPanel>
<!-- Progress bar -->
<ProgressBar x:Name="ApplyProgressBar"
Style="{DynamicResource ApplyProgressBarStyle}"
Minimum="0" Maximum="100" Value="0"
Margin="0,2,0,8"/>
<!-- Step counter -->
<TextBlock x:Name="ApplyStepCounter"
Text="Step 0 of 0"
FontSize="12"
Foreground="{DynamicResource FgColor}"
HorizontalAlignment="Right"
Opacity="0.8"/>
</StackPanel>
</Border>
</StackPanel>
<!-- Completion content -->
<StackPanel x:Name="ApplyCompletionPanel" Visibility="Collapsed">
<StackPanel Margin="32,24">
<!-- Success icon -->
<TextBlock x:Name="ApplyCompletionIcon"
Text="&#xE73E;"
FontFamily="Segoe Fluent Icons"
FontSize="40"
Foreground="{DynamicResource ButtonBg}"
HorizontalAlignment="Center"
Margin="0,0,0,12"/>
<TextBlock x:Name="ApplyCompletionTitle"
Text="Changes Applied"
Style="{DynamicResource ModalTitleStyle}"/>
<TextBlock x:Name="ApplyCompletionMessage"
Text="All changes have been applied successfully!"
Style="{DynamicResource ModalSubtextStyle}"/>
</StackPanel>
<!-- Button Panel -->
<Border Background="{DynamicResource BgColor}"
BorderBrush="{DynamicResource BorderColor}"
BorderThickness="0,1,0,0"
Padding="16,12"
CornerRadius="0,0,8,8">
<StackPanel x:Name="ButtonPanel"
Orientation="Horizontal"
HorizontalAlignment="Center">
<Button x:Name="ApplyKofiBtn" Width="210" Height="32"
Style="{DynamicResource SecondaryButtonStyle}"
Margin="0,0,12,0"
AutomationProperties.Name="Support the creator">
<StackPanel Orientation="Horizontal" VerticalAlignment="Center">
<TextBlock Text="&#xEB52;" FontFamily="Segoe Fluent Icons" FontSize="14" VerticalAlignment="Center" Margin="0,0,8,-1"/>
<TextBlock Text="Support the creator" VerticalAlignment="Center" FontSize="14" Margin="0,0,0,1"/>
</StackPanel>
</Button>
<Button x:Name="ApplyCloseBtn" Width="100" Height="32"
Style="{DynamicResource PrimaryButtonStyle}"
AutomationProperties.Name="Close">
<TextBlock Text="Close" VerticalAlignment="Center" FontSize="14" Margin="0,0,0,1"/>
</Button>
</StackPanel>
</Border>
</StackPanel>
</StackPanel>
</Grid>
</Border>
</Window>

View File

@@ -1,7 +1,7 @@
<Window xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="Win11Debloat"
MinWidth="1080" MinHeight="600"
MinWidth="1130" MinHeight="600"
MaxWidth="1400"
ResizeMode="CanResize"
SnapsToDevicePixels="True"
@@ -11,43 +11,6 @@
Background="Transparent"
Foreground="{DynamicResource FgColor}">
<Window.Resources>
<!-- ScrollBar Style -->
<Style TargetType="{x:Type ScrollBar}">
<Setter Property="Background" Value="Transparent"/>
<Setter Property="Width" Value="8"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type ScrollBar}">
<Grid>
<Track Name="PART_Track" IsDirectionReversed="true">
<Track.Thumb>
<Thumb>
<Thumb.Style>
<Style TargetType="Thumb">
<Setter Property="Background" Value="{DynamicResource ScrollBarThumbColor}"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="Thumb">
<Border Background="{TemplateBinding Background}" CornerRadius="4"/>
</ControlTemplate>
</Setter.Value>
</Setter>
<Style.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Background" Value="{DynamicResource ScrollBarThumbHoverColor}"/>
</Trigger>
</Style.Triggers>
</Style>
</Thumb.Style>
</Thumb>
</Track.Thumb>
</Track>
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<!-- ComboBox Style -->
<Style TargetType="ComboBox">
<Setter Property="Background" Value="{DynamicResource ComboBgColor}"/>
@@ -449,84 +412,6 @@
<GridLength x:Key="AppTableCol1Width">1*</GridLength>
<GridLength x:Key="AppTableCol2Width">286</GridLength>
<!-- Button Style -->
<Style x:Key="PrimaryButtonStyle" TargetType="Button">
<Setter Property="Background" Value="{DynamicResource ButtonBg}"/>
<Setter Property="Foreground" Value="white"/>
<Setter Property="BorderBrush" Value="{DynamicResource ButtonBg}"/>
<Setter Property="BorderThickness" Value="1"/>
<Setter Property="Padding" Value="0"/>
<Setter Property="FontSize" Value="14"/>
<Setter Property="Cursor" Value="Hand"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="Button">
<Border Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
CornerRadius="4"
Padding="{TemplateBinding Padding}">
<ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
<Style.Triggers>
<Trigger Property="IsEnabled" Value="False">
<Setter Property="Background" Value="{DynamicResource ButtonDisabled}"/>
<Setter Property="BorderBrush" Value="{DynamicResource ButtonDisabled}"/>
<Setter Property="Foreground" Value="{DynamicResource ButtonTextDisabled}"/>
</Trigger>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Background" Value="{DynamicResource ButtonHover}"/>
<Setter Property="BorderBrush" Value="{DynamicResource ButtonHover}"/>
</Trigger>
<Trigger Property="IsPressed" Value="True">
<Setter Property="Background" Value="{DynamicResource ButtonPressed}"/>
<Setter Property="BorderBrush" Value="{DynamicResource ButtonPressed}"/>
</Trigger>
</Style.Triggers>
</Style>
<!-- Secondary Button Style -->
<Style x:Key="SecondaryButtonStyle" TargetType="Button">
<Setter Property="Background" Value="{DynamicResource SecondaryButtonBg}"/>
<Setter Property="Foreground" Value="{DynamicResource FgColor}"/>
<Setter Property="BorderBrush" Value="{DynamicResource ButtonBorderColor}"/>
<Setter Property="BorderThickness" Value="1"/>
<Setter Property="Padding" Value="0"/>
<Setter Property="FontSize" Value="14"/>
<Setter Property="Cursor" Value="Hand"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="Button">
<Border Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
CornerRadius="4"
Padding="{TemplateBinding Padding}">
<ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center" Margin="0,0,0,1"/>
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
<Style.Triggers>
<Trigger Property="IsEnabled" Value="False">
<Setter Property="Background" Value="{DynamicResource SecondaryButtonDisabled}"/>
<Setter Property="BorderBrush" Value="{DynamicResource BorderColor}"/>
<Setter Property="Foreground" Value="{DynamicResource SecondaryButtonTextDisabled}"/>
</Trigger>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Background" Value="{DynamicResource SecondaryButtonHover}"/>
<Setter Property="BorderBrush" Value="{DynamicResource ButtonBorderColor}"/>
</Trigger>
<Trigger Property="IsPressed" Value="True">
<Setter Property="Background" Value="{DynamicResource SecondaryButtonPressed}"/>
<Setter Property="BorderBrush" Value="{DynamicResource ButtonBorderColor}"/>
</Trigger>
</Style.Triggers>
</Style>
<!-- Title Bar Button Style -->
<Style x:Key="TitleBarButton" TargetType="Button">
<Setter Property="Background" Value="Transparent"/>
@@ -789,13 +674,13 @@
<!-- Action Buttons -->
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center" Margin="0,20,0,0">
<Button x:Name="HomeDefaultModeBtn" Width="180" Height="50" Style="{StaticResource PrimaryButtonStyle}" Margin="0,0,12,0" AutomationProperties.Name="Default Mode">
<Button x:Name="HomeDefaultModeBtn" Width="180" Height="50" Style="{DynamicResource PrimaryButtonStyle}" Margin="0,0,12,0" AutomationProperties.Name="Default Mode">
<StackPanel Orientation="Horizontal" VerticalAlignment="Center">
<TextBlock Text="&#xe735;" FontFamily="Segoe Fluent Icons" FontSize="16" VerticalAlignment="Center" Margin="0,0,8,0"/>
<TextBlock Text="Default Mode" ToolTip="Quickly select the recommended settings" FontWeight="SemiBold" VerticalAlignment="Center" FontSize="17" Margin="0,0,0,2"/>
</StackPanel>
</Button>
<Button x:Name="HomeStartBtn" Width="180" Height="50" Style="{StaticResource SecondaryButtonStyle}" AutomationProperties.Name="Custom Setup">
<Button x:Name="HomeStartBtn" Width="180" Height="50" Style="{DynamicResource SecondaryButtonStyle}" AutomationProperties.Name="Custom Setup">
<StackPanel Orientation="Horizontal" VerticalAlignment="Center">
<TextBlock Text="&#xe90f;" FontFamily="Segoe Fluent Icons" FontSize="14" VerticalAlignment="Center" Margin="0,0,8,0"/>
<TextBlock Text="Custom Setup" ToolTip="Manually select your preferred settings" FontWeight="SemiBold" VerticalAlignment="Center" FontSize="17" Margin="0,0,0,2"/>
@@ -825,9 +710,9 @@
</Grid.ColumnDefinitions>
<StackPanel Orientation="Horizontal" Grid.Column="0">
<Button x:Name="DefaultAppsBtn" Content="Select Default Apps" ToolTip="Select the default selection of apps" Style="{StaticResource SecondaryButtonStyle}" Height="32" Padding="10,0" Margin="0,0,10,0" AutomationProperties.Name="Select Default Apps"/>
<Button x:Name="LoadLastUsedAppsBtn" Content="Select Last Used Selection" ToolTip="Select the apps that were selected the last time Win11Debloat was run" Style="{StaticResource SecondaryButtonStyle}" Height="32" Padding="10,0" Margin="0,0,10,0" AutomationProperties.Name="Select Last Used Selection"/>
<Button x:Name="ClearAppSelectionBtn" Content="Clear Selection" ToolTip="Clear all selected apps" Style="{StaticResource SecondaryButtonStyle}" Height="32" Padding="10,0" Margin="0,0,10,0" AutomationProperties.Name="Clear Selection"/>
<Button x:Name="DefaultAppsBtn" Content="Select Default Apps" ToolTip="Select the default selection of apps" Style="{DynamicResource SecondaryButtonStyle}" Height="32" Padding="10,0" Margin="0,0,10,0" AutomationProperties.Name="Select Default Apps"/>
<Button x:Name="LoadLastUsedAppsBtn" Content="Select Last Used Selection" ToolTip="Select the apps that were selected the last time Win11Debloat was run" Style="{DynamicResource SecondaryButtonStyle}" Height="32" Padding="10,0" Margin="0,0,10,0" AutomationProperties.Name="Select Last Used Selection"/>
<Button x:Name="ClearAppSelectionBtn" Content="Clear Selection" ToolTip="Clear all selected apps" Style="{DynamicResource SecondaryButtonStyle}" Height="32" Padding="10,0" Margin="0,0,10,0" AutomationProperties.Name="Clear Selection"/>
</StackPanel>
<CheckBox x:Name="OnlyInstalledAppsBox" Grid.Column="2" Content="Only show installed apps" IsChecked="False" Foreground="{DynamicResource FgColor}" VerticalAlignment="Center" AutomationProperties.Name="Only show installed apps"/>
@@ -881,7 +766,7 @@
</Grid>
</Border>
<!-- Apps content -->
<Border Grid.Row="1" BorderBrush="{DynamicResource BorderColor}" CornerRadius="0,0,4,4" BorderThickness="1" Background="{DynamicResource CardBgColor}">
<Border Grid.Row="1" BorderBrush="{DynamicResource BorderColor}" CornerRadius="0,0,4,4" BorderThickness="1" Background="{DynamicResource CardBgColor}" Padding="0,1,1,1">
<Grid>
<ScrollViewer VerticalScrollBarVisibility="Visible">
<StackPanel x:Name="AppSelectionPanel" Margin="10,4,0,4"/>
@@ -918,9 +803,9 @@
</Grid.ColumnDefinitions>
<StackPanel Grid.Column="0" Orientation="Horizontal">
<Button x:Name="LoadDefaultsBtn" Content="Select Default Settings" ToolTip="Select the settings that are recommended for most people" Style="{StaticResource SecondaryButtonStyle}" Padding="10,0" Height="32" Margin="0,0,10,0" AutomationProperties.Name="Select Default Settings"/>
<Button x:Name="LoadLastUsedBtn" Content="Select Last Used Settings" ToolTip="Select the settings that were used the last time Win11Debloat was run" Style="{StaticResource SecondaryButtonStyle}" Padding="10,0" Height="32" Margin="0,0,10,0" AutomationProperties.Name="Select Last Used Settings"/>
<Button x:Name="ClearAllTweaksBtn" Content="Clear Selection" ToolTip="Clear all selected tweaks" Style="{StaticResource SecondaryButtonStyle}" Padding="10,0" Height="32" Margin="0,0,10,0" AutomationProperties.Name="Clear Selection"/>
<Button x:Name="LoadDefaultsBtn" Content="Select Default Settings" ToolTip="Select the settings that are recommended for most people" Style="{DynamicResource SecondaryButtonStyle}" Padding="10,0" Height="32" Margin="0,0,10,0" AutomationProperties.Name="Select Default Settings"/>
<Button x:Name="LoadLastUsedBtn" Content="Select Last Used Settings" ToolTip="Select the settings that were used the last time Win11Debloat was run" Style="{DynamicResource SecondaryButtonStyle}" Padding="10,0" Height="32" Margin="0,0,10,0" AutomationProperties.Name="Select Last Used Settings"/>
<Button x:Name="ClearAllTweaksBtn" Content="Clear Selection" ToolTip="Clear all selected tweaks" Style="{DynamicResource SecondaryButtonStyle}" Padding="10,0" Height="32" Margin="0,0,10,0" AutomationProperties.Name="Clear Selection"/>
</StackPanel>
<Border x:Name="TweakSearchBorder" Grid.Column="2">
@@ -988,167 +873,146 @@
</DockPanel>
</TabItem>
<!-- Overview Tab -->
<TabItem Header="Overview" x:Name="OverviewTab">
<!-- Deployment Settings Tab -->
<TabItem Header="Deployment Settings" x:Name="DeploymentSettingsTab">
<DockPanel>
<Border DockPanel.Dock="Top" Padding="20,10,20,0">
<StackPanel>
<TextBlock Text="Overview" FontWeight="Bold" FontSize="20" Margin="0,0,0,5" Foreground="{DynamicResource FgColor}"/>
<TextBlock Text="Review and confirm your choices before proceeding" FontSize="13" Margin="0,0,0,20" Foreground="{DynamicResource FgColor}" TextWrapping="Wrap"/>
<TextBlock Text="Deployment Settings" FontWeight="Bold" FontSize="20" Margin="0,0,0,5" Foreground="{DynamicResource FgColor}"/>
<TextBlock Text="Configure how your changes will be applied and more" FontSize="13" Margin="0,0,0,20" Foreground="{DynamicResource FgColor}" TextWrapping="Wrap"/>
</StackPanel>
</Border>
<Grid>
<ScrollViewer VerticalScrollBarVisibility="Auto" Margin="0,-20,0,0" Padding="20,10,20,0">
<StackPanel Margin="0,10,0,5">
<!-- Selected Changes -->
<Border BorderBrush="{DynamicResource BorderColor}" BorderThickness="1" CornerRadius="4" Background="{DynamicResource CardBgColor}" Padding="16,12,16,4" Margin="0,0,0,16">
<StackPanel>
<TextBlock Text="Selected Changes" Style="{StaticResource CategoryHeaderTextBlock}"/>
<StackPanel x:Name="OverviewChangesPanel"/>
<StackPanel Margin="0,0,0,3"/>
</StackPanel>
</Border>
<Grid.RowDefinitions>
<RowDefinition Height="*"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<!-- Apply Changes To -->
<Border BorderBrush="{DynamicResource BorderColor}" BorderThickness="1" CornerRadius="4" Background="{DynamicResource CardBgColor}" Padding="16,12" Margin="0,0,0,16">
<StackPanel>
<TextBlock Text="Apply Changes To" Style="{StaticResource CategoryHeaderTextBlock}"/>
<ComboBox x:Name="UserSelectionCombo" Margin="0,0,0,6" AutomationProperties.Name="Apply Changes To">
<ComboBoxItem Content="Current User" IsSelected="True"/>
<ComboBoxItem Content="Other User"/>
<ComboBoxItem Content="Windows Default User (Sysprep)"/>
</ComboBox>
<StackPanel x:Name="OtherUserPanel" Visibility="Collapsed" Margin="0,0,0,6">
<TextBlock x:Name="UsernameValidationMessage" Text="" FontStyle="Italic" Foreground="{DynamicResource CloseHover}" FontSize="11" Margin="3,0,0,4" TextWrapping="Wrap"/>
<Border IsEnabled="{Binding ElementName=OtherUsernameTextBox, Path=IsEnabled}">
<Border.Style>
<Style TargetType="Border" BasedOn="{StaticResource UserTextBoxBorderStyle}">
<Style.Triggers>
<DataTrigger Binding="{Binding ElementName=OtherUsernameTextBox, Path=IsFocused}" Value="True">
<Setter Property="Background" Value="{DynamicResource InputFocusColor}"/>
</DataTrigger>
</Style.Triggers>
</Style>
</Border.Style>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<TextBlock Grid.Column="0" Text="&#xE77B;" FontFamily="Segoe Fluent Icons" FontSize="14" VerticalAlignment="Center" Margin="4,0,8,0" Foreground="{DynamicResource FgColor}"/>
<TextBlock x:Name="UsernameTextBoxPlaceholder" Grid.Column="1" Text="Enter username" Foreground="{DynamicResource FgColor}" Opacity="0.5" FontSize="13" Margin="3,0,0,1" VerticalAlignment="Center" IsHitTestVisible="False"/>
<TextBox x:Name="OtherUsernameTextBox" Grid.Column="1" Style="{StaticResource UserTextBoxStyle}" Text="" AutomationProperties.Name="Enter username"/>
</Grid>
</Border>
</StackPanel>
<TextBlock x:Name="UserSelectionDescription" Text="Changes will be applied to the currently logged-in user profile." Foreground="{DynamicResource FgColor}" FontSize="12" TextWrapping="Wrap" Margin="0,6,0,3"/>
</StackPanel>
</Border>
<Grid Grid.Row="0">
<ScrollViewer VerticalScrollBarVisibility="Auto" Margin="0,-20,0,0" Padding="20,10,20,0">
<Grid Margin="0,10,0,5">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<!-- App Removal Scope -->
<Border x:Name="AppRemovalScopeSection" BorderBrush="{DynamicResource BorderColor}" BorderThickness="1" CornerRadius="4" Background="{DynamicResource CardBgColor}" Padding="16,12" Margin="0,0,0,16">
<StackPanel>
<TextBlock Text="Remove Apps From" Style="{StaticResource CategoryHeaderTextBlock}"/>
<ComboBox x:Name="AppRemovalScopeCombo" Margin="0,0,0,6" AutomationProperties.Name="App Removal Scope">
<ComboBoxItem x:Name="AppRemovalScopeAllUsers" Content="All users" IsSelected="True"/>
<ComboBoxItem x:Name="AppRemovalScopeCurrentUser" Content="Current user only"/>
<ComboBoxItem x:Name="AppRemovalScopeTargetUser" Content="Target user only" Visibility="Collapsed"/>
</ComboBox>
<TextBlock x:Name="AppRemovalScopeDescription" Text="Apps will be removed for all users and from the Windows image to prevent reinstallation for new users." Foreground="{DynamicResource FgColor}" FontSize="12" TextWrapping="Wrap" Margin="0,6,0,3"/>
</StackPanel>
</Border>
<!-- Options -->
<Border BorderBrush="{DynamicResource BorderColor}" BorderThickness="1" CornerRadius="4" Background="{DynamicResource CardBgColor}" Padding="16,12,16,3" Margin="0,0,0,16">
<StackPanel>
<TextBlock Text="Options" Style="{StaticResource CategoryHeaderTextBlock}"/>
<!-- Restore Point Option -->
<!-- Apply Changes To -->
<Border Grid.Row="0" BorderBrush="{DynamicResource BorderColor}" BorderThickness="1" CornerRadius="4" Background="{DynamicResource CardBgColor}" Padding="16,12" Margin="0,0,0,16">
<StackPanel>
<CheckBox x:Name="RestorePointCheckBox" Style="{StaticResource FeatureCheckboxStyle}" Content="Create a system restore point (Recommended)" AutomationProperties.Name="Create a system restore point (Recommended)"/>
<TextBlock Text="Apply Changes To" Style="{StaticResource CategoryHeaderTextBlock}"/>
<ComboBox x:Name="UserSelectionCombo" Margin="0,0,0,6" AutomationProperties.Name="Apply Changes To">
<ComboBoxItem Content="Current User" IsSelected="True"/>
<ComboBoxItem Content="Other User"/>
<ComboBoxItem Content="Windows Default User (Sysprep)"/>
</ComboBox>
<StackPanel x:Name="OtherUserPanel" Visibility="Collapsed" Margin="0,0,0,6">
<TextBlock x:Name="UsernameValidationMessage" Text="" FontStyle="Italic" Foreground="{DynamicResource CloseHover}" FontSize="11" Margin="3,0,0,4" TextWrapping="Wrap"/>
<Border IsEnabled="{Binding ElementName=OtherUsernameTextBox, Path=IsEnabled}">
<Border.Style>
<Style TargetType="Border" BasedOn="{StaticResource UserTextBoxBorderStyle}">
<Style.Triggers>
<DataTrigger Binding="{Binding ElementName=OtherUsernameTextBox, Path=IsFocused}" Value="True">
<Setter Property="Background" Value="{DynamicResource InputFocusColor}"/>
</DataTrigger>
</Style.Triggers>
</Style>
</Border.Style>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<TextBlock Grid.Column="0" Text="&#xE77B;" FontFamily="Segoe Fluent Icons" FontSize="14" VerticalAlignment="Center" Margin="4,0,8,0" Foreground="{DynamicResource FgColor}"/>
<TextBlock x:Name="UsernameTextBoxPlaceholder" Grid.Column="1" Text="Enter username" Foreground="{DynamicResource FgColor}" Opacity="0.5" FontSize="13" Margin="3,0,0,1" VerticalAlignment="Center" IsHitTestVisible="False"/>
<TextBox x:Name="OtherUsernameTextBox" Grid.Column="1" Style="{StaticResource UserTextBoxStyle}" Text="" AutomationProperties.Name="Enter username"/>
</Grid>
</Border>
</StackPanel>
<TextBlock x:Name="UserSelectionDescription" Text="Changes will be applied to the currently logged-in user profile." Foreground="{DynamicResource FgColor}" FontSize="12" TextWrapping="Wrap" Margin="0,6,0,3"/>
</StackPanel>
<!-- Restart Explorer Option -->
</Border>
<!-- App Removal Scope -->
<Border Grid.Row="1" x:Name="AppRemovalScopeSection" BorderBrush="{DynamicResource BorderColor}" BorderThickness="1" CornerRadius="4" Background="{DynamicResource CardBgColor}" Padding="16,12" Margin="0,0,0,16">
<StackPanel>
<CheckBox x:Name="RestartExplorerCheckBox" Style="{StaticResource FeatureCheckboxStyle}" Content="Restart the Windows Explorer process to apply all changes immediately" AutomationProperties.Name="Restart the Windows Explorer process to apply all changes immediately"/>
<TextBlock Text="Remove Apps For" Style="{StaticResource CategoryHeaderTextBlock}"/>
<ComboBox x:Name="AppRemovalScopeCombo" Margin="0,0,0,6" AutomationProperties.Name="App Removal Scope">
<ComboBoxItem x:Name="AppRemovalScopeAllUsers" Content="All users" IsSelected="True"/>
<ComboBoxItem x:Name="AppRemovalScopeCurrentUser" Content="Current user only"/>
<ComboBoxItem x:Name="AppRemovalScopeTargetUser" Content="Target user only" Visibility="Collapsed"/>
</ComboBox>
<TextBlock x:Name="AppRemovalScopeDescription" Text="Apps will be removed for all users and from the Windows image to prevent reinstallation for new users." Foreground="{DynamicResource FgColor}" FontSize="12" TextWrapping="Wrap" Margin="0,6,0,3"/>
</StackPanel>
</StackPanel>
</Border>
<!-- Apply Changes Button -->
<Button x:Name="OverviewApplyBtn" Style="{StaticResource PrimaryButtonStyle}" Width="190" Height="44" Margin="0,0,0,15" HorizontalAlignment="Center" AutomationProperties.Name="Apply Changes">
<StackPanel Orientation="Horizontal" VerticalAlignment="Center">
<TextBlock Text="&#xE73E;" FontFamily="Segoe Fluent Icons" FontSize="20" FontWeight="SemiBold" VerticalAlignment="Center"/>
<TextBlock Text="Apply Changes" VerticalAlignment="Center" FontSize="18" FontWeight="SemiBold" Margin="8,0,0,4"/>
</StackPanel>
</Button>
</StackPanel>
</ScrollViewer>
<!-- Top fade gradient -->
<Border IsHitTestVisible="False" VerticalAlignment="Top" Height="15" Margin="0,-15,20,0" Background="{DynamicResource BgColor}">
<Border.OpacityMask>
<LinearGradientBrush StartPoint="0,0" EndPoint="0,1">
<GradientStop Color="Black" Offset="0"/>
<GradientStop Color="Black" Offset="0.5"/>
<GradientStop Color="Transparent" Offset="1"/>
</LinearGradientBrush>
</Border.OpacityMask>
</Border>
<!-- Bottom fade gradient -->
<Border IsHitTestVisible="False" VerticalAlignment="Bottom" Height="20" Margin="0,0,20,0" Background="{DynamicResource BgColor}">
<Border.OpacityMask>
<LinearGradientBrush StartPoint="0,0" EndPoint="0,1">
<GradientStop Color="Transparent" Offset="0"/>
<GradientStop Color="Black" Offset="1"/>
</LinearGradientBrush>
</Border.OpacityMask>
</Border>
</Border>
<!-- Options -->
<Border Grid.Row="2" BorderBrush="{DynamicResource BorderColor}" BorderThickness="1" CornerRadius="4" Background="{DynamicResource CardBgColor}" Padding="16,12,16,3" Margin="0,0,0,16">
<StackPanel>
<TextBlock Text="Options" Style="{StaticResource CategoryHeaderTextBlock}"/>
<!-- Restore Point Option -->
<StackPanel>
<CheckBox x:Name="RestorePointCheckBox" Style="{StaticResource FeatureCheckboxStyle}" IsChecked="True" Content="Create a system restore point (Recommended)" AutomationProperties.Name="Create a system restore point (Recommended)"/>
</StackPanel>
<!-- Restart Explorer Option -->
<StackPanel>
<CheckBox x:Name="RestartExplorerCheckBox" Style="{StaticResource FeatureCheckboxStyle}" Content="Restart the Windows Explorer process to apply all changes immediately" AutomationProperties.Name="Restart the Windows Explorer process to apply all changes immediately"/>
</StackPanel>
</StackPanel>
</Border>
</Grid>
</ScrollViewer>
<!-- Top fade gradient -->
<Border IsHitTestVisible="False" VerticalAlignment="Top" Height="10" Margin="0,-12,20,0" Background="{DynamicResource BgColor}">
<Border.OpacityMask>
<LinearGradientBrush StartPoint="0,0" EndPoint="0,1">
<GradientStop Color="Black" Offset="0"/>
<GradientStop Color="Black" Offset="0.5"/>
<GradientStop Color="Transparent" Offset="1"/>
</LinearGradientBrush>
</Border.OpacityMask>
</Border>
<!-- Bottom fade gradient -->
<Border IsHitTestVisible="False" VerticalAlignment="Bottom" Height="20" Margin="0,0,20,0" Background="{DynamicResource BgColor}">
<Border.OpacityMask>
<LinearGradientBrush StartPoint="0,0" EndPoint="0,1">
<GradientStop Color="Transparent" Offset="0"/>
<GradientStop Color="Black" Offset="1"/>
</LinearGradientBrush>
</Border.OpacityMask>
</Border>
</Grid>
<!-- Review & Apply Section -->
<StackPanel Grid.Row="1" HorizontalAlignment="Stretch" Background="{DynamicResource BgColor}">
<Button x:Name="ReviewChangesBtn" Background="Transparent" BorderThickness="0" Cursor="Hand" HorizontalAlignment="Center" Margin="0,4,0,8" AutomationProperties.Name="Review selected changes">
<Button.Template>
<ControlTemplate TargetType="Button">
<TextBlock x:Name="LinkText" Text="Review selected changes" FontSize="14" Foreground="{DynamicResource ButtonBg}" FontWeight="SemiBold" HorizontalAlignment="Center"/>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter TargetName="LinkText" Property="Foreground" Value="{DynamicResource ButtonHover}"/>
</Trigger>
<Trigger Property="IsPressed" Value="True">
<Setter TargetName="LinkText" Property="Foreground" Value="{DynamicResource ButtonPressed}"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Button.Template>
</Button>
<Button x:Name="DeploymentApplyBtn" Style="{DynamicResource PrimaryButtonStyle}" Width="190" Height="44" HorizontalAlignment="Center" AutomationProperties.Name="Apply Changes">
<StackPanel Orientation="Horizontal" VerticalAlignment="Center">
<TextBlock Text="&#xE73E;" FontFamily="Segoe Fluent Icons" FontSize="20" FontWeight="SemiBold" VerticalAlignment="Center"/>
<TextBlock Text="Apply Changes" VerticalAlignment="Center" FontSize="18" FontWeight="SemiBold" Margin="8,0,0,4"/>
</StackPanel>
</Button>
</StackPanel>
</Grid>
</DockPanel>
</TabItem>
<!-- Apply Tab -->
<TabItem Header="Apply" x:Name="ApplyTab">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<!-- Header -->
<Border DockPanel.Dock="Top" Padding="20,10,20,0">
<StackPanel Grid.Row="0">
<TextBlock Text="Applying Changes" FontWeight="Bold" FontSize="20" Margin="0,0,0,5" Foreground="{DynamicResource FgColor}"/>
<TextBlock Text="Sit back and relax while Win11Debloat applies your selected changes" FontSize="13" Margin="0,0,0,20" Foreground="{DynamicResource FgColor}" TextWrapping="Wrap"/>
</StackPanel>
</Border>
<!-- Console Output -->
<Border Grid.Row="1" BorderBrush="{DynamicResource BorderColor}" BorderThickness="1" CornerRadius="4" Background="#0C0C0C" Margin="20,0">
<ScrollViewer x:Name="ConsoleScrollViewer" VerticalScrollBarVisibility="Auto" Padding="10">
<TextBlock x:Name="ConsoleOutput" FontFamily="Consolas" FontSize="12" Foreground="#CCCCCC" TextWrapping="Wrap" Text="" AutomationProperties.LiveSetting="Polite"/>
</ScrollViewer>
</Border>
<!-- Progress and Finish Button -->
<Border Grid.Row="2" Background="{DynamicResource BgColor}" Padding="10,0" CornerRadius="0,0,8,8" Margin="20,16,20,8">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<!-- Status and Finish Button -->
<StackPanel Grid.Row="1" HorizontalAlignment="Center">
<Button x:Name="FinishBtn" Width="200" Height="48" Style="{StaticResource PrimaryButtonStyle}" Margin="0" IsEnabled="False" AutomationProperties.Name="Finish">
<TextBlock x:Name="FinishBtnText" Text="Applying changes..." VerticalAlignment="Center" FontSize="18" FontWeight="SemiBold" Margin="0,0,0,1"/>
</Button>
</StackPanel>
</Grid>
</Border>
</Grid>
</TabItem>
</TabControl>
<!-- Bottom Navigation Buttons -->
@@ -1159,7 +1023,7 @@
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<Button x:Name="PreviousBtn" Grid.Column="0" Width="120" Height="36" Style="{StaticResource SecondaryButtonStyle}" Visibility="Collapsed" Margin="10,0,0,0" AutomationProperties.Name="Previous">
<Button x:Name="PreviousBtn" Grid.Column="0" Width="120" Height="36" Style="{DynamicResource SecondaryButtonStyle}" Visibility="Collapsed" Margin="10,0,0,0" AutomationProperties.Name="Previous">
<StackPanel Orientation="Horizontal" VerticalAlignment="Center">
<TextBlock Text="&#xE72B;" FontFamily="Segoe Fluent Icons" FontSize="12" Margin="0,0,8,0" VerticalAlignment="Center"/>
<TextBlock Text="Previous" VerticalAlignment="Center" FontSize="14" Margin="0,0,0,1"/>
@@ -1167,7 +1031,7 @@
</Button>
<StackPanel Grid.Column="2" Orientation="Horizontal" HorizontalAlignment="Right">
<Button x:Name="NextBtn" Width="120" Height="36" Margin="0,0,10,0" Style="{StaticResource PrimaryButtonStyle}" AutomationProperties.Name="Next">
<Button x:Name="NextBtn" Width="120" Height="36" Margin="0,0,10,0" Style="{DynamicResource PrimaryButtonStyle}" AutomationProperties.Name="Next">
<StackPanel Orientation="Horizontal" VerticalAlignment="Center">
<TextBlock Text="Next" VerticalAlignment="Center" FontSize="14" Margin="0,0,0,1"/>
<TextBlock Text="&#xE72A;" FontFamily="Segoe Fluent Icons" FontSize="12" Margin="8,0,0,0" VerticalAlignment="Center"/>
@@ -1180,7 +1044,7 @@
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center" VerticalAlignment="Center">
<Ellipse x:Name="ProgressIndicator1" Width="10" Height="10" Margin="4,0" Fill="#808080" ToolTip="App Removal"/>
<Ellipse x:Name="ProgressIndicator2" Width="10" Height="10" Margin="4,0" Fill="#808080" ToolTip="System Tweaks"/>
<Ellipse x:Name="ProgressIndicator3" Width="10" Height="10" Margin="4,0" Fill="#808080" ToolTip="Overview"/>
<Ellipse x:Name="ProgressIndicator3" Width="10" Height="10" Margin="4,0" Fill="#808080" ToolTip="Deployment Settings"/>
</StackPanel>
</Grid>

View File

@@ -3,87 +3,14 @@
Title="MessageBox"
Width="440"
SizeToContent="Height"
MaxHeight="500"
ResizeMode="NoResize"
WindowStartupLocation="CenterScreen"
WindowStartupLocation="CenterOwner"
WindowStyle="None"
AllowsTransparency="True"
Background="Transparent"
Topmost="True"
ShowInTaskbar="False">
<Window.Resources>
<!-- Button Style -->
<Style x:Key="MessageBoxButton" TargetType="Button">
<Setter Property="Background" Value="{DynamicResource SecondaryButtonBg}"/>
<Setter Property="Foreground" Value="{DynamicResource FgColor}"/>
<Setter Property="BorderThickness" Value="1"/>
<Setter Property="BorderBrush" Value="{DynamicResource ButtonBorderColor}"/>
<Setter Property="Padding" Value="0"/>
<Setter Property="FontSize" Value="14"/>
<Setter Property="Height" Value="32"/>
<Setter Property="MinWidth" Value="80"/>
<Setter Property="Margin" Value="4,0"/>
<Setter Property="FontWeight" Value="Normal"/>
<Setter Property="Cursor" Value="Hand"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="Button">
<Border x:Name="Border"
Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
CornerRadius="4"
Padding="{TemplateBinding Padding}">
<ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter TargetName="Border" Property="Background" Value="{DynamicResource SecondaryButtonHover}"/>
</Trigger>
<Trigger Property="IsPressed" Value="True">
<Setter TargetName="Border" Property="Background" Value="{DynamicResource SecondaryButtonPressed}"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<!-- Primary Button Style -->
<Style x:Key="PrimaryMessageBoxButton" TargetType="Button" BasedOn="{StaticResource MessageBoxButton}">
<Setter Property="Background" Value="{DynamicResource ButtonBg}"/>
<Setter Property="Foreground" Value="white"/>
<Setter Property="BorderBrush" Value="{DynamicResource ButtonBg}"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="Button">
<Border Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
CornerRadius="4"
Padding="{TemplateBinding Padding}">
<ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center" Margin="0,0,0,1"/>
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
<Style.Triggers>
<Trigger Property="IsEnabled" Value="False">
<Setter Property="Background" Value="{DynamicResource ButtonDisabled}"/>
<Setter Property="BorderBrush" Value="{DynamicResource ButtonDisabled}"/>
<Setter Property="Foreground" Value="{DynamicResource ButtonTextDisabled}"/>
</Trigger>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Background" Value="{DynamicResource ButtonHover}"/>
<Setter Property="BorderBrush" Value="{DynamicResource ButtonHover}"/>
</Trigger>
<Trigger Property="IsPressed" Value="True">
<Setter Property="Background" Value="{DynamicResource ButtonPressed}"/>
<Setter Property="BorderBrush" Value="{DynamicResource ButtonPressed}"/>
</Trigger>
</Style.Triggers>
</Style>
</Window.Resources>
<Border BorderBrush="{DynamicResource BorderColor}"
BorderThickness="1"
@@ -117,32 +44,34 @@
</Grid>
<!-- Message Content -->
<Grid Grid.Row="1" Margin="24,12,24,20">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<ScrollViewer Grid.Row="1" VerticalScrollBarVisibility="Auto" MaxHeight="500" Padding="0" Margin="20,12,1,20">
<Grid Margin="0,0,20,0">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<!-- Icon -->
<TextBlock x:Name="IconText"
Grid.Column="0"
FontFamily="Segoe Fluent Icons"
FontSize="24"
Foreground="{DynamicResource FgColor}"
VerticalAlignment="Center"
Margin="0,2,14,0"
Visibility="Collapsed"/>
<!-- Icon -->
<TextBlock x:Name="IconText"
Grid.Column="0"
FontFamily="Segoe Fluent Icons"
FontSize="24"
Foreground="{DynamicResource FgColor}"
VerticalAlignment="Center"
Margin="4,2,14,0"
Visibility="Collapsed"/>
<!-- Message Text -->
<TextBlock x:Name="MessageText"
Grid.Column="1"
Text="Message content goes here"
TextWrapping="Wrap"
FontSize="14"
LineHeight="20"
Foreground="{DynamicResource FgColor}"
VerticalAlignment="Center"/>
</Grid>
<!-- Message Text -->
<TextBlock x:Name="MessageText"
Grid.Column="1"
Text="Message content goes here"
TextWrapping="Wrap"
FontSize="14"
LineHeight="20"
Foreground="{DynamicResource FgColor}"
VerticalAlignment="Center"/>
</Grid>
</ScrollViewer>
<!-- Button Panel -->
<Border Grid.Row="2"
@@ -156,10 +85,12 @@
HorizontalAlignment="Right">
<Button x:Name="Button1"
Content="OK"
Style="{StaticResource PrimaryMessageBoxButton}"/>
Height="32" MinWidth="80" Margin="4,0"
Style="{DynamicResource PrimaryButtonStyle}"/>
<Button x:Name="Button2"
Content="Cancel"
Style="{StaticResource MessageBoxButton}"
Height="32" MinWidth="80" Margin="4,0"
Style="{DynamicResource SecondaryButtonStyle}"
Visibility="Collapsed"/>
</StackPanel>
</Border>

165
Schemas/SharedStyles.xaml Normal file
View File

@@ -0,0 +1,165 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<!-- Primary Button Style -->
<Style x:Key="PrimaryButtonStyle" TargetType="Button">
<Setter Property="Background" Value="{DynamicResource ButtonBg}"/>
<Setter Property="Foreground" Value="white"/>
<Setter Property="BorderBrush" Value="{DynamicResource ButtonBg}"/>
<Setter Property="BorderThickness" Value="1"/>
<Setter Property="Padding" Value="0"/>
<Setter Property="FontSize" Value="14"/>
<Setter Property="Cursor" Value="Hand"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="Button">
<Border Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
CornerRadius="4"
Padding="{TemplateBinding Padding}">
<ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
<Style.Triggers>
<Trigger Property="IsEnabled" Value="False">
<Setter Property="Background" Value="{DynamicResource ButtonDisabled}"/>
<Setter Property="BorderBrush" Value="{DynamicResource ButtonDisabled}"/>
<Setter Property="Foreground" Value="{DynamicResource ButtonTextDisabled}"/>
</Trigger>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Background" Value="{DynamicResource ButtonHover}"/>
<Setter Property="BorderBrush" Value="{DynamicResource ButtonHover}"/>
</Trigger>
<Trigger Property="IsPressed" Value="True">
<Setter Property="Background" Value="{DynamicResource ButtonPressed}"/>
<Setter Property="BorderBrush" Value="{DynamicResource ButtonPressed}"/>
</Trigger>
</Style.Triggers>
</Style>
<!-- Secondary Button Style -->
<Style x:Key="SecondaryButtonStyle" TargetType="Button">
<Setter Property="Background" Value="{DynamicResource SecondaryButtonBg}"/>
<Setter Property="Foreground" Value="{DynamicResource FgColor}"/>
<Setter Property="BorderBrush" Value="{DynamicResource ButtonBorderColor}"/>
<Setter Property="BorderThickness" Value="1"/>
<Setter Property="Padding" Value="0"/>
<Setter Property="FontSize" Value="14"/>
<Setter Property="Cursor" Value="Hand"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="Button">
<Border Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
CornerRadius="4"
Padding="{TemplateBinding Padding}">
<ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center" Margin="0,0,0,1"/>
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
<Style.Triggers>
<Trigger Property="IsEnabled" Value="False">
<Setter Property="Background" Value="{DynamicResource SecondaryButtonDisabled}"/>
<Setter Property="BorderBrush" Value="{DynamicResource BorderColor}"/>
<Setter Property="Foreground" Value="{DynamicResource SecondaryButtonTextDisabled}"/>
</Trigger>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Background" Value="{DynamicResource SecondaryButtonHover}"/>
<Setter Property="BorderBrush" Value="{DynamicResource ButtonBorderColor}"/>
</Trigger>
<Trigger Property="IsPressed" Value="True">
<Setter Property="Background" Value="{DynamicResource SecondaryButtonPressed}"/>
<Setter Property="BorderBrush" Value="{DynamicResource ButtonBorderColor}"/>
</Trigger>
</Style.Triggers>
</Style>
<!-- Hyperlink Style -->
<Style x:Key="HyperlinkStyle" TargetType="TextBlock">
<Setter Property="Foreground" Value="{DynamicResource ButtonBg}"/>
<Setter Property="Cursor" Value="Hand"/>
<Style.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Foreground" Value="{DynamicResource ButtonHover}"/>
</Trigger>
</Style.Triggers>
</Style>
<!-- ProgressBar Style -->
<Style x:Key="ApplyProgressBarStyle" TargetType="ProgressBar">
<Setter Property="Background" Value="{DynamicResource ButtonBorderColor}"/>
<Setter Property="Foreground" Value="{DynamicResource ButtonBg}"/>
<Setter Property="Height" Value="6"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="ProgressBar">
<Grid>
<Border x:Name="PART_Track" Background="{TemplateBinding Background}" CornerRadius="3" Height="{TemplateBinding Height}"/>
<Border x:Name="PART_Indicator" Background="{TemplateBinding Foreground}" CornerRadius="3" HorizontalAlignment="Left" Height="{TemplateBinding Height}"/>
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<!-- Modal Title Style -->
<Style x:Key="ModalTitleStyle" TargetType="TextBlock">
<Setter Property="FontWeight" Value="Bold"/>
<Setter Property="FontSize" Value="20"/>
<Setter Property="Foreground" Value="{DynamicResource FgColor}"/>
<Setter Property="HorizontalAlignment" Value="Center"/>
<Setter Property="Margin" Value="0,0,0,8"/>
</Style>
<!-- Modal Subtext Style -->
<Style x:Key="ModalSubtextStyle" TargetType="TextBlock">
<Setter Property="FontSize" Value="13"/>
<Setter Property="Foreground" Value="{DynamicResource FgColor}"/>
<Setter Property="Opacity" Value="0.8"/>
<Setter Property="HorizontalAlignment" Value="Center"/>
<Setter Property="TextAlignment" Value="Center"/>
</Style>
<!-- ScrollBar Style -->
<Style TargetType="{x:Type ScrollBar}">
<Setter Property="Background" Value="Transparent"/>
<Setter Property="Width" Value="8"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type ScrollBar}">
<Grid>
<Track Name="PART_Track" IsDirectionReversed="true">
<Track.Thumb>
<Thumb>
<Thumb.Style>
<Style TargetType="Thumb">
<Setter Property="Background" Value="{DynamicResource ScrollBarThumbColor}"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="Thumb">
<Border Background="{TemplateBinding Background}" CornerRadius="4"/>
</ControlTemplate>
</Setter.Value>
</Setter>
<Style.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Background" Value="{DynamicResource ScrollBarThumbHoverColor}"/>
</Trigger>
</Style.Triggers>
</Style>
</Thumb.Style>
</Thumb>
</Track.Thumb>
</Track>
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</ResourceDictionary>

View File

@@ -24,20 +24,13 @@ function ApplySettingsToUiControls {
}
}
# 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
# Skip RestorePointCheckBox, this is always checked by default
if ($paramName -eq 'CreateRestorePoint') {
if ($restorePointCheckBox) { $restorePointCheckBox.IsChecked = $true }
continue
}

View File

@@ -74,4 +74,17 @@ function SetWindowThemeResources {
$window.Resources.Add("WarningIconColor", [System.Windows.Media.SolidColorBrush]::new([System.Windows.Media.ColorConverter]::ConvertFromString("#FFB900")))
$window.Resources.Add("ErrorIconColor", [System.Windows.Media.SolidColorBrush]::new([System.Windows.Media.ColorConverter]::ConvertFromString("#E81123")))
$window.Resources.Add("QuestionIconColor", [System.Windows.Media.SolidColorBrush]::new([System.Windows.Media.ColorConverter]::ConvertFromString("#0078D4")))
# Load and merge shared styles
if ($script:SharedStylesSchema -and (Test-Path $script:SharedStylesSchema)) {
$sharedXaml = Get-Content -Path $script:SharedStylesSchema -Raw
$sharedReader = [System.Xml.XmlReader]::Create([System.IO.StringReader]::new($sharedXaml))
try {
$sharedDict = [System.Windows.Markup.XamlReader]::Load($sharedReader)
$window.Resources.MergedDictionaries.Add($sharedDict)
}
finally {
$sharedReader.Close()
}
}
}

View File

@@ -0,0 +1,177 @@
function Show-ApplyModal {
param (
[Parameter(Mandatory=$false)]
[System.Windows.Window]$Owner = $null,
[Parameter(Mandatory=$false)]
[bool]$RestartExplorer = $false
)
Add-Type -AssemblyName PresentationFramework,PresentationCore,WindowsBase | Out-Null
$usesDarkMode = GetSystemUsesDarkMode
# Determine owner window
$ownerWindow = if ($Owner) { $Owner } else { $script:GuiWindow }
# Show overlay if owner window exists
$overlay = $null
if ($ownerWindow) {
try {
$overlay = $ownerWindow.FindName('ModalOverlay')
if ($overlay) {
$ownerWindow.Dispatcher.Invoke([action]{ $overlay.Visibility = 'Visible' })
}
}
catch { }
}
# Load XAML from file
$xaml = Get-Content -Path $script:ApplyChangesWindowSchema -Raw
$reader = [System.Xml.XmlReader]::Create([System.IO.StringReader]::new($xaml))
try {
$applyWindow = [System.Windows.Markup.XamlReader]::Load($reader)
}
finally {
$reader.Close()
}
# Set owner to owner window if it exists
if ($ownerWindow) {
try {
$applyWindow.Owner = $ownerWindow
}
catch { }
}
# Apply theme resources
SetWindowThemeResources -window $applyWindow -usesDarkMode $usesDarkMode
# Get UI elements
$script:ApplyInProgressPanel = $applyWindow.FindName('ApplyInProgressPanel')
$script:ApplyCompletionPanel = $applyWindow.FindName('ApplyCompletionPanel')
$script:ApplyStepNameEl = $applyWindow.FindName('ApplyStepName')
$script:ApplyStepCounterEl = $applyWindow.FindName('ApplyStepCounter')
$script:ApplyProgressBarEl = $applyWindow.FindName('ApplyProgressBar')
$script:ApplyCompletionTitleEl = $applyWindow.FindName('ApplyCompletionTitle')
$script:ApplyCompletionMessageEl = $applyWindow.FindName('ApplyCompletionMessage')
$script:ApplyCompletionIconEl = $applyWindow.FindName('ApplyCompletionIcon')
$applyCloseBtn = $applyWindow.FindName('ApplyCloseBtn')
$applyKofiBtn = $applyWindow.FindName('ApplyKofiBtn')
$applyCancelBtn = $applyWindow.FindName('ApplyCancelBtn')
# Initialize in-progress state
$script:ApplyInProgressPanel.Visibility = 'Visible'
$script:ApplyCompletionPanel.Visibility = 'Collapsed'
$script:ApplyStepNameEl.Text = "Preparing..."
$script:ApplyStepCounterEl.Text = "Preparing..."
$script:ApplyProgressBarEl.Value = 0
# Set up progress callback for ExecuteAllChanges
$script:ApplyProgressCallback = {
param($currentStep, $totalSteps, $stepName)
$script:ApplyStepNameEl.Text = $stepName
$script:ApplyStepCounterEl.Text = "Step $currentStep of $totalSteps"
# Store current step/total in Tag properties for sub-step interpolation
$script:ApplyStepCounterEl.Tag = $currentStep
$script:ApplyProgressBarEl.Tag = $totalSteps
# Show progress at the start of each step (empty at step 1, full after last step completes)
$pct = if ($totalSteps -gt 0) { [math]::Round((($currentStep - 1) / $totalSteps) * 100) } else { 0 }
$script:ApplyProgressBarEl.Value = $pct
# Process pending window messages to keep UI responsive
DoEvents
}
# Sub-step callback updates step name and interpolates progress bar within the current step
$script:ApplySubStepCallback = {
param($subStepName, $subIndex, $subCount)
$script:ApplyStepNameEl.Text = $subStepName
# Interpolate progress bar between previous step and current step
$currentStep = [int]($script:ApplyStepCounterEl.Tag)
$totalSteps = [int]($script:ApplyProgressBarEl.Tag)
if ($totalSteps -gt 0 -and $subCount -gt 0) {
$baseProgress = ($currentStep - 1) / $totalSteps
$stepFraction = ($subIndex / $subCount) / $totalSteps
$script:ApplyProgressBarEl.Value = [math]::Round(($baseProgress + $stepFraction) * 100)
}
DoEvents
}
# Run changes in background to keep UI responsive
$applyWindow.Dispatcher.BeginInvoke([System.Windows.Threading.DispatcherPriority]::Background, [action]{
try {
ExecuteAllChanges
# Restart explorer if requested
if ($RestartExplorer -and -not $script:CancelRequested) {
RestartExplorer
}
Write-Host ""
if ($script:CancelRequested) {
Write-Host "Script execution was cancelled by the user. Some changes may not have been applied."
} else {
Write-Host "All changes have been applied successfully."
}
# Show completion state
$script:ApplyProgressBarEl.Value = 100
$script:ApplyInProgressPanel.Visibility = 'Collapsed'
$script:ApplyCompletionPanel.Visibility = 'Visible'
if ($script:CancelRequested) {
$script:ApplyCompletionIconEl.Text = [char]0xE7BA
$script:ApplyCompletionIconEl.Foreground = [System.Windows.Media.SolidColorBrush]::new([System.Windows.Media.ColorConverter]::ConvertFromString("#e8912d"))
$script:ApplyCompletionTitleEl.Text = "Cancelled"
$script:ApplyCompletionMessageEl.Text = "Script execution was cancelled by the user."
} else {
$script:ApplyCompletionTitleEl.Text = "Changes Applied"
$script:ApplyCompletionMessageEl.Text = "All changes have been applied successfully!"
}
$applyWindow.Dispatcher.Invoke([System.Windows.Threading.DispatcherPriority]::Render, [action]{})
}
catch {
Write-Host "Error: $($_.Exception.Message)"
$script:ApplyInProgressPanel.Visibility = 'Collapsed'
$script:ApplyCompletionPanel.Visibility = 'Visible'
$script:ApplyCompletionIconEl.Text = [char]0xEA39
$script:ApplyCompletionIconEl.Foreground = [System.Windows.Media.SolidColorBrush]::new([System.Windows.Media.ColorConverter]::ConvertFromString("#c42b1c"))
$script:ApplyCompletionTitleEl.Text = "Error"
$script:ApplyCompletionMessageEl.Text = "An error occurred while applying changes: $($_.Exception.Message)"
$applyWindow.Dispatcher.Invoke([System.Windows.Threading.DispatcherPriority]::Render, [action]{})
}
finally {
$script:ApplyProgressCallback = $null
$script:ApplySubStepCallback = $null
}
})
# Button handlers
$applyCloseBtn.Add_Click({
$applyWindow.Close()
})
$applyKofiBtn.Add_Click({
Start-Process "https://ko-fi.com/raphire"
})
$applyCancelBtn.Add_Click({
if ($script:ApplyCompletionPanel.Visibility -eq 'Visible') {
# Completion state - just close
$applyWindow.Close()
} else {
# In-progress state - request cancellation
$script:CancelRequested = $true
}
})
# Show dialog
$applyWindow.ShowDialog() | Out-Null
# Hide overlay after dialog closes
if ($overlay) {
try {
$ownerWindow.Dispatcher.Invoke([action]{ $overlay.Visibility = 'Collapsed' })
}
catch { }
}
}

View File

@@ -221,15 +221,7 @@ function Show-MainWindow {
$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
# Set script-level variable for GUI window reference
$script:GuiWindow = $window
# Updates app selection status text in the App Selection tab
@@ -972,8 +964,7 @@ function Show-MainWindow {
$totalTabs = $tabControl.Items.Count
$homeIndex = 0
$overviewIndex = $totalTabs - 2
$applyIndex = $totalTabs - 1
$overviewIndex = $totalTabs - 1
# Navigation button visibility
if ($currentIndex -eq $homeIndex) {
@@ -982,26 +973,23 @@ function Show-MainWindow {
} 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
# Tab indices: 0=Home, 1=App Removal, 2=Tweaks, 3=Deployment Settings
$blueColor = "#0067c0"
$greyColor = "#808080"
$progressIndicator1 = $window.FindName('ProgressIndicator1') # App Removal
$progressIndicator2 = $window.FindName('ProgressIndicator2') # Tweaks
$progressIndicator3 = $window.FindName('ProgressIndicator3') # Overview
$progressIndicator3 = $window.FindName('ProgressIndicator3') # Deployment Settings
$bottomNavGrid = $window.FindName('BottomNavGrid')
# Hide bottom navigation on home page and apply tab
if ($currentIndex -eq 0 -or $currentIndex -eq $applyIndex) {
# Hide bottom navigation on home page
if ($currentIndex -eq 0) {
$bottomNavGrid.Visibility = 'Collapsed'
} else {
$bottomNavGrid.Visibility = 'Visible'
@@ -1022,7 +1010,7 @@ function Show-MainWindow {
$progressIndicator2.Fill = $greyColor
}
# Indicator 3 (Overview) - tab index 3
# Indicator 3 (Deployment Settings) - tab index 3
if ($currentIndex -ge 3) {
$progressIndicator3.Fill = $blueColor
} else {
@@ -1142,8 +1130,6 @@ function Show-MainWindow {
function GenerateOverview {
# Load Features.json
$featuresJson = LoadJsonFile -filePath $script:FeaturesFilePath -expectedVersion "1.0"
$overviewChangesPanel = $window.FindName('OverviewChangesPanel')
$overviewChangesPanel.Children.Clear()
$changesList = @()
@@ -1155,7 +1141,7 @@ function Show-MainWindow {
}
}
if ($selectedAppsCount -gt 0) {
$changesList += "Remove $selectedAppsCount selected application(s)"
$changesList += "Remove $selectedAppsCount application(s)"
}
# Update app removal scope section based on whether apps are selected
@@ -1206,20 +1192,19 @@ function Show-MainWindow {
}
}
return $changesList
}
function ShowChangesOverview {
$changesList = GenerateOverview
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
}
Show-MessageBox -Message 'No changes have been selected.' -Title 'Selected Changes' -Button 'OK' -Icon 'Information'
return
}
$message = ($changesList | ForEach-Object { "- $_" }) -join "`n"
Show-MessageBox -Message $message -Title 'Selected Changes' -Button 'OK' -Icon 'None' -Width 600
}
$previousBtn.Add_Click({
@@ -1261,14 +1246,20 @@ function Show-MainWindow {
}
}
# Navigate directly to the Overview tab
# Navigate directly to the Deployment Settings tab
$tabControl.SelectedIndex = 3
UpdateNavigationButtons
})
# Handle Overview Apply Changes button - validates and immediately starts applying changes
$overviewApplyBtn = $window.FindName('OverviewApplyBtn')
$overviewApplyBtn.Add_Click({
# Handle Review Changes link button
$reviewChangesBtn = $window.FindName('ReviewChangesBtn')
$reviewChangesBtn.Add_Click({
ShowChangesOverview
})
# Handle Apply Changes button - validates and immediately starts applying changes
$deploymentApplyBtn = $window.FindName('DeploymentApplyBtn')
$deploymentApplyBtn.Add_Click({
if (-not (ValidateOtherUsername)) {
Show-MessageBox -Message "Please enter a valid username." -Title "Invalid Username" -Button 'OK' -Icon 'Warning' | Out-Null
return
@@ -1381,47 +1372,15 @@ function Show-MainWindow {
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 = ""
# Check if user wants to restart explorer
$restartExplorerCheckBox = $window.FindName('RestartExplorerCheckBox')
$shouldRestartExplorer = $restartExplorerCheckBox -and $restartExplorerCheckBox.IsChecked
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
# Check if user wants to restart explorer (from checkbox)
$restartExplorerCheckBox = $window.FindName('RestartExplorerCheckBox')
if ($restartExplorerCheckBox -and $restartExplorerCheckBox.IsChecked -and -not $script:CancelRequested) {
RestartExplorer
}
Write-ToConsole ""
if ($script:CancelRequested) {
Write-ToConsole "Script execution was cancelled by the user. Some changes may not have been applied."
} else {
Write-ToConsole "All changes have been applied. Please check the output above for any errors."
}
$finishBtn.Dispatcher.Invoke([action]{
$finishBtn.IsEnabled = $true
$finishBtnText.Text = "Close Win11Debloat"
})
}
catch {
Write-ToConsole "Error: $($_.Exception.Message)"
$finishBtn.Dispatcher.Invoke([action]{
$finishBtn.IsEnabled = $true
$finishBtnText.Text = "Close Win11Debloat"
})
}
})
# Show the apply changes window
Show-ApplyModal -Owner $window -RestartExplorer $shouldRestartExplorer
# Close the main window after the apply dialog closes
$window.Close()
})
# Initialize UI elements on window load
@@ -1460,15 +1419,6 @@ function Show-MainWindow {
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({
@@ -1552,17 +1502,6 @@ function Show-MainWindow {
}
}
}
# 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

View File

@@ -16,7 +16,10 @@ function Show-MessageBox {
[string]$Icon = 'None',
[Parameter(Mandatory=$false)]
[System.Windows.Window]$Owner = $null
[System.Windows.Window]$Owner = $null,
[Parameter(Mandatory=$false)]
[int]$Width = 0
)
Add-Type -AssemblyName PresentationFramework,PresentationCore,WindowsBase | Out-Null
@@ -28,11 +31,15 @@ function Show-MessageBox {
# Show overlay if owner window exists
$overlay = $null
$overlayWasAlreadyVisible = $false
if ($ownerWindow) {
try {
$overlay = $ownerWindow.FindName('ModalOverlay')
if ($overlay) {
$ownerWindow.Dispatcher.Invoke([action]{ $overlay.Visibility = 'Visible' })
$overlayWasAlreadyVisible = ($overlay.Visibility -eq 'Visible')
if (-not $overlayWasAlreadyVisible) {
$ownerWindow.Dispatcher.Invoke([action]{ $overlay.Visibility = 'Visible' })
}
}
}
catch { }
@@ -56,6 +63,11 @@ function Show-MessageBox {
catch { }
}
# Apply custom width if specified
if ($Width -gt 0) {
$msgWindow.Width = $Width
}
# Apply theme resources
SetWindowThemeResources -window $msgWindow -usesDarkMode $usesDarkMode
@@ -142,8 +154,8 @@ function Show-MessageBox {
# Show dialog and return result from Tag
$msgWindow.ShowDialog() | Out-Null
# Hide overlay after dialog closes
if ($overlay) {
# Hide overlay after dialog closes (only if this dialog was the one that showed it)
if ($overlay -and -not $overlayWasAlreadyVisible) {
try {
$ownerWindow.Dispatcher.Invoke([action]{ $overlay.Visibility = 'Collapsed' })
}

View File

@@ -109,15 +109,17 @@ $script:AppSelectionSchema = "$PSScriptRoot/Schemas/AppSelectionWindow.xaml"
$script:MainWindowSchema = "$PSScriptRoot/Schemas/MainWindow.xaml"
$script:MessageBoxSchema = "$PSScriptRoot/Schemas/MessageBoxWindow.xaml"
$script:AboutWindowSchema = "$PSScriptRoot/Schemas/AboutWindow.xaml"
$script:ApplyChangesWindowSchema = "$PSScriptRoot/Schemas/ApplyChangesWindow.xaml"
$script:SharedStylesSchema = "$PSScriptRoot/Schemas/SharedStyles.xaml"
$script:FeaturesFilePath = "$script:AssetsPath/Features.json"
$script:ControlParams = 'WhatIf', 'Confirm', 'Verbose', 'Debug', 'LogPath', 'Silent', 'Sysprep', 'User', 'NoRestartExplorer', 'RunDefaults', 'RunDefaultsLite', 'RunSavedSettings', 'RunAppsListGenerator', 'CLI', 'AppRemovalTarget'
# Script-level variables for GUI elements
$script:GuiConsoleOutput = $null
$script:GuiConsoleScrollViewer = $null
$script:GuiWindow = $null
$script:CancelRequested = $false
$script:ApplyProgressCallback = $null
$script:ApplySubStepCallback = $null
# Check if current powershell environment is limited by security policies
if ($ExecutionContext.SessionState.LanguageMode -ne "FullLanguage") {
@@ -159,7 +161,7 @@ else {
}
# 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))) {
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:ApplyChangesWindowSchema) -and (Test-Path $script:SharedStylesSchema) -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..."
@@ -228,6 +230,7 @@ if (-not $script:WingetInstalled -and -not $Silent) {
. "$PSScriptRoot/Scripts/GUI/AttachShiftClickBehavior.ps1"
. "$PSScriptRoot/Scripts/GUI/ApplySettingsToUiControls.ps1"
. "$PSScriptRoot/Scripts/GUI/Show-MessageBox.ps1"
. "$PSScriptRoot/Scripts/GUI/Show-ApplyModal.ps1"
. "$PSScriptRoot/Scripts/GUI/Show-AppSelectionWindow.ps1"
. "$PSScriptRoot/Scripts/GUI/Show-MainWindow.ps1"
. "$PSScriptRoot/Scripts/GUI/Show-AboutDialog.ps1"
@@ -241,59 +244,59 @@ if (-not $script:WingetInstalled -and -not $Silent) {
. "$PSScriptRoot/Scripts/FileIO/LoadAppsFromFile.ps1"
. "$PSScriptRoot/Scripts/FileIO/LoadAppsDetailsFromJson.ps1"
# Writes to both GUI console output and standard console
function Write-ToConsole {
param(
[string]$message,
[string]$ForegroundColor = $null
# Processes all pending WPF window messages (input, render, etc.) to keep the UI responsive
# during long-running operations on the UI thread. Equivalent to Application.DoEvents().
function DoEvents {
if (-not $script:GuiWindow) { return }
$frame = [System.Windows.Threading.DispatcherFrame]::new()
[System.Windows.Threading.Dispatcher]::CurrentDispatcher.BeginInvoke(
[System.Windows.Threading.DispatcherPriority]::Background,
[System.Windows.Threading.DispatcherOperationCallback]{
param($f)
$f.Continue = $false
return $null
},
$frame
)
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
[System.Windows.Threading.Dispatcher]::PushFrame($frame)
}
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: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 {}
}
})
# Runs a scriptblock in a background PowerShell runspace while keeping the UI responsive.
# In GUI mode, the work executes on a separate thread and the UI thread pumps messages (~60fps).
# In CLI mode, the scriptblock runs directly in the current session.
function Invoke-NonBlocking {
param(
[scriptblock]$ScriptBlock,
[object[]]$ArgumentList = @()
)
# Force UI to process pending updates for real-time display
if ($script:GuiWindow) {
$script:GuiWindow.Dispatcher.Invoke([System.Windows.Threading.DispatcherPriority]::Background, [action]{})
}
if (-not $script:GuiWindow) {
return (& $ScriptBlock @ArgumentList)
}
$ps = [powershell]::Create()
try {
if ($ForegroundColor) {
Write-Host $message -ForegroundColor $ForegroundColor
$null = $ps.AddScript($ScriptBlock.ToString())
foreach ($arg in $ArgumentList) {
$null = $ps.AddArgument($arg)
}
else {
Write-Host $message
$handle = $ps.BeginInvoke()
while (-not $handle.IsCompleted) {
DoEvents
Start-Sleep -Milliseconds 16
}
$result = $ps.EndInvoke($handle)
if ($result.Count -eq 0) { return $null }
if ($result.Count -eq 1) { return $result[0] }
return @($result)
}
catch {
Write-Host $message
finally {
$ps.Dispose()
}
}
@@ -484,17 +487,27 @@ function RemoveApps {
# Determine target from script-level params, defaulting to AllUsers
$targetUser = GetTargetUserForAppRemoval
$appIndex = 0
$appCount = @($appsList).Count
Foreach ($app in $appsList) {
if ($script:CancelRequested) {
return
}
Write-ToConsole "Attempting to remove $app..."
$appIndex++
# Update step name and sub-progress to show which app is being removed (only for bulk removal)
if ($script:ApplySubStepCallback -and $appCount -gt 1) {
& $script:ApplySubStepCallback "Removing apps ($appIndex/$appCount)" $appIndex $appCount
}
Write-Host "Attempting to remove $app..."
# Use WinGet only to remove OneDrive and Edge
if (($app -eq "Microsoft.OneDrive") -or ($app -eq "Microsoft.Edge")) {
if ($script:WingetInstalled -eq $false) {
Write-ToConsole "WinGet is either not installed or is outdated, $app could not be removed" -ForegroundColor Red
Write-Host "WinGet is either not installed or is outdated, $app could not be removed" -ForegroundColor Red
continue
}
@@ -509,21 +522,24 @@ function RemoveApps {
}
else {
# Uninstall app via WinGet
$wingetOutput = winget uninstall --accept-source-agreements --disable-interactivity --id $app
$wingetOutput = Invoke-NonBlocking -ScriptBlock {
param($appId)
winget uninstall --accept-source-agreements --disable-interactivity --id $appId
} -ArgumentList $app
If (($app -eq "Microsoft.Edge") -and (Select-String -InputObject $wingetOutput -Pattern "Uninstall failed with exit code")) {
Write-ToConsole "Unable to uninstall Microsoft Edge via WinGet" -ForegroundColor Red
Write-Host "Unable to uninstall Microsoft Edge via WinGet" -ForegroundColor Red
if ($script:GuiConsoleOutput) {
if ($script:GuiWindow) {
$result = Show-MessageBox -Message 'Unable to uninstall Microsoft Edge via WinGet. Would you like to forcefully uninstall it? NOT RECOMMENDED!' -Title 'Force Uninstall Microsoft Edge?' -Button 'YesNo' -Icon 'Warning'
if ($result -eq 'Yes') {
Write-ToConsole ""
Write-Host ""
ForceRemoveEdge
}
}
elseif ($( Read-Host -Prompt "Would you like to forcefully uninstall Microsoft Edge? NOT RECOMMENDED! (y/n)" ) -eq 'y') {
Write-ToConsole ""
Write-Host ""
ForceRemoveEdge
}
}
@@ -538,43 +554,47 @@ function RemoveApps {
try {
switch ($targetUser) {
"AllUsers" {
# Remove installed app for all existing users
Get-AppxPackage -Name $appPattern -AllUsers | Remove-AppxPackage -AllUsers -ErrorAction Continue
# Remove provisioned app from OS image, so the app won't be installed for any new users
Get-AppxProvisionedPackage -Online | Where-Object { $_.PackageName -like $appPattern } | ForEach-Object { Remove-ProvisionedAppxPackage -Online -AllUsers -PackageName $_.PackageName }
# Remove installed app for all existing users, and from OS image
Invoke-NonBlocking -ScriptBlock {
param($pattern)
Get-AppxPackage -Name $pattern -AllUsers | Remove-AppxPackage -AllUsers -ErrorAction Continue
Get-AppxProvisionedPackage -Online | Where-Object { $_.PackageName -like $pattern } | ForEach-Object { Remove-ProvisionedAppxPackage -Online -AllUsers -PackageName $_.PackageName }
} -ArgumentList $appPattern
}
"CurrentUser" {
# Remove installed app for current user only
Get-AppxPackage -Name $appPattern | Remove-AppxPackage -ErrorAction Continue
Invoke-NonBlocking -ScriptBlock {
param($pattern)
Get-AppxPackage -Name $pattern | Remove-AppxPackage -ErrorAction Continue
} -ArgumentList $appPattern
}
default {
# Target is a specific username - remove app for that user only
# Get the user's SID
$userAccount = New-Object System.Security.Principal.NTAccount($targetUser)
$userSid = $userAccount.Translate([System.Security.Principal.SecurityIdentifier]).Value
# Remove the app package for the specific user
Get-AppxPackage -Name $appPattern -User $userSid | Remove-AppxPackage -User $userSid -ErrorAction Continue
Invoke-NonBlocking -ScriptBlock {
param($pattern, $user)
$userAccount = New-Object System.Security.Principal.NTAccount($user)
$userSid = $userAccount.Translate([System.Security.Principal.SecurityIdentifier]).Value
Get-AppxPackage -Name $pattern -User $userSid | Remove-AppxPackage -User $userSid -ErrorAction Continue
} -ArgumentList @($appPattern, $targetUser)
}
}
}
catch {
if ($DebugPreference -ne "SilentlyContinue") {
Write-ToConsole "Something went wrong while trying to remove $app" -ForegroundColor Yellow
Write-Host "Something went wrong while trying to remove $app" -ForegroundColor Yellow
Write-Host $psitem.Exception.StackTrace -ForegroundColor Gray
}
}
}
Write-ToConsole ""
Write-Host ""
}
# Forcefully removes Microsoft Edge using its uninstaller
# Credit: Based on work from loadstring1 & ave9858
function ForceRemoveEdge {
Write-ToConsole "> Forcefully uninstalling Microsoft Edge..."
Write-Host "> Forcefully uninstalling Microsoft Edge..."
$regView = [Microsoft.Win32.RegistryView]::Registry32
$hklm = [Microsoft.Win32.RegistryKey]::OpenBaseKey([Microsoft.Win32.RegistryHive]::LocalMachine, $regView)
@@ -588,11 +608,14 @@ function ForceRemoveEdge {
# Remove edge
$uninstallRegKey = $hklm.OpenSubKey('SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Microsoft Edge')
if ($null -ne $uninstallRegKey) {
Write-ToConsole "Running uninstaller..."
Write-Host "Running uninstaller..."
$uninstallString = $uninstallRegKey.GetValue('UninstallString') + ' --force-uninstall'
Start-Process cmd.exe "/c $uninstallString" -WindowStyle Hidden -Wait
Invoke-NonBlocking -ScriptBlock {
param($cmd)
Start-Process cmd.exe "/c $cmd" -WindowStyle Hidden -Wait
} -ArgumentList $uninstallString
Write-ToConsole "Removing leftover files..."
Write-Host "Removing leftover files..."
$edgePaths = @(
"$env:ProgramData\Microsoft\Windows\Start Menu\Programs\Microsoft Edge.lnk",
@@ -607,11 +630,11 @@ function ForceRemoveEdge {
foreach ($path in $edgePaths) {
if (Test-Path -Path $path) {
Remove-Item -Path $path -Force -Recurse -ErrorAction SilentlyContinue
Write-ToConsole " Removed $path" -ForegroundColor DarkGray
Write-Host " Removed $path" -ForegroundColor DarkGray
}
}
Write-ToConsole "Cleaning up registry..."
Write-Host "Cleaning up registry..."
# Remove MS Edge from autostart
reg delete "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run" /v "MicrosoftEdgeAutoLaunch_A9F6DCE4ABADF4F51CF45CD7129E3C6C" /f *>$null
@@ -619,10 +642,10 @@ 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-ToConsole "Microsoft Edge was uninstalled"
Write-Host "Microsoft Edge was uninstalled"
}
else {
Write-ToConsole "Unable to forcefully uninstall Microsoft Edge, uninstaller could not be found" -ForegroundColor Red
Write-Host "Unable to forcefully uninstall Microsoft Edge, uninstaller could not be found" -ForegroundColor Red
}
}
@@ -634,57 +657,67 @@ function RegImport {
$path
)
Write-ToConsole $message
Write-Host $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 ""
Write-Host "Error: Unable to find registry file: $path" -ForegroundColor Red
Write-Host ""
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"
if ($script:Params.ContainsKey("Sysprep") -or $script:Params.ContainsKey("User")) {
# Sysprep targets Default user, User targets the specified user
$hiveDatPath = if ($script:Params.ContainsKey("Sysprep")) {
GetUserDirectory -userName "Default" -fileName "NTUSER.DAT"
} else {
GetUserDirectory -userName $script:Params.Item("User") -fileName "NTUSER.DAT"
}
reg load "HKU\Default" $defaultUserPath | Out-Null
$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
$regOutput = reg import "$script:RegfilesPath\Sysprep\$path" 2>&1
reg unload "HKU\Default" | Out-Null
$regResult = Invoke-NonBlocking -ScriptBlock {
param($datPath, $regFilePath)
$global:LASTEXITCODE = 0
reg load "HKU\Default" $datPath | Out-Null
$output = reg import $regFilePath 2>&1
$code = $LASTEXITCODE
reg unload "HKU\Default" | Out-Null
return @{ Output = $output; ExitCode = $code }
} -ArgumentList @($hiveDatPath, "$script:RegfilesPath\Sysprep\$path")
}
else {
$regOutput = reg import "$script:RegfilesPath\$path" 2>&1
$regResult = Invoke-NonBlocking -ScriptBlock {
param($regFilePath)
$global:LASTEXITCODE = 0
$output = reg import $regFilePath 2>&1
return @{ Output = $output; ExitCode = $LASTEXITCODE }
} -ArgumentList "$script:RegfilesPath\$path"
}
$hasSuccess = $LASTEXITCODE -eq 0
$regOutput = $regResult.Output
$hasSuccess = $regResult.ExitCode -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
Write-Host $lineText
}
else {
Write-ToConsole $lineText -ForegroundColor Red
Write-Host $lineText -ForegroundColor Red
}
}
}
}
if (-not $hasSuccess) {
Write-ToConsole "Failed importing registry file: $path" -ForegroundColor Red
Write-Host "Failed importing registry file: $path" -ForegroundColor Red
}
Write-ToConsole ""
Write-Host ""
}
@@ -695,12 +728,12 @@ function ReplaceStartMenuForAllUsers {
$startMenuTemplate = "$script:AssetsPath/Start/start2.bin"
)
Write-ToConsole "> Removing all pinned apps from the start menu for all users..."
Write-Host "> Removing all pinned apps from the start menu for all users..."
# Check if template bin file exists
if (-not (Test-Path $startMenuTemplate)) {
Write-ToConsole "Error: Unable to clear start menu, start2.bin file missing from script folder" -ForegroundColor Red
Write-ToConsole ""
Write-Host "Error: Unable to clear start menu, start2.bin file missing from script folder" -ForegroundColor Red
Write-Host ""
return
}
@@ -719,13 +752,13 @@ function ReplaceStartMenuForAllUsers {
# Create folder if it doesn't exist
if (-not (Test-Path $defaultStartMenuPath)) {
new-item $defaultStartMenuPath -ItemType Directory -Force | Out-Null
Write-ToConsole "Created LocalState folder for default user profile"
Write-Host "Created LocalState folder for default user profile"
}
# Copy template to default profile
Copy-Item -Path $startMenuTemplate -Destination $defaultStartMenuPath -Force
Write-ToConsole "Replaced start menu for the default user profile"
Write-ToConsole ""
Write-Host "Replaced start menu for the default user profile"
Write-Host ""
}
@@ -744,12 +777,12 @@ function ReplaceStartMenu {
# Check if template bin file exists
if (-not (Test-Path $startMenuTemplate)) {
Write-ToConsole "Error: Unable to replace start menu, template file not found" -ForegroundColor Red
Write-Host "Error: Unable to replace start menu, template file not found" -ForegroundColor Red
return
}
if ([IO.Path]::GetExtension($startMenuTemplate) -ne ".bin" ) {
Write-ToConsole "Error: Unable to replace start menu, template file is not a valid .bin file" -ForegroundColor Red
Write-Host "Error: Unable to replace start menu, template file is not a valid .bin file" -ForegroundColor Red
return
}
@@ -762,14 +795,14 @@ function ReplaceStartMenu {
Move-Item -Path $startMenuBinFile -Destination $backupBinFile -Force
}
else {
Write-ToConsole "Unable to find original start2.bin file for user $userName, no backup was created for this user" -ForegroundColor Yellow
Write-Host "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-ToConsole "Replaced start menu for user $userName"
Write-Host "Replaced start menu for user $userName"
}
@@ -810,7 +843,7 @@ function ExecuteParameter {
# If feature has RegistryKey and ApplyText, use dynamic RegImport
if ($feature -and $feature.RegistryKey -and $feature.ApplyText) {
RegImport $feature.ApplyText $feature.RegistryKey
RegImport "> $($feature.ApplyText)" $feature.RegistryKey
# Handle special cases that have additional logic after RegImport
switch ($paramKey) {
@@ -833,78 +866,78 @@ function ExecuteParameter {
# Handle features without RegistryKey or with special logic
switch ($paramKey) {
'RemoveApps' {
Write-ToConsole "> Removing selected apps for $(GetFriendlyTargetUserName)..."
Write-Host "> Removing selected apps for $(GetFriendlyTargetUserName)..."
$appsList = GenerateAppsList
if ($appsList.Count -eq 0) {
Write-ToConsole "No valid apps were selected for removal" -ForegroundColor Yellow
Write-ToConsole ""
Write-Host "No valid apps were selected for removal" -ForegroundColor Yellow
Write-Host ""
return
}
Write-ToConsole "$($appsList.Count) apps selected for removal"
Write-Host "$($appsList.Count) apps selected for removal"
RemoveApps $appsList
}
'RemoveAppsCustom' {
Write-ToConsole "> Removing selected apps..."
Write-Host "> Removing selected apps..."
$appsList = LoadAppsFromFile $script:CustomAppsListFilePath
if ($appsList.Count -eq 0) {
Write-ToConsole "No valid apps were selected for removal" -ForegroundColor Yellow
Write-ToConsole ""
Write-Host "No valid apps were selected for removal" -ForegroundColor Yellow
Write-Host ""
return
}
Write-ToConsole "$($appsList.Count) apps selected for removal"
Write-Host "$($appsList.Count) apps selected for removal"
RemoveApps $appsList
}
'RemoveCommApps' {
$appsList = 'Microsoft.windowscommunicationsapps', 'Microsoft.People'
Write-ToConsole "> Removing Mail, Calendar and People apps..."
Write-Host "> Removing Mail, Calendar and People apps..."
RemoveApps $appsList
return
}
'RemoveW11Outlook' {
$appsList = 'Microsoft.OutlookForWindows'
Write-ToConsole "> Removing new Outlook for Windows app..."
Write-Host "> Removing new Outlook for Windows app..."
RemoveApps $appsList
return
}
'RemoveGamingApps' {
$appsList = 'Microsoft.GamingApp', 'Microsoft.XboxGameOverlay', 'Microsoft.XboxGamingOverlay'
Write-ToConsole "> Removing gaming related apps..."
Write-Host "> 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..."
Write-Host "> Removing HP apps..."
RemoveApps $appsList
return
}
"EnableWindowsSandbox" {
Write-ToConsole "> Enabling Windows Sandbox..."
Write-Host "> Enabling Windows Sandbox..."
EnableWindowsFeature "Containers-DisposableClientVM"
Write-ToConsole ""
Write-Host ""
return
}
"EnableWindowsSubsystemForLinux" {
Write-ToConsole "> Enabling Windows Subsystem for Linux..."
Write-Host "> Enabling Windows Subsystem for Linux..."
EnableWindowsFeature "VirtualMachinePlatform"
EnableWindowsFeature "Microsoft-Windows-Subsystem-Linux"
Write-ToConsole ""
Write-Host ""
return
}
'ClearStart' {
Write-ToConsole "> Removing all pinned apps from the start menu for user $(GetUserName)..."
Write-Host "> Removing all pinned apps from the start menu for user $(GetUserName)..."
ReplaceStartMenu
Write-ToConsole ""
Write-Host ""
return
}
'ReplaceStart' {
Write-ToConsole "> Replacing the start menu for user $(GetUserName)..."
Write-Host "> Replacing the start menu for user $(GetUserName)..."
ReplaceStartMenu $script:Params.Item("ReplaceStart")
Write-ToConsole ""
Write-Host ""
return
}
'ClearStartAllUsers' {
@@ -922,21 +955,57 @@ function ExecuteParameter {
# Executes all selected parameters/features
# Parameters:
function ExecuteAllChanges {
# Build list of actionable parameters (skip control params and data-only params)
$actionableKeys = @()
foreach ($paramKey in $script:Params.Keys) {
if ($script:ControlParams -contains $paramKey) { continue }
if ($paramKey -eq 'Apps') { continue }
if ($paramKey -eq 'CreateRestorePoint') { continue }
$actionableKeys += $paramKey
}
$totalSteps = $actionableKeys.Count
if ($script:Params.ContainsKey("CreateRestorePoint")) { $totalSteps++ }
$currentStep = 0
# 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..."
$currentStep++
if ($script:ApplyProgressCallback) {
& $script:ApplyProgressCallback $currentStep $totalSteps "Creating system restore point"
}
Write-Host "> Attempting to create a system restore point..."
CreateSystemRestorePoint
Write-ToConsole ""
Write-Host ""
}
# Execute all parameters
foreach ($paramKey in $script:Params.Keys) {
foreach ($paramKey in $actionableKeys) {
if ($script:CancelRequested) {
return
}
if ($script:ControlParams -contains $paramKey) {
continue
$currentStep++
# Get friendly name for the step
$stepName = $paramKey
if ($script:Features.ContainsKey($paramKey)) {
$feature = $script:Features[$paramKey]
if ($feature.ApplyText) {
# Prefer explicit ApplyText when provided
$stepName = $feature.ApplyText
} elseif ($feature.Label) {
# Fallback: construct a name from Action and Label, or just Label
if ($feature.Action) {
$stepName = "$($feature.Action) $($feature.Label)"
} else {
$stepName = $feature.Label
}
}
}
if ($script:ApplyProgressCallback) {
& $script:ApplyProgressCallback $currentStep $totalSteps $stepName
}
ExecuteParameter -paramKey $paramKey
@@ -950,7 +1019,7 @@ function CreateSystemRestorePoint {
if ($SysRestore.RPSessionInterval -eq 0) {
# 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') {
if ($script:GuiWindow -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"
@@ -965,20 +1034,20 @@ function CreateSystemRestorePoint {
if (-not $enableSystemRestoreJobDone) {
Remove-Job -Job $enableSystemRestoreJob -Force -ErrorAction SilentlyContinue
Write-ToConsole "Error: Failed to enable system restore and create restore point, operation timed out" -ForegroundColor Red
Write-Host "Error: Failed to enable system restore and create restore point, operation timed out" -ForegroundColor Red
$failed = $true
}
else {
$result = Receive-Job $enableSystemRestoreJob
Remove-Job -Job $enableSystemRestoreJob -ErrorAction SilentlyContinue
if ($result) {
Write-ToConsole $result -ForegroundColor Red
Write-Host $result -ForegroundColor Red
$failed = $true
}
}
}
else {
Write-ToConsole ""
Write-Host ""
$failed = $true
}
}
@@ -1011,17 +1080,17 @@ function CreateSystemRestorePoint {
if (-not $createRestorePointJobDone) {
Remove-Job -Job $createRestorePointJob -Force -ErrorAction SilentlyContinue
Write-ToConsole "Error: Failed to create system restore point, operation timed out" -ForegroundColor Red
Write-Host "Error: Failed to create system restore point, operation timed out" -ForegroundColor Red
$failed = $true
}
else {
$result = Receive-Job $createRestorePointJob
Remove-Job -Job $createRestorePointJob -ErrorAction SilentlyContinue
if ($result.Success) {
Write-ToConsole $result.Message
Write-Host $result.Message
}
else {
Write-ToConsole $result.Message -ForegroundColor Red
Write-Host $result.Message -ForegroundColor Red
$failed = $true
}
}
@@ -1029,7 +1098,7 @@ function CreateSystemRestorePoint {
# Ensure that the user is aware if creating a restore point failed, and give them the option to continue without a restore point or cancel the script
if ($failed) {
if ($script:GuiConsoleOutput) {
if ($script:GuiWindow) {
$result = Show-MessageBox "Failed to create a system restore point. Do you want to continue without a restore point?" "Restore Point Creation Failed" "YesNo" "Warning"
if ($result -ne "Yes") {
@@ -1038,67 +1107,73 @@ function CreateSystemRestorePoint {
}
}
elseif (-not $Silent) {
Write-ToConsole "Failed to create a system restore point. Do you want to continue without a restore point? (y/n)" -ForegroundColor Yellow
Write-Host "Failed to create a system restore point. Do you want to continue without a restore point? (y/n)" -ForegroundColor Yellow
if ($( Read-Host ) -ne 'y') {
$script:CancelRequested = $true
return
}
}
Write-ToConsole "Warning: Continuing without restore point" -ForegroundColor Yellow
Write-Host "Warning: Continuing without restore point" -ForegroundColor Yellow
}
}
# Enables a Windows optional feature and pipes its output to Write-ToConsole
# Enables a Windows optional feature and pipes its output to the console
function EnableWindowsFeature {
param (
[string]$FeatureName
)
Enable-WindowsOptionalFeature -Online -FeatureName $FeatureName -All -NoRestart *>&1 `
| Where-Object { $_ -isnot [Microsoft.Dism.Commands.ImageObject] -and $_.ToString() -notlike '*Restart is suppressed*' } `
| ForEach-Object { $msg = $_.ToString().Trim(); if ($msg) { Write-ToConsole $msg } }
$result = Invoke-NonBlocking -ScriptBlock {
param($name)
Enable-WindowsOptionalFeature -Online -FeatureName $name -All -NoRestart
} -ArgumentList $FeatureName
$dismResult = @($result) | Where-Object { $_ -is [Microsoft.Dism.Commands.ImageObject] }
if ($dismResult) {
Write-Host ($dismResult | Out-String).Trim()
}
}
# Restart the Windows Explorer process
function RestartExplorer {
Write-ToConsole "> Attempting to restart the Windows Explorer process to apply all changes..."
Write-Host "> 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-ToConsole "Explorer process restart was skipped, please manually reboot your PC to apply all changes" -ForegroundColor Yellow
Write-Host "Explorer process restart was skipped, please manually reboot your PC to apply all changes" -ForegroundColor Yellow
return
}
if ($script:Params.ContainsKey("EnableWindowsSandbox")) {
Write-ToConsole "Warning: The Windows Sandbox feature will only be available after a reboot" -ForegroundColor Yellow
Write-Host "Warning: The Windows Sandbox feature will only be available after a reboot" -ForegroundColor Yellow
}
if ($script:Params.ContainsKey("EnableWindowsSubsystemForLinux")) {
Write-ToConsole "Warning: The Windows Subsystem for Linux feature will only be available after a reboot" -ForegroundColor Yellow
Write-Host "Warning: The Windows Subsystem for Linux feature will only be available after a reboot" -ForegroundColor Yellow
}
if ($script:Params.ContainsKey("DisableMouseAcceleration")) {
Write-ToConsole "Warning: Changes to the Enhance Pointer Precision setting will only take effect after a reboot" -ForegroundColor Yellow
Write-Host "Warning: Changes to the Enhance Pointer Precision setting will only take effect after a reboot" -ForegroundColor Yellow
}
if ($script:Params.ContainsKey("DisableStickyKeys")) {
Write-ToConsole "Warning: Changes to the Sticky Keys setting will only take effect after a reboot" -ForegroundColor Yellow
Write-Host "Warning: Changes to the Sticky Keys setting will only take effect after a reboot" -ForegroundColor Yellow
}
if ($script:Params.ContainsKey("DisableAnimations")) {
Write-ToConsole "Warning: Animations will only be disabled after a reboot" -ForegroundColor Yellow
Write-Host "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-ToConsole "Restarting the Windows Explorer process... (This may cause your screen to flicker)"
Write-Host "Restarting the Windows Explorer process... (This may cause your screen to flicker)"
Stop-Process -processName: Explorer -Force
}
else {
Write-ToConsole "Unable to restart Windows Explorer process, please manually reboot your PC to apply all changes" -ForegroundColor Yellow
Write-Host "Unable to restart Windows Explorer process, please manually reboot your PC to apply all changes" -ForegroundColor Yellow
}
}