Integrated debloater

This commit is contained in:
Serge
2023-06-07 22:52:04 +02:00
parent b13306b989
commit 59288b9422
9 changed files with 303 additions and 91 deletions

139
app/Extra.Designer.cs generated
View File

@@ -93,6 +93,9 @@ namespace GHelper
checkVariBright = new CheckBox(); checkVariBright = new CheckBox();
checkGpuApps = new CheckBox(); checkGpuApps = new CheckBox();
checkFnLock = new CheckBox(); checkFnLock = new CheckBox();
panelServices = new Panel();
labelServices = new Label();
buttonServices = new RButton();
groupBindings.SuspendLayout(); groupBindings.SuspendLayout();
tableKeys.SuspendLayout(); tableKeys.SuspendLayout();
((System.ComponentModel.ISupportInitialize)pictureHelp).BeginInit(); ((System.ComponentModel.ISupportInitialize)pictureHelp).BeginInit();
@@ -104,6 +107,7 @@ namespace GHelper
panelXMG.SuspendLayout(); panelXMG.SuspendLayout();
tableBacklight.SuspendLayout(); tableBacklight.SuspendLayout();
groupOther.SuspendLayout(); groupOther.SuspendLayout();
panelServices.SuspendLayout();
SuspendLayout(); SuspendLayout();
// //
// groupBindings // groupBindings
@@ -380,7 +384,7 @@ namespace GHelper
groupLight.Margin = new Padding(4, 2, 4, 2); groupLight.Margin = new Padding(4, 2, 4, 2);
groupLight.Name = "groupLight"; groupLight.Name = "groupLight";
groupLight.Padding = new Padding(4, 2, 4, 11); groupLight.Padding = new Padding(4, 2, 4, 11);
groupLight.Size = new Size(966, 554); groupLight.Size = new Size(966, 526);
groupLight.TabIndex = 1; groupLight.TabIndex = 1;
groupLight.TabStop = false; groupLight.TabStop = false;
groupLight.Text = "Keyboard Backlight"; groupLight.Text = "Keyboard Backlight";
@@ -398,15 +402,15 @@ namespace GHelper
panelBacklightExtra.Controls.Add(labelSpeed); panelBacklightExtra.Controls.Add(labelSpeed);
panelBacklightExtra.Controls.Add(comboKeyboardSpeed); panelBacklightExtra.Controls.Add(comboKeyboardSpeed);
panelBacklightExtra.Dock = DockStyle.Top; panelBacklightExtra.Dock = DockStyle.Top;
panelBacklightExtra.Location = new Point(4, 315); panelBacklightExtra.Location = new Point(4, 299);
panelBacklightExtra.Margin = new Padding(4, 2, 4, 2); panelBacklightExtra.Margin = new Padding(4, 2, 4, 2);
panelBacklightExtra.Name = "panelBacklightExtra"; panelBacklightExtra.Name = "panelBacklightExtra";
panelBacklightExtra.Size = new Size(958, 228); panelBacklightExtra.Size = new Size(958, 216);
panelBacklightExtra.TabIndex = 43; panelBacklightExtra.TabIndex = 43;
// //
// numericBacklightPluggedTime // numericBacklightPluggedTime
// //
numericBacklightPluggedTime.Location = new Point(702, 181); numericBacklightPluggedTime.Location = new Point(702, 169);
numericBacklightPluggedTime.Margin = new Padding(4, 2, 4, 2); numericBacklightPluggedTime.Margin = new Padding(4, 2, 4, 2);
numericBacklightPluggedTime.Maximum = new decimal(new int[] { 3600, 0, 0, 0 }); numericBacklightPluggedTime.Maximum = new decimal(new int[] { 3600, 0, 0, 0 });
numericBacklightPluggedTime.Name = "numericBacklightPluggedTime"; numericBacklightPluggedTime.Name = "numericBacklightPluggedTime";
@@ -415,7 +419,7 @@ namespace GHelper
// //
// labelBacklightTimeoutPlugged // labelBacklightTimeoutPlugged
// //
labelBacklightTimeoutPlugged.Location = new Point(13, 183); labelBacklightTimeoutPlugged.Location = new Point(13, 171);
labelBacklightTimeoutPlugged.Margin = new Padding(4, 0, 4, 0); labelBacklightTimeoutPlugged.Margin = new Padding(4, 0, 4, 0);
labelBacklightTimeoutPlugged.Name = "labelBacklightTimeoutPlugged"; labelBacklightTimeoutPlugged.Name = "labelBacklightTimeoutPlugged";
labelBacklightTimeoutPlugged.Size = new Size(683, 45); labelBacklightTimeoutPlugged.Size = new Size(683, 45);
@@ -424,7 +428,7 @@ namespace GHelper
// //
// numericBacklightTime // numericBacklightTime
// //
numericBacklightTime.Location = new Point(702, 132); numericBacklightTime.Location = new Point(702, 120);
numericBacklightTime.Margin = new Padding(4, 2, 4, 2); numericBacklightTime.Margin = new Padding(4, 2, 4, 2);
numericBacklightTime.Maximum = new decimal(new int[] { 3600, 0, 0, 0 }); numericBacklightTime.Maximum = new decimal(new int[] { 3600, 0, 0, 0 });
numericBacklightTime.Name = "numericBacklightTime"; numericBacklightTime.Name = "numericBacklightTime";
@@ -433,7 +437,7 @@ namespace GHelper
// //
// labelBacklightTimeout // labelBacklightTimeout
// //
labelBacklightTimeout.Location = new Point(13, 134); labelBacklightTimeout.Location = new Point(13, 122);
labelBacklightTimeout.Margin = new Padding(4, 0, 4, 0); labelBacklightTimeout.Margin = new Padding(4, 0, 4, 0);
labelBacklightTimeout.Name = "labelBacklightTimeout"; labelBacklightTimeout.Name = "labelBacklightTimeout";
labelBacklightTimeout.Size = new Size(683, 45); labelBacklightTimeout.Size = new Size(683, 45);
@@ -452,7 +456,7 @@ namespace GHelper
// trackBrightness // trackBrightness
// //
trackBrightness.LargeChange = 1; trackBrightness.LargeChange = 1;
trackBrightness.Location = new Point(355, 60); trackBrightness.Location = new Point(355, 59);
trackBrightness.Margin = new Padding(4, 2, 4, 2); trackBrightness.Margin = new Padding(4, 2, 4, 2);
trackBrightness.Maximum = 3; trackBrightness.Maximum = 3;
trackBrightness.Name = "trackBrightness"; trackBrightness.Name = "trackBrightness";
@@ -462,7 +466,7 @@ namespace GHelper
// //
// labelSpeed // labelSpeed
// //
labelSpeed.Location = new Point(13, 15); labelSpeed.Location = new Point(13, 18);
labelSpeed.Margin = new Padding(4, 0, 4, 0); labelSpeed.Margin = new Padding(4, 0, 4, 0);
labelSpeed.Name = "labelSpeed"; labelSpeed.Name = "labelSpeed";
labelSpeed.Size = new Size(539, 41); labelSpeed.Size = new Size(539, 41);
@@ -478,7 +482,7 @@ namespace GHelper
comboKeyboardSpeed.FormattingEnabled = true; comboKeyboardSpeed.FormattingEnabled = true;
comboKeyboardSpeed.ItemHeight = 32; comboKeyboardSpeed.ItemHeight = 32;
comboKeyboardSpeed.Items.AddRange(new object[] { "Slow", "Normal", "Fast" }); comboKeyboardSpeed.Items.AddRange(new object[] { "Slow", "Normal", "Fast" });
comboKeyboardSpeed.Location = new Point(607, 15); comboKeyboardSpeed.Location = new Point(607, 16);
comboKeyboardSpeed.Margin = new Padding(4, 11, 4, 9); comboKeyboardSpeed.Margin = new Padding(4, 11, 4, 9);
comboKeyboardSpeed.Name = "comboKeyboardSpeed"; comboKeyboardSpeed.Name = "comboKeyboardSpeed";
comboKeyboardSpeed.Size = new Size(292, 40); comboKeyboardSpeed.Size = new Size(292, 40);
@@ -489,7 +493,7 @@ namespace GHelper
// //
panelXMG.Controls.Add(checkXMG); panelXMG.Controls.Add(checkXMG);
panelXMG.Dock = DockStyle.Top; panelXMG.Dock = DockStyle.Top;
panelXMG.Location = new Point(4, 257); panelXMG.Location = new Point(4, 241);
panelXMG.Margin = new Padding(4, 2, 4, 2); panelXMG.Margin = new Padding(4, 2, 4, 2);
panelXMG.Name = "panelXMG"; panelXMG.Name = "panelXMG";
panelXMG.Size = new Size(958, 58); panelXMG.Size = new Size(958, 58);
@@ -545,7 +549,7 @@ namespace GHelper
tableBacklight.RowStyles.Add(new RowStyle()); tableBacklight.RowStyles.Add(new RowStyle());
tableBacklight.RowStyles.Add(new RowStyle()); tableBacklight.RowStyles.Add(new RowStyle());
tableBacklight.RowStyles.Add(new RowStyle()); tableBacklight.RowStyles.Add(new RowStyle());
tableBacklight.Size = new Size(958, 223); tableBacklight.Size = new Size(958, 207);
tableBacklight.TabIndex = 41; tableBacklight.TabIndex = 41;
// //
// labelBacklight // labelBacklight
@@ -563,8 +567,8 @@ namespace GHelper
// checkAwake // checkAwake
// //
checkAwake.Dock = DockStyle.Fill; checkAwake.Dock = DockStyle.Fill;
checkAwake.Location = new Point(4, 45); checkAwake.Location = new Point(4, 43);
checkAwake.Margin = new Padding(4, 2, 4, 2); checkAwake.Margin = new Padding(4, 0, 4, 0);
checkAwake.Name = "checkAwake"; checkAwake.Name = "checkAwake";
checkAwake.Padding = new Padding(15, 2, 6, 2); checkAwake.Padding = new Padding(15, 2, 6, 2);
checkAwake.Size = new Size(231, 41); checkAwake.Size = new Size(231, 41);
@@ -575,8 +579,8 @@ namespace GHelper
// checkBoot // checkBoot
// //
checkBoot.Dock = DockStyle.Fill; checkBoot.Dock = DockStyle.Fill;
checkBoot.Location = new Point(4, 90); checkBoot.Location = new Point(4, 84);
checkBoot.Margin = new Padding(4, 2, 4, 2); checkBoot.Margin = new Padding(4, 0, 4, 0);
checkBoot.Name = "checkBoot"; checkBoot.Name = "checkBoot";
checkBoot.Padding = new Padding(15, 2, 6, 2); checkBoot.Padding = new Padding(15, 2, 6, 2);
checkBoot.Size = new Size(231, 41); checkBoot.Size = new Size(231, 41);
@@ -587,8 +591,8 @@ namespace GHelper
// checkSleep // checkSleep
// //
checkSleep.Dock = DockStyle.Fill; checkSleep.Dock = DockStyle.Fill;
checkSleep.Location = new Point(4, 135); checkSleep.Location = new Point(4, 125);
checkSleep.Margin = new Padding(4, 2, 4, 2); checkSleep.Margin = new Padding(4, 0, 4, 0);
checkSleep.Name = "checkSleep"; checkSleep.Name = "checkSleep";
checkSleep.Padding = new Padding(15, 2, 6, 2); checkSleep.Padding = new Padding(15, 2, 6, 2);
checkSleep.Size = new Size(231, 41); checkSleep.Size = new Size(231, 41);
@@ -599,8 +603,8 @@ namespace GHelper
// checkShutdown // checkShutdown
// //
checkShutdown.Dock = DockStyle.Fill; checkShutdown.Dock = DockStyle.Fill;
checkShutdown.Location = new Point(4, 180); checkShutdown.Location = new Point(4, 166);
checkShutdown.Margin = new Padding(4, 2, 4, 2); checkShutdown.Margin = new Padding(4, 0, 4, 0);
checkShutdown.Name = "checkShutdown"; checkShutdown.Name = "checkShutdown";
checkShutdown.Padding = new Padding(15, 2, 6, 2); checkShutdown.Padding = new Padding(15, 2, 6, 2);
checkShutdown.Size = new Size(231, 41); checkShutdown.Size = new Size(231, 41);
@@ -623,8 +627,8 @@ namespace GHelper
// checkAwakeLogo // checkAwakeLogo
// //
checkAwakeLogo.Dock = DockStyle.Fill; checkAwakeLogo.Dock = DockStyle.Fill;
checkAwakeLogo.Location = new Point(243, 45); checkAwakeLogo.Location = new Point(243, 43);
checkAwakeLogo.Margin = new Padding(4, 2, 4, 2); checkAwakeLogo.Margin = new Padding(4, 0, 4, 0);
checkAwakeLogo.Name = "checkAwakeLogo"; checkAwakeLogo.Name = "checkAwakeLogo";
checkAwakeLogo.Padding = new Padding(15, 2, 6, 2); checkAwakeLogo.Padding = new Padding(15, 2, 6, 2);
checkAwakeLogo.Size = new Size(231, 41); checkAwakeLogo.Size = new Size(231, 41);
@@ -635,8 +639,8 @@ namespace GHelper
// checkBootLogo // checkBootLogo
// //
checkBootLogo.Dock = DockStyle.Fill; checkBootLogo.Dock = DockStyle.Fill;
checkBootLogo.Location = new Point(243, 90); checkBootLogo.Location = new Point(243, 84);
checkBootLogo.Margin = new Padding(4, 2, 4, 2); checkBootLogo.Margin = new Padding(4, 0, 4, 0);
checkBootLogo.Name = "checkBootLogo"; checkBootLogo.Name = "checkBootLogo";
checkBootLogo.Padding = new Padding(15, 2, 6, 2); checkBootLogo.Padding = new Padding(15, 2, 6, 2);
checkBootLogo.Size = new Size(231, 41); checkBootLogo.Size = new Size(231, 41);
@@ -647,8 +651,8 @@ namespace GHelper
// checkSleepLogo // checkSleepLogo
// //
checkSleepLogo.Dock = DockStyle.Fill; checkSleepLogo.Dock = DockStyle.Fill;
checkSleepLogo.Location = new Point(243, 135); checkSleepLogo.Location = new Point(243, 125);
checkSleepLogo.Margin = new Padding(4, 2, 4, 2); checkSleepLogo.Margin = new Padding(4, 0, 4, 0);
checkSleepLogo.Name = "checkSleepLogo"; checkSleepLogo.Name = "checkSleepLogo";
checkSleepLogo.Padding = new Padding(15, 2, 6, 2); checkSleepLogo.Padding = new Padding(15, 2, 6, 2);
checkSleepLogo.Size = new Size(231, 41); checkSleepLogo.Size = new Size(231, 41);
@@ -659,8 +663,8 @@ namespace GHelper
// checkShutdownLogo // checkShutdownLogo
// //
checkShutdownLogo.Dock = DockStyle.Fill; checkShutdownLogo.Dock = DockStyle.Fill;
checkShutdownLogo.Location = new Point(243, 180); checkShutdownLogo.Location = new Point(243, 166);
checkShutdownLogo.Margin = new Padding(4, 2, 4, 2); checkShutdownLogo.Margin = new Padding(4, 0, 4, 0);
checkShutdownLogo.Name = "checkShutdownLogo"; checkShutdownLogo.Name = "checkShutdownLogo";
checkShutdownLogo.Padding = new Padding(15, 2, 6, 2); checkShutdownLogo.Padding = new Padding(15, 2, 6, 2);
checkShutdownLogo.Size = new Size(231, 41); checkShutdownLogo.Size = new Size(231, 41);
@@ -683,8 +687,8 @@ namespace GHelper
// checkAwakeBar // checkAwakeBar
// //
checkAwakeBar.Dock = DockStyle.Fill; checkAwakeBar.Dock = DockStyle.Fill;
checkAwakeBar.Location = new Point(482, 45); checkAwakeBar.Location = new Point(482, 43);
checkAwakeBar.Margin = new Padding(4, 2, 4, 2); checkAwakeBar.Margin = new Padding(4, 0, 4, 0);
checkAwakeBar.Name = "checkAwakeBar"; checkAwakeBar.Name = "checkAwakeBar";
checkAwakeBar.Padding = new Padding(15, 2, 6, 2); checkAwakeBar.Padding = new Padding(15, 2, 6, 2);
checkAwakeBar.Size = new Size(231, 41); checkAwakeBar.Size = new Size(231, 41);
@@ -695,8 +699,8 @@ namespace GHelper
// checkBootBar // checkBootBar
// //
checkBootBar.Dock = DockStyle.Fill; checkBootBar.Dock = DockStyle.Fill;
checkBootBar.Location = new Point(482, 90); checkBootBar.Location = new Point(482, 84);
checkBootBar.Margin = new Padding(4, 2, 4, 2); checkBootBar.Margin = new Padding(4, 0, 4, 0);
checkBootBar.Name = "checkBootBar"; checkBootBar.Name = "checkBootBar";
checkBootBar.Padding = new Padding(15, 2, 6, 2); checkBootBar.Padding = new Padding(15, 2, 6, 2);
checkBootBar.Size = new Size(231, 41); checkBootBar.Size = new Size(231, 41);
@@ -707,8 +711,8 @@ namespace GHelper
// checkSleepBar // checkSleepBar
// //
checkSleepBar.Dock = DockStyle.Fill; checkSleepBar.Dock = DockStyle.Fill;
checkSleepBar.Location = new Point(482, 135); checkSleepBar.Location = new Point(482, 125);
checkSleepBar.Margin = new Padding(4, 2, 4, 2); checkSleepBar.Margin = new Padding(4, 0, 4, 0);
checkSleepBar.Name = "checkSleepBar"; checkSleepBar.Name = "checkSleepBar";
checkSleepBar.Padding = new Padding(15, 2, 6, 2); checkSleepBar.Padding = new Padding(15, 2, 6, 2);
checkSleepBar.Size = new Size(231, 41); checkSleepBar.Size = new Size(231, 41);
@@ -719,8 +723,8 @@ namespace GHelper
// checkShutdownBar // checkShutdownBar
// //
checkShutdownBar.Dock = DockStyle.Fill; checkShutdownBar.Dock = DockStyle.Fill;
checkShutdownBar.Location = new Point(482, 180); checkShutdownBar.Location = new Point(482, 166);
checkShutdownBar.Margin = new Padding(4, 2, 4, 2); checkShutdownBar.Margin = new Padding(4, 0, 4, 0);
checkShutdownBar.Name = "checkShutdownBar"; checkShutdownBar.Name = "checkShutdownBar";
checkShutdownBar.Padding = new Padding(15, 2, 6, 2); checkShutdownBar.Padding = new Padding(15, 2, 6, 2);
checkShutdownBar.Size = new Size(231, 41); checkShutdownBar.Size = new Size(231, 41);
@@ -743,8 +747,8 @@ namespace GHelper
// checkAwakeLid // checkAwakeLid
// //
checkAwakeLid.Dock = DockStyle.Fill; checkAwakeLid.Dock = DockStyle.Fill;
checkAwakeLid.Location = new Point(721, 45); checkAwakeLid.Location = new Point(721, 43);
checkAwakeLid.Margin = new Padding(4, 2, 4, 2); checkAwakeLid.Margin = new Padding(4, 0, 4, 0);
checkAwakeLid.Name = "checkAwakeLid"; checkAwakeLid.Name = "checkAwakeLid";
checkAwakeLid.Padding = new Padding(15, 2, 6, 2); checkAwakeLid.Padding = new Padding(15, 2, 6, 2);
checkAwakeLid.Size = new Size(233, 41); checkAwakeLid.Size = new Size(233, 41);
@@ -755,8 +759,8 @@ namespace GHelper
// checkBootLid // checkBootLid
// //
checkBootLid.Dock = DockStyle.Fill; checkBootLid.Dock = DockStyle.Fill;
checkBootLid.Location = new Point(721, 90); checkBootLid.Location = new Point(721, 84);
checkBootLid.Margin = new Padding(4, 2, 4, 2); checkBootLid.Margin = new Padding(4, 0, 4, 0);
checkBootLid.Name = "checkBootLid"; checkBootLid.Name = "checkBootLid";
checkBootLid.Padding = new Padding(15, 2, 6, 2); checkBootLid.Padding = new Padding(15, 2, 6, 2);
checkBootLid.Size = new Size(233, 41); checkBootLid.Size = new Size(233, 41);
@@ -767,8 +771,8 @@ namespace GHelper
// checkSleepLid // checkSleepLid
// //
checkSleepLid.Dock = DockStyle.Fill; checkSleepLid.Dock = DockStyle.Fill;
checkSleepLid.Location = new Point(721, 135); checkSleepLid.Location = new Point(721, 125);
checkSleepLid.Margin = new Padding(4, 2, 4, 2); checkSleepLid.Margin = new Padding(4, 0, 4, 0);
checkSleepLid.Name = "checkSleepLid"; checkSleepLid.Name = "checkSleepLid";
checkSleepLid.Padding = new Padding(15, 2, 6, 2); checkSleepLid.Padding = new Padding(15, 2, 6, 2);
checkSleepLid.Size = new Size(233, 41); checkSleepLid.Size = new Size(233, 41);
@@ -779,8 +783,8 @@ namespace GHelper
// checkShutdownLid // checkShutdownLid
// //
checkShutdownLid.Dock = DockStyle.Fill; checkShutdownLid.Dock = DockStyle.Fill;
checkShutdownLid.Location = new Point(721, 180); checkShutdownLid.Location = new Point(721, 166);
checkShutdownLid.Margin = new Padding(4, 2, 4, 2); checkShutdownLid.Margin = new Padding(4, 0, 4, 0);
checkShutdownLid.Name = "checkShutdownLid"; checkShutdownLid.Name = "checkShutdownLid";
checkShutdownLid.Padding = new Padding(15, 2, 6, 2); checkShutdownLid.Padding = new Padding(15, 2, 6, 2);
checkShutdownLid.Size = new Size(233, 41); checkShutdownLid.Size = new Size(233, 41);
@@ -800,7 +804,7 @@ namespace GHelper
groupOther.Controls.Add(checkGpuApps); groupOther.Controls.Add(checkGpuApps);
groupOther.Controls.Add(checkFnLock); groupOther.Controls.Add(checkFnLock);
groupOther.Dock = DockStyle.Top; groupOther.Dock = DockStyle.Top;
groupOther.Location = new Point(9, 908); groupOther.Location = new Point(9, 880);
groupOther.Margin = new Padding(4, 2, 4, 2); groupOther.Margin = new Padding(4, 2, 4, 2);
groupOther.Name = "groupOther"; groupOther.Name = "groupOther";
groupOther.Padding = new Padding(20, 2, 4, 10); groupOther.Padding = new Padding(20, 2, 4, 10);
@@ -894,13 +898,51 @@ namespace GHelper
checkFnLock.Text = "Process Fn+F hotkeys without Fn"; checkFnLock.Text = "Process Fn+F hotkeys without Fn";
checkFnLock.UseVisualStyleBackColor = true; checkFnLock.UseVisualStyleBackColor = true;
// //
// panelServices
//
panelServices.Controls.Add(labelServices);
panelServices.Controls.Add(buttonServices);
panelServices.Dock = DockStyle.Top;
panelServices.Location = new Point(9, 1176);
panelServices.Name = "panelServices";
panelServices.Size = new Size(966, 72);
panelServices.TabIndex = 3;
//
// labelServices
//
labelServices.AutoSize = true;
labelServices.Font = new Font("Segoe UI", 9F, FontStyle.Bold, GraphicsUnit.Point);
labelServices.Location = new Point(23, 19);
labelServices.Name = "labelServices";
labelServices.Size = new Size(273, 32);
labelServices.TabIndex = 20;
labelServices.Text = "Asus Services Running";
//
// buttonServices
//
buttonServices.Activated = false;
buttonServices.Anchor = AnchorStyles.Bottom | AnchorStyles.Left;
buttonServices.BackColor = SystemColors.ControlLight;
buttonServices.BorderColor = Color.Transparent;
buttonServices.BorderRadius = 2;
buttonServices.FlatStyle = FlatStyle.Flat;
buttonServices.Location = new Point(695, 14);
buttonServices.Margin = new Padding(4, 2, 4, 2);
buttonServices.Name = "buttonServices";
buttonServices.Secondary = true;
buttonServices.Size = new Size(250, 44);
buttonServices.TabIndex = 19;
buttonServices.Text = "Start Services";
buttonServices.UseVisualStyleBackColor = false;
//
// Extra // Extra
// //
AutoScaleDimensions = new SizeF(13F, 32F); AutoScaleDimensions = new SizeF(13F, 32F);
AutoScaleMode = AutoScaleMode.Font; AutoScaleMode = AutoScaleMode.Font;
AutoSize = true; AutoSize = true;
AutoSizeMode = AutoSizeMode.GrowAndShrink; AutoSizeMode = AutoSizeMode.GrowAndShrink;
ClientSize = new Size(984, 1244); ClientSize = new Size(984, 1262);
Controls.Add(panelServices);
Controls.Add(groupOther); Controls.Add(groupOther);
Controls.Add(groupLight); Controls.Add(groupLight);
Controls.Add(groupBindings); Controls.Add(groupBindings);
@@ -931,6 +973,8 @@ namespace GHelper
tableBacklight.ResumeLayout(false); tableBacklight.ResumeLayout(false);
groupOther.ResumeLayout(false); groupOther.ResumeLayout(false);
groupOther.PerformLayout(); groupOther.PerformLayout();
panelServices.ResumeLayout(false);
panelServices.PerformLayout();
ResumeLayout(false); ResumeLayout(false);
PerformLayout(); PerformLayout();
} }
@@ -999,5 +1043,8 @@ namespace GHelper
private RComboBox comboFNC; private RComboBox comboFNC;
private TextBox textFNC; private TextBox textFNC;
private CheckBox checkVariBright; private CheckBox checkVariBright;
private Panel panelServices;
private RButton buttonServices;
private Label labelServices;
} }
} }

