Skip to content

Commit

Permalink
v 4.90.1
Browse files Browse the repository at this point in the history
-refactoring (working with Firewall)
-add tweaks disable overlay (gamebar) with remove xbox and disable game mode
  • Loading branch information
Greedeks committed Aug 2, 2024
1 parent c5f9341 commit 08aa4bb
Show file tree
Hide file tree
Showing 6 changed files with 79 additions and 14 deletions.
4 changes: 4 additions & 0 deletions .Source/GTweak/Language/lang.ru.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,8 @@
<v:String x:Key="tgl18_system">Использовать обычную схему электропитания</v:String>
<v:String x:Key="tgl19_system">Функция Bluetooth и устройства</v:String>
<v:String x:Key="tgl20_system">Брандмауэр Защитника Windows</v:String>
<v:String x:Key="tgl21_system">Функция Windows «Игровой режим»</v:String>
<v:String x:Key="tgl22_system">Функция Xbox «Игровая панель»</v:String>

<v:String x:Key="TextSlider1_description_system">Изменяет скорость движения указателя мыши, экономя ваше время для поисков параметров мыши.</v:String>
<v:String x:Key="TextSlider2_description_system">Изменят задержку перед началом повтора вводимого символа, рекомендованное значение - 0.</v:String>
Expand All @@ -346,6 +348,8 @@
<v:String x:Key="TglButton18_description_system">Добавит слегка измененную схему электропитания «Максимальная Производительность», или в случае её наличия, просто переключит на имеющуюся схему электропитания.</v:String>
<v:String x:Key="TglButton19_description_system">Если вам не нужен Bluetooth и вы не хотите использовать устройства по Bluetooth. То отключайте его, так же уберет иконку с панели задач.</v:String>
<v:String x:Key="TglButton20_description_system">Брандмауэр позволяет вам разрешить или запретить программам выход в интернет, а так же контролировать трафик. Что делает его полезным, если вы намерено хотетите и знаете что делаете, то отключайте. А так не рекомендовано этого делать.</v:String>
<v:String x:Key="TglButton21_description_system">Игровой режим не оказывает большое влияния на мощные системы. Однако если у вас много процессов, работающих в фоновом режиме, то режим гарантирует, что фоновые процессы не будут влиять на работу игры.</v:String>
<v:String x:Key="TglButton22_description_system">Функция для записи ваших игр. По большому счету использует в пустую ресурсы вашей системы. Есть много лучших альтернатив, да и в добавок которые не открываются спонтанно.</v:String>
<!--#endregion-->

<!--#region Information System Page -->
Expand Down
4 changes: 4 additions & 0 deletions .Source/GTweak/Language/lang.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,8 @@
<v:String x:Key="tgl18_system">Use a conventional power supply circuit</v:String>
<v:String x:Key="tgl19_system">Bluetooth and device function</v:String>
<v:String x:Key="tgl20_system">Windows Defender Firewall</v:String>
<v:String x:Key="tgl21_system">Windows feature «Game Mode»</v:String>
<v:String x:Key="tgl22_system">Xbox feature «Game Bar»</v:String>

<v:String x:Key="TextSlider1_description_system">Changes the speed of the mouse pointer, saving you time to search for mouse parameters.</v:String>
<v:String x:Key="TextSlider2_description_system">Will change the delay before starting to repeat the entered character, the recommended value is 0.</v:String>
Expand All @@ -346,6 +348,8 @@
<v:String x:Key="TglButton18_description_system">Will add a slightly modified «Maximum Performance» power supply circuit, or if available, simply switch to the existing power supply circuit.</v:String>
<v:String x:Key="TglButton19_description_system">If you don't need Bluetooth and you don't want to use Bluetooth devices. Then disable it, it will also remove the icon from the taskbar.</v:String>
<v:String x:Key="TglButton20_description_system">The firewall allows you to allow or deny programs access to the Internet, as well as control traffic. Which makes it useful, if you intentionally want to and know what you're doing, then turn it off. And it is not recommended to do this.</v:String>
<v:String x:Key="TglButton21_description_system">The game mode does not have much effect on powerful systems. However, if you have a lot of processes running in the background, then the mode ensures that background processes will not affect the operation of the game.</v:String>
<v:String x:Key="TglButton22_description_system">A function for recording your games. By and large, it uses up the resources of your system. There are many better alternatives, and in addition, which do not open spontaneously.</v:String>
<!--#endregion-->

