Skip to content

Portable Tool for an Ideal Windows Setup

determining the locale & re

Greedeks44471f850b38
diff --git a/.Source/GTweak/Utilities/Configuration/SystemDiagnostics.cs b/.Source/GTweak/Utilities/Configuration/SystemDiagnostics.cs
index 2c75edbb..bfef3f9a 100644
--- a/.Source/GTweak/Utilities/Configuration/SystemDiagnostics.cs
+++ b/.Source/GTweak/Utilities/Configuration/SystemDiagnostics.cs
@@ -97,10 +97,10 @@ namespace GTweak.Utilities.Configuration
{
string nameProfile = string.Empty;
- foreach (var managementObj in new ManagementObjectSearcher(@"root\cimv2", $"select FullName from Win32_UserAccount where domain='{Environment.UserDomainName}' and name='{Environment.UserName.ToLower()}'", new EnumerationOptions { ReturnImmediately = true }).Get())
+ foreach (var managementObj in new ManagementObjectSearcher(@"root\cimv2", $"select FullName from Win32_UserAccount where domain='{Environment.UserDomainName}' and name='{Environment.UserName.ToLowerInvariant()}'", new EnumerationOptions { ReturnImmediately = true }).Get())
nameProfile = managementObj["FullName"] as string;
- return !string.IsNullOrWhiteSpace(nameProfile) ? nameProfile : Environment.UserName.ToLower();
+ return !string.IsNullOrWhiteSpace(nameProfile) ? nameProfile : Environment.UserName.ToLowerInvariant();
}
internal void GetHardwareData()
diff --git a/.Source/GTweak/Utilities/Controls/BlockRunTweaker.cs b/.Source/GTweak/Utilities/Controls/BlockRunTweaker.cs
index 609545cc..030bb9c6 100644
--- a/.Source/GTweak/Utilities/Controls/BlockRunTweaker.cs
+++ b/.Source/GTweak/Utilities/Controls/BlockRunTweaker.cs
@@ -10,7 +10,7 @@ using System.Windows;
namespace GTweak.Utilities.Controls
{
- internal sealed class BlockRunTweaker
+ internal static class BlockRunTweaker
{
[DllImport("user32.dll")]
private static extern bool ShowWindow(IntPtr handle, int cmdShow);
diff --git a/.Source/GTweak/Utilities/Controls/ErrorLogging.cs b/.Source/GTweak/Utilities/Controls/ErrorLogging.cs
index f24960b5..554242fe 100644
--- a/.Source/GTweak/Utilities/Controls/ErrorLogging.cs
+++ b/.Source/GTweak/Utilities/Controls/ErrorLogging.cs
@@ -7,7 +7,7 @@ using System.Threading.Tasks;
namespace GTweak.Utilities.Controls
{
- internal class ErrorLogging
+ internal static class ErrorLogging
{
[Conditional("DEBUG")]
internal static void LogDebug(Exception ex, [CallerMemberName] string memberName = "") => Debug.WriteLine($"Debug: {ex.Message}\nStack Trace: {ex.StackTrace}\nMember: {memberName}\n");
diff --git a/.Source/GTweak/Utilities/Helpers/Managers/ExplorerManager.cs b/.Source/GTweak/Utilities/Helpers/Managers/ExplorerManager.cs
index 68f6d836..9c373de9 100644
--- a/.Source/GTweak/Utilities/Helpers/Managers/ExplorerManager.cs
+++ b/.Source/GTweak/Utilities/Helpers/Managers/ExplorerManager.cs
@@ -9,6 +9,8 @@ namespace GTweak.Utilities.Helpers.Managers
{
internal class ExplorerManager
{
+ protected ExplorerManager() { }
+
internal static readonly Dictionary<string, bool> InterfBtnMapping = new[]
{
new { Button = "TglButton7", NeedRestart = true },
diff --git a/.Source/GTweak/Utilities/Helpers/Managers/INIManager.cs b/.Source/GTweak/Utilities/Helpers/Managers/INIManager.cs
index 49c1ad41..e0907927 100644
--- a/.Source/GTweak/Utilities/Helpers/Managers/INIManager.cs
+++ b/.Source/GTweak/Utilities/Helpers/Managers/INIManager.cs
@@ -30,7 +30,7 @@ namespace GTweak.Utilities.Helpers.Managers
internal const string SectionSvc = "Services Tweaks";
internal const string SectionSys = "System Tweaks";
- internal INIManager(string iniPath) => _pathToConfig = new FileInfo(iniPath).FullName.ToString();
+ internal INIManager(string iniPath) => _pathToConfig = new FileInfo(iniPath).FullName;
internal string Read(string section, string key)
{
diff --git a/.Source/GTweak/Utilities/Helpers/Managers/UnarchiveManager.cs b/.Source/GTweak/Utilities/Helpers/Managers/UnarchiveManager.cs
index d87225ae..7d19e55f 100644
--- a/.Source/GTweak/Utilities/Helpers/Managers/UnarchiveManager.cs
+++ b/.Source/GTweak/Utilities/Helpers/Managers/UnarchiveManager.cs
@@ -1,4 +1,5 @@
-using System.IO;
+using System;
+using System.IO;
using System.IO.Compression;
namespace GTweak.Utilities.Helpers.Managers
@@ -16,7 +17,7 @@ namespace GTweak.Utilities.Helpers.Managers
fileSize = ms.ToArray();
}
- string folderDir = path.Remove(path.LastIndexOf(@"\"));
+ string folderDir = path.Remove(path.LastIndexOf(@"\", StringComparison.OrdinalIgnoreCase));
if (!Directory.Exists(folderDir))
Directory.CreateDirectory(folderDir);
diff --git a/.Source/GTweak/Utilities/Helpers/Storage/NotifActionsStorage.cs b/.Source/GTweak/Utilities/Helpers/Storage/NotifActionsStorage.cs
index 5173e0f3..b7cbe30e 100644
--- a/.Source/GTweak/Utilities/Helpers/Storage/NotifActionsStorage.cs
+++ b/.Source/GTweak/Utilities/Helpers/Storage/NotifActionsStorage.cs
@@ -3,7 +3,7 @@ using System.Linq;
namespace GTweak.Utilities.Helpers.Storage
{
- internal class NotifActionsStorage
+ internal static class NotifActionsStorage
{
internal static readonly Dictionary<string, string> ConfNotifActions = new[]
{
diff --git a/.Source/GTweak/Utilities/Helpers/Storage/TaskStorage.cs b/.Source/GTweak/Utilities/Helpers/Storage/TaskStorage.cs
index cff8dce7..d771d9d9 100644
--- a/.Source/GTweak/Utilities/Helpers/Storage/TaskStorage.cs
+++ b/.Source/GTweak/Utilities/Helpers/Storage/TaskStorage.cs
@@ -2,7 +2,7 @@
{
internal class TaskStorage
{
- internal static readonly string[] dataCollectTasks = {
+ protected static readonly string[] dataCollectTasks = {
@"\Microsoft\Windows\Maintenance\WinSAT",
@"\Microsoft\Windows\Autochk\Proxy",
@"\Microsoft\Windows\Application Experience\Microsoft Compatibility Appraiser",
@@ -16,12 +16,12 @@
@"\Microsoft\Windows\DiskDiagnostic\Microsoft-Windows-DiskDiagnosticResolver",
@"\Microsoft\Windows\DiskDiagnostic\Microsoft-Windows-DiskDiagnosticDataCollector" };
- internal static readonly string[] nvidiaTasks = {
+ protected static readonly string[] nvidiaTasks = {
@"\NvTmRepOnLogon_{B2FE1952-0186-46C3-BAEC-A80AA35AC5B8}",
@"\NvTmRep_{B2FE1952-0186-46C3-BAEC-A80AA35AC5B8}",
@"\NvTmMon_{B2FE1952-0186-46C3-BAEC-A80AA35AC5B8}" };
- internal static readonly string[] telemetryTasks = {
+ protected static readonly string[] telemetryTasks = {
@"\Microsoft\Office\Office ClickToRun Service Monitor",
@"\Microsoft\Office\OfficeTelemetry\AgentFallBack2016",
@"\Microsoft\Office\OfficeTelemetry\OfficeTelemetryAgentLogOn2016",
@@ -31,7 +31,7 @@
@"\Microsoft\Office\OfficeTelemetryAgentLogOn",
@"\Microsoft\Office\Office 15 Subscription Heartbeat" };
- internal static readonly string[] winUpdatesTasks = {
+ protected static readonly string[] winUpdatesTasks = {
@"\Microsoft\Windows\UpdateOrchestrator\Report policies",
@"\Microsoft\Windows\UpdateOrchestrator\Schedule Scan",
@"\Microsoft\Windows\UpdateOrchestrator\Schedule Scan Static Task",
@@ -44,21 +44,21 @@
@"\Microsoft\Windows\WindowsUpdate\Refresh Group Policy Cache",
@"\Microsoft\Windows\WindowsUpdate\Scheduled Start" };
- internal static readonly string[] memoryDiagTasks = {
+ protected static readonly string[] memoryDiagTasks = {
@"\Microsoft\Windows\MemoryDiagnostic\ProcessMemoryDiagnosticEvents",
@"\Microsoft\Windows\MemoryDiagnostic\RunFullMemoryDiagnostic" };
- internal static readonly string restoreTask = @"\Microsoft\Windows\SystemRestore\SR";
- internal static readonly string defragTask = @"\Microsoft\Windows\Defrag\ScheduledDefrag";
+ protected static readonly string restoreTask = @"\Microsoft\Windows\SystemRestore\SR";
+ protected static readonly string defragTask = @"\Microsoft\Windows\Defrag\ScheduledDefrag";
- internal static readonly string[] edgeTasks = {
+ protected static readonly string[] edgeTasks = {
@"\MicrosoftEdgeUpdateTaskMachineUA{EA17DF76-AE5F-45F8-8867-FE5E0DD06656}",
@"\MicrosoftEdgeUpdateTaskMachineCore{11EED34D-1A62-4BB7-9A2E-0D83ED6A609F}",
@"\MicrosoftEdgeUpdateTaskMachineCore*",
@"\MicrosoftEdgeUpdateTaskMachineUA*",
@"\MicrosoftEdgeUpdateTaskUser*" };
- internal static readonly string[] WinDefenderTasks = {
+ protected static readonly string[] WinDefenderTasks = {
@"\Microsoft\Windows\ExploitGuard\ExploitGuard MDM policy Refresh",
@"\Microsoft\Windows\Windows Defender\Windows Defender Cache Maintenance",
@"\Microsoft\Windows\Windows Defender\Windows Defender Cleanup",
diff --git a/.Source/GTweak/Utilities/Helpers/Storage/WinKeyStorage.cs b/.Source/GTweak/Utilities/Helpers/Storage/WinKeyStorage.cs
index f3798175..2a82819f 100644
--- a/.Source/GTweak/Utilities/Helpers/Storage/WinKeyStorage.cs
+++ b/.Source/GTweak/Utilities/Helpers/Storage/WinKeyStorage.cs
@@ -4,7 +4,9 @@ namespace GTweak.Utilities.Helpers.Storage
{
internal class WinKeyStorage
{
- internal static readonly Dictionary<(string pattern, byte words), string> keysKMS = new Dictionary<(string pattern, byte words), string>
+ protected WinKeyStorage() { }
+
+ protected static readonly Dictionary<(string pattern, byte words), string> keysKMS = new Dictionary<(string pattern, byte words), string>
{
{ ("Home", 1), @"TX9XD-98N7V-6WMQ6-BX7FG-H8Q99" },
{ ("Home|N", 2), @"4CPRK-NM3K3-X6XXQ-RXX86-WXCHW" },
@@ -26,7 +28,7 @@ namespace GTweak.Utilities.Helpers.Storage
{ ("Pro|N|for|Workstations", 4), @"9FNHH-K3HBT-3W4TD-6383H-6XYWF" },
};
- internal static readonly Dictionary<(string pattern, byte words), string> keysHWID = new Dictionary<(string pattern, byte words), string>
+ protected static readonly Dictionary<(string pattern, byte words), string> keysHWID = new Dictionary<(string pattern, byte words), string>
{
{ ("Education", 1), @"YNMGQ-8RYV3-4PGQ3-C8XTP-7CFBY" },
{ ("Education|N", 2), @"84NGF-MHBT6-FXBX8-QWJK7-DRR8H" },
diff --git a/.Source/GTweak/Utilities/Tweaks/ConfidentialityTweaks.cs b/.Source/GTweak/Utilities/Tweaks/ConfidentialityTweaks.cs
index 2c90a6e5..05201f4a 100644
--- a/.Source/GTweak/Utilities/Tweaks/ConfidentialityTweaks.cs
+++ b/.Source/GTweak/Utilities/Tweaks/ConfidentialityTweaks.cs
@@ -268,14 +268,14 @@ namespace GTweak.Utilities.Tweaks
}
else
{
- RegistryHelp.Write(Registry.LocalMachine, diagTrack, "DependOnService", new string[] { "RpcSs" }, RegistryValueKind.MultiString);
+ RegistryHelp.Write(Registry.LocalMachine, diagTrack, "DependOnService", new[] { "RpcSs" }, RegistryValueKind.MultiString);
RegistryHelp.Write(Registry.LocalMachine, diagTrack, "Description", @"@%SystemRoot%\system32\diagtrack.dll,-3002", RegistryValueKind.String);
RegistryHelp.Write(Registry.LocalMachine, diagTrack, "DisplayName", @"@%SystemRoot%\system32\diagtrack.dll,-3001", RegistryValueKind.String);
RegistryHelp.Write(Registry.LocalMachine, diagTrack, "ErrorControl", 1, RegistryValueKind.DWord);
RegistryHelp.Write(Registry.LocalMachine, diagTrack, "FailureActions", Array.ConvertAll("80,51,01,00,00,00,00,00,00,00,00,00,03,00,00,00,14,00,00,00,01,00,00,00,30,75,00,00,01,00,00,00,30,75,00,00,00,00,00,00,00,00,00,00".Split(','), s => Convert.ToByte(s, 16)), RegistryValueKind.Binary);
RegistryHelp.Write(Registry.LocalMachine, diagTrack, "ImagePath", @"%SystemRoot%\System32\svchost.exe -k utcsvc -p", RegistryValueKind.ExpandString);
RegistryHelp.Write(Registry.LocalMachine, diagTrack, "ObjectName", "LocalSystem", RegistryValueKind.String);
- RegistryHelp.Write(Registry.LocalMachine, diagTrack, "RequiredPrivileges", new string[] { "SeChangeNotifyPrivilege", "SeCreateGlobalPrivilege", "SeAssignPrimaryTokenPrivilege", "SeImpersonatePrivilege", "SeSystemProfilePrivilege", "SeTcbPrivilege", "SeDebugPrivilege", "SeSecurityPrivilege" }, RegistryValueKind.MultiString);
+ RegistryHelp.Write(Registry.LocalMachine, diagTrack, "RequiredPrivileges", new[] { "SeChangeNotifyPrivilege", "SeCreateGlobalPrivilege", "SeAssignPrimaryTokenPrivilege", "SeImpersonatePrivilege", "SeSystemProfilePrivilege", "SeTcbPrivilege", "SeDebugPrivilege", "SeSecurityPrivilege" }, RegistryValueKind.MultiString);
RegistryHelp.Write(Registry.LocalMachine, diagTrack, "ServiceSidType", 1, RegistryValueKind.DWord);
RegistryHelp.Write(Registry.LocalMachine, diagTrack, "Start", 2, RegistryValueKind.DWord);
RegistryHelp.Write(Registry.LocalMachine, diagTrack, "Type", 16, RegistryValueKind.DWord);
@@ -284,7 +284,7 @@ namespace GTweak.Utilities.Tweaks
RegistryHelp.Write(Registry.LocalMachine, $@"{diagTrack}\Parameters", "ServiceMain", "ServiceMain", RegistryValueKind.String);
RegistryHelp.Write(Registry.LocalMachine, dmwappushservice, "DelayedAutoStart", 1, RegistryValueKind.DWord);
- RegistryHelp.Write(Registry.LocalMachine, dmwappushservice, "DependOnService", new string[] { "rpcss" }, RegistryValueKind.MultiString);
+ RegistryHelp.Write(Registry.LocalMachine, dmwappushservice, "DependOnService", new[] { "rpcss" }, RegistryValueKind.MultiString);
RegistryHelp.Write(Registry.LocalMachine, dmwappushservice, "Description", @"@%SystemRoot%\system32\dmwappushsvc.dll,-201", RegistryValueKind.DWord);
RegistryHelp.Write(Registry.LocalMachine, dmwappushservice, "DisplayName", @"@%SystemRoot%\system32\dmwappushsvc.dll,-200", RegistryValueKind.DWord);
RegistryHelp.Write(Registry.LocalMachine, dmwappushservice, "ErrorControl", 1, RegistryValueKind.DWord);
@@ -311,14 +311,14 @@ namespace GTweak.Utilities.Tweaks
RegistryHelp.Write(Registry.LocalMachine, $@"{dmwappushservice}\TriggerInfo\1", "Type", 7, RegistryValueKind.DWord);
RegistryHelp.Write(Registry.LocalMachine, $@"{dmwappushservice}\Security", "Security", Array.ConvertAll("01,00,04,80,b0,00,00,00,bc,00,00,00,00,00,00,00,14,00,00,00,02,00,9c,00,07,00,00,00,00,00,14,00,8d,01,02,00,01,01,00,00,00,00,00,05,04,00,00,00,00,00,14,00,8d,01,02,00,01,01,00,00,00,00,00,05,06,00,00,00,00,00,14,00,ff,01,0f,00,01,01,00,00,00,00,00,05,12,00,00,00,00,00,18,00,ff,01,0f,00,01,02,00,00,00,00,00,05,20,00,00,00,20,02,00,00,00,00,18,00,14,00,00,00,01,02,00,00,00,00,00,0f,02,00,00,00,01,00,00,00,00,00,14,00,14,00,00,00,01,01,00,00,00,00,00,05,04,00,00,00,00,00,14,00,14,00,00,00,01,01,00,00,00,00,00,05,0b,00,00,00,01,01,00,00,00,00,00,05,12,00,00,00,01,01,00,00,00,00,00,05,12,00,00,00".Split(','), s => Convert.ToByte(s, 16)), RegistryValueKind.Binary);
- RegistryHelp.Write(Registry.LocalMachine, diagsvc, "DependOnService", new string[] { "RpcSs" }, RegistryValueKind.MultiString);
+ RegistryHelp.Write(Registry.LocalMachine, diagsvc, "DependOnService", new[] { "RpcSs" }, RegistryValueKind.MultiString);
RegistryHelp.Write(Registry.LocalMachine, diagsvc, "Description", @"@%systemroot%\system32\DiagSvc.dll,-101", RegistryValueKind.String);
RegistryHelp.Write(Registry.LocalMachine, diagsvc, "DisplayName", @"@%systemroot%\system32\DiagSvc.dll,-100", RegistryValueKind.String);
RegistryHelp.Write(Registry.LocalMachine, diagsvc, "ErrorControl", 1, RegistryValueKind.DWord);
RegistryHelp.Write(Registry.LocalMachine, diagsvc, "FailureActions", Array.ConvertAll("80,51,01,00,00,00,00,00,00,00,00,00,03,00,00,00,14,00,00,00,01,00,00,00,30,75,00,00,01,00,00,00,30,75,00,00,00,00,00,00,00,00,00,00".Split(','), s => Convert.ToByte(s, 16)), RegistryValueKind.Binary);
RegistryHelp.Write(Registry.LocalMachine, diagsvc, "ImagePath", @"%SystemRoot%\System32\svchost.exe -k diagnostics", RegistryValueKind.ExpandString);
RegistryHelp.Write(Registry.LocalMachine, diagsvc, "ObjectName", "LocalSystem", RegistryValueKind.String);
- RegistryHelp.Write(Registry.LocalMachine, diagsvc, "RequiredPrivileges", new string[] { "SeTcbPrivilege", "nSeTakeOwnershipPrivilege", "nSeDebugPrivilege", "nSeBackupPrivilege", "nSeImpersonatePrivilege", "nSeLoadDriverPrivilege", "nSeRestorePrivilege", "nSeManageVolumePrivilege" }, RegistryValueKind.MultiString);
+ RegistryHelp.Write(Registry.LocalMachine, diagsvc, "RequiredPrivileges", new[] { "SeTcbPrivilege", "nSeTakeOwnershipPrivilege", "nSeDebugPrivilege", "nSeBackupPrivilege", "nSeImpersonatePrivilege", "nSeLoadDriverPrivilege", "nSeRestorePrivilege", "nSeManageVolumePrivilege" }, RegistryValueKind.MultiString);
RegistryHelp.Write(Registry.LocalMachine, diagsvc, "ServiceSidType", 1, RegistryValueKind.DWord);
RegistryHelp.Write(Registry.LocalMachine, diagsvc, "Start", 3, RegistryValueKind.DWord);
RegistryHelp.Write(Registry.LocalMachine, diagsvc, "Type", 32, RegistryValueKind.DWord);
diff --git a/.Source/GTweak/Utilities/Tweaks/DefenderManager/WindowsDefender.cs b/.Source/GTweak/Utilities/Tweaks/DefenderManager/WindowsDefender.cs
index ef074f5c..f5d57fb4 100644
--- a/.Source/GTweak/Utilities/Tweaks/DefenderManager/WindowsDefender.cs
+++ b/.Source/GTweak/Utilities/Tweaks/DefenderManager/WindowsDefender.cs
@@ -290,7 +290,7 @@ namespace GTweak.Utilities.Tweaks.DefenderManager
RegistryHelp.DeleteValue(Registry.CurrentUser, @"SOFTWARE\Microsoft\Windows\CurrentVersion\Run", "Windows Defender");
RegistryHelp.DeleteValue(Registry.LocalMachine, @"SOFTWARE\Microsoft\Windows\CurrentVersion\Run", "SecurityHealth");
- KillProcess(new string[] { "SecurityHealthService", "SecurityHealthSystray" });
+ KillProcess(new[] { "SecurityHealthService", "SecurityHealthSystray" });
TrustedInstaller.CreateProcessAsTrustedInstaller(SettingsRepository.PID, "cmd.exe /c taskkill /f /im MsMpEng.exe & reg add HKCU\\Software\\Microsoft\\Windows\\CurrentVersion\\AppHost /t REG_DWORD /v EnableWebContentEvaluation /d 0 /f & " +
"reg add HKLM\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer /t REG_SZ /v SmartScreenEnabled /d \"off\" /f & " +
diff --git a/.Source/GTweak/Utilities/Tweaks/NTFSCompressor.cs b/.Source/GTweak/Utilities/Tweaks/NTFSCompressor.cs
index 4c328dfd..e6d930f3 100644
--- a/.Source/GTweak/Utilities/Tweaks/NTFSCompressor.cs
+++ b/.Source/GTweak/Utilities/Tweaks/NTFSCompressor.cs
@@ -8,7 +8,7 @@ using System.Threading.Tasks;
namespace GTweak.Utilities.Tweaks
{
- internal sealed class NTFSCompressor
+ internal static class NTFSCompressor
{
private const ushort COMPRESSION_FORMAT_NONE = 0x0000;
private const ushort COMPRESSION_FORMAT_DEFAULT = 0x0001;
diff --git a/.Source/GTweak/Utilities/Tweaks/UninstallingPakages.cs b/.Source/GTweak/Utilities/Tweaks/UninstallingPakages.cs
index 2aa79303..2e9d6f06 100644
--- a/.Source/GTweak/Utilities/Tweaks/UninstallingPakages.cs
+++ b/.Source/GTweak/Utilities/Tweaks/UninstallingPakages.cs
@@ -271,7 +271,7 @@ namespace GTweak.Utilities.Tweaks
RegistryHelp.DeleteFolderTree(Registry.LocalMachine, @"SYSTEM\CurrentControlSet\Services\MicrosoftEdgeElevationService", true);
}
- foreach (string folder in new string[] { "Edge", "EdgeCore", "EdgeUpdate", "Temp", "EdgeWebView" })
+ foreach (string folder in new[] { "Edge", "EdgeCore", "EdgeUpdate", "Temp", "EdgeWebView" })
{
if (!removeWebViewFlag && (folder == "EdgeWebView" || folder == "EdgeCore" || folder == "EdgeUpdate"))
continue;
diff --git a/.Source/GTweak/Utilities/Tweaks/WindowsLicense.cs b/.Source/GTweak/Utilities/Tweaks/WindowsLicense.cs
index 17ff2993..7ee0d568 100644
--- a/.Source/GTweak/Utilities/Tweaks/WindowsLicense.cs
+++ b/.Source/GTweak/Utilities/Tweaks/WindowsLicense.cs
@@ -71,9 +71,9 @@ namespace GTweak.Utilities.Tweaks
await RunCommandAsync($"/c slmgr.vbs //b /ipk {keyWinHWID}", 4000);
CommandExecutor.RunCommand($@"/c del /f /q {StoragePaths.SystemDisk}ProgramData\Microsoft\Windows\ClipSVC\GenuineTicket\*.xml & del /f /q {StoragePaths.SystemDisk}ProgramData\Microsoft\Windows\ClipSVC\Install\Migration\*.xml");
- string originalGeo = RegistryHelp.GetValue(@"HKEY_CURRENT_USER\Control Panel\International\Geo", "Name", CultureInfo.InstalledUICulture.Name.Split('-')[1].ToUpper());
+ string originalGeo = RegistryHelp.GetValue(@"HKEY_CURRENT_USER\Control Panel\International\Geo", "Name", CultureInfo.InstalledUICulture.Name.Split('-')[1].ToUpperInvariant());
RegistryHelp.Write(Registry.CurrentUser, @"Control Panel\International\Geo", "Name", "US", RegistryValueKind.String);
- foreach (string service in new string[] { "ClipSVC", "wlidsvc", "sppsvc", "KeyIso", "LicenseManager", "Winmgmt" })
+ foreach (string service in new[] { "ClipSVC", "wlidsvc", "sppsvc", "KeyIso", "LicenseManager", "Winmgmt" })
CommandExecutor.RunCommand($"sc config {service} start= auto && sc start {service}");
await Task.Delay(3000);
diff --git a/.Source/GTweak/Windows/LoadingWindow.xaml.cs b/.Source/GTweak/Windows/LoadingWindow.xaml.cs
index 97697553..f61f66a5 100644
--- a/.Source/GTweak/Windows/LoadingWindow.xaml.cs
+++ b/.Source/GTweak/Windows/LoadingWindow.xaml.cs
@@ -7,12 +7,11 @@ using System;
using System.ComponentModel;
using System.Threading;
using System.Threading.Tasks;
-using System.Windows;
using System.Windows.Media.Animation;
namespace GTweak.Windows
{
- public partial class LoadingWindow : Window
+ public partial class LoadingWindow
{
public LoadingWindow()
{
@@ -75,7 +74,7 @@ namespace GTweak.Windows
private void BackgroundWorker_ProgressChanged(object sender, ProgressChangedEventArgs e)
{
- int index = Array.IndexOf(new int[] { 5, 30, 55, 75, 95 }, e.ProgressPercentage);
+ int index = Array.IndexOf(new[] { 5, 30, 55, 75, 95 }, e.ProgressPercentage);
if (index >= 0)
new TypewriterAnimation((string)FindResource($"text{++index}_load"), TextLoad, TimeSpan.FromMilliseconds(200));
}
diff --git a/.Source/GTweak/Windows/RebootWindow.xaml.cs b/.Source/GTweak/Windows/RebootWindow.xaml.cs
index 97da1683..2312d351 100644
--- a/.Source/GTweak/Windows/RebootWindow.xaml.cs
+++ b/.Source/GTweak/Windows/RebootWindow.xaml.cs
@@ -6,7 +6,7 @@ using System.Windows.Media.Animation;
namespace GTweak.Windows
{
- public partial class RebootWindow : Window
+ public partial class RebootWindow
{
public RebootWindow()
{
diff --git a/.Source/GTweak/Windows/UpdateWindow.xaml.cs b/.Source/GTweak/Windows/UpdateWindow.xaml.cs
index 4090ddb4..2e6308c0 100644
--- a/.Source/GTweak/Windows/UpdateWindow.xaml.cs
+++ b/.Source/GTweak/Windows/UpdateWindow.xaml.cs
@@ -11,7 +11,7 @@ using System.Windows.Media.Animation;
namespace GTweak.Windows
{
- public partial class UpdateWindow : Window
+ public partial class UpdateWindow
{
public UpdateWindow()
{
diff --git a/.Source/GTweak/Windows/WaitingWindow.xaml.cs b/.Source/GTweak/Windows/WaitingWindow.xaml.cs
index 3658688d..5abcf37d 100644
--- a/.Source/GTweak/Windows/WaitingWindow.xaml.cs
+++ b/.Source/GTweak/Windows/WaitingWindow.xaml.cs
@@ -11,7 +11,7 @@ namespace GTweak.Windows
/// Darkened screen
/// </summary>
- public partial class WaitingWindow : Window
+ public partial class WaitingWindow
{
private readonly DisablingWinKeys disablingWinKeys = new DisablingWinKeys();
public WaitingWindow()