View File

@@ -1,6 +1,5 @@
using CustomControls; using CustomControls;
using GHelper.Gpu; using GHelper.Gpu;
using Microsoft.VisualBasic.Devices;
using System.Diagnostics; using System.Diagnostics;
namespace GHelper namespace GHelper
@@ -231,7 +230,61 @@ namespace GHelper
pictureHelp.Click += PictureHelp_Click; pictureHelp.Click += PictureHelp_Click;
buttonServices.Click += ButtonServices_Click;
InitVariBright(); InitVariBright();
InitServices();
}
private void InitServices()
{
if (OptimizationService.IsRunning()) buttonServices.Text = Properties.Strings.Stop;
else buttonServices.Text = Properties.Strings.Start;
labelServices.Text = Properties.Strings.AsusServicesRunning + ": " + OptimizationService.GetRunningCount();
buttonServices.Enabled = true;
Program.inputDispatcher.Init();
}
public void ServiesToggle()
{
buttonServices.Enabled = false;
if (OptimizationService.IsRunning())
{
labelServices.Text = Properties.Strings.StoppingServices + " ...";
Task.Run(() =>
{
OptimizationService.StopAsusServices();
BeginInvoke(delegate
{
InitServices();
});
});
}
else
{
labelServices.Text = Properties.Strings.StartingServices + " ...";
Task.Run(() =>
{
OptimizationService.StartAsusServices();
BeginInvoke(delegate
{
InitServices();
});
});
}
}
private void ButtonServices_Click(object? sender, EventArgs e)
{
if (ProcessHelper.IsUserAdministrator())
ServiesToggle();
else
ProcessHelper.RunAsAdmin("services");
} }
private void InitVariBright() private void InitVariBright()