<!--#region Information System Page -->
Expand Down
4 changes: 2 additions & 2 deletions .Source/GTweak/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
[assembly: AssemblyCopyright("Copyright © 2024 Greedeks")]
[assembly: AssemblyTrademark("Greedeks")]
[assembly: AssemblyCulture("")]
[assembly: AssemblyInformationalVersion("Build: 4.90.0")]
[assembly: AssemblyFileVersion("4.90.0")]
[assembly: AssemblyInformationalVersion("Build: 4.90.1")]
[assembly: AssemblyFileVersion("4.90.1")]

[assembly: ComVisible(false)]

Expand Down
31 changes: 19 additions & 12 deletions .Source/GTweak/Utilities/Tweaks/Firewall.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using NetFwTypeLib;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Threading.Tasks;
using System.Windows;
Expand All @@ -9,6 +10,12 @@ namespace GTweak.Utilities.Tweaks
internal abstract class Firewall
{
private static readonly string nameRules = @"GTweak - Windows Update blocking";
private static readonly SortedList<string, string> programPaths = new SortedList<string, string>
{
["MoUso_New"] = @"Windows\UUS\amd64\MoUsoCoreWorker.exe",
["MoUso_Old"] = @"Windows\System32\MoUsoCoreWorker.exe",
["Uso"] = @"Windows\System32\usoclient.exe",
};
private static bool CheckRulesWindows(string nameRule)
{
bool isCheck = true;
Expand All @@ -28,24 +35,24 @@ protected static void BlockWindowsUpdate(bool isChoose)
if (CheckRulesWindows(nameRules) && isChoose)
{
Parallel.Invoke(
() => { RulesUpdateIN(isChoose, Settings.PathSystemDisk + @"Windows\UUS\amd64\MoUsoCoreWorker.exe", nameRules); },
() => { RulesUpdateIN(isChoose, Settings.PathSystemDisk + @"Windows\System32\MoUsoCoreWorker.exe", string.Concat(nameRules," (Old Way)")); },
() => { RulesUpdateIN(isChoose, Settings.PathSystemDisk + @"Windows\System32\usoclient.exe", string.Concat(nameRules," (Update Orchestrator)")); },
() => { RulesUpdateOUT(isChoose, Settings.PathSystemDisk + @"Windows\UUS\amd64\MoUsoCoreWorker.exe", nameRules); },
() => { RulesUpdateOUT(isChoose, Settings.PathSystemDisk + @"Windows\System32\MoUsoCoreWorker.exe", string.Concat(nameRules, " (Old Way)")); },
() => { RulesUpdateOUT(isChoose, Settings.PathSystemDisk + @"Windows\System32\usoclient.exe", string.Concat(nameRules, " (Update Orchestrator)")); });
() => { RulesUpdateIN(isChoose, Settings.PathSystemDisk + programPaths["MoUso_New"], nameRules); },
() => { RulesUpdateIN(isChoose, Settings.PathSystemDisk + programPaths["MoUso_Old"], string.Concat(nameRules," (Old Way)")); },
() => { RulesUpdateIN(isChoose, Settings.PathSystemDisk + programPaths["Uso"], string.Concat(nameRules," (Update Orchestrator)")); },
() => { RulesUpdateOUT(isChoose, Settings.PathSystemDisk + @programPaths["MoUso_New"], nameRules); },
() => { RulesUpdateOUT(isChoose, Settings.PathSystemDisk + programPaths["MoUso_Old"], string.Concat(nameRules, " (Old Way)")); },
() => { RulesUpdateOUT(isChoose, Settings.PathSystemDisk + programPaths["Uso"], string.Concat(nameRules, " (Update Orchestrator)")); });
}
else
{
try {
RulesUpdateIN(isChoose, Settings.PathSystemDisk + @"Windows\UUS\amd64\MoUsoCoreWorker.exe", nameRules);
RulesUpdateIN(isChoose, Settings.PathSystemDisk + @"Windows\System32\MoUsoCoreWorker.exe", string.Concat(nameRules, " (Old Way)"));
RulesUpdateIN(isChoose, Settings.PathSystemDisk + @"Windows\System32\usoclient.exe", string.Concat(nameRules, " (Update Orchestrator)"));
RulesUpdateIN(isChoose, Settings.PathSystemDisk + programPaths["MoUso_New"], nameRules);
RulesUpdateIN(isChoose, Settings.PathSystemDisk + programPaths["MoUso_Old"], string.Concat(nameRules, " (Old Way)"));
RulesUpdateIN(isChoose, Settings.PathSystemDisk + programPaths["Uso"], string.Concat(nameRules, " (Update Orchestrator)"));
} catch (Exception ex) { Debug.WriteLine(ex.Message.ToString()); }
try {
RulesUpdateOUT(isChoose, Settings.PathSystemDisk + @"Windows\UUS\amd64\MoUsoCoreWorker.exe", nameRules);
RulesUpdateOUT(isChoose, Settings.PathSystemDisk + @"Windows\System32\MoUsoCoreWorker.exe", string.Concat(nameRules, " (Old Way)"));
RulesUpdateOUT(isChoose, Settings.PathSystemDisk + @"Windows\System32\usoclient.exe", string.Concat(nameRules, " (Update Orchestrator)"));
RulesUpdateOUT(isChoose, Settings.PathSystemDisk + programPaths["MoUso_New"], nameRules);
RulesUpdateOUT(isChoose, Settings.PathSystemDisk + programPaths["MoUso_Old"], string.Concat(nameRules, " (Old Way)"));
RulesUpdateOUT(isChoose, Settings.PathSystemDisk + programPaths["Uso"], string.Concat(nameRules, " (Update Orchestrator)"));
} catch (Exception ex) { Debug.WriteLine(ex.Message.ToString()); }
}
}
Expand Down
48 changes: 48 additions & 0 deletions .Source/GTweak/Utilities/Tweaks/SystemTweaks.cs
Original file line number Diff line number Diff line change
Expand Up @@ -243,22 +243,44 @@ internal void ViewSystem(SystemView systemV)
else
systemV.TglButton17.StateNA = false;


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
systemV.TglButton18.StateNA = false;


