Skip to content
This repository was archived by the owner on Jan 20, 2026. It is now read-only.

Commit c70a27d

Browse files
committed
Upstream
1 parent e3c97cb commit c70a27d

6 files changed

Lines changed: 124 additions & 81 deletions

File tree

Optimizer/Forms/MainForm.Designer.cs

Lines changed: 66 additions & 64 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Optimizer/Forms/MainForm.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -415,6 +415,7 @@ private void SetHelpBoxTranslation()
415415
helpBox.SetToolTip(classicRibbonSw.Label, Options.TranslationList["classicRibbonTip"].ToString());
416416
helpBox.SetToolTip(classicContextSw.Label, Options.TranslationList["classicContextTip"].ToString());
417417
helpBox.SetToolTip(picUpdate, Options.TranslationList["linkUpdate"].ToString() + "!");
418+
helpBox.SetToolTip(picLab, Options.TranslationList["lblLab"].ToString());
418419
helpBox.SetToolTip(ffTelemetrySw.Label, Options.TranslationList["ffTelemetryTip"].ToString());
419420
helpBox.SetToolTip(vsSw.Label, Options.TranslationList["vsTip"].ToString());
420421
helpBox.SetToolTip(chromeTelemetrySw.Label, Options.TranslationList["chromeTelemetryTip"].ToString());
@@ -874,7 +875,7 @@ public MainForm(SplashForm _splashForm, bool disableIndicium = false, bool disab
874875
if (Program.EXPERIMENTAL_BUILD)
875876
{
876877
btnUpdate.Enabled = false;
877-
lblUpdateDisabled.Visible = true;
878+
picLab.Visible = true;
878879
}
879880

880881
// network monitoring

Optimizer/Forms/MainForm.resx

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,17 @@
118118
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
119119
</resheader>
120120
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
121+
<data name="picLab.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
122+
<value>
123+
iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAL
124+
EgAACxIB0t1+/AAAASJJREFUaEPtjkEOBCEIBOf/P51X7F44EIKTUsG+WAkHsYF6Lhcx7/v+dsrW6Mik
125+
ZsrW6MikZsrW6CFiJCODyJGMDCJHMjKIHMnIIHIkI4PIkYwMIkcyMogcycggciQjg8iRjAwiRzIyiBzJ
126+
yCByJCODyJGMDCJHMjKiHCkb1ZPJkbJxPZkcKRvXkonNlK3RMSs0m28lyhChlZk2iEj273u+f5QoMRLJ
127+
/n0v/h2DSoz+fT/+tROPrwhU7Fim4njFjiUqD1fuwoyOxjfBz8zOLvF1MOsR/NzK/BRfx7Iewc+tzE+x
128+
e2g06/vZfwkVR0azvp/9l1Bx4Gve/40yy7QuN1pvtC0OtN1pWxxouxMXnyo7v0+2/ETZ+X2y5SfKzl8u
129+
fTzPH/7wS2w8ChpKAAAAAElFTkSuQmCC
130+
</value>
131+
</data>
121132
<data name="picUpdate.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
122133
<value>
123134
iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAL
@@ -849,7 +860,7 @@ any application only by typing your desired keyword.</value>
849860
AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w
850861
LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0
851862
ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAAC8
852-
GgAAAk1TRnQBSQFMAgEBCQEAAbABAQGwAQEBIAEAASABAAT/ASEBAAj/AUIBTQE2BwABNgMAASgDAAGA
863+
GgAAAk1TRnQBSQFMAgEBCQEAAdgBAQHYAQEBIAEAASABAAT/ASEBAAj/AUIBTQE2BwABNgMAASgDAAGA
853864
AwABYAMAAQEBAAEgBgABwP8A/wD/AP8A/wD/AP8A/wAeAANHAYB0//8AiQADRwGAdP//AIkAAyoBQANH
854865
AYADRwGAA0cBgANHAYADRwGAA0cBgANHAYADRwGAA0cBgANHAYADRwGAA0cBgANHAYADRwGAA0cBgANH
855866
AYADRwGAA0cBgANHAYADRwGAA0cBgANHAYADRwGAA0cBgANHAYADRwGAA0cBgANHAYADRwGA/wD/AP8A

Optimizer/Optimize.cs

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,12 @@ public static class Optimize
99
{
1010
readonly static string DiagnosisAutoLoggerFolder = Path.Combine(CleanHelper.ProgramData, @"Microsoft\Diagnosis\ETLLogs\AutoLogger");
1111

12+
13+
1214
internal static void DisableTelemetryRunner()
1315
{
14-
Registry.SetValue(
15-
@"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\CompatTelRunner.exe",
16-
"Debugger", @"%windir%\System32\taskkill.exe"
17-
);
18-
19-
Registry.SetValue(
20-
@"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\DeviceCensus.exe",
21-
"Debugger", @"%windir%\System32\taskkill.exe"
22-
);
16+
Utilities.PreventProcessFromRunning("CompatTelRunner.exe");
17+
Utilities.PreventProcessFromRunning("DeviceCensus.exe");
2318
}
2419

2520
internal static void EnablePerformanceTweaks()
@@ -1624,10 +1619,7 @@ internal static void EnableVisualStudioTelemetry()
16241619
// CHROME TELEMETRY + SOFTWARE REPORTER TOOL
16251620
internal static void DisableChromeTelemetry()
16261621
{
1627-
Registry.SetValue(
1628-
@"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\software_reporter_tool.exe",
1629-
"Debugger", @"%windir%\System32\taskkill.exe"
1630-
);
1622+
Utilities.PreventProcessFromRunning("software_reporter_tool.exe");
16311623

16321624
Registry.SetValue(@"HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Google\Chrome", "MetricsReportingEnabled", 0);
16331625
Registry.SetValue(@"HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Google\Chrome", "ChromeCleanupReportingEnabled", 0);

Optimizer/Program.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ static class Program
1313
/* VERSION PROPERTIES */
1414
/* DO NOT LEAVE THEM EMPTY */
1515

16-
internal readonly static float Major = 11;
17-
internal readonly static float Minor = 8;
16+
internal readonly static float Major = 0;
17+
internal readonly static float Minor = 0;
1818

1919
internal readonly static bool EXPERIMENTAL_BUILD = false;
2020

Optimizer/Utilities.cs

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -736,6 +736,8 @@ internal static void DisableProtectedService(string serviceName)
736736
allServicesKey.GrantFullControlOnSubKey(serviceName);
737737
using (RegistryKey serviceKey = allServicesKey.OpenSubKeyWritable(serviceName))
738738
{
739+
if (serviceKey == null) return;
740+
739741
foreach (string subkeyName in serviceKey.GetSubKeyNames())
740742
{
741743
serviceKey.TakeOwnershipOnSubKey(subkeyName);
@@ -780,6 +782,8 @@ internal static void EnableProtectedService(string serviceName)
780782
allServicesKey.GrantFullControlOnSubKey(serviceName);
781783
using (RegistryKey serviceKey = allServicesKey.OpenSubKeyWritable(serviceName))
782784
{
785+
if (serviceKey == null) return;
786+
783787
foreach (string subkeyName in serviceKey.GetSubKeyNames())
784788
{
785789
serviceKey.TakeOwnershipOnSubKey(subkeyName);
@@ -794,6 +798,7 @@ internal static void EnableProtectedService(string serviceName)
794798
public static RegistryKey OpenSubKeyWritable(this RegistryKey registryKey, string subkeyName, RegistryRights? rights = null)
795799
{
796800
RegistryKey subKey = null;
801+
797802
if (rights == null)
798803
subKey = registryKey.OpenSubKey(subkeyName, RegistryKeyPermissionCheck.ReadWriteSubTree);
799804
else
@@ -892,5 +897,37 @@ internal static void SearchWith(string term, bool ddg)
892897
}
893898
catch { }
894899
}
900+
901+
internal static void PreventProcessFromRunning(string pName)
902+
{
903+
try
904+
{
905+
using (RegistryKey ifeo = Registry.LocalMachine.OpenSubKeyWritable(@"SOFTWARE\Microsoft\Windows NT\CurrentVersion"))
906+
{
907+
if (ifeo == null) return;
908+
909+
ifeo.GrantFullControlOnSubKey("Image File Execution Options");
910+
911+
using (RegistryKey k = ifeo.OpenSubKeyWritable("Image File Execution Options"))
912+
{
913+
if (k == null) return;
914+
915+
k.CreateSubKey(pName);
916+
k.GrantFullControlOnSubKey(pName);
917+
918+
using (RegistryKey f = k.OpenSubKeyWritable(pName))
919+
{
920+
if (f == null) return;
921+
922+
f.SetValue("Debugger", @"%windir%\System32\taskkill.exe");
923+
}
924+
}
925+
}
926+
}
927+
catch (Exception ex)
928+
{
929+
ErrorLogger.LogError("Utilities.PreventProcessFromRunning", ex.Message, ex.StackTrace);
930+
}
931+
}
895932
}
896933
}

0 commit comments

Comments
 (0)