Skip to content

Portable Tool for an Ideal Windows Setup

-checking for updates, parsing the github version -clear code

Greedeks653924da43b8
diff --git a/.Source/GTweak/Languages/en/Lang.xaml b/.Source/GTweak/Languages/en/Lang.xaml
index 285ff333..31615f34 100644
--- a/.Source/GTweak/Languages/en/Lang.xaml
+++ b/.Source/GTweak/Languages/en/Lang.xaml
@@ -73,6 +73,7 @@
<v:String x:Key="btgl_sound_main">Notification sound</v:String>
<v:String x:Key="slider_volume_main">Notifications volume:</v:String>
<v:String x:Key="btgl_toast_main">Pin on top of all windows</v:String>
+ <v:String x:Key="btgl_update_main">Checking for updates</v:String>
<v:String x:Key="cmbox_lang_main">Interface language:</v:String>
<v:String x:Key="cmbox_eng_main">English</v:String>
<v:String x:Key="cmbox_ru_main">Russian</v:String>
diff --git a/.Source/GTweak/Languages/ru/Lang.xaml b/.Source/GTweak/Languages/ru/Lang.xaml
index 613e1fc2..958fa5f5 100644
--- a/.Source/GTweak/Languages/ru/Lang.xaml
+++ b/.Source/GTweak/Languages/ru/Lang.xaml
@@ -73,6 +73,7 @@
<v:String x:Key="btgl_sound_main">Звук уведомление</v:String>
<v:String x:Key="slider_volume_main">Громкость уведомлений:</v:String>
<v:String x:Key="btgl_toast_main">Закрепить поверх всех окон</v:String>
+ <v:String x:Key="btgl_update_main">Проверка наличия обновлений</v:String>
<v:String x:Key="cmbox_lang_main">Язык интерфейса:</v:String>
<v:String x:Key="cmbox_eng_main">Английский</v:String>
<v:String x:Key="cmbox_ru_main">Русский</v:String>
diff --git a/.Source/GTweak/Utilities/BlockRunTweaker.cs b/.Source/GTweak/Utilities/BlockRunTweaker.cs
index 2e3cdcdb..916d424e 100644
--- a/.Source/GTweak/Utilities/BlockRunTweaker.cs
+++ b/.Source/GTweak/Utilities/BlockRunTweaker.cs
@@ -1,4 +1,5 @@
-using GTweak.Windows;
+using GTweak.Utilities.Tweaks;
+using GTweak.Windows;
using System;
using System.Diagnostics;
using System.Linq;
@@ -6,7 +7,6 @@ using System.Management;
using System.Runtime.InteropServices;
using System.Threading;
using System.Threading.Tasks;
-using GTweak.Utilities.Tweaks;
namespace GTweak.Utilities
{
@@ -47,7 +47,7 @@ namespace GTweak.Utilities
Parallel.Invoke(() =>
{
foreach (var managementObj in new ManagementObjectSearcher(@"root\cimv2", "select Caption from Win32_OperatingSystem", optionsObj).Get())
- SystemData.СomputerСonfiguration.clientWinVersion = Convert.ToString(managementObj["Caption"]);;
+ SystemData.СomputerСonfiguration.clientWinVersion = Convert.ToString(managementObj["Caption"]); ;
});
if (SystemData.СomputerСonfiguration.clientWinVersion.Contains("11") || SystemData.СomputerСonfiguration.clientWinVersion.Contains("10")) return;
diff --git a/.Source/GTweak/Utilities/Helpers/INIManager.cs b/.Source/GTweak/Utilities/Helpers/INIManager.cs
index 27a6e17e..35e75e40 100644
--- a/.Source/GTweak/Utilities/Helpers/INIManager.cs
+++ b/.Source/GTweak/Utilities/Helpers/INIManager.cs
@@ -16,8 +16,8 @@ namespace GTweak.Utilities.Helpers
private static extern int GetPrivateProfileSection(string section, StringBuilder retVal, int size, string filePath);
private readonly string pathToConfig;
- internal static Dictionary<string, string>
- UserTweaksConfidentiality = new Dictionary<string, string>(),
+ internal static Dictionary<string, string>
+ UserTweaksConfidentiality = new Dictionary<string, string>(),
UserTweaksInterface = new Dictionary<string, string>(),
UserTweaksServices = new Dictionary<string, string>(),
UserTweaksSystem = new Dictionary<string, string>();
diff --git a/.Source/GTweak/Utilities/Helpers/RegistryHelp.cs b/.Source/GTweak/Utilities/Helpers/RegistryHelp.cs
index 5f26d498..6c3e44c8 100644
--- a/.Source/GTweak/Utilities/Helpers/RegistryHelp.cs
+++ b/.Source/GTweak/Utilities/Helpers/RegistryHelp.cs
@@ -1,12 +1,12 @@
using Microsoft.Win32;
-using System.Diagnostics;
using System;
+using System.Diagnostics;
namespace GTweak.Utilities.Helpers
{
internal readonly struct RegistryHelp
{
- internal static void DeleteFolderTree(in RegistryKey registrykey, in string subkey)
+ internal static void DeleteFolderTree(in RegistryKey registrykey, in string subkey)
{
if (registrykey.OpenSubKey(subkey) == null) return;
try { registrykey.DeleteSubKeyTree(subkey); } catch (Exception ex) { Debug.WriteLine(ex.Message.ToString()); }
@@ -17,7 +17,7 @@ namespace GTweak.Utilities.Helpers
if (registrykey.OpenSubKey(subkey) == null || registrykey.OpenSubKey(subkey)?.GetValue(value, null) == null) return;
try { registrykey.OpenSubKey(subkey, true)?.DeleteValue(value); } catch (Exception ex) { Debug.WriteLine(ex.Message.ToString()); }
}
-
+
internal static void Write<T>(in RegistryKey registrykey, in string key, in string name, in T data, in RegistryValueKind kind)
{
try { registrykey.CreateSubKey(key, true)?.SetValue(name, data, kind); } catch (Exception ex) { Debug.WriteLine(ex.Message.ToString()); }
diff --git a/.Source/GTweak/Utilities/Helpers/TakingOwnership.cs b/.Source/GTweak/Utilities/Helpers/TakingOwnership.cs
index 1fbaf4fd..b82a65b4 100644
--- a/.Source/GTweak/Utilities/Helpers/TakingOwnership.cs
+++ b/.Source/GTweak/Utilities/Helpers/TakingOwnership.cs
@@ -145,7 +145,7 @@ namespace GTweak.Utilities.Helpers
[DllImport("advapi32.dll", EntryPoint = "LookupPrivilegeValueA")]
[return: MarshalAs(UnmanagedType.Bool)]
- private static extern bool LookupPrivilegeValueA([In] [MarshalAs(UnmanagedType.LPStr)] string lpSystemName, [In] [MarshalAs(UnmanagedType.LPStr)] string lpName, [Out] out LUID lpLuid);
+ private static extern bool LookupPrivilegeValueA([In][MarshalAs(UnmanagedType.LPStr)] string lpSystemName, [In][MarshalAs(UnmanagedType.LPStr)] string lpName, [Out] out LUID lpLuid);
[DllImport("advapi32.dll", EntryPoint = "AdjustTokenPrivileges")]
[return: MarshalAs(UnmanagedType.Bool)]
diff --git a/.Source/GTweak/Utilities/Settings.cs b/.Source/GTweak/Utilities/Settings.cs
index 759374f1..e3fba079 100644
--- a/.Source/GTweak/Utilities/Settings.cs
+++ b/.Source/GTweak/Utilities/Settings.cs
@@ -22,16 +22,19 @@ namespace GTweak.Utilities
private static bool _isViewNotification = true;
private static bool _isSoundNotification = true;
private static byte _volumeNotification = 50;
+ private static bool _isTopMost = false;
+ private static bool _isСheckingUpdate = true;
private static string _language = App.GettingSystemLanguage;
private static string _theme = "Dark";
- private static bool _isTopMost = false;
- internal static int PID = 0;
internal static bool _isHiddenIpAddress = false;
+ internal static int PID = 0;
+
internal static bool IsViewNotification { get => _isViewNotification; set => _isViewNotification = value; }
internal static bool IsSoundNotification { get => _isSoundNotification; set => _isSoundNotification = value; }
internal static byte VolumeNotification { get => _volumeNotification; set => _volumeNotification = value; }
internal static bool IsTopMost { get => _isTopMost; set => _isTopMost = value; }
+ internal static bool IsСheckingUpdate { get => _isСheckingUpdate; set => _isСheckingUpdate = value; }
internal static string Language { get => _language; set => _language = value; }
internal static string Theme { get => _theme; set => _theme = value; }
internal static bool IsHiddenIpAddress { get => _isHiddenIpAddress; set => _isHiddenIpAddress = value; }
@@ -45,13 +48,14 @@ namespace GTweak.Utilities
private readonly void СheckingParameters()
{
RegistryKey registryKey = Registry.CurrentUser.CreateSubKey(@"Software\GTweak");
- if (registryKey == null || registryKey.GetValue("Notification", null) == null || registryKey.GetValue("Sound", null) == null || registryKey.GetValue("Volume", null) == null ||
- registryKey.GetValue("TopMost", null) == null || registryKey.GetValue("Language", null) == null || registryKey.GetValue("HiddenIP", null) == null || registryKey.GetValue("Theme", null) == null)
+ if (registryKey == null || registryKey.GetValue("Notification", null) == null || registryKey.GetValue("Sound", null) == null || registryKey.GetValue("Volume", null) == null || registryKey.GetValue("TopMost", null) == null ||
+ registryKey.GetValue("Update", null) == null || registryKey.GetValue("Language", null) == null || registryKey.GetValue("HiddenIP", null) == null || registryKey.GetValue("Theme", null) == null)
{
registryKey?.SetValue("Notification", IsViewNotification, RegistryValueKind.String);
registryKey?.SetValue("Sound", IsSoundNotification, RegistryValueKind.String);
registryKey?.SetValue("Volume", VolumeNotification, RegistryValueKind.String);
registryKey?.SetValue("TopMost", IsTopMost, RegistryValueKind.String);
+ registryKey?.SetValue("Update", IsСheckingUpdate, RegistryValueKind.String);
registryKey?.SetValue("HiddenIP", IsHiddenIpAddress, RegistryValueKind.String);
registryKey?.SetValue("Theme", Theme, RegistryValueKind.String);
registryKey?.SetValue("Language", App.GettingSystemLanguage, RegistryValueKind.String);
@@ -62,6 +66,7 @@ namespace GTweak.Utilities
IsSoundNotification = bool.Parse(registryKey?.GetValue("Sound").ToString() ?? "True");
VolumeNotification = byte.Parse(registryKey?.GetValue("Volume").ToString() ?? "50");
IsTopMost = bool.Parse(registryKey?.GetValue("TopMost").ToString() ?? "False");
+ IsСheckingUpdate = bool.Parse(registryKey?.GetValue("Update").ToString() ?? "True");
IsHiddenIpAddress = bool.Parse(registryKey?.GetValue("HiddenIP").ToString() ?? "False");
Language = registryKey?.GetValue("Language").ToString() ?? App.GettingSystemLanguage;
Theme = registryKey?.GetValue("Theme").ToString() ?? "Dark";
@@ -88,6 +93,9 @@ namespace GTweak.Utilities
case "TopMost":
IsTopMost = bool.Parse(registryKey?.GetValue("TopMost").ToString() ?? "False");
break;
+ case "Update":
+ IsСheckingUpdate = bool.Parse(registryKey?.GetValue("Update").ToString() ?? "True");
+ break;
case "Language":
Language = registryKey?.GetValue("Language").ToString() ?? App.GettingSystemLanguage;
break;
@@ -101,7 +109,7 @@ namespace GTweak.Utilities
registryKey?.Close();
});
-
+
internal static void SaveFileConfig()
{
@@ -176,7 +184,7 @@ namespace GTweak.Utilities
Process.Start(new ProcessStartInfo()
{
Arguments = "/c choice /c y /n /d y /t 3 & del \"" + (new FileInfo(new Uri(Assembly.GetExecutingAssembly().CodeBase).LocalPath)).Name + "\" & " +
- "rd /s /q " + PathTempFiles + @"& rd /s /q "+Environment.SystemDirectory+ @"\config\systemprofile\AppData\Local\GTweak",
+ "rd /s /q " + PathTempFiles + @"& rd /s /q " + Environment.SystemDirectory + @"\config\systemprofile\AppData\Local\GTweak",
WindowStyle = ProcessWindowStyle.Hidden,
CreateNoWindow = true,
FileName = "cmd.exe"
diff --git a/.Source/GTweak/Utilities/Tweaks/ConfidentialityTweaks.cs b/.Source/GTweak/Utilities/Tweaks/ConfidentialityTweaks.cs
index ca9110be..84b8c17a 100644
--- a/.Source/GTweak/Utilities/Tweaks/ConfidentialityTweaks.cs
+++ b/.Source/GTweak/Utilities/Tweaks/ConfidentialityTweaks.cs
@@ -1,8 +1,8 @@
using GTweak.Utilities.Helpers;
using GTweak.View;
using Microsoft.Win32;
-using System.Diagnostics;
using System;
+using System.Diagnostics;
using System.IO;
using System.IO.Compression;
using System.Threading;
@@ -369,7 +369,7 @@ namespace GTweak.Utilities.Tweaks
{
BlockSpyDomain(true);
- try { File.Delete(Settings.PathSystemDisk + @"\Windows\System32\drivers\etc\hosts (Default GTweak)"); }
+ try { File.Delete(Settings.PathSystemDisk + @"\Windows\System32\drivers\etc\hosts (Default GTweak)"); }
catch (Exception ex) { Debug.WriteLine(ex.Message.ToString()); }
File.Move(Settings.PathSystemDisk + @"\Windows\System32\drivers\etc\hosts", Settings.PathSystemDisk + @"\Windows\System32\drivers\etc\hosts (Default GTweak)");
diff --git a/.Source/GTweak/Utilities/Tweaks/Firewall.cs b/.Source/GTweak/Utilities/Tweaks/Firewall.cs
index 46c2a07f..44955c72 100644
--- a/.Source/GTweak/Utilities/Tweaks/Firewall.cs
+++ b/.Source/GTweak/Utilities/Tweaks/Firewall.cs
@@ -19,7 +19,7 @@ namespace GTweak.Utilities.Tweaks
private static readonly SortedList<string, string> ProgramPaths = new SortedList<string, string>
{
- ["MoUso_New"] = string.Concat(Settings.PathSystemDisk,@"Windows\UUS\amd64\MoUsoCoreWorker.exe"),
+ ["MoUso_New"] = string.Concat(Settings.PathSystemDisk, @"Windows\UUS\amd64\MoUsoCoreWorker.exe"),
["MoUso_Old"] = string.Concat(Settings.PathSystemDisk, @"Windows\System32\MoUsoCoreWorker.exe"),
["Uso"] = string.Concat(Settings.PathSystemDisk, @"Windows\System32\usoclient.exe"),
["WD"] = string.Concat(Settings.PathSystemDisk, @"Program Files\Windows Defender\MpCmdRun.exe"),
@@ -44,13 +44,15 @@ namespace GTweak.Utilities.Tweaks
{
if (CheckRulesWindows(NameRules["Update"]) && isChoose)
{
- Parallel.Invoke(() => {
+ Parallel.Invoke(() =>
+ {
AddRulesIn(isChoose, File.Exists(ProgramPaths["MoUso_New"]) ? ProgramPaths["MoUso_New"] : ProgramPaths["MoUso_Old"], NameRules["Update"]);
- AddRulesIn(isChoose, ProgramPaths["Uso"], string.Concat(NameRules["Update"], " (Update Orchestrator)"));
+ AddRulesIn(isChoose, ProgramPaths["Uso"], string.Concat(NameRules["Update"], " (Update Orchestrator)"));
},
- () => {
- AddRulesOut(isChoose, File.Exists(ProgramPaths["MoUso_New"]) ? ProgramPaths["MoUso_New"] : ProgramPaths["MoUso_Old"], NameRules["Update"]);
- AddRulesOut(isChoose, ProgramPaths["Uso"], string.Concat(NameRules["Update"], " (Update Orchestrator)"));
+ () =>
+ {
+ AddRulesOut(isChoose, File.Exists(ProgramPaths["MoUso_New"]) ? ProgramPaths["MoUso_New"] : ProgramPaths["MoUso_Old"], NameRules["Update"]);
+ AddRulesOut(isChoose, ProgramPaths["Uso"], string.Concat(NameRules["Update"], " (Update Orchestrator)"));
});
}
else
@@ -71,8 +73,8 @@ namespace GTweak.Utilities.Tweaks
catch (Exception ex) { Debug.WriteLine(ex.Message.ToString()); }
});
}
- }
- catch { new ViewNotification().Show("", (string)Application.Current.Resources["title0_notification"], (string)Application.Current.Resources["firewalloff_notification"]); }
+ }
+ catch { new ViewNotification().Show("", (string)Application.Current.Resources["title0_notification"], (string)Application.Current.Resources["firewalloff_notification"]); }
}
private static void AddRulesIn(in bool isChoose, in string pathProgram, in string nameRule, in string description = "Windows update blocking")
diff --git a/.Source/GTweak/Utilities/Tweaks/InterfaceTweaks.cs b/.Source/GTweak/Utilities/Tweaks/InterfaceTweaks.cs
index fe748f16..39416467 100644
--- a/.Source/GTweak/Utilities/Tweaks/InterfaceTweaks.cs
+++ b/.Source/GTweak/Utilities/Tweaks/InterfaceTweaks.cs
@@ -45,7 +45,7 @@ namespace GTweak.Utilities.Tweaks
if (Registry.GetValue(@"HKEY_CURRENT_USER\Control Panel\Desktop", "CursorBlinkRate", null) == null ||
Registry.GetValue(@"HKEY_CURRENT_USER\Control Panel\Desktop", "CursorBlinkRate", string.Empty).ToString() != "250")
- interfaceV.TglButton4.StateNA = true;
+ interfaceV.TglButton4.StateNA = true;
else
interfaceV.TglButton4.StateNA = false;
@@ -252,11 +252,11 @@ namespace GTweak.Utilities.Tweaks
if (SystemData.СomputerСonfiguration.clientWinVersion.Contains("11"))
{
- if (Registry.GetValue(@"HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\PushNotifications", "ToastEnabled", null) == null ||
- Registry.GetValue(@"HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\PushNotifications", "ToastEnabled", string.Empty).ToString() != "0" ||
- Registry.GetValue(@"HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager", "SubscribedContent-310093Enabled", null) == null ||
- Registry.GetValue(@"HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager", "SubscribedContent-310093Enabled", string.Empty).ToString() != "0" ||
- Registry.GetValue(@"HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager", "SubscribedContent-338389Enabled", null) == null ||
+ if (Registry.GetValue(@"HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\PushNotifications", "ToastEnabled", null) == null ||
+ Registry.GetValue(@"HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\PushNotifications", "ToastEnabled", string.Empty).ToString() != "0" ||
+ Registry.GetValue(@"HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager", "SubscribedContent-310093Enabled", null) == null ||
+ Registry.GetValue(@"HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager", "SubscribedContent-310093Enabled", string.Empty).ToString() != "0" ||
+ Registry.GetValue(@"HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager", "SubscribedContent-338389Enabled", null) == null ||
Registry.GetValue(@"HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager", "SubscribedContent-338389Enabled", string.Empty).ToString() != "0")
interfaceV.TglButton22.StateNA = true;
else
@@ -353,7 +353,7 @@ namespace GTweak.Utilities.Tweaks
launchExplorer.StartInfo.UseShellExecute = true;
launchExplorer.Start();
}
-
+
}
}
}
@@ -490,7 +490,7 @@ namespace GTweak.Utilities.Tweaks
break;
case "TglButton13":
if (isChoose)
- RegistryHelp.DeleteValue(Registry.CurrentUser, @"Software\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\NewStartPanel", "{20D04FE0-3AEA-1069-A2D8-08002B30309D}");
+ RegistryHelp.DeleteValue(Registry.CurrentUser, @"Software\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\NewStartPanel", "{20D04FE0-3AEA-1069-A2D8-08002B30309D}");
else
RegistryHelp.Write(Registry.CurrentUser, @"Software\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\NewStartPanel", "{20D04FE0-3AEA-1069-A2D8-08002B30309D}", 0, RegistryValueKind.DWord);
break;
@@ -606,10 +606,10 @@ namespace GTweak.Utilities.Tweaks
RegistryHelp.Write(Registry.CurrentUser, @"Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced", "Start_AccountNotifications", 0, RegistryValueKind.DWord);
RegistryHelp.Write(Registry.CurrentUser, @"Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced", "Start_IrisRecommendations", 0, RegistryValueKind.DWord);
RegistryHelp.Write(Registry.CurrentUser, @"SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager", "RotatingLockScreenOverlayEnabled", 0, RegistryValueKind.DWord);
- RegistryHelp.Write(Registry.CurrentUser, @"SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager", "RotatingLockScreenEnabled", 0, RegistryValueKind.DWord);
+ RegistryHelp.Write(Registry.CurrentUser, @"SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager", "RotatingLockScreenEnabled", 0, RegistryValueKind.DWord);
RegistryHelp.Write(Registry.CurrentUser, @"SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager", "SubscribedContent-338387Enabled", 0, RegistryValueKind.DWord);
}
-
+
}
else
{
@@ -648,7 +648,7 @@ namespace GTweak.Utilities.Tweaks
case "TglButton22":
if (isChoose)
{
- if(SystemData.СomputerСonfiguration.clientWinVersion.Contains("10"))
+ if (SystemData.СomputerСonfiguration.clientWinVersion.Contains("10"))
RegistryHelp.Write(Registry.CurrentUser, @"Software\Policies\Microsoft\Windows\Explorer", "DisableNotificationCenter", 1, RegistryValueKind.DWord);
if (SystemData.СomputerСonfiguration.clientWinVersion.Contains("11"))
{
diff --git a/.Source/GTweak/Utilities/Tweaks/RecoveryPoint.cs b/.Source/GTweak/Utilities/Tweaks/RecoveryPoint.cs
index 9c3673ad..a5306d2b 100644
--- a/.Source/GTweak/Utilities/Tweaks/RecoveryPoint.cs
+++ b/.Source/GTweak/Utilities/Tweaks/RecoveryPoint.cs
@@ -105,7 +105,8 @@ namespace GTweak.Utilities.Tweaks
"0" => true,
_ => false
};
- } catch { return false; }
+ }
+ catch { return false; }
}
internal static void DisablePoint()
diff --git a/.Source/GTweak/Utilities/Tweaks/ServicesTweaks.cs b/.Source/GTweak/Utilities/Tweaks/ServicesTweaks.cs
index a9008eca..d2d701ce 100644
--- a/.Source/GTweak/Utilities/Tweaks/ServicesTweaks.cs
+++ b/.Source/GTweak/Utilities/Tweaks/ServicesTweaks.cs
@@ -871,7 +871,7 @@ namespace GTweak.Utilities.Tweaks
FileName = "cmd.exe"
});
- ChangeStateTask();
+ ChangeStateTask();
await Task.Delay(1000);
@@ -904,7 +904,8 @@ namespace GTweak.Utilities.Tweaks
ChangeStateTask();
}
- } catch (Exception ex) { Debug.WriteLine(ex); }
+ }
+ catch (Exception ex) { Debug.WriteLine(ex); }
}
}
}
diff --git a/.Source/GTweak/Utilities/Tweaks/SystemData.cs b/.Source/GTweak/Utilities/Tweaks/SystemData.cs
index c4b32768..192563fd 100644
--- a/.Source/GTweak/Utilities/Tweaks/SystemData.cs
+++ b/.Source/GTweak/Utilities/Tweaks/SystemData.cs
@@ -4,9 +4,12 @@ using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Globalization;
+using System.IO;
+using System.Linq;
using System.Management;
using System.Net;
using System.Net.Http;
+using System.Reflection;
using System.Runtime.InteropServices;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
@@ -98,7 +101,8 @@ namespace GTweak.Utilities.Tweaks
internal readonly void GetCpuUsage()
{
- Parallel.Invoke(async () => {
+ Parallel.Invoke(async () =>
+ {
PerformanceCounter cpuCounter = new PerformanceCounter("Processor Information", "% Processor Utility", "_Total", true);
cpuCounter.NextValue();
await Task.Delay(1000);
@@ -149,14 +153,14 @@ namespace GTweak.Utilities.Tweaks
},
delegate
{
- foreach (var managementObj in new ManagementObjectSearcher(@"root\cimv2", "select Name, Caption, Description, SerialNumber from Win32_BIOS", optionsObj).Get())
+ foreach (var managementObj in new ManagementObjectSearcher(@"root\cimv2", "select Name, Caption, Description, SerialNumber from Win32_BIOS", optionsObj).Get())
{
if (!string.IsNullOrEmpty((string)managementObj["Name"]))
СonfigurationData["BIOS"] += !string.IsNullOrEmpty((string)managementObj["SerialNumber"]) ? (string)managementObj["Name"] + ", S/N-" + (string)managementObj["SerialNumber"] + "\n" : (string)managementObj["Name"] + "\n";
else if (!string.IsNullOrEmpty((string)managementObj["Caption"]))
- СonfigurationData["BIOS"] += !string.IsNullOrEmpty((string)managementObj["SerialNumber"]) ? (string)managementObj["Caption"] + ", S/N-" + (string)managementObj["SerialNumber"] + "\n" : (string)managementObj["Caption"] + "\n";
+ СonfigurationData["BIOS"] += !string.IsNullOrEmpty((string)managementObj["SerialNumber"]) ? (string)managementObj["Caption"] + ", S/N-" + (string)managementObj["SerialNumber"] + "\n" : (string)managementObj["Caption"] + "\n";
else if (!string.IsNullOrEmpty((string)managementObj["Description"]))
- СonfigurationData["BIOS"] += !string.IsNullOrEmpty((string)managementObj["SerialNumber"]) ? (string)managementObj["Description"] + ", S/N-" + (string)managementObj["SerialNumber"] + "\n" : (string)managementObj["Description"] + "\n";
+ СonfigurationData["BIOS"] += !string.IsNullOrEmpty((string)managementObj["SerialNumber"]) ? (string)managementObj["Description"] + ", S/N-" + (string)managementObj["SerialNumber"] + "\n" : (string)managementObj["Description"] + "\n";
}
СonfigurationData["BIOS"] = СonfigurationData["BIOS"].TrimEnd('\n');
},
@@ -206,21 +210,21 @@ namespace GTweak.Utilities.Tweaks
СonfigurationData["Disk"] += Convert.ToString((ulong)managementObj["Size"] / 1024000000) + " GB " + "[" + (string)managementObj["FriendlyName"] + "] " + _type + "\n";
}
СonfigurationData["Disk"] = СonfigurationData["Disk"].TrimEnd('\n');
- },
+ },
delegate
{
- СonfigurationData["Sound"] = string.Empty;
- foreach (var managementObj in new ManagementObjectSearcher(@"root\cimv2", "select Name,Caption,Description from Win32_SoundDevice", optionsObj).Get())
- {
- if (!string.IsNullOrEmpty((string)managementObj["Name"]))
- СonfigurationData["Sound"] += (string)managementObj["Name"] + "\n";
- else if (!string.IsNullOrEmpty((string)managementObj["Caption"]))
- СonfigurationData["Sound"] += (string)managementObj["Caption"] + "\n";
- else if (!string.IsNullOrEmpty((string)managementObj["Description"]))
- СonfigurationData["Sound"] += (string)managementObj["Description"] + "\n";
- }
- СonfigurationData["Sound"] = СonfigurationData["Sound"].TrimEnd('\n');
- },
+ СonfigurationData["Sound"] = string.Empty;
+ foreach (var managementObj in new ManagementObjectSearcher(@"root\cimv2", "select Name,Caption,Description from Win32_SoundDevice", optionsObj).Get())
+ {
+ if (!string.IsNullOrEmpty((string)managementObj["Name"]))
+ СonfigurationData["Sound"] += (string)managementObj["Name"] + "\n";
+ else if (!string.IsNullOrEmpty((string)managementObj["Caption"]))
+ СonfigurationData["Sound"] += (string)managementObj["Caption"] + "\n";
+ else if (!string.IsNullOrEmpty((string)managementObj["Description"]))
+ СonfigurationData["Sound"] += (string)managementObj["Description"] + "\n";
+ }
+ СonfigurationData["Sound"] = СonfigurationData["Sound"].TrimEnd('\n');
+ },
delegate
{
СonfigurationData["NetAdapter"] = string.Empty;
@@ -232,17 +236,19 @@ namespace GTweak.Utilities.Tweaks
internal static bool IsCheckInternetConnection()
{
- try {
+ try
+ {
string dns = CultureInfo.InstalledUICulture switch
{
{ Name: string name } when name.StartsWith("fa") => "aparat.com",
{ Name: string name } when name.StartsWith("zh") => "baidu.com",
{ Name: string name } when name.StartsWith("ru") => "yandex.ru",
- _ => "google.com",
+ _ => "google.com",
};
-
+
TimeSpan timeout = TimeSpan.FromSeconds(5.0);
- Task<IPAddress> task = Task.Run(() => {
+ Task<IPAddress> task = Task.Run(() =>
+ {
return Dns.GetHostEntry(dns).AddressList[0];
});
if (!task.Wait(timeout))
@@ -270,7 +276,7 @@ namespace GTweak.Utilities.Tweaks
СonfigurationData["IpAddress"] = (string)Application.Current.Resources["limited_systemInformation"];
isInternetLimited = true;
}
- finally
+ finally
{
if (isInternetLimited)
isInternetLimited = false;
@@ -296,8 +302,38 @@ namespace GTweak.Utilities.Tweaks
}
});
}
+ }
+
+ internal sealed class UtilityСonfiguration
+ {
+ internal sealed class GitVersionUtility
+ {
+ [JsonProperty("tag_name")]
+ internal string СurrentVersion { get; set; }
+ }
+ internal static bool IsNeedUpdate()
+ {
+ if (СomputerСonfiguration.IsCheckInternetConnection())
+ {
+ if (!(WebRequest.Create("https://api.github.com/repos/greedeks/gtweak/releases/latest") is HttpWebRequest webRequest))
+ return false;
+ webRequest.ContentType = "application/json";
+ webRequest.UserAgent = "Nothing";
+
+ using Stream stream = webRequest.GetResponse().GetResponseStream();
+ using StreamReader sreader = new StreamReader(stream);
+ string DataAsJson = sreader.ReadToEnd();
+ GitVersionUtility gitVersionUtility = JsonConvert.DeserializeObject<GitVersionUtility>(DataAsJson);
+ if ((Assembly.GetEntryAssembly() ?? throw new InvalidOperationException()).GetCustomAttribute<AssemblyInformationalVersionAttribute>().InformationalVersion.Split(' ').Last().Trim() != gitVersionUtility.СurrentVersion)
+ return true;
+ else
+ return false;
+ }
+ else
+ return false;
+ }
}
}
}
diff --git a/.Source/GTweak/Utilities/Tweaks/SystemTweaks.cs b/.Source/GTweak/Utilities/Tweaks/SystemTweaks.cs
index c2247c57..1fb4d123 100644
--- a/.Source/GTweak/Utilities/Tweaks/SystemTweaks.cs
+++ b/.Source/GTweak/Utilities/Tweaks/SystemTweaks.cs
@@ -24,7 +24,7 @@ namespace GTweak.Utilities.Tweaks
internal const uint SPI_SETMOUSE = 0x0004;
};
- internal sealed class SystemTweaks: Firewall
+ internal sealed class SystemTweaks : Firewall
{
private static readonly string[] schedulerTasks = new string[2] {
@"Microsoft\Windows\MemoryDiagnostic\ProcessMemoryDiagnosticEvents",
@@ -128,20 +128,20 @@ namespace GTweak.Utilities.Tweaks
catch (Exception ex) { Debug.WriteLine(ex.Message.ToString()); }
- systemV.TglButton8.StateNA = Registry.GetValue(@"HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\SecurityHealthService", "Start", null) == null ||
- Registry.GetValue(@"HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\SecurityHealthService", "Start", string.Empty).ToString() != "4" ||
- Registry.GetValue(@"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows Defender\Features", "TamperProtection", null) == null ||
- Registry.GetValue(@"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows Defender\Features", "TamperProtection", string.Empty).ToString() != "0" ||
- Registry.GetValue(@"HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender Security Center\App and Browser protection", "DisallowExploitProtectionOverride", null) == null ||
- Registry.GetValue(@"HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender Security Center\App and Browser protection", "DisallowExploitProtectionOverride", string.Empty).ToString() != "0" ||
- Registry.GetValue(@"HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender Security Center\App and Browser protection", "UILockdown", null) == null ||
- Registry.GetValue(@"HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender Security Center\App and Browser protection", "UILockdown", string.Empty).ToString() != "1" ||
- Registry.GetValue(@"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows Defender\Real-Time Protection", "DisableBehaviorMonitoring", null) == null ||
- Registry.GetValue(@"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows Defender\Real-Time Protection", "DisableBehaviorMonitoring", string.Empty).ToString() != "1" ||
- Registry.GetValue(@"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows Defender\Real-Time Protection", "DisableRealtimeMonitoring", null) == null ||
- Registry.GetValue(@"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows Defender\Real-Time Protection", "DisableRealtimeMonitoring", string.Empty).ToString() != "1"; ;
-
-
+ systemV.TglButton8.StateNA = Registry.GetValue(@"HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\SecurityHealthService", "Start", null) == null ||
+ Registry.GetValue(@"HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\SecurityHealthService", "Start", string.Empty).ToString() != "4" ||
+ Registry.GetValue(@"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows Defender\Features", "TamperProtection", null) == null ||
+ Registry.GetValue(@"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows Defender\Features", "TamperProtection", string.Empty).ToString() != "0" ||
+ Registry.GetValue(@"HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender Security Center\App and Browser protection", "DisallowExploitProtectionOverride", null) == null ||
+ Registry.GetValue(@"HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender Security Center\App and Browser protection", "DisallowExploitProtectionOverride", string.Empty).ToString() != "0" ||
+ Registry.GetValue(@"HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender Security Center\App and Browser protection", "UILockdown", null) == null ||
+ Registry.GetValue(@"HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender Security Center\App and Browser protection", "UILockdown", string.Empty).ToString() != "1" ||
+ Registry.GetValue(@"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows Defender\Real-Time Protection", "DisableBehaviorMonitoring", null) == null ||
+ Registry.GetValue(@"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows Defender\Real-Time Protection", "DisableBehaviorMonitoring", string.Empty).ToString() != "1" ||
+ Registry.GetValue(@"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows Defender\Real-Time Protection", "DisableRealtimeMonitoring", null) == null ||
+ Registry.GetValue(@"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows Defender\Real-Time Protection", "DisableRealtimeMonitoring", string.Empty).ToString() != "1"; ;
+
+
if (Registry.GetValue(@"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System", "PromptOnSecureDesktop", null) == null ||
Registry.GetValue(@"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System", "PromptOnSecureDesktop", string.Empty).ToString() != "0" ||
@@ -224,7 +224,7 @@ namespace GTweak.Utilities.Tweaks
systemV.TglButton17.StateNA = false;
- if (!Registry.GetValue(@"HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Power\User\PowerSchemes\" + activeGuid + "", "Description", string.Empty).ToString().Contains("-18") &&
+ if (!Registry.GetValue(@"HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Power\User\PowerSchemes\" + activeGuid + "", "Description", string.Empty).ToString().Contains("-18") &&
!Registry.GetValue(@"HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Power\User\PowerSchemes\" + activeGuid + "", "FriendlyName", string.Empty).ToString().Contains("-19"))
systemV.TglButton18.StateNA = true;
else
@@ -269,7 +269,8 @@ namespace GTweak.Utilities.Tweaks
{
ManagementObjectSearcher searcher = new ManagementObjectSearcher("SELECT DeviceId FROM Win32_PnPEntity WHERE service='BthLEEnum'");
isBluetoothStatus = searcher.Get().Count > 0;
- } catch { isBluetoothStatus = false; }
+ }
+ catch { isBluetoothStatus = false; }
}
internal void ViewTaskState()
@@ -438,7 +439,8 @@ namespace GTweak.Utilities.Tweaks
keychange?.SetValue("PerformanceIdleTime", _dataTime, RegistryValueKind.Binary);
}
}
- } catch (Exception ex) { Debug.WriteLine(ex.Message.ToString()); }
+ }
+ catch (Exception ex) { Debug.WriteLine(ex.Message.ToString()); }
break;
case "TglButton8":
BackgroundWorker backgroundWorker = new BackgroundWorker();
@@ -713,7 +715,7 @@ namespace GTweak.Utilities.Tweaks
},
};
- string _serchScheme = default,
+ string _serchScheme = default,
unlockFrequency = @"-attributes SUB_PROCESSOR 75b0ae3f-bce0-45a7-8c89-c9611c25e100 -ATTRIB_HIDE",
inputPath = Settings.PathTempFiles + @"\UltimatePerformance.pow";
diff --git a/.Source/GTweak/Utilities/Tweaks/UninstallingApps.cs b/.Source/GTweak/Utilities/Tweaks/UninstallingApps.cs
index 41800470..203522ca 100644
--- a/.Source/GTweak/Utilities/Tweaks/UninstallingApps.cs
+++ b/.Source/GTweak/Utilities/Tweaks/UninstallingApps.cs
@@ -24,7 +24,7 @@ namespace GTweak.Utilities.Tweaks
["GetHelp"] = false,
["MicrosoftOfficeHub"] = false,
["MicrosoftSolitaireCollection"] = false,
- ["MixedReality"] = false,
+ ["MixedReality"] = false,
["Xbox"] = false,
["Paint3D"] = false,
["OneNote"] = false,
@@ -65,7 +65,7 @@ namespace GTweak.Utilities.Tweaks
["Microsoft3D"] = new List<string>(1) { "Microsoft.Microsoft3DViewer" },
["Music"] = new List<string>(1) { "Microsoft.ZuneMusic" },
["GetHelp"] = new List<string>(1) { "Microsoft.GetHelp" },
- ["MicrosoftOfficeHub"] = new List<string>(1) { "Microsoft.MicrosoftOfficeHub"},
+ ["MicrosoftOfficeHub"] = new List<string>(1) { "Microsoft.MicrosoftOfficeHub" },
["MicrosoftSolitaireCollection"] = new List<string>(1) { "Microsoft.MicrosoftSolitaireCollection" },
["MixedReality"] = new List<string>(1) { "Microsoft.MixedReality.Portal" },
["Xbox"] = new List<string>(7) { "Microsoft.XboxApp", "Microsoft.GamingApp", "Microsoft.XboxGamingOverlay", "Microsoft.XboxGameOverlay", "Microsoft.XboxIdentityProvider", "Microsoft.Xbox.TCUI", "Microsoft.XboxSpeechToTextOverlay" },
@@ -260,7 +260,7 @@ namespace GTweak.Utilities.Tweaks
process.Dispose();
}
- string argumentsFolders = @"/c rd /s /q %userprofile%\AppData\Local\Microsoft\OneDrive & rd /s /q ""%allusersprofile%\Microsoft OneDrive"" & rd /s /q " + Settings.PathSystemDisk +@"\OneDriveTemp";
+ string argumentsFolders = @"/c rd /s /q %userprofile%\AppData\Local\Microsoft\OneDrive & rd /s /q ""%allusersprofile%\Microsoft OneDrive"" & rd /s /q " + Settings.PathSystemDisk + @"\OneDriveTemp";
if (isLocalAccount)
argumentsFolders += @" & rd /s /q %userprofile%\OneDrive";
diff --git a/.Source/GTweak/Utilities/Tweaks/WindowsDefender.cs b/.Source/GTweak/Utilities/Tweaks/WindowsDefender.cs
index 649ca3cd..58ee029b 100644
--- a/.Source/GTweak/Utilities/Tweaks/WindowsDefender.cs
+++ b/.Source/GTweak/Utilities/Tweaks/WindowsDefender.cs
@@ -88,7 +88,7 @@ namespace GTweak.Utilities.Tweaks
RegistryHelp.CreateFolder(Registry.LocalMachine, @"SYSTEM\CurrentControlSet\Services\SharedAccess\Parameters\FirewallPolicy\StandardProfile");
RegistryHelp.Write(Registry.LocalMachine, @"SYSTEM\CurrentControlSet\Services\SharedAccess\Parameters\FirewallPolicy\StandardProfile", "DisableNotifications", 0, RegistryValueKind.DWord);
-
+
RegistryHelp.DeleteRegristyTree(Registry.LocalMachine, @"SOFTWARE\Policies\Microsoft\Windows Defender Security Center");
RegistryHelp.DeleteRegristyTree(Registry.CurrentUser, @"SOFTWARE\Classes\Local Settings\Software\Microsoft\Windows\CurrentVersion\AppContainer\Storage\microsoft.microsoftedge_8wekyb3d8bbwe\MicrosoftEdge");
@@ -140,7 +140,7 @@ namespace GTweak.Utilities.Tweaks
RegistryHelp.Write(Registry.ClassesRoot, @"*\shellex\ContextMenuHandlers\EPP", "", "{09A47860-11B0-4DA5-AFA5-26D86198A780}", RegistryValueKind.String);
RegistryHelp.Write(Registry.ClassesRoot, @"Directory\shellex\ContextMenuHandlers\EPP", "", "{09A47860-11B0-4DA5-AFA5-26D86198A780}", RegistryValueKind.String);
RegistryHelp.Write(Registry.ClassesRoot, @"Drive\shellex\ContextMenuHandlers\EPP", "", "{09A47860-11B0-4DA5-AFA5-26D86198A780}", RegistryValueKind.String);
- RegistryHelp.Write(Registry.ClassesRoot, @"CLSID\{09A47860-11B0-4DA5-AFA5-26D86198A780}\InprocServer32", "", Settings.PathSystemDisk+ @"Program Files\Windows Defender\shellext.dll", RegistryValueKind.String);
+ RegistryHelp.Write(Registry.ClassesRoot, @"CLSID\{09A47860-11B0-4DA5-AFA5-26D86198A780}\InprocServer32", "", Settings.PathSystemDisk + @"Program Files\Windows Defender\shellext.dll", RegistryValueKind.String);
RegistryHelp.Write(Registry.ClassesRoot, @"CLSID\{09A47860-11B0-4DA5-AFA5-26D86198A780}\InprocServer32", "ThreadingModel", "Apartment", RegistryValueKind.String);
}
@@ -351,7 +351,7 @@ namespace GTweak.Utilities.Tweaks
{
foreach (Process process in Process.GetProcessesByName(getName))
{
- try { process.Kill();}
+ try { process.Kill(); }
catch (Exception ex) { Debug.WriteLine(ex.Message.ToString()); }
}
}
diff --git a/.Source/GTweak/Utilities/Tweaks/WindowsLicense.cs b/.Source/GTweak/Utilities/Tweaks/WindowsLicense.cs
index 05b3fee3..d319a904 100644
--- a/.Source/GTweak/Utilities/Tweaks/WindowsLicense.cs
+++ b/.Source/GTweak/Utilities/Tweaks/WindowsLicense.cs
@@ -14,7 +14,8 @@ namespace GTweak.Utilities.Tweaks
internal void LicenseStatus()
{
- Parallel.Invoke(() => {
+ Parallel.Invoke(() =>
+ {
foreach (var managementObj in new ManagementObjectSearcher(@"root\cimv2", "SELECT LicenseStatus FROM SoftwareLicensingProduct WHERE ApplicationID = '55c92734-d682-4d71-983e-d6ec3f16059f' and LicenseStatus = 1").Get())
statusLicense = (uint)managementObj["LicenseStatus"];
});
diff --git a/.Source/GTweak/Utilities/ViewNotification.cs b/.Source/GTweak/Utilities/ViewNotification.cs
index 60e43066..7b75d503 100644
--- a/.Source/GTweak/Utilities/ViewNotification.cs
+++ b/.Source/GTweak/Utilities/ViewNotification.cs
@@ -25,7 +25,7 @@ namespace GTweak.Utilities
{
NotificationWindow notificationWindow = new NotificationWindow();
- Parallel.Invoke(async() =>
+ Parallel.Invoke(async () =>
{
if (notificationWindow.IsLoaded || isAlreadyLaunch)
return;
diff --git a/.Source/GTweak/View/ApplicationsView.xaml.cs b/.Source/GTweak/View/ApplicationsView.xaml.cs
index 51568ecb..cbd0fda1 100644
--- a/.Source/GTweak/View/ApplicationsView.xaml.cs
+++ b/.Source/GTweak/View/ApplicationsView.xaml.cs
@@ -64,7 +64,7 @@ namespace GTweak.View
});
if (backgroundQueue.IsQueueCompleted())
{
- await Task.Delay(15000);
+ await Task.Delay(15000);
if (applicationName != "YandexMusic")
UninstallingApps.IsAppDeletedList[appImage.Name] = false;
else
diff --git a/.Source/GTweak/View/ConfidentialityView.xaml.cs b/.Source/GTweak/View/ConfidentialityView.xaml.cs
index 0db5b65d..03e18f03 100644
--- a/.Source/GTweak/View/ConfidentialityView.xaml.cs
+++ b/.Source/GTweak/View/ConfidentialityView.xaml.cs
@@ -23,7 +23,7 @@ namespace GTweak.View
{
ToggleButton toggleButton = (ToggleButton)sender;
- if (TextDescription.Text != (string)FindResource(toggleButton.Name+ "_description_confidentiality"))
+ if (TextDescription.Text != (string)FindResource(toggleButton.Name + "_description_confidentiality"))
{
string _descriptionTweak = (string)FindResource(toggleButton.Name + "_description_confidentiality");
TimeSpan time = _descriptionTweak.Length < 200 ? TimeSpan.FromMilliseconds(400) : TimeSpan.FromMilliseconds(550);
diff --git a/.Source/GTweak/View/InformationSystemView.xaml.cs b/.Source/GTweak/View/InformationSystemView.xaml.cs
index 441c97f8..6a929c4f 100644
--- a/.Source/GTweak/View/InformationSystemView.xaml.cs
+++ b/.Source/GTweak/View/InformationSystemView.xaml.cs
@@ -1,5 +1,6 @@
using GTweak.Core.ViewModel;
using GTweak.Utilities;
+using GTweak.Utilities.Tweaks;
using System;
using System.ComponentModel;
using System.Threading;
@@ -12,7 +13,6 @@ using System.Windows.Input;
using System.Windows.Media.Animation;
using System.Windows.Media.Effects;
using System.Windows.Threading;
-using GTweak.Utilities.Tweaks;
namespace GTweak.View
{
@@ -25,7 +25,7 @@ namespace GTweak.View
{
InitializeComponent();
- App.LanguageChanged += delegate
+ App.LanguageChanged += delegate
{
if (!SystemData.СomputerСonfiguration.isConnectionLose)
{
@@ -54,7 +54,7 @@ namespace GTweak.View
BackgroundWorker backgroundWorker = new BackgroundWorker();
backgroundWorker.RunWorkerAsync();
backgroundWorker.DoWork += delegate
- {
+ {
Parallel.Invoke(SystemData.СomputerСonfiguration.UpdatingDeviceData);
new Thread(() => new SystemData.MonitoringSystem().GetCpuUsage()).Start();
new Thread(() => new SystemData.MonitoringSystem().GetCpuUsage()).IsBackground = true;
@@ -87,7 +87,7 @@ namespace GTweak.View
}, Application.Current.Dispatcher);
timer.Start();
}
-
+
private void AnimationPopup(bool _reverse)
{
PopupCopy.IsOpen = true;
@@ -142,7 +142,8 @@ namespace GTweak.View
private void ProgressBarAnim()
{
- Parallel.Invoke(() => {
+ Parallel.Invoke(() =>
+ {
DoubleAnimation doubleAnim = new DoubleAnimation()
{
From = CPULoad.Value,
diff --git a/.Source/GTweak/View/InterfaceView.xaml.cs b/.Source/GTweak/View/InterfaceView.xaml.cs
index 38153df8..2652753c 100644
--- a/.Source/GTweak/View/InterfaceView.xaml.cs
+++ b/.Source/GTweak/View/InterfaceView.xaml.cs
@@ -51,8 +51,8 @@ namespace GTweak.View
private void Tweak_MouseLeave(object sender, MouseEventArgs e)
{
- if (TextViewColor.Visibility==Visibility.Visible)
- TextViewColor.Visibility=Visibility.Hidden;
+ if (TextViewColor.Visibility == Visibility.Visible)
+ TextViewColor.Visibility = Visibility.Hidden;
if (TextDescription.Text != (string)FindResource("defaultDescription"))
new TypewriterAnimation((string)FindResource("defaultDescription"), TextDescription, TimeSpan.FromMilliseconds(250));
}
diff --git a/.Source/GTweak/View/SystemView.xaml.cs b/.Source/GTweak/View/SystemView.xaml.cs
index aa66cf3a..5895f2f1 100644
--- a/.Source/GTweak/View/SystemView.xaml.cs
+++ b/.Source/GTweak/View/SystemView.xaml.cs
@@ -104,7 +104,7 @@ namespace GTweak.View
new ViewNotification().Show("", (string)FindResource("title0_notification"), (string)FindResource("warningwindef_notification"));
}
}
-
+
}
private void Page_Loaded(object sender, RoutedEventArgs e)
diff --git a/.Source/GTweak/Windows/MainWindow.xaml b/.Source/GTweak/Windows/MainWindow.xaml
index a56a7b5f..992bd4fd 100644
--- a/.Source/GTweak/Windows/MainWindow.xaml
+++ b/.Source/GTweak/Windows/MainWindow.xaml
@@ -166,12 +166,12 @@
<Grid Width="399">
<Grid.RowDefinitions>
<RowDefinition Height="52*"/>
- <RowDefinition Height="458*"/>
+ <RowDefinition Height="462*"/>
<RowDefinition Height="41*"/>
</Grid.RowDefinitions>
<Grid Grid.Row="0">
- <TextBlock FontFamily="{StaticResource Jura}" Text="{DynamicResource title_settings_main}" Foreground="{StaticResource Color_Accent}" FontSize="20" Margin="0,10,0,0" HorizontalAlignment="Center" VerticalAlignment="Top">
+ <TextBlock FontFamily="{StaticResource Jura}" Text="{DynamicResource title_settings_main}" Foreground="{StaticResource Color_Accent}" FontSize="20" HorizontalAlignment="Center" VerticalAlignment="Top" Margin="0,10,0,0">
<TextBlock.Effect>
<DropShadowEffect BlurRadius="20" ShadowDepth="1" Direction="-90" Color="{StaticResource Color_Shadow}" />
</TextBlock.Effect>
@@ -185,16 +185,18 @@
<uс:ToggleButton x:Name="BtnNotification" DynamicText="{DynamicResource btgl_notifications_main}" VerticalAlignment="Top" Height="25" Margin="40,20,0,0" ChangedState="BtnNotification_ChangedState"/>
- <uс:ToggleButton x:Name="BtnSoundNtn" DynamicText="{DynamicResource btgl_sound_main}" VerticalAlignment="Top" Height="25" Margin="40,20,0,0" ChangedState="BtnSoundNtn_ChangedState"/>
+ <uс:ToggleButton x:Name="BtnSoundNtn" DynamicText="{DynamicResource btgl_sound_main}" VerticalAlignment="Top" Height="25" Margin="40,15,0,0" ChangedState="BtnSoundNtn_ChangedState"/>
- <StackPanel Orientation="Horizontal" Height="45" VerticalAlignment="Top" Margin="40,20,0,0">
+ <StackPanel Orientation="Horizontal" Height="45" VerticalAlignment="Top" Margin="40,15,0,0">
<TextBlock Style="{StaticResource Text_In}" Foreground="{StaticResource Color_Highlighted}" Margin="0,4,0,0" Text="{DynamicResource slider_volume_main}"/>
<Slider x:Name="SliderVolume" Style="{StaticResource Horizontal_Slider}" IsSnapToTickEnabled="True" Minimum="0" Maximum="100" Margin="7,13,0,0" Width="140" ValueChanged="SliderVolume_ValueChanged"/>
</StackPanel>
- <uс:ToggleButton x:Name="BtnTopMost" VerticalAlignment="Top" Height="25" DynamicText="{DynamicResource btgl_toast_main}" Margin="40,20,0,0" ChangedState="BtnTopMost_ChangedState"/>
+ <uс:ToggleButton x:Name="BtnTopMost" VerticalAlignment="Top" Height="25" DynamicText="{DynamicResource btgl_toast_main}" Margin="40,15,0,0" ChangedState="BtnTopMost_ChangedState"/>
- <StackPanel Orientation="Horizontal" Height="45" VerticalAlignment="Top" Margin="40,20,0,0">
+ <uс:ToggleButton x:Name="BtnUpdate" DynamicText="{DynamicResource btgl_update_main}" VerticalAlignment="Top" Height="25" Margin="40,15,0,0" ChangedState="BtnUpdate_ChangedState"/>
+
+ <StackPanel Orientation="Horizontal" Height="45" VerticalAlignment="Top" Margin="40,15,0,0">
<TextBlock Style="{StaticResource Text_In}" Foreground="{StaticResource Color_Highlighted}" Text="{DynamicResource cmbox_lang_main}"/>
<ComboBox x:Name="LanguageSelectionMenu" Height="25" Width="155" Margin="10,-5,0,0" SelectionChanged="LanguageSelectionMenu_SelectionChanged" >
<TextBlock Text="{DynamicResource cmbox_eng_main}"/>
@@ -213,7 +215,7 @@
<Border Background="{DynamicResource Color_Accent}" Height="1.2" Width="330" VerticalAlignment="Bottom" Margin="0,10,0,0" CornerRadius="10 10 0 0"/>
- <StackPanel Orientation="Horizontal" Margin="40,20,0,0">
+ <StackPanel Orientation="Horizontal" Margin="40,15,0,0">
<TextBlock Style="{StaticResource Text_In}" Foreground="{StaticResource Color_Highlighted}" Margin="0,4,0,0" Text="{DynamicResource text_saveconfig}"/>
<Button x:Name="BtnExport" FontSize="10pt" Style="{StaticResource BtnDefault}" Width="96" Height="26" Margin="10,0,0,0" Cursor="Hand" PreviewMouseDown="BtnExport_PreviewMouseDown">
<StackPanel Orientation="Horizontal">
@@ -229,7 +231,7 @@
</Button>
</StackPanel>
- <StackPanel Orientation="Horizontal" Margin="40,20,0,0">
+ <StackPanel Orientation="Horizontal" Margin="40,15,0,0">
<TextBlock Style="{StaticResource Text_In}" Foreground="{StaticResource Color_Highlighted}" Margin="0,4,0,0" Text="{DynamicResource text_selfremove}"/>
<Button x:Name="BtnDelete" Content="{DynamicResource btn_selfremove}" FontSize="10pt" Style="{StaticResource BtnDefault}" Width="107" Height="26" Margin="10,0,0,0" Cursor="Hand" PreviewMouseDown="BtnDelete_PreviewMouseDown"/>
</StackPanel>
diff --git a/.Source/GTweak/Windows/MainWindow.xaml.cs b/.Source/GTweak/Windows/MainWindow.xaml.cs
index 22be3a25..92d8a4c0 100644
--- a/.Source/GTweak/Windows/MainWindow.xaml.cs
+++ b/.Source/GTweak/Windows/MainWindow.xaml.cs
@@ -14,7 +14,7 @@ using System.Windows.Media.Animation;
namespace GTweak
{
public partial class MainWindow
- {
+ {
public MainWindow()
{
InitializeComponent();
@@ -22,6 +22,7 @@ namespace GTweak
BtnNotification.State = Settings.IsViewNotification;
BtnSoundNtn.State = Settings.IsSoundNotification;
BtnTopMost.State = Topmost = Settings.IsTopMost;
+ BtnUpdate.State = Settings.IsСheckingUpdate;
SliderVolume.Value = Settings.VolumeNotification;
LanguageSelectionMenu.SelectedIndex = Settings.Language == "en" ? 0 : 1;
ThemeSelectionMenu.SelectedIndex = Settings.Theme switch
@@ -37,7 +38,8 @@ namespace GTweak
#region Button Title/Animation Window
private void SettingsMenuAnimation()
{
- Parallel.Invoke(() => {
+ Parallel.Invoke(() =>
+ {
Storyboard storyboard = new Storyboard();
DoubleAnimation rotateAnimation = new DoubleAnimation()
{
@@ -134,6 +136,8 @@ namespace GTweak
private void BtnSoundNtn_ChangedState(object sender, EventArgs e) => Parallel.Invoke(() => { Settings.ChangingParameters(!BtnSoundNtn.State, "Sound"); });
+ private void BtnUpdate_ChangedState(object sender, EventArgs e) => Parallel.Invoke(() => { Settings.ChangingParameters(!BtnUpdate.State, "Update"); });
+
private void BtnTopMost_ChangedState(object sender, EventArgs e)
{
Parallel.Invoke(() =>
@@ -143,10 +147,10 @@ namespace GTweak
});
}
- private void SliderVolume_ValueChanged(object sender, RoutedPropertyChangedEventArgs<double> e)
+ private void SliderVolume_ValueChanged(object sender, RoutedPropertyChangedEventArgs<double> e)
{
SliderVolume.Value = SliderVolume.Value == 0 ? 1 : SliderVolume.Value;
- Parallel.Invoke(() => { Settings.ChangingParameters(SliderVolume.Value, "Volume"); });
+ Parallel.Invoke(() => { Settings.ChangingParameters(SliderVolume.Value, "Volume"); });
}
private void LanguageSelectionMenu_SelectionChanged(object sender, SelectionChangedEventArgs e)
@@ -206,7 +210,7 @@ namespace GTweak
if (e.LeftButton == MouseButtonState.Pressed)
{
Image btnConcat = (Image)sender;
- switch(btnConcat.Uid)
+ switch (btnConcat.Uid)
{
case "git":
Process.Start("https://github.com/Greedeks");
@@ -219,7 +223,7 @@ namespace GTweak
break;
}
}
-
+
}
#endregion
}
diff --git a/.Source/GTweak/Windows/MessageWindow.xaml.cs b/.Source/GTweak/Windows/MessageWindow.xaml.cs
index aa04e9d7..a6752efb 100644
--- a/.Source/GTweak/Windows/MessageWindow.xaml.cs
+++ b/.Source/GTweak/Windows/MessageWindow.xaml.cs
@@ -22,12 +22,13 @@ namespace GTweak.Windows
{
timer = new DispatcherTimer(new TimeSpan(0, 0, 1), DispatcherPriority.Normal, delegate
{
- BtnAccept.Content= $"{new Regex("[(05)(04)(03)(02)]").Replace(BtnAccept.Content.ToString(), "")}({time:ss})";
+ BtnAccept.Content = $"{new Regex("[(05)(04)(03)(02)]").Replace(BtnAccept.Content.ToString(), "")}({time:ss})";
if (time == TimeSpan.Zero) { timer?.Stop(); Application.Current.Shutdown(); }
time = time.Add(TimeSpan.FromSeconds(-1));
}, Application.Current.Dispatcher);
- } catch (Exception ex) { Debug.WriteLine(ex.Message.ToString()); }
+ }
+ catch (Exception ex) { Debug.WriteLine(ex.Message.ToString()); }
timer?.Start();
if (isViolationSystem)
diff --git a/.Source/GTweak/Windows/WaitingWindow.xaml.cs b/.Source/GTweak/Windows/WaitingWindow.xaml.cs
index 172ca73c..18531e40 100644
--- a/.Source/GTweak/Windows/WaitingWindow.xaml.cs
+++ b/.Source/GTweak/Windows/WaitingWindow.xaml.cs
@@ -10,7 +10,7 @@ namespace GTweak.Windows
/// <summary>
/// Darkened screen
/// </summary>
-
+
public partial class WaitingWindow : Window
{
private readonly DisablingWinKeys disablingWinKeys = new DisablingWinKeys();
@@ -29,7 +29,7 @@ namespace GTweak.Windows
ProcessModule objCurrentModule = Process.GetCurrentProcess().MainModule;
disablingWinKeys.objKeyboardProcess = new DisablingWinKeys.LowLevelKeyboardProc(disablingWinKeys.CaptureKey);
disablingWinKeys.ptrHook = DisablingWinKeys.SetWindowsHookEx(13, disablingWinKeys.objKeyboardProcess, DisablingWinKeys.GetModuleHandle(objCurrentModule.ModuleName), 1);
- this.Close();
+ this.Close();
};
Timeline.SetDesiredFrameRate(doubleAnim, 400);
BeginAnimation(OpacityProperty, doubleAnim);