if (isBluetoothStatus)
systemV.TglButton19.StateNA = true;
else
systemV.TglButton19.StateNA = false;


if (Registry.GetValue(@"HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\mpssvc", "Start", null).ToString() != "4")
systemV.TglButton20.StateNA = true;
else
systemV.TglButton20.StateNA = false;


if (Registry.GetValue(@"HKEY_CURRENT_USER\Software\Microsoft\GameBar", "AutoGameModeEnabled", null) == null ||
Registry.GetValue(@"HKEY_CURRENT_USER\Software\Microsoft\GameBar", "AutoGameModeEnabled", null).ToString() != "0" ||
Registry.GetValue(@"HKEY_CURRENT_USER\Software\Microsoft\GameBar", "AllowAutoGameMode", null) == null ||
Registry.GetValue(@"HKEY_CURRENT_USER\Software\Microsoft\GameBar", "AllowAutoGameMode", null).ToString() != "0")
systemV.TglButton21.StateNA = true;
else
systemV.TglButton21.StateNA = false;


if (Registry.GetValue(@"HKEY_CURRENT_USER\Software\Microsoft\GameBar", "UseNexusForGameBarEnabled", null) == null ||
Registry.GetValue(@"HKEY_CURRENT_USER\Software\Microsoft\GameBar", "UseNexusForGameBarEnabled", null).ToString() != "0" ||
Registry.GetValue(@"HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\GameDVR", "AppCaptureEnabled", null) == null ||
Registry.GetValue(@"HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\GameDVR", "AppCaptureEnabled", null).ToString() != "0" ||
Registry.GetValue(@"HKEY_CURRENT_USER\System\GameConfigStore", "GameDVR_Enabled", null) == null ||
Registry.GetValue(@"HKEY_CURRENT_USER\System\GameConfigStore", "GameDVR_Enabled", null).ToString() != "0")
systemV.TglButton22.StateNA = true;
else
systemV.TglButton22.StateNA = false;
}