View File

@@ -16,7 +16,7 @@
<PlatformTarget>AnyCPU</PlatformTarget> <PlatformTarget>AnyCPU</PlatformTarget>
<ProduceReferenceAssembly>False</ProduceReferenceAssembly> <ProduceReferenceAssembly>False</ProduceReferenceAssembly>
<AllowUnsafeBlocks>True</AllowUnsafeBlocks> <AllowUnsafeBlocks>True</AllowUnsafeBlocks>
<AssemblyVersion>0.80</AssemblyVersion> <AssemblyVersion>0.81</AssemblyVersion>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">

View File

@@ -91,43 +91,6 @@ public class NvidiaGpuControl : IGpuControl
} }
private static void RunCMD(string name, string args)
{
var cmd = new Process();
cmd.StartInfo.UseShellExecute = false;
cmd.StartInfo.CreateNoWindow = true;
cmd.StartInfo.RedirectStandardOutput = true;
cmd.StartInfo.WindowStyle = ProcessWindowStyle.Hidden;
cmd.StartInfo.FileName = name;
cmd.StartInfo.Arguments = args;
cmd.Start();
Logger.WriteLine(cmd.StandardOutput.ReadToEnd());
cmd.WaitForExit();
}
public bool RestartGPUPnP()
{
if (!IsValid) return false;
try
{
PhysicalGPU internalGpu = _internalGpu!;
var pnpDeviceId = internalGpu.BusInformation.PCIIdentifiers.ToString();
Logger.WriteLine("Device ID:" + pnpDeviceId);
RunCMD("pnputil", $"/disable-device /deviceid \"{pnpDeviceId}\"");
Thread.Sleep(3000);
RunCMD("pnputil", $"/enable-device /deviceid \"{pnpDeviceId}\"");
Thread.Sleep(2000);
return true;
}
catch (Exception ex)
{
Logger.WriteLine(ex.ToString());
return false;
}
}
public bool RestartGPU() public bool RestartGPU()
{ {
@@ -135,7 +98,7 @@ public class NvidiaGpuControl : IGpuControl
{ {
string script = @"$device = Get-PnpDevice | Where-Object { $_.FriendlyName -imatch 'NVIDIA' -and $_.Class -eq 'Display' }; Disable-PnpDevice $device.InstanceId -Confirm:$false; Start-Sleep -Seconds 3; Enable-PnpDevice $device.InstanceId -Confirm:$false"; string script = @"$device = Get-PnpDevice | Where-Object { $_.FriendlyName -imatch 'NVIDIA' -and $_.Class -eq 'Display' }; Disable-PnpDevice $device.InstanceId -Confirm:$false; Start-Sleep -Seconds 3; Enable-PnpDevice $device.InstanceId -Confirm:$false";
Logger.WriteLine(script); Logger.WriteLine(script);
RunCMD("powershell", script); ProcessHelper.RunCMD("powershell", script);
//Thread.Sleep(2000); //Thread.Sleep(2000);
return true; return true;
} }

View File

@@ -1,13 +1,27 @@
using System.Text.RegularExpressions; using Microsoft.Win32;
using System.Text;
using System.Diagnostics; using System.Diagnostics;
using Microsoft.Win32; using System.Text;
using System.Text.RegularExpressions;
namespace GHelper namespace GHelper
{ {
public static class OptimizationService public static class OptimizationService
{ {
public static void SetChargeLimit (int newValue)
static List<string> services = new() {
"AsusAppService",
"ASUSLinkNear",
"ASUSLinkRemote",
"ASUSSoftwareManager",
"ASUSSwitch",
"ASUSSystemAnalysis",
"ASUSSystemDiagnosis",
"ArmouryCrateControlInterface",
"AsusCertService",
"ASUSOptimization"
};
public static void SetChargeLimit(int newValue)
{ {
// Set the path to the .ini file // Set the path to the .ini file
string path = @"C:\ProgramData\ASUS\ASUS System Control Interface\ASUSOptimization\Customization.ini"; string path = @"C:\ProgramData\ASUS\ASUS System Control Interface\ASUSOptimization\Customization.ini";
@@ -41,8 +55,18 @@ namespace GHelper
return (Process.GetProcessesByName("AsusOptimization").Count() > 0); return (Process.GetProcessesByName("AsusOptimization").Count() > 0);
} }
public static int GetRunningCount()
{
int count = 0;
foreach (string service in services)
{
if (Process.GetProcessesByName(service).Count() > 0) count++;
}
return count;
}
public static void SetBacklightOffDelay(int value = 60)
public static void SetBacklightOffDelay(int value = 60)
{ {
try try
{ {
@@ -60,6 +84,23 @@ namespace GHelper
} }
public static void StopAsusServices()
{
foreach (string service in services)
{
ProcessHelper.StopDisableService(service);
}
}
public static void StartAsusServices()
{
foreach (string service in services)
{
ProcessHelper.StartEnableService(service);
}
}
} }
} }

View File

@@ -92,6 +92,48 @@ namespace GHelper
} }
} }
public static void StopDisableService(string serviceName)
{
try
{
string script = $"Set-Service -Name \"{serviceName}\" -Status stopped -StartupType disabled";
Logger.WriteLine(script);
RunCMD("powershell", script);
}
catch (Exception ex)
{
Logger.WriteLine(ex.ToString());
}
}
public static void StartEnableService(string serviceName)
{
try
{
string script = $"Set-Service -Name \"{serviceName}\" -Status running -StartupType Automatic";
Logger.WriteLine(script);
RunCMD("powershell", script);
}
catch (Exception ex)
{
Logger.WriteLine(ex.ToString());
}
}
public static void RunCMD(string name, string args)
{
var cmd = new Process();
cmd.StartInfo.UseShellExecute = false;
cmd.StartInfo.CreateNoWindow = true;
cmd.StartInfo.RedirectStandardOutput = true;
cmd.StartInfo.WindowStyle = ProcessWindowStyle.Hidden;
cmd.StartInfo.FileName = name;
cmd.StartInfo.Arguments = args;
cmd.Start();
Logger.WriteLine(cmd.StandardOutput.ReadToEnd());
cmd.WaitForExit();
}
} }
} }

