diff --git a/src/TIW11/Modules/OpenTweaks/Assessments/Personalization/AppsTheme.cs b/src/TIW11/Modules/OpenTweaks/Assessments/Desktop/AppsTheme.cs similarity index 93% rename from src/TIW11/Modules/OpenTweaks/Assessments/Personalization/AppsTheme.cs rename to src/TIW11/Modules/OpenTweaks/Assessments/Desktop/AppsTheme.cs index ee172e79..94c67872 100644 --- a/src/TIW11/Modules/OpenTweaks/Assessments/Personalization/AppsTheme.cs +++ b/src/TIW11/Modules/OpenTweaks/Assessments/Desktop/AppsTheme.cs @@ -1,62 +1,62 @@ -using Microsoft.Win32; - -namespace ThisIsWin11.OpenTweaks.Assessment.Personalization -{ - internal class AppsTheme : AssessmentBase - { - private static readonly ErrorHelper logger = ErrorHelper.Instance; - - private const string keyName = @"HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Themes\Personalize"; - private const int desiredValue = 0; - - public override string ID() - { - return "Use Apps dark theme"; - } - - public override string Info() - { - return "This will also enable dark theme for ThisIsWin11."; - } - - public override bool CheckAssessment() - { - return !( - RegistryHelper.IntEquals(keyName, "AppsUseLightTheme", desiredValue) - ); - } - - public override bool DoAssessment() - { - try - { - Registry.SetValue(keyName, "AppsUseLightTheme", desiredValue, RegistryValueKind.DWord); - - logger.Log("- Apps dark theme has been successfully enabled."); - logger.Log(keyName); - - logger.Log("\n\nDark theme will also be enabled for ThisIsWin11.\nPlease restart the app for the changes to take effect."); - - return true; - } - catch - { } - - return false; - } - - public override bool UndoAssessment() - { - try - { - Registry.SetValue(keyName, "AppsUseLightTheme", "1", RegistryValueKind.DWord); - logger.Log("- Apps light theme has been successfully enabled."); - return true; - } - catch - { } - - return false; - } - } +using Microsoft.Win32; + +namespace ThisIsWin11.OpenTweaks.Assessment.Desktop +{ + internal class AppsTheme : AssessmentBase + { + private static readonly ErrorHelper logger = ErrorHelper.Instance; + + private const string keyName = @"HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Themes\Personalize"; + private const int desiredValue = 0; + + public override string ID() + { + return "Use Apps dark theme"; + } + + public override string Info() + { + return "This will also enable dark theme for ThisIsWin11."; + } + + public override bool CheckAssessment() + { + return !( + RegistryHelper.IntEquals(keyName, "AppsUseLightTheme", desiredValue) + ); + } + + public override bool DoAssessment() + { + try + { + Registry.SetValue(keyName, "AppsUseLightTheme", desiredValue, RegistryValueKind.DWord); + + logger.Log("- Apps dark theme has been successfully enabled."); + logger.Log(keyName); + + logger.Log("\n\nDark theme will also be enabled for ThisIsWin11.\nPlease restart the app for the changes to take effect."); + + return true; + } + catch + { } + + return false; + } + + public override bool UndoAssessment() + { + try + { + Registry.SetValue(keyName, "AppsUseLightTheme", "1", RegistryValueKind.DWord); + logger.Log("- Apps light theme has been successfully enabled."); + return true; + } + catch + { } + + return false; + } + } } \ No newline at end of file diff --git a/src/TIW11/Modules/OpenTweaks/Assessments/Personalization/SnapAssistFlyout.cs b/src/TIW11/Modules/OpenTweaks/Assessments/Desktop/SnapAssistFlyout.cs similarity index 93% rename from src/TIW11/Modules/OpenTweaks/Assessments/Personalization/SnapAssistFlyout.cs rename to src/TIW11/Modules/OpenTweaks/Assessments/Desktop/SnapAssistFlyout.cs index f462e2cf..bf9d1278 100644 --- a/src/TIW11/Modules/OpenTweaks/Assessments/Personalization/SnapAssistFlyout.cs +++ b/src/TIW11/Modules/OpenTweaks/Assessments/Desktop/SnapAssistFlyout.cs @@ -1,60 +1,60 @@ -using Microsoft.Win32; -using System; - -namespace ThisIsWin11.OpenTweaks.Assessment.Personalization -{ - internal class SnapAssistFlyout : AssessmentBase - { - private static readonly ErrorHelper logger = ErrorHelper.Instance; - - private const string keyName = @"HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced"; - private const int desiredValue = 0; - - public override string ID() - { - return "Disable Snap Assist"; - } - - public override string Info() - { - return "When you hover over the maximize button in apps, this feature gives you a flyout to display possible layouts."; - } - - public override bool CheckAssessment() - { - return !( - RegistryHelper.IntEquals(keyName, "EnableSnapAssistFlyout", desiredValue) - ); - } - - public override bool DoAssessment() - { - try - { - Registry.SetValue(keyName, "EnableSnapAssistFlyout", desiredValue, RegistryValueKind.DWord); - - logger.Log("- Snap Assist Layout has been disabled.\nPlease restart your PC for the changes to take effect."); - logger.Log(keyName); - return true; - } - catch (Exception ex) - { logger.Log("Could not disable Snap Assist {0}", ex.Message); } - - return false; - } - - public override bool UndoAssessment() - { - try - { - Registry.SetValue(keyName, "EnableSnapAssistFlyout", 1, RegistryValueKind.DWord); - logger.Log("- Snap Assist has been enabled.\nPlease restart your PC for the changes to take effect."); - return true; - } - catch - { } - - return false; - } - } +using Microsoft.Win32; +using System; + +namespace ThisIsWin11.OpenTweaks.Assessment.Desktop +{ + internal class SnapAssistFlyout : AssessmentBase + { + private static readonly ErrorHelper logger = ErrorHelper.Instance; + + private const string keyName = @"HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced"; + private const int desiredValue = 0; + + public override string ID() + { + return "Disable Snap Assist"; + } + + public override string Info() + { + return "When you hover over the maximize button in apps, this feature gives you a flyout to display possible layouts."; + } + + public override bool CheckAssessment() + { + return !( + RegistryHelper.IntEquals(keyName, "EnableSnapAssistFlyout", desiredValue) + ); + } + + public override bool DoAssessment() + { + try + { + Registry.SetValue(keyName, "EnableSnapAssistFlyout", desiredValue, RegistryValueKind.DWord); + + logger.Log("- Snap Assist Layout has been disabled.\nPlease restart your PC for the changes to take effect."); + logger.Log(keyName); + return true; + } + catch (Exception ex) + { logger.Log("Could not disable Snap Assist {0}", ex.Message); } + + return false; + } + + public override bool UndoAssessment() + { + try + { + Registry.SetValue(keyName, "EnableSnapAssistFlyout", 1, RegistryValueKind.DWord); + logger.Log("- Snap Assist has been enabled.\nPlease restart your PC for the changes to take effect."); + return true; + } + catch + { } + + return false; + } + } } \ No newline at end of file diff --git a/src/TIW11/Modules/OpenTweaks/Assessments/Desktop/Stickers.cs b/src/TIW11/Modules/OpenTweaks/Assessments/Desktop/Stickers.cs new file mode 100644 index 00000000..98d895d8 --- /dev/null +++ b/src/TIW11/Modules/OpenTweaks/Assessments/Desktop/Stickers.cs @@ -0,0 +1,59 @@ +using Microsoft.Win32; + +namespace ThisIsWin11.OpenTweaks.Assessment.Desktop +{ + internal class Stickers : AssessmentBase + { + private static readonly ErrorHelper logger = ErrorHelper.Instance; + + private const string keyName = @"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\PolicyManager\current\device\Stickers"; + private const int desiredValue = 1; + + public override string ID() + { + return "Enable Desktop Stickers"; + } + + public override string Info() + { + return ""; + } + + public override bool CheckAssessment() + { + return !( + RegistryHelper.IntEquals(keyName, "EnableStickers", desiredValue) + ); + } + + public override bool DoAssessment() + { + try + { + Registry.SetValue(keyName, "EnableStickers", desiredValue, RegistryValueKind.DWord); + + logger.Log("- Desktop Stickers has been enabled (ONLY available in 22H2 Build 22621 and higher)."); + logger.Log(keyName); + return true; + } + catch + { } + + return false; + } + + public override bool UndoAssessment() + { + try + { + Registry.SetValue(keyName, "EnableStickers", "0", RegistryValueKind.DWord); + logger.Log("- Desktop Sticker feature has been disabled."); + return true; + } + catch + { } + + return false; + } + } +} \ No newline at end of file diff --git a/src/TIW11/Modules/OpenTweaks/Assessments/Personalization/Transparency.cs b/src/TIW11/Modules/OpenTweaks/Assessments/Desktop/Transparency.cs similarity index 93% rename from src/TIW11/Modules/OpenTweaks/Assessments/Personalization/Transparency.cs rename to src/TIW11/Modules/OpenTweaks/Assessments/Desktop/Transparency.cs index 2740608e..245f6136 100644 --- a/src/TIW11/Modules/OpenTweaks/Assessments/Personalization/Transparency.cs +++ b/src/TIW11/Modules/OpenTweaks/Assessments/Desktop/Transparency.cs @@ -1,60 +1,60 @@ -using Microsoft.Win32; -using System; - -namespace ThisIsWin11.OpenTweaks.Assessment.Personalization -{ - internal class Transparency : AssessmentBase - { - private static readonly ErrorHelper logger = ErrorHelper.Instance; - - private const string keyName = @"HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Themes\Personalize"; - private const int desiredValue = 0; - - public override string ID() - { - return "Disable acrylic Fluent Design effects"; - } - - public override string Info() - { - return ""; - } - - public override bool CheckAssessment() - { - return !( - RegistryHelper.IntEquals(keyName, "EnableTransparency", desiredValue) - ); - } - - public override bool DoAssessment() - { - try - { - Registry.SetValue(keyName, "EnableTransparency", desiredValue, RegistryValueKind.DWord); - - logger.Log("- Transparency effects has been disabled."); - logger.Log(keyName); - return true; - } - catch (Exception ex) - { logger.Log("Could not disable transparency effects {0}", ex.Message); } - - return false; - } - - public override bool UndoAssessment() - { - try - { - Registry.SetValue(keyName, "EnableTransparency", 1, RegistryValueKind.DWord); - logger.Log("- Transparency effects has been enabled."); - return true; - } - catch - { } - - return false; - } - } +using Microsoft.Win32; +using System; + +namespace ThisIsWin11.OpenTweaks.Assessment.Desktop +{ + internal class Transparency : AssessmentBase + { + private static readonly ErrorHelper logger = ErrorHelper.Instance; + + private const string keyName = @"HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Themes\Personalize"; + private const int desiredValue = 0; + + public override string ID() + { + return "Disable acrylic Fluent Design effects"; + } + + public override string Info() + { + return ""; + } + + public override bool CheckAssessment() + { + return !( + RegistryHelper.IntEquals(keyName, "EnableTransparency", desiredValue) + ); + } + + public override bool DoAssessment() + { + try + { + Registry.SetValue(keyName, "EnableTransparency", desiredValue, RegistryValueKind.DWord); + + logger.Log("- Transparency effects has been disabled."); + logger.Log(keyName); + return true; + } + catch (Exception ex) + { logger.Log("Could not disable transparency effects {0}", ex.Message); } + + return false; + } + + public override bool UndoAssessment() + { + try + { + Registry.SetValue(keyName, "EnableTransparency", 1, RegistryValueKind.DWord); + logger.Log("- Transparency effects has been enabled."); + return true; + } + catch + { } + + return false; + } + } } \ No newline at end of file diff --git a/src/TIW11/Modules/OpenTweaks/Assessments/Personalization/Widgets.cs b/src/TIW11/Modules/OpenTweaks/Assessments/Desktop/Widgets.cs similarity index 92% rename from src/TIW11/Modules/OpenTweaks/Assessments/Personalization/Widgets.cs rename to src/TIW11/Modules/OpenTweaks/Assessments/Desktop/Widgets.cs index b1ce3626..ce969466 100644 --- a/src/TIW11/Modules/OpenTweaks/Assessments/Personalization/Widgets.cs +++ b/src/TIW11/Modules/OpenTweaks/Assessments/Desktop/Widgets.cs @@ -1,60 +1,60 @@ -using Microsoft.Win32; -using System; - -namespace ThisIsWin11.OpenTweaks.Assessment.Personalization -{ - internal class Widgets : AssessmentBase - { - private static readonly ErrorHelper logger = ErrorHelper.Instance; - - private const string keyName = @"HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced"; - private const int desiredValue = 0; - - public override string ID() - { - return "Disable Widgets"; - } - - public override string Info() - { - return ""; - } - - public override bool CheckAssessment() - { - return !( - RegistryHelper.IntEquals(keyName, "TaskbarDa", desiredValue) - ); - } - - public override bool DoAssessment() - { - try - { - Registry.SetValue(keyName, "TaskbarDa", desiredValue, RegistryValueKind.DWord); - - logger.Log("- Widgets has been disabled."); - logger.Log(keyName); - return true; - } - catch (Exception ex) - { logger.Log("Could not disable Widgets {0}", ex.Message); } - - return false; - } - - public override bool UndoAssessment() - { - try - { - Registry.SetValue(keyName, "TaskbarDa", 1, RegistryValueKind.DWord); - logger.Log("- Widgets has been enabled."); - return true; - } - catch - { } - - return false; - } - } +using Microsoft.Win32; +using System; + +namespace ThisIsWin11.OpenTweaks.Assessment.Desktop +{ + internal class Widgets : AssessmentBase + { + private static readonly ErrorHelper logger = ErrorHelper.Instance; + + private const string keyName = @"HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced"; + private const int desiredValue = 0; + + public override string ID() + { + return "Disable Widgets"; + } + + public override string Info() + { + return ""; + } + + public override bool CheckAssessment() + { + return !( + RegistryHelper.IntEquals(keyName, "TaskbarDa", desiredValue) + ); + } + + public override bool DoAssessment() + { + try + { + Registry.SetValue(keyName, "TaskbarDa", desiredValue, RegistryValueKind.DWord); + + logger.Log("- Widgets has been disabled."); + logger.Log(keyName); + return true; + } + catch (Exception ex) + { logger.Log("Could not disable Widgets {0}", ex.Message); } + + return false; + } + + public override bool UndoAssessment() + { + try + { + Registry.SetValue(keyName, "TaskbarDa", 1, RegistryValueKind.DWord); + logger.Log("- Widgets has been enabled."); + return true; + } + catch + { } + + return false; + } + } } \ No newline at end of file diff --git a/src/TIW11/Modules/OpenTweaks/Assessments/Personalization/WidgetsR.cs b/src/TIW11/Modules/OpenTweaks/Assessments/Desktop/WidgetsR.cs similarity index 94% rename from src/TIW11/Modules/OpenTweaks/Assessments/Personalization/WidgetsR.cs rename to src/TIW11/Modules/OpenTweaks/Assessments/Desktop/WidgetsR.cs index a159389b..0fb3ec11 100644 --- a/src/TIW11/Modules/OpenTweaks/Assessments/Personalization/WidgetsR.cs +++ b/src/TIW11/Modules/OpenTweaks/Assessments/Desktop/WidgetsR.cs @@ -1,70 +1,70 @@ -using System; -using System.Diagnostics; -using System.IO; -using System.Net; - -namespace ThisIsWin11.OpenTweaks.Assessment.Personalization -{ - internal class WidgetsRemove : AssessmentBase - { - private static readonly ErrorHelper logger = ErrorHelper.Instance; - - public override string ID() - { - return "Uninstall Widgets"; - } - - public override string Info() - { - return "The Widgets app runs in the background even with the option turned off.\nThis will uninstall the Widgets app package."; - } - - public override bool CheckAssessment() - { - var appPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), "Packages", "MicrosoftWindows.Client.WebExperience_cw5n1h2txyewy"); - - if (!Directory.Exists(appPath)) - { - return false; - } - - return true; - } - - public override bool DoAssessment() - { - try - { - using (var client = new WebClient()) - { - logger.Log("- Uninstalling Widgets app"); - WindowsHelper.RunWT("winget uninstall \"windows web experience pack\""); - logger.Log("Done."); - return true; - } - } - catch (Exception ex) - { logger.Log("{0}", ex.Message); } - - return false; - } - - public override bool UndoAssessment() - { - try - { - using (var client = new WebClient()) - { - logger.Log("- Installing Widgets app...\nWe've opened the download link in the Microsoft Store.\n\nPlease install the package \"Windows Web Experience Pack\". "); - Process.Start("ms-windows-store://pdp/?ProductId=9MSSGKG348SP"); - - return true; - } - } - catch (Exception ex) - { logger.Log("{0}", ex.Message); } - - return false; - } - } +using System; +using System.Diagnostics; +using System.IO; +using System.Net; + +namespace ThisIsWin11.OpenTweaks.Assessment.Desktop +{ + internal class WidgetsRemove : AssessmentBase + { + private static readonly ErrorHelper logger = ErrorHelper.Instance; + + public override string ID() + { + return "Uninstall Widgets"; + } + + public override string Info() + { + return "The Widgets app runs in the background even with the option turned off.\nThis will uninstall the Widgets app package."; + } + + public override bool CheckAssessment() + { + var appPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), "Packages", "MicrosoftWindows.Client.WebExperience_cw5n1h2txyewy"); + + if (!Directory.Exists(appPath)) + { + return false; + } + + return true; + } + + public override bool DoAssessment() + { + try + { + using (var client = new WebClient()) + { + logger.Log("- Uninstalling Widgets app"); + WindowsHelper.RunWT("winget uninstall \"windows web experience pack\""); + logger.Log("Done."); + return true; + } + } + catch (Exception ex) + { logger.Log("{0}", ex.Message); } + + return false; + } + + public override bool UndoAssessment() + { + try + { + using (var client = new WebClient()) + { + logger.Log("- Installing Widgets app...\nWe've opened the download link in the Microsoft Store.\n\nPlease install the package \"Windows Web Experience Pack\". "); + Process.Start("ms-windows-store://pdp/?ProductId=9MSSGKG348SP"); + + return true; + } + } + catch (Exception ex) + { logger.Log("{0}", ex.Message); } + + return false; + } + } } \ No newline at end of file diff --git a/src/TIW11/Modules/OpenTweaks/Assessments/Personalization/WindowsTheme.cs b/src/TIW11/Modules/OpenTweaks/Assessments/Desktop/WindowsTheme.cs similarity index 92% rename from src/TIW11/Modules/OpenTweaks/Assessments/Personalization/WindowsTheme.cs rename to src/TIW11/Modules/OpenTweaks/Assessments/Desktop/WindowsTheme.cs index aa10bb86..179ad945 100644 --- a/src/TIW11/Modules/OpenTweaks/Assessments/Personalization/WindowsTheme.cs +++ b/src/TIW11/Modules/OpenTweaks/Assessments/Desktop/WindowsTheme.cs @@ -1,59 +1,59 @@ -using Microsoft.Win32; - -namespace ThisIsWin11.OpenTweaks.Assessment.Personalization -{ - internal class WindowsTheme : AssessmentBase - { - private static readonly ErrorHelper logger = ErrorHelper.Instance; - - private const string keyName = @"HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Themes\Personalize"; - private const int desiredValue = 0; - - public override string ID() - { - return "Use Windows dark theme"; - } - - public override string Info() - { - return ""; - } - - public override bool CheckAssessment() - { - return !( - RegistryHelper.IntEquals(keyName, "SystemUsesLightTheme", desiredValue) - ); - } - - public override bool DoAssessment() - { - try - { - Registry.SetValue(keyName, "SystemUsesLightTheme", desiredValue, RegistryValueKind.DWord); - - logger.Log("- Windows dark theme has been successfully enabled."); - logger.Log(keyName); - return true; - } - catch - { } - - return false; - } - - public override bool UndoAssessment() - { - try - { - Registry.SetValue(keyName, "SystemUsesLightTheme", "1", RegistryValueKind.DWord); - logger.Log("- Windows light theme has been successfully enabled."); - return true; - } - catch - { } - - return false; - } - } +using Microsoft.Win32; + +namespace ThisIsWin11.OpenTweaks.Assessment.Desktop +{ + internal class WindowsTheme : AssessmentBase + { + private static readonly ErrorHelper logger = ErrorHelper.Instance; + + private const string keyName = @"HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Themes\Personalize"; + private const int desiredValue = 0; + + public override string ID() + { + return "Use Windows dark theme"; + } + + public override string Info() + { + return ""; + } + + public override bool CheckAssessment() + { + return !( + RegistryHelper.IntEquals(keyName, "SystemUsesLightTheme", desiredValue) + ); + } + + public override bool DoAssessment() + { + try + { + Registry.SetValue(keyName, "SystemUsesLightTheme", desiredValue, RegistryValueKind.DWord); + + logger.Log("- Windows dark theme has been successfully enabled."); + logger.Log(keyName); + return true; + } + catch + { } + + return false; + } + + public override bool UndoAssessment() + { + try + { + Registry.SetValue(keyName, "SystemUsesLightTheme", "1", RegistryValueKind.DWord); + logger.Log("- Windows light theme has been successfully enabled."); + return true; + } + catch + { } + + return false; + } + } } \ No newline at end of file diff --git a/src/TIW11/Modules/OpenTweaks/Assessments/Personalization/FileExplorer.cs b/src/TIW11/Modules/OpenTweaks/Assessments/Explorer/FileExplorer.cs similarity index 93% rename from src/TIW11/Modules/OpenTweaks/Assessments/Personalization/FileExplorer.cs rename to src/TIW11/Modules/OpenTweaks/Assessments/Explorer/FileExplorer.cs index be1f45b2..9c73aa9f 100644 --- a/src/TIW11/Modules/OpenTweaks/Assessments/Personalization/FileExplorer.cs +++ b/src/TIW11/Modules/OpenTweaks/Assessments/Explorer/FileExplorer.cs @@ -1,60 +1,60 @@ -using Microsoft.Win32; - -namespace ThisIsWin11.OpenTweaks.Assessment.Personalization -{ - internal class FileExplorer : AssessmentBase - { - private static readonly ErrorHelper logger = ErrorHelper.Instance; - - private const string keyName = @"HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Shell Extensions\Blocked"; - - public override string ID() - { - return "Enable Windows 10 File Explorer"; - } - - public override string Info() - { - return ""; - } - - public override bool CheckAssessment() - { - return !( - RegistryHelper.StringEquals(keyName, "{e2bf9676-5f8f-435c-97eb-11607a5bedf7}", "") - ); - } - - public override bool DoAssessment() - { - try - { - Registry.SetValue(keyName, "{e2bf9676-5f8f-435c-97eb-11607a5bedf7}", "", RegistryValueKind.String); - - logger.Log("- Windows 10 File Explorer has been successfully enabled.\nRestart is required for the changes to take effect!"); - logger.Log(keyName); - return true; - } - catch - { } - - return false; - } - - public override bool UndoAssessment() - { - try - { - var RegKey = Registry.LocalMachine.OpenSubKey(@"Software\Microsoft\Windows\CurrentVersion\Shell Extensions\Blocked", true); - RegKey.DeleteValue("{e2bf9676-5f8f-435c-97eb-11607a5bedf7}"); - - logger.Log("- Windows 10 File Explorer has been successfully disabled.\nRestart is required for the changes to take effect!"); - return true; - } - catch - { } - - return false; - } - } +using Microsoft.Win32; + +namespace ThisIsWin11.OpenTweaks.Assessment.Explorer +{ + internal class FileExplorer : AssessmentBase + { + private static readonly ErrorHelper logger = ErrorHelper.Instance; + + private const string keyName = @"HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Shell Extensions\Blocked"; + + public override string ID() + { + return "Enable Windows 10 File Explorer"; + } + + public override string Info() + { + return ""; + } + + public override bool CheckAssessment() + { + return !( + RegistryHelper.StringEquals(keyName, "{e2bf9676-5f8f-435c-97eb-11607a5bedf7}", "") + ); + } + + public override bool DoAssessment() + { + try + { + Registry.SetValue(keyName, "{e2bf9676-5f8f-435c-97eb-11607a5bedf7}", "", RegistryValueKind.String); + + logger.Log("- Windows 10 File Explorer has been successfully enabled.\nRestart is required for the changes to take effect!"); + logger.Log(keyName); + return true; + } + catch + { } + + return false; + } + + public override bool UndoAssessment() + { + try + { + var RegKey = Registry.LocalMachine.OpenSubKey(@"Software\Microsoft\Windows\CurrentVersion\Shell Extensions\Blocked", true); + RegKey.DeleteValue("{e2bf9676-5f8f-435c-97eb-11607a5bedf7}"); + + logger.Log("- Windows 10 File Explorer has been successfully disabled.\nRestart is required for the changes to take effect!"); + return true; + } + catch + { } + + return false; + } + } } \ No newline at end of file diff --git a/src/TIW11/Modules/OpenTweaks/Assessments/Personalization/HiddenFileExt.cs b/src/TIW11/Modules/OpenTweaks/Assessments/Explorer/HiddenFileExt.cs similarity index 92% rename from src/TIW11/Modules/OpenTweaks/Assessments/Personalization/HiddenFileExt.cs rename to src/TIW11/Modules/OpenTweaks/Assessments/Explorer/HiddenFileExt.cs index 22193f97..db2508e1 100644 --- a/src/TIW11/Modules/OpenTweaks/Assessments/Personalization/HiddenFileExt.cs +++ b/src/TIW11/Modules/OpenTweaks/Assessments/Explorer/HiddenFileExt.cs @@ -1,60 +1,60 @@ -using Microsoft.Win32; -using System; - -namespace ThisIsWin11.OpenTweaks.Assessment.Personalization -{ - internal class HiddenFileExt : AssessmentBase - { - private static readonly ErrorHelper logger = ErrorHelper.Instance; - - private const string keyName = @"HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced"; - private const int desiredValue = 0; - - public override string ID() - { - return "Show hidden file name extensions"; - } - - public override string Info() - { - return ""; - } - - public override bool CheckAssessment() - { - return !( - RegistryHelper.IntEquals(keyName, "HideFileExt", desiredValue) - ); - } - - public override bool DoAssessment() - { - try - { - Registry.SetValue(keyName, "HideFileExt", desiredValue, RegistryValueKind.DWord); - - logger.Log("- File name extensions are now visible."); - logger.Log(keyName); - return true; - } - catch (Exception ex) - { logger.Log("Could not hide file name extensions {0}", ex.Message); } - - return false; - } - - public override bool UndoAssessment() - { - try - { - Registry.SetValue(keyName, "HideFileExt", 1, RegistryValueKind.DWord); - logger.Log("- File name extensions are now hidden again."); - return true; - } - catch - { } - - return false; - } - } +using Microsoft.Win32; +using System; + +namespace ThisIsWin11.OpenTweaks.Assessment.Explorer +{ + internal class HiddenFileExt : AssessmentBase + { + private static readonly ErrorHelper logger = ErrorHelper.Instance; + + private const string keyName = @"HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced"; + private const int desiredValue = 0; + + public override string ID() + { + return "Show hidden file name extensions"; + } + + public override string Info() + { + return ""; + } + + public override bool CheckAssessment() + { + return !( + RegistryHelper.IntEquals(keyName, "HideFileExt", desiredValue) + ); + } + + public override bool DoAssessment() + { + try + { + Registry.SetValue(keyName, "HideFileExt", desiredValue, RegistryValueKind.DWord); + + logger.Log("- File name extensions are now visible."); + logger.Log(keyName); + return true; + } + catch (Exception ex) + { logger.Log("Could not hide file name extensions {0}", ex.Message); } + + return false; + } + + public override bool UndoAssessment() + { + try + { + Registry.SetValue(keyName, "HideFileExt", 1, RegistryValueKind.DWord); + logger.Log("- File name extensions are now hidden again."); + return true; + } + catch + { } + + return false; + } + } } \ No newline at end of file diff --git a/src/TIW11/Modules/OpenTweaks/Assessments/Personalization/HiddenFileFolder.cs b/src/TIW11/Modules/OpenTweaks/Assessments/Explorer/HiddenFileFolder.cs similarity index 93% rename from src/TIW11/Modules/OpenTweaks/Assessments/Personalization/HiddenFileFolder.cs rename to src/TIW11/Modules/OpenTweaks/Assessments/Explorer/HiddenFileFolder.cs index 0acd7989..aa7e58bf 100644 --- a/src/TIW11/Modules/OpenTweaks/Assessments/Personalization/HiddenFileFolder.cs +++ b/src/TIW11/Modules/OpenTweaks/Assessments/Explorer/HiddenFileFolder.cs @@ -1,60 +1,60 @@ -using Microsoft.Win32; -using System; - -namespace ThisIsWin11.OpenTweaks.Assessment.Personalization -{ - internal class HiddenFileFolder : AssessmentBase - { - private static readonly ErrorHelper logger = ErrorHelper.Instance; - - private const string keyName = @"HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced"; - private const int desiredValue = 1; - - public override string ID() - { - return "Show hidden files, folders and drives in File Explorer"; - } - - public override string Info() - { - return ""; - } - - public override bool CheckAssessment() - { - return !( - RegistryHelper.IntEquals(keyName, "Hidden", desiredValue) - ); - } - - public override bool DoAssessment() - { - try - { - Registry.SetValue(keyName, "Hidden", desiredValue, RegistryValueKind.DWord); - - logger.Log("- Hidden files, folders and drives are now visible."); - logger.Log(keyName); - return true; - } - catch (Exception ex) - { logger.Log("Could not hide files, folders and drives {0}", ex.Message); } - - return false; - } - - public override bool UndoAssessment() - { - try - { - Registry.SetValue(keyName, "Hidden", 2, RegistryValueKind.DWord); - logger.Log("- Files, folders and drives are now hidden again."); - return true; - } - catch - { } - - return false; - } - } +using Microsoft.Win32; +using System; + +namespace ThisIsWin11.OpenTweaks.Assessment.Explorer +{ + internal class HiddenFileFolder : AssessmentBase + { + private static readonly ErrorHelper logger = ErrorHelper.Instance; + + private const string keyName = @"HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced"; + private const int desiredValue = 1; + + public override string ID() + { + return "Show hidden files, folders and drives in File Explorer"; + } + + public override string Info() + { + return ""; + } + + public override bool CheckAssessment() + { + return !( + RegistryHelper.IntEquals(keyName, "Hidden", desiredValue) + ); + } + + public override bool DoAssessment() + { + try + { + Registry.SetValue(keyName, "Hidden", desiredValue, RegistryValueKind.DWord); + + logger.Log("- Hidden files, folders and drives are now visible."); + logger.Log(keyName); + return true; + } + catch (Exception ex) + { logger.Log("Could not hide files, folders and drives {0}", ex.Message); } + + return false; + } + + public override bool UndoAssessment() + { + try + { + Registry.SetValue(keyName, "Hidden", 2, RegistryValueKind.DWord); + logger.Log("- Files, folders and drives are now hidden again."); + return true; + } + catch + { } + + return false; + } + } } \ No newline at end of file diff --git a/src/TIW11/Modules/OpenTweaks/Assessments/System/RemoveW11Watermark.cs b/src/TIW11/Modules/OpenTweaks/Assessments/System/RemoveW11Watermark.cs new file mode 100644 index 00000000..891c2f44 --- /dev/null +++ b/src/TIW11/Modules/OpenTweaks/Assessments/System/RemoveW11Watermark.cs @@ -0,0 +1,62 @@ +using Microsoft.Win32; + +namespace ThisIsWin11.OpenTweaks.Assessment.System +{ + internal class RemoveW11Watermark : AssessmentBase + { + private static readonly ErrorHelper logger = ErrorHelper.Instance; + + private const string keyName = @"HKEY_CURRENT_USER\Control Panel\UnsupportedHardwareNotificationCache"; + private const int desiredValue = 0; + + public override string ID() + { + return "Remove Windows 11 System requirements watermark"; + } + + public override string Info() + { + return "Microsoft will display with Build 2257 a desktop watermark on devices where Windows 11 is running on unsupported hardware."; + } + + public override bool CheckAssessment() + { + return !( + RegistryHelper.IntEquals(keyName, "SV2", desiredValue) + ); + } + + public override bool DoAssessment() + { + try + { + Registry.SetValue(keyName, "SV2", desiredValue, RegistryValueKind.DWord); + + logger.Log("- Watermark and the settings notification should be gone."); + logger.Log(keyName); + return true; + } + catch + { } + + return false; + } + + public override bool UndoAssessment() + { + try + { + var RegKey = Registry.CurrentUser.OpenSubKey(@"Control Panel\UnsupportedHardwareNotificationCache", true); + + RegKey.DeleteValue("SV2"); + logger.Log("- Watermark has been enabled again."); + + return true; + } + catch + { } + + return false; + } + } +} \ No newline at end of file diff --git a/src/TIW11/Modules/OpenTweaks/Assessments/Personalization/MostUsedApps.cs b/src/TIW11/Modules/OpenTweaks/Assessments/Taskbar/MostUsedApps.cs similarity index 93% rename from src/TIW11/Modules/OpenTweaks/Assessments/Personalization/MostUsedApps.cs rename to src/TIW11/Modules/OpenTweaks/Assessments/Taskbar/MostUsedApps.cs index 67fa3990..e3c622de 100644 --- a/src/TIW11/Modules/OpenTweaks/Assessments/Personalization/MostUsedApps.cs +++ b/src/TIW11/Modules/OpenTweaks/Assessments/Taskbar/MostUsedApps.cs @@ -1,62 +1,62 @@ -using Microsoft.Win32; -using System; - -namespace ThisIsWin11.OpenTweaks.Assessment.Personalization -{ - internal class MostUsedApps : AssessmentBase - { - private static readonly ErrorHelper logger = ErrorHelper.Instance; - - private const string keyName = @"HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Explorer"; - private const int desiredValue = 2; - - public override string ID() - { - return "Hide most used apps in start menu"; - } - - public override string Info() - { - return ""; - } - - public override bool CheckAssessment() - { - return !( - RegistryHelper.IntEquals(keyName, "ShowOrHideMostUsedApps", desiredValue) - ); - } - - public override bool DoAssessment() - { - try - { - Registry.SetValue(keyName, "ShowOrHideMostUsedApps", desiredValue, RegistryValueKind.DWord); - - logger.Log("- Most Used Apps has been disabled."); - logger.Log(keyName); - return true; - } - catch (Exception ex) - { logger.Log("Could not disable Most Used Apps {0}", ex.Message); } - - return false; - } - - public override bool UndoAssessment() - { - try - { - var RegKey = Registry.LocalMachine.OpenSubKey(@"SOFTWARE\Policies\Microsoft\Windows\Explorer", true); - RegKey.DeleteValue("ShowOrHideMostUsedApps"); - - logger.Log("- Most Used Apps has been set to default behavior."); - return true; - } - catch - { } - - return false; - } - } +using Microsoft.Win32; +using System; + +namespace ThisIsWin11.OpenTweaks.Assessment.Taskbar +{ + internal class MostUsedApps : AssessmentBase + { + private static readonly ErrorHelper logger = ErrorHelper.Instance; + + private const string keyName = @"HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Explorer"; + private const int desiredValue = 2; + + public override string ID() + { + return "Hide most used apps in start menu"; + } + + public override string Info() + { + return ""; + } + + public override bool CheckAssessment() + { + return !( + RegistryHelper.IntEquals(keyName, "ShowOrHideMostUsedApps", desiredValue) + ); + } + + public override bool DoAssessment() + { + try + { + Registry.SetValue(keyName, "ShowOrHideMostUsedApps", desiredValue, RegistryValueKind.DWord); + + logger.Log("- Most Used Apps has been disabled."); + logger.Log(keyName); + return true; + } + catch (Exception ex) + { logger.Log("Could not disable Most Used Apps {0}", ex.Message); } + + return false; + } + + public override bool UndoAssessment() + { + try + { + var RegKey = Registry.LocalMachine.OpenSubKey(@"SOFTWARE\Policies\Microsoft\Windows\Explorer", true); + RegKey.DeleteValue("ShowOrHideMostUsedApps"); + + logger.Log("- Most Used Apps has been set to default behavior."); + return true; + } + catch + { } + + return false; + } + } } \ No newline at end of file diff --git a/src/TIW11/Modules/OpenTweaks/Assessments/Personalization/TaskView.cs b/src/TIW11/Modules/OpenTweaks/Assessments/Taskbar/TaskView.cs similarity index 93% rename from src/TIW11/Modules/OpenTweaks/Assessments/Personalization/TaskView.cs rename to src/TIW11/Modules/OpenTweaks/Assessments/Taskbar/TaskView.cs index ec7aec2f..030a7fe5 100644 --- a/src/TIW11/Modules/OpenTweaks/Assessments/Personalization/TaskView.cs +++ b/src/TIW11/Modules/OpenTweaks/Assessments/Taskbar/TaskView.cs @@ -1,60 +1,60 @@ -using Microsoft.Win32; -using System; - -namespace ThisIsWin11.OpenTweaks.Assessment.Personalization -{ - internal class TaskView : AssessmentBase - { - private static readonly ErrorHelper logger = ErrorHelper.Instance; - - private const string keyName = @"HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced"; - private const int desiredValue = 0; - - public override string ID() - { - return "Hide Task view button on taskbar"; - } - - public override string Info() - { - return ""; - } - - public override bool CheckAssessment() - { - return !( - RegistryHelper.IntEquals(keyName, "ShowTaskViewButton", desiredValue) - ); - } - - public override bool DoAssessment() - { - try - { - Registry.SetValue(keyName, "ShowTaskViewButton", desiredValue, RegistryValueKind.DWord); - - logger.Log("- Task view button has been disabled."); - logger.Log(keyName); - return true; - } - catch (Exception ex) - { logger.Log("Could not disable Task view button {0}", ex.Message); } - - return false; - } - - public override bool UndoAssessment() - { - try - { - Registry.SetValue(keyName, "ShowTaskViewButton", 1 , RegistryValueKind.DWord); - logger.Log("- Task view button has been enabled."); - return true; - } - catch - { } - - return false; - } - } +using Microsoft.Win32; +using System; + +namespace ThisIsWin11.OpenTweaks.Assessment.Taskbar +{ + internal class TaskView : AssessmentBase + { + private static readonly ErrorHelper logger = ErrorHelper.Instance; + + private const string keyName = @"HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced"; + private const int desiredValue = 0; + + public override string ID() + { + return "Hide Task view button on taskbar"; + } + + public override string Info() + { + return ""; + } + + public override bool CheckAssessment() + { + return !( + RegistryHelper.IntEquals(keyName, "ShowTaskViewButton", desiredValue) + ); + } + + public override bool DoAssessment() + { + try + { + Registry.SetValue(keyName, "ShowTaskViewButton", desiredValue, RegistryValueKind.DWord); + + logger.Log("- Task view button has been disabled."); + logger.Log(keyName); + return true; + } + catch (Exception ex) + { logger.Log("Could not disable Task view button {0}", ex.Message); } + + return false; + } + + public override bool UndoAssessment() + { + try + { + Registry.SetValue(keyName, "ShowTaskViewButton", 1 , RegistryValueKind.DWord); + logger.Log("- Task view button has been enabled."); + return true; + } + catch + { } + + return false; + } + } } \ No newline at end of file diff --git a/src/TIW11/Modules/OpenTweaks/Assessments/Personalization/TaskbarAl.cs b/src/TIW11/Modules/OpenTweaks/Assessments/Taskbar/TaskbarAl.cs similarity index 92% rename from src/TIW11/Modules/OpenTweaks/Assessments/Personalization/TaskbarAl.cs rename to src/TIW11/Modules/OpenTweaks/Assessments/Taskbar/TaskbarAl.cs index eb5595be..9d4638af 100644 --- a/src/TIW11/Modules/OpenTweaks/Assessments/Personalization/TaskbarAl.cs +++ b/src/TIW11/Modules/OpenTweaks/Assessments/Taskbar/TaskbarAl.cs @@ -1,59 +1,59 @@ -using Microsoft.Win32; - -namespace ThisIsWin11.OpenTweaks.Assessment.Personalization -{ - internal class TaskbarAl : AssessmentBase - { - private static readonly ErrorHelper logger = ErrorHelper.Instance; - - private const string keyName = @"HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced"; - private const int desiredValue = 0; //left - - public override string ID() - { - return "Align Taskbar to left"; - } - - public override string Info() - { - return ""; - } - - public override bool CheckAssessment() - { - return !( - RegistryHelper.IntEquals(keyName, "TaskbarAl", desiredValue) - ); - } - - public override bool DoAssessment() - { - try - { - Registry.SetValue(keyName, "TaskbarAl", desiredValue, RegistryValueKind.DWord); - - logger.Log("- Taskbar alignment has been set to left."); - logger.Log(keyName); - return true; - } - catch - { } - - return false; - } - - public override bool UndoAssessment() - { - try - { - Registry.SetValue(keyName, "TaskbarAl", "1", RegistryValueKind.DWord); - logger.Log("- Taskbar alignment has been set to middle."); - return true; - } - catch - { } - - return false; - } - } +using Microsoft.Win32; + +namespace ThisIsWin11.OpenTweaks.Assessment.Taskbar +{ + internal class TaskbarAl : AssessmentBase + { + private static readonly ErrorHelper logger = ErrorHelper.Instance; + + private const string keyName = @"HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced"; + private const int desiredValue = 0; //left + + public override string ID() + { + return "Align Taskbar to left"; + } + + public override string Info() + { + return ""; + } + + public override bool CheckAssessment() + { + return !( + RegistryHelper.IntEquals(keyName, "TaskbarAl", desiredValue) + ); + } + + public override bool DoAssessment() + { + try + { + Registry.SetValue(keyName, "TaskbarAl", desiredValue, RegistryValueKind.DWord); + + logger.Log("- Taskbar alignment has been set to left."); + logger.Log(keyName); + return true; + } + catch + { } + + return false; + } + + public override bool UndoAssessment() + { + try + { + Registry.SetValue(keyName, "TaskbarAl", "1", RegistryValueKind.DWord); + logger.Log("- Taskbar alignment has been set to middle."); + return true; + } + catch + { } + + return false; + } + } } \ No newline at end of file diff --git a/src/TIW11/Modules/OpenTweaks/Assessments/Personalization/TaskbarChat.cs b/src/TIW11/Modules/OpenTweaks/Assessments/Taskbar/TaskbarChat.cs similarity index 92% rename from src/TIW11/Modules/OpenTweaks/Assessments/Personalization/TaskbarChat.cs rename to src/TIW11/Modules/OpenTweaks/Assessments/Taskbar/TaskbarChat.cs index 7b7c4502..a7a3336a 100644 --- a/src/TIW11/Modules/OpenTweaks/Assessments/Personalization/TaskbarChat.cs +++ b/src/TIW11/Modules/OpenTweaks/Assessments/Taskbar/TaskbarChat.cs @@ -1,60 +1,60 @@ -using Microsoft.Win32; -using System; - -namespace ThisIsWin11.OpenTweaks.Assessment.Personalization -{ - internal class TaskbarChat : AssessmentBase - { - private static readonly ErrorHelper logger = ErrorHelper.Instance; - - private const string keyName = @"HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced"; - private const int desiredValue = 0; - - public override string ID() - { - return "Hide Chat icon (Microsoft Teams) on taskbar"; - } - - public override string Info() - { - return ""; - } - - public override bool CheckAssessment() - { - return !( - RegistryHelper.IntEquals(keyName, "TaskbarMn", desiredValue) - ); - } - - public override bool DoAssessment() - { - try - { - Registry.SetValue(keyName, "TaskbarMn", desiredValue, RegistryValueKind.DWord); - - logger.Log("- Chat icon has been disabled."); - logger.Log(keyName); - return true; - } - catch (Exception ex) - { logger.Log("Could not disable chat icon {0}", ex.Message); } - - return false; - } - - public override bool UndoAssessment() - { - try - { - Registry.SetValue(keyName, "TaskbarMn", 1, RegistryValueKind.DWord); - logger.Log("- Chat icon has been enabled."); - return true; - } - catch - { } - - return false; - } - } +using Microsoft.Win32; +using System; + +namespace ThisIsWin11.OpenTweaks.Assessment.Taskbar +{ + internal class TaskbarChat : AssessmentBase + { + private static readonly ErrorHelper logger = ErrorHelper.Instance; + + private const string keyName = @"HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced"; + private const int desiredValue = 0; + + public override string ID() + { + return "Hide Chat icon (Microsoft Teams) on taskbar"; + } + + public override string Info() + { + return ""; + } + + public override bool CheckAssessment() + { + return !( + RegistryHelper.IntEquals(keyName, "TaskbarMn", desiredValue) + ); + } + + public override bool DoAssessment() + { + try + { + Registry.SetValue(keyName, "TaskbarMn", desiredValue, RegistryValueKind.DWord); + + logger.Log("- Chat icon has been disabled."); + logger.Log(keyName); + return true; + } + catch (Exception ex) + { logger.Log("Could not disable chat icon {0}", ex.Message); } + + return false; + } + + public override bool UndoAssessment() + { + try + { + Registry.SetValue(keyName, "TaskbarMn", 1, RegistryValueKind.DWord); + logger.Log("- Chat icon has been enabled."); + return true; + } + catch + { } + + return false; + } + } } \ No newline at end of file diff --git a/src/TIW11/Modules/OpenTweaks/Assessments/Personalization/TaskbarMM.cs b/src/TIW11/Modules/OpenTweaks/Assessments/Taskbar/TaskbarMM.cs similarity index 93% rename from src/TIW11/Modules/OpenTweaks/Assessments/Personalization/TaskbarMM.cs rename to src/TIW11/Modules/OpenTweaks/Assessments/Taskbar/TaskbarMM.cs index 0ef13843..6030f305 100644 --- a/src/TIW11/Modules/OpenTweaks/Assessments/Personalization/TaskbarMM.cs +++ b/src/TIW11/Modules/OpenTweaks/Assessments/Taskbar/TaskbarMM.cs @@ -1,66 +1,66 @@ -using Microsoft.Win32; - -namespace ThisIsWin11.OpenTweaks.Assessment.Personalization -{ - internal class TaskbarMM : AssessmentBase - { - private static readonly ErrorHelper logger = ErrorHelper.Instance; - - private const string keyName = @"HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced"; - private const int desiredValue = 0; - - public override string ID() - { - return "Hide Taskbar on multiple monitors"; - } - - public override string Info() - { - return "This will hide secondary taskbars."; - } - - public override bool CheckAssessment() - { - return !( - RegistryHelper.IntEquals(keyName, "MMTaskbarEnabled", desiredValue) - ); - } - - public override bool DoAssessment() - { - try - { - Registry.SetValue(keyName, "MMTaskbarEnabled", desiredValue, RegistryValueKind.DWord); - - WindowsHelper.RunCmd("/c taskkill /f /im explorer.exe"); - WindowsHelper.RunCmd("/c start explorer.exe"); - - logger.Log("- Taskbar on secondary monitor has been disabled."); - logger.Log(keyName); - return true; - } - catch - { } - - return false; - } - - public override bool UndoAssessment() - { - try - { - Registry.SetValue(keyName, "MMTaskbarEnabled", "1", RegistryValueKind.DWord); - - WindowsHelper.RunCmd("/c taskkill /f /im explorer.exe"); - WindowsHelper.RunCmd("/c start explorer.exe"); - - logger.Log("- Taskbar on secondary monitor has been enabled."); - return true; - } - catch - { } - - return false; - } - } +using Microsoft.Win32; + +namespace ThisIsWin11.OpenTweaks.Assessment.Taskbar +{ + internal class TaskbarMM : AssessmentBase + { + private static readonly ErrorHelper logger = ErrorHelper.Instance; + + private const string keyName = @"HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced"; + private const int desiredValue = 0; + + public override string ID() + { + return "Hide Taskbar on multiple monitors"; + } + + public override string Info() + { + return "This will hide secondary taskbars."; + } + + public override bool CheckAssessment() + { + return !( + RegistryHelper.IntEquals(keyName, "MMTaskbarEnabled", desiredValue) + ); + } + + public override bool DoAssessment() + { + try + { + Registry.SetValue(keyName, "MMTaskbarEnabled", desiredValue, RegistryValueKind.DWord); + + WindowsHelper.RunCmd("/c taskkill /f /im explorer.exe"); + WindowsHelper.RunCmd("/c start explorer.exe"); + + logger.Log("- Taskbar on secondary monitor has been disabled."); + logger.Log(keyName); + return true; + } + catch + { } + + return false; + } + + public override bool UndoAssessment() + { + try + { + Registry.SetValue(keyName, "MMTaskbarEnabled", "1", RegistryValueKind.DWord); + + WindowsHelper.RunCmd("/c taskkill /f /im explorer.exe"); + WindowsHelper.RunCmd("/c start explorer.exe"); + + logger.Log("- Taskbar on secondary monitor has been enabled."); + return true; + } + catch + { } + + return false; + } + } } \ No newline at end of file diff --git a/src/TIW11/Modules/OpenTweaks/Assessments/Personalization/TaskbarSearch.cs b/src/TIW11/Modules/OpenTweaks/Assessments/Taskbar/TaskbarSearch.cs similarity index 92% rename from src/TIW11/Modules/OpenTweaks/Assessments/Personalization/TaskbarSearch.cs rename to src/TIW11/Modules/OpenTweaks/Assessments/Taskbar/TaskbarSearch.cs index fc9a3e44..3aa24b39 100644 --- a/src/TIW11/Modules/OpenTweaks/Assessments/Personalization/TaskbarSearch.cs +++ b/src/TIW11/Modules/OpenTweaks/Assessments/Taskbar/TaskbarSearch.cs @@ -1,60 +1,60 @@ -using Microsoft.Win32; -using System; - -namespace ThisIsWin11.OpenTweaks.Assessment.Personalization -{ - internal class TaskbarSearch : AssessmentBase - { - private static readonly ErrorHelper logger = ErrorHelper.Instance; - - private const string keyName = @"HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Search"; - private const int desiredValue = 0; - - public override string ID() - { - return "Hide Search icon on taskbar"; - } - - public override string Info() - { - return ""; - } - - public override bool CheckAssessment() - { - return !( - RegistryHelper.IntEquals(keyName, "SearchboxTaskbarMode", desiredValue) - ); - } - - public override bool DoAssessment() - { - try - { - Registry.SetValue(keyName, "SearchboxTaskbarMode", desiredValue, RegistryValueKind.DWord); - - logger.Log("- Search icon has been disabled."); - logger.Log(keyName); - return true; - } - catch (Exception ex) - { logger.Log("Could not disable search icon {0}", ex.Message); } - - return false; - } - - public override bool UndoAssessment() - { - try - { - Registry.SetValue(keyName, "SearchboxTaskbarMode", 1, RegistryValueKind.DWord); - logger.Log("- Search icon has been enabled."); - return true; - } - catch - { } - - return false; - } - } +using Microsoft.Win32; +using System; + +namespace ThisIsWin11.OpenTweaks.Assessment.Taskbar +{ + internal class TaskbarSearch : AssessmentBase + { + private static readonly ErrorHelper logger = ErrorHelper.Instance; + + private const string keyName = @"HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Search"; + private const int desiredValue = 0; + + public override string ID() + { + return "Hide Search icon on taskbar"; + } + + public override string Info() + { + return ""; + } + + public override bool CheckAssessment() + { + return !( + RegistryHelper.IntEquals(keyName, "SearchboxTaskbarMode", desiredValue) + ); + } + + public override bool DoAssessment() + { + try + { + Registry.SetValue(keyName, "SearchboxTaskbarMode", desiredValue, RegistryValueKind.DWord); + + logger.Log("- Search icon has been disabled."); + logger.Log(keyName); + return true; + } + catch (Exception ex) + { logger.Log("Could not disable search icon {0}", ex.Message); } + + return false; + } + + public override bool UndoAssessment() + { + try + { + Registry.SetValue(keyName, "SearchboxTaskbarMode", 1, RegistryValueKind.DWord); + logger.Log("- Search icon has been enabled."); + return true; + } + catch + { } + + return false; + } + } } \ No newline at end of file diff --git a/src/TIW11/Modules/OpenTweaks/Assessments/Personalization/TaskbarSi.cs b/src/TIW11/Modules/OpenTweaks/Assessments/Taskbar/TaskbarSi.cs similarity index 93% rename from src/TIW11/Modules/OpenTweaks/Assessments/Personalization/TaskbarSi.cs rename to src/TIW11/Modules/OpenTweaks/Assessments/Taskbar/TaskbarSi.cs index a1c13653..02180a5b 100644 --- a/src/TIW11/Modules/OpenTweaks/Assessments/Personalization/TaskbarSi.cs +++ b/src/TIW11/Modules/OpenTweaks/Assessments/Taskbar/TaskbarSi.cs @@ -1,59 +1,59 @@ -using Microsoft.Win32; - -namespace ThisIsWin11.OpenTweaks.Assessment.Personalization -{ - internal class TaskbarSi : AssessmentBase - { - private static readonly ErrorHelper logger = ErrorHelper.Instance; - - private const string keyName = @"HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced"; - private const int desiredValue = 0; - - public override string ID() - { - return "Small Taskbar and icons"; - } - - public override string Info() - { - return ""; - } - - public override bool CheckAssessment() - { - return !( - RegistryHelper.IntEquals(keyName, "TaskbarSi", desiredValue) - ); - } - - public override bool DoAssessment() - { - try - { - Registry.SetValue(keyName, "TaskbarSi", desiredValue, RegistryValueKind.DWord); - - logger.Log("- Taskbar size has been set to small.\nRestart is required for the changes to take effect!"); - logger.Log(keyName); - return true; - } - catch - { } - - return false; - } - - public override bool UndoAssessment() - { - try - { - Registry.SetValue(keyName, "TaskbarSi", "1", RegistryValueKind.DWord); - logger.Log("- Taskbar size has been set to default/medium.\nRestart is required for the changes to take effect!"); - return true; - } - catch - { } - - return false; - } - } +using Microsoft.Win32; + +namespace ThisIsWin11.OpenTweaks.Assessment.Taskbar +{ + internal class TaskbarSi : AssessmentBase + { + private static readonly ErrorHelper logger = ErrorHelper.Instance; + + private const string keyName = @"HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced"; + private const int desiredValue = 0; + + public override string ID() + { + return "Small Taskbar and icons"; + } + + public override string Info() + { + return ""; + } + + public override bool CheckAssessment() + { + return !( + RegistryHelper.IntEquals(keyName, "TaskbarSi", desiredValue) + ); + } + + public override bool DoAssessment() + { + try + { + Registry.SetValue(keyName, "TaskbarSi", desiredValue, RegistryValueKind.DWord); + + logger.Log("- Taskbar size has been set to small.\nRestart is required for the changes to take effect!"); + logger.Log(keyName); + return true; + } + catch + { } + + return false; + } + + public override bool UndoAssessment() + { + try + { + Registry.SetValue(keyName, "TaskbarSi", "1", RegistryValueKind.DWord); + logger.Log("- Taskbar size has been set to default/medium.\nRestart is required for the changes to take effect!"); + return true; + } + catch + { } + + return false; + } + } } \ No newline at end of file diff --git a/src/TIW11/Properties/AssemblyInfo.cs b/src/TIW11/Properties/AssemblyInfo.cs index 8fd36d62..beeeb495 100644 --- a/src/TIW11/Properties/AssemblyInfo.cs +++ b/src/TIW11/Properties/AssemblyInfo.cs @@ -9,7 +9,7 @@ [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("Builtbybel")] [assembly: AssemblyProduct("ThisIsWin11")] -[assembly: AssemblyCopyright("Copyright © 2022")] +[assembly: AssemblyCopyright("Copyright © 2022 Builtbybel")] [assembly: AssemblyTrademark("Builtbybel")] [assembly: AssemblyCulture("")] @@ -31,5 +31,5 @@ // Sie können alle Werte angeben oder Standardwerte für die Build- und Revisionsnummern verwenden, // indem Sie "*" wie unten gezeigt eingeben: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.1.160")] -[assembly: AssemblyFileVersion("1.1.160")] +[assembly: AssemblyVersion("1.2.220")] +[assembly: AssemblyFileVersion("1.2.220")] diff --git a/src/TIW11/ThisIsWin11.csproj b/src/TIW11/ThisIsWin11.csproj index f54fcf13..852b2b93 100644 --- a/src/TIW11/ThisIsWin11.csproj +++ b/src/TIW11/ThisIsWin11.csproj @@ -80,26 +80,28 @@ + - - + + + - - - - - - - - - - - - + + + + + + + + + + + + @@ -108,13 +110,13 @@ - + - + Component diff --git a/src/TIW11/Views/AutomateWindow.cs b/src/TIW11/Views/AutomateWindow.cs index 05ded3c4..68c2027a 100644 --- a/src/TIW11/Views/AutomateWindow.cs +++ b/src/TIW11/Views/AutomateWindow.cs @@ -389,7 +389,9 @@ private void menuAutomateApplied_Click(object sender, EventArgs e) private void btnAutomateMenu_Click(object sender, EventArgs e) => this.menuAutomate.Show(Cursor.Position.X, Cursor.Position.Y); - private void btnEdit_Click(object sender, EventArgs e) => menuAutomateEdit.PerformClick(); + private void btnEdit_Click(object sender, EventArgs e) + + => menuAutomateEdit.PerformClick(); private void menuAutomatePopOut_Click(object sender, EventArgs e) { diff --git a/src/TIW11/Views/CustomizeWindow.cs b/src/TIW11/Views/CustomizeWindow.cs index 7b7466f0..4c4c24c0 100644 --- a/src/TIW11/Views/CustomizeWindow.cs +++ b/src/TIW11/Views/CustomizeWindow.cs @@ -14,7 +14,7 @@ namespace ThisIsWin11 { public partial class CustomizeWindow : Form { - private static readonly string componentsVersion = "110"; + private static readonly string componentsVersion = "150"; private readonly string osWarning = "We could not recognize this system as Windows 11. Some settings are not tested on this operating system and could lead to malfunction."; private GetStarted.OS osInfo = new GetStarted.OS(); @@ -107,44 +107,57 @@ public void InitializeAssessments() Checked = true, }; - TreeNode personalization = new TreeNode("Personalization", new TreeNode[] { - new AssessmentNode(new OpenTweaks.Assessment.Personalization.AppsTheme()), - new AssessmentNode(new OpenTweaks.Assessment.Personalization.WindowsTheme()), - new AssessmentNode(new OpenTweaks.Assessment.Personalization.Transparency()), - new AssessmentNode(new OpenTweaks.Assessment.Personalization.SnapAssistFlyout()), - new AssessmentNode(new OpenTweaks.Assessment.Personalization.Widgets()), - new AssessmentNode(new OpenTweaks.Assessment.Personalization.WidgetsRemove()), - new AssessmentNode(new OpenTweaks.Assessment.Personalization.TaskbarAl()), - new AssessmentNode(new OpenTweaks.Assessment.Personalization.TaskbarSi()), - new AssessmentNode(new OpenTweaks.Assessment.Personalization.TaskbarMM()), - new AssessmentNode(new OpenTweaks.Assessment.Personalization.TaskbarSearch()), - new AssessmentNode(new OpenTweaks.Assessment.Personalization.TaskbarChat()), - new AssessmentNode(new OpenTweaks.Assessment.Personalization.TaskView()), - new AssessmentNode(new OpenTweaks.Assessment.Personalization.FileExplorer()), - new AssessmentNode(new OpenTweaks.Assessment.Personalization.MostUsedApps()), - new AssessmentNode(new OpenTweaks.Assessment.Personalization.HiddenFileFolder()), - new AssessmentNode(new OpenTweaks.Assessment.Personalization.HiddenFileExt()), + TreeNode explorer = new TreeNode("Explorer", new TreeNode[] { + new AssessmentNode(new OpenTweaks.Assessment.Explorer.FileExplorer()), + new AssessmentNode(new OpenTweaks.Assessment.Explorer.HiddenFileFolder()), + new AssessmentNode(new OpenTweaks.Assessment.Explorer.HiddenFileExt()), }) { Checked = true, }; - TreeNode paranoia = new TreeNode("Paranoia", new TreeNode[] { - new AssessmentNode(new OpenTweaks.Assessment.Paranoia.CleanMgr()), - new AssessmentNode(new OpenTweaks.Assessment.Paranoia.WindowsSpyBlocker()), - new AssessmentNode(new OpenTweaks.Assessment.Paranoia.ShutUp11()), + System.Windows.Forms.TreeNode taskbar = new System.Windows.Forms.TreeNode("Taskbar and Start menu", new System.Windows.Forms.TreeNode[] { + new AssessmentNode(new OpenTweaks.Assessment.Taskbar.TaskbarAl()), + new AssessmentNode(new OpenTweaks.Assessment.Taskbar.TaskbarSi()), + new AssessmentNode(new OpenTweaks.Assessment.Taskbar.TaskbarMM()), + new AssessmentNode(new OpenTweaks.Assessment.Taskbar.TaskbarSearch()), + new AssessmentNode(new OpenTweaks.Assessment.Taskbar.TaskbarChat()), + new AssessmentNode(new OpenTweaks.Assessment.Taskbar.TaskView()), + new AssessmentNode(new OpenTweaks.Assessment.Taskbar.MostUsedApps()), + }) + { + Checked = true, + }; + + System.Windows.Forms.TreeNode desktop = new System.Windows.Forms.TreeNode("Desktop", new System.Windows.Forms.TreeNode[] { + new AssessmentNode(new OpenTweaks.Assessment.Desktop.AppsTheme()), + new AssessmentNode(new OpenTweaks.Assessment.Desktop.WindowsTheme()), + new AssessmentNode(new OpenTweaks.Assessment.Desktop.Transparency()), + new AssessmentNode(new OpenTweaks.Assessment.Desktop.SnapAssistFlyout()), + new AssessmentNode(new OpenTweaks.Assessment.Desktop.Widgets()), + new AssessmentNode(new OpenTweaks.Assessment.Desktop.WidgetsRemove()), + new AssessmentNode(new OpenTweaks.Assessment.Desktop.Stickers()), }) { Checked = true, }; - TreeNode system = new TreeNode("System", new TreeNode[] { + System.Windows.Forms.TreeNode system = new System.Windows.Forms.TreeNode("My Computer", new System.Windows.Forms.TreeNode[] { new AssessmentNode(new OpenTweaks.Assessment.System.Fax()), new AssessmentNode(new OpenTweaks.Assessment.System.XPSWriter()), + new AssessmentNode(new OpenTweaks.Assessment.System.RemoveW11Watermark()), new AssessmentNode(new OpenTweaks.Assessment.System.EnableWSL()), new AssessmentNode(new OpenTweaks.Assessment.System.InstallWSA()), new AssessmentNode(new OpenTweaks.Assessment.System.HyperV()), new AssessmentNode(new OpenTweaks.Assessment.System.TeamsAutostart()), + }) + { + Checked = true, + }; + TreeNode paranoia = new TreeNode("Paranoia", new TreeNode[] { + new AssessmentNode(new OpenTweaks.Assessment.Paranoia.CleanMgr()), + new AssessmentNode(new OpenTweaks.Assessment.Paranoia.WindowsSpyBlocker()), + new AssessmentNode(new OpenTweaks.Assessment.Paranoia.ShutUp11()), }) { Checked = true, @@ -216,9 +229,11 @@ public void InitializeAssessments() root.Nodes.AddRange(new TreeNode[] { settings, - personalization, - paranoia, + explorer, + taskbar, + desktop, system, + paranoia, update, gaming, privacy, diff --git a/src/TIW11/Views/SettingsWindow.Designer.cs b/src/TIW11/Views/SettingsWindow.Designer.cs index ad55565c..c8d67837 100644 --- a/src/TIW11/Views/SettingsWindow.Designer.cs +++ b/src/TIW11/Views/SettingsWindow.Designer.cs @@ -53,7 +53,7 @@ private void InitializeComponent() this.menuFeedbackHub = new System.Windows.Forms.ToolStripMenuItem(); this.label1 = new System.Windows.Forms.Label(); this.lblTheme = new System.Windows.Forms.LinkLabel(); - this.label2 = new System.Windows.Forms.Label(); + this.lblSettingsMode = new System.Windows.Forms.Label(); this.menuSettings.SuspendLayout(); this.SuspendLayout(); // @@ -187,7 +187,7 @@ private void InitializeComponent() this.lblAppMediaGitHub.Size = new System.Drawing.Size(336, 22); this.lblAppMediaGitHub.TabIndex = 166; this.lblAppMediaGitHub.TabStop = true; - this.lblAppMediaGitHub.Text = "GitHub (1.7k Starred)"; + this.lblAppMediaGitHub.Text = "GitHub (2.6k Starred)"; this.lblAppMediaGitHub.VisitedLinkColor = System.Drawing.Color.MediumVioletRed; this.lblAppMediaGitHub.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.lblAppMediaGitHub_LinkClicked); // @@ -382,21 +382,21 @@ private void InitializeComponent() this.lblTheme.VisitedLinkColor = System.Drawing.Color.MediumVioletRed; this.lblTheme.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.lblTheme_LinkClicked); // - // label2 + // lblSettingsMode // - this.label2.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + this.lblSettingsMode.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); - this.label2.AutoEllipsis = true; - this.label2.AutoSize = true; - this.label2.BackColor = System.Drawing.Color.White; - this.label2.Font = new System.Drawing.Font("Segoe UI Variable Text Semibold", 20.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.label2.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64))))); - this.label2.ImeMode = System.Windows.Forms.ImeMode.NoControl; - this.label2.Location = new System.Drawing.Point(60, 266); - this.label2.Name = "label2"; - this.label2.Size = new System.Drawing.Size(86, 36); - this.label2.TabIndex = 182; - this.label2.Text = "Mode"; + this.lblSettingsMode.AutoEllipsis = true; + this.lblSettingsMode.AutoSize = true; + this.lblSettingsMode.BackColor = System.Drawing.Color.White; + this.lblSettingsMode.Font = new System.Drawing.Font("Segoe UI Variable Text Semibold", 20.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.lblSettingsMode.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64))))); + this.lblSettingsMode.ImeMode = System.Windows.Forms.ImeMode.NoControl; + this.lblSettingsMode.Location = new System.Drawing.Point(60, 266); + this.lblSettingsMode.Name = "lblSettingsMode"; + this.lblSettingsMode.Size = new System.Drawing.Size(86, 36); + this.lblSettingsMode.TabIndex = 182; + this.lblSettingsMode.Text = "Mode"; // // SettingsWindow // @@ -405,7 +405,7 @@ private void InitializeComponent() this.AutoScroll = true; this.BackColor = System.Drawing.Color.White; this.ClientSize = new System.Drawing.Size(1210, 862); - this.Controls.Add(this.label2); + this.Controls.Add(this.lblSettingsMode); this.Controls.Add(this.lblTheme); this.Controls.Add(this.label1); this.Controls.Add(this.btnSettingsMenu); @@ -463,7 +463,7 @@ private void InitializeComponent() private Controls.RoundedButton btnSettingsMenu; private System.Windows.Forms.Label label1; public System.Windows.Forms.LinkLabel lblTheme; - private System.Windows.Forms.Label label2; + private System.Windows.Forms.Label lblSettingsMode; public System.Windows.Forms.Button btnCheckForUpdates; } } \ No newline at end of file diff --git a/src/TIW11/Views/SettingsWindow.cs b/src/TIW11/Views/SettingsWindow.cs index 55c56565..6b6f018e 100644 --- a/src/TIW11/Views/SettingsWindow.cs +++ b/src/TIW11/Views/SettingsWindow.cs @@ -41,6 +41,7 @@ private void RegisterTheme() lblHeartFillEmoji.BackColor = lblSettingsSubDev.BackColor = lblSettingsAppMain.BackColor = + lblSettingsMode.BackColor = rtbSettingsAbout.BackColor = colorBackground; @@ -52,6 +53,7 @@ private void RegisterTheme() lblSettingsApp.ForeColor = lblSettingsAppMain.ForeColor = rtbSettingsAbout.ForeColor = + lblSettingsMode.ForeColor = colorForeground; btnAppMediaGitHubIssues.BackColor = colorBackgroundButtonContrast;