internal void ViewBluetoothStatus()
Expand Down Expand Up @@ -597,6 +619,32 @@ internal static void UseSystem(string tweak, bool isChoose)
RegistryHelp.Write(Registry.LocalMachine, @"SYSTEM\CurrentControlSet\Services\SharedAccess\Parameters\FirewallPolicy\DomainProfile", "EnableFirewall", "0", RegistryValueKind.DWord);
}
break;
case "TglButton21":
if (isChoose)
{
RegistryHelp.Write(Registry.CurrentUser, @"Software\Microsoft\GameBar", "AutoGameModeEnabled", 0, RegistryValueKind.DWord);
RegistryHelp.Write(Registry.CurrentUser, @"Software\Microsoft\GameBar", "AllowAutoGameMode", 0, RegistryValueKind.DWord);
}
else
{
RegistryHelp.Write(Registry.CurrentUser, @"Software\Microsoft\GameBar", "AutoGameModeEnabled", 1, RegistryValueKind.DWord);
RegistryHelp.Write(Registry.CurrentUser, @"Software\Microsoft\GameBar", "AllowAutoGameMode", 1, RegistryValueKind.DWord);
}
break;
case "TglButton22":
if (isChoose)
{
RegistryHelp.Write(Registry.CurrentUser, @"SOFTWARE\Microsoft\Windows\CurrentVersion\GameDVR", "AppCaptureEnabled", 0, RegistryValueKind.DWord);
RegistryHelp.Write(Registry.CurrentUser, @"System\GameConfigStore", "GameDVR_Enabled", 0, RegistryValueKind.DWord);
RegistryHelp.Write(Registry.CurrentUser, @"Software\Microsoft\GameBar", "UseNexusForGameBarEnabled", 0, RegistryValueKind.DWord);
}
else
{
RegistryHelp.Write(Registry.CurrentUser, @"SOFTWARE\Microsoft\Windows\CurrentVersion\GameDVR", "AppCaptureEnabled", 1, RegistryValueKind.DWord);
RegistryHelp.Write(Registry.CurrentUser, @"System\GameConfigStore", "GameDVR_Enabled", 1, RegistryValueKind.DWord);
RegistryHelp.Write(Registry.CurrentUser, @"Software\Microsoft\GameBar", "UseNexusForGameBarEnabled", 1, RegistryValueKind.DWord);
}
break;
}
}

Expand Down
2 changes: 2 additions & 0 deletions .Source/GTweak/View/SystemView.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
<uc:ToggleButton x:Name="TglButton6" Height="25" Width="Auto" Margin="20,20,0,0" DynamicText="{DynamicResource tgl6_system}" MouseEnter="Tweak_MouseEnter" MouseLeave="Tweak_MouseLeave" ChangedState="TglButton_ChangedState"/>
<uc:ToggleButton x:Name="TglButton7" Height="25" Width="Auto" Margin="20,20,0,0" DynamicText="{DynamicResource tgl7_system}" MouseEnter="Tweak_MouseEnter" MouseLeave="Tweak_MouseLeave" ChangedState="TglButton_ChangedState"/>
<uc:ToggleButton x:Name="TglButton19" Height="25" Width="Auto" Margin="20,20,0,0" DynamicText="{DynamicResource tgl19_system}" MouseEnter="Tweak_MouseEnter" MouseLeave="Tweak_MouseLeave" ChangedState="TglButton_ChangedState"/>
<uc:ToggleButton x:Name="TglButton21" Height="25" Width="Auto" Margin="20,20,0,0" DynamicText="{DynamicResource tgl21_system}" MouseEnter="Tweak_MouseEnter" MouseLeave="Tweak_MouseLeave" ChangedState="TglButton_ChangedState"/>
</StackPanel>
</Grid>

Expand All @@ -65,6 +66,7 @@
<uc:ToggleButton x:Name="TglButton17" Height="25" Width="Auto" Margin="20,20,0,0" DynamicText="{DynamicResource tgl17_system}" MouseEnter="Tweak_MouseEnter" MouseLeave="Tweak_MouseLeave" ChangedState="TglButton_ChangedState"/>
<uc:ToggleButton x:Name="TglButton18" Height="25" Width="Auto" Margin="20,20,0,0" DynamicText="{DynamicResource tgl18_system}" MouseEnter="Tweak_MouseEnter" MouseLeave="Tweak_MouseLeave" ChangedState="TglButton_ChangedState"/>
<uc:ToggleButton x:Name="TglButton20" Height="25" Width="Auto" Margin="20,20,0,0" DynamicText="{DynamicResource tgl20_system}" MouseEnter="Tweak_MouseEnter" MouseLeave="Tweak_MouseLeave" ChangedState="TglButton_ChangedState"/>
<uc:ToggleButton x:Name="TglButton22" Height="25" Width="Auto" Margin="20,20,0,0" DynamicText="{DynamicResource tgl22_system}" MouseEnter="Tweak_MouseEnter" MouseLeave="Tweak_MouseLeave" ChangedState="TglButton_ChangedState"/>
</StackPanel>
</Grid>
</Grid>
Expand Down

0 comments on commit 08aa4bb

Please sign in to comment.