View File

@@ -3,6 +3,7 @@ using System.Diagnostics;
using System.Globalization; using System.Globalization;
using System.Reflection; using System.Reflection;
using System.Security.Principal; using System.Security.Principal;
using System.Windows.Forms;
using static NativeMethods; using static NativeMethods;
namespace GHelper namespace GHelper
@@ -188,6 +189,11 @@ namespace GHelper
case "gpurestart": case "gpurestart":
settingsForm.RestartGPU(false); settingsForm.RestartGPU(false);
break; break;
case "services":
settingsForm.keyb = new Extra();
settingsForm.keyb.Show();
settingsForm.keyb.ServiesToggle();
break;
} }
} }
} }

View File

@@ -177,6 +177,15 @@ namespace GHelper.Properties {
} }
} }
/// <summary>
/// Looks up a localized string similar to Asus Services Running.
/// </summary>
internal static string AsusServicesRunning {
get {
return ResourceManager.GetString("AsusServicesRunning", resourceCulture);
}
}
/// <summary> /// <summary>
/// Looks up a localized string similar to Breathe. /// Looks up a localized string similar to Breathe.
/// </summary> /// </summary>
@@ -1041,6 +1050,24 @@ namespace GHelper.Properties {
} }
} }
/// <summary>
/// Looks up a localized string similar to Start.
/// </summary>
internal static string Start {
get {
return ResourceManager.GetString("Start", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Starting Services.
/// </summary>
internal static string StartingServices {
get {
return ResourceManager.GetString("StartingServices", resourceCulture);
}
}
/// <summary> /// <summary>
/// Looks up a localized string similar to Startup Error. /// Looks up a localized string similar to Startup Error.
/// </summary> /// </summary>
@@ -1050,6 +1077,24 @@ namespace GHelper.Properties {
} }
} }
/// <summary>
/// Looks up a localized string similar to Stop.
/// </summary>
internal static string Stop {
get {
return ResourceManager.GetString("Stop", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Stopping Services.
/// </summary>
internal static string StoppingServices {
get {
return ResourceManager.GetString("StoppingServices", resourceCulture);
}
}
/// <summary> /// <summary>
/// Looks up a localized string similar to Toggle Aura. /// Looks up a localized string similar to Toggle Aura.
/// </summary> /// </summary>

View File

@@ -156,6 +156,9 @@
<data name="ApplyWindowsPowerPlan" xml:space="preserve"> <data name="ApplyWindowsPowerPlan" xml:space="preserve">
<value>Auto adjust Windows Power Modes</value> <value>Auto adjust Windows Power Modes</value>
</data> </data>
<data name="AsusServicesRunning" xml:space="preserve">
<value>Asus Services Running</value>
</data>
<data name="AuraBreathe" xml:space="preserve"> <data name="AuraBreathe" xml:space="preserve">
<value>Breathe</value> <value>Breathe</value>
</data> </data>
@@ -444,9 +447,21 @@
<data name="StandardMode" xml:space="preserve"> <data name="StandardMode" xml:space="preserve">
<value>Standard</value> <value>Standard</value>
</data> </data>
<data name="Start" xml:space="preserve">
<value>Start</value>
</data>
<data name="StartingServices" xml:space="preserve">
<value>Starting Services</value>
</data>
<data name="StartupError" xml:space="preserve"> <data name="StartupError" xml:space="preserve">
<value>Startup Error</value> <value>Startup Error</value>
</data> </data>
<data name="Stop" xml:space="preserve">
<value>Stop</value>
</data>
<data name="StoppingServices" xml:space="preserve">
<value>Stopping Services</value>
</data>
<data name="ToggleAura" xml:space="preserve"> <data name="ToggleAura" xml:space="preserve">
<value>Toggle Aura</value> <value>Toggle Aura</value>
</data> </data>