Compare commits

..

4 Commits
v0.78 ... v0.79

Author SHA1 Message Date
Serge
678f4b0eb7 UI tweaks 2023-06-05 22:32:50 +02:00
Serge
4bbfbd0382 Driver Updates 2023-06-05 17:31:59 +02:00
Serge
4c8291c74b S15 fix 2023-06-05 11:49:56 +02:00
Serge
e9060ad8c0 Update README.md 2023-06-04 23:29:42 +02:00
17 changed files with 1094 additions and 318 deletions

View File

@@ -61,8 +61,25 @@ public static class AppConfig
GetModel();
return (_model is not null && _model.ToLower().Contains(contains.ToLower()));
}
public static string GetModelShort()
{
GetModel();
if (_model is not null)
{
int trim = _model.LastIndexOf("_");
if (trim > 0) return _model.Substring(trim+1);
trim = _model.LastIndexOf(" ");
if (trim > 0) return _model.Substring(trim + 1);
return _model;
}
return "";
}
private static void initConfig()
{
config = new Dictionary<string, object>();

View File

@@ -1,5 +1,4 @@
using GHelper;
using System.Management;
using System.Management;
using System.Runtime.InteropServices;
public enum AsusFan
@@ -93,6 +92,7 @@ public class AsusACPI
public const int PerformanceBalanced = 0;
public const int PerformanceTurbo = 1;
public const int PerformanceSilent = 2;
public const int PerformanceManual = 4;
public const int GPUModeEco = 0;
public const int GPUModeStandard = 1;
@@ -420,6 +420,24 @@ public class AsusACPI
return DeviceGet(PPT_CPUB0) >= 0 && DeviceGet(PPT_GPUC0) < 0;
}
public void ScanRange()
{
int value;
string appPath = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\GHelper";
string logFile = appPath + "\\scan.txt";
for (uint i = 0x00000000; i <= 0x00160000; i++)
{
value = DeviceGet(i);
if (value >= 0)
using (StreamWriter w = File.AppendText(logFile))
{
w.WriteLine(i.ToString("X8") + ": " + value.ToString("X4") + " (" + value + ")");
w.Close();
}
}
}
public void TUFKeyboardBrightness(int brightness)
{
int param = 0x80 | (brightness & 0x7F);

View File

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

View File

@@ -187,7 +187,11 @@ public class AmdGpuControl : IGpuControl
}
}
foreach (string kill in appNames) ProcessHelper.KillByName(kill);
List<string> immune = new() { "svchost", "system", "ntoskrnl", "csrss", "winlogon", "wininit", "smss" };
foreach (string kill in appNames)
if (!immune.Contains(kill.ToLower()))
ProcessHelper.KillByName(kill);
}

View File

@@ -126,6 +126,9 @@ namespace GHelper
if (settingsForm.keyb is not null && settingsForm.keyb.Text != "")
settingsForm.keyb.InitTheme();
if (settingsForm.updates is not null && settingsForm.updates.Text != "")
settingsForm.updates.InitTheme();
break;
}
}

View File

@@ -350,6 +350,16 @@ namespace GHelper.Properties {
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap icons8_software_48 {
get {
object obj = ResourceManager.GetObject("icons8-software-48", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>

View File

@@ -118,6 +118,9 @@
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="brightness_up" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\brightness-up.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="icons8-leaf-96" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\icons8-leaf-96.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
@@ -133,11 +136,17 @@
<data name="icons8-fiat-500-48" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\icons8-fiat-500-48.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="icons8_microphone_96" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\icons8-microphone-96.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="icons8-rocket-48" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\icons8-rocket-48.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="icons8-bicycle-48 (1)" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\icons8-bicycle-48 (1).png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="icons8-game-controller-48" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\icons8-game-controller-48.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
<data name="icons8_touchpad_96" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\icons8-touchpad-96.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="icons8-fan-head-96" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\icons8-fan-head-96.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
@@ -145,8 +154,8 @@
<data name="icons8-processor-96" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\icons8-processor-96.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="icons8-spa-flower-48" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\icons8-spa-flower-48.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
<data name="icons8-game-controller-48" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\icons8-game-controller-48.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="icons8-spa-flower-96" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\icons8-spa-flower-96.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
@@ -157,9 +166,15 @@
<data name="icons8-keyboard-48" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\icons8-keyboard-48.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="brightness_down" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\brightness-down.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="icons8-fan-speed-48" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\icons8-fan-speed-48.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="icons8-help-64" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\icons8-help-64.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="icons8-speed-96" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\icons8-speed-96.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
@@ -169,12 +184,24 @@
<data name="icons8-laptop-48" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\icons8-laptop-48.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="icons8-project-management-48 (1)" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\icons8-project-management-48 (1).png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="icons8-video-card-48" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\icons8-video-card-48.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="backlight_up" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\backlight-up.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="icons8-spa-flower-48" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\icons8-spa-flower-48.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="icons8-organic-food-961" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\icons8-organic-food-961.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="icons8_function" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\icons8-function-mac-96.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="icons8-balance-symbol-96" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\icons8-balance-symbol-96.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
@@ -184,55 +211,31 @@
<data name="icons8-matrix-desktop-48" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\icons8-matrix-desktop-48.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="icons8_mute_unmute_96" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\icons8-mute-unmute-96.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="icons8-xbox-controller-96" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\icons8-xbox-controller-96.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="icons8-project-management-48" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\icons8-project-management-48.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="icons8_video_48" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\icons8-video-48.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="icons8-leaf-48" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\icons8-leaf-48.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="ultimate" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\ultimate.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="icons8-rocket-48" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\icons8-rocket-48.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
<data name="backlight_down" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\backlight-down.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="icons8-speed-48" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\icons8-speed-48.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="icons8-help-64" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\icons8-help-64.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="icons8_video_48" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\icons8-video-48.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="icons8-project-management-48 (1)" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\icons8-project-management-48 (1).png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="icons8_microphone_96" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\icons8-microphone-96.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="icons8_touchpad_96" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\icons8-touchpad-96.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="backlight_down" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\backlight-down.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="backlight_up" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\backlight-up.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="brightness_down" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\brightness-down.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="brightness_up" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\brightness-up.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="icons8_mute_unmute_96" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\icons8-mute-unmute-96.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="icons8_function" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\icons8-function-mac-96.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
<data name="icons8-software-48" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\icons8-software-48.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
</root>

View File

@@ -312,6 +312,15 @@ namespace GHelper.Properties {
}
}
/// <summary>
/// Looks up a localized string similar to BIOS and Driver Updates.
/// </summary>
internal static string BiosAndDriverUpdates {
get {
return ResourceManager.GetString("BiosAndDriverUpdates", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Boot.
/// </summary>
@@ -393,6 +402,15 @@ namespace GHelper.Properties {
}
}
/// <summary>
/// Looks up a localized string similar to Drivers and Software.
/// </summary>
internal static string DriverAndSoftware {
get {
return ResourceManager.GetString("DriverAndSoftware", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Disables dGPU for battery savings.
/// </summary>
@@ -1095,6 +1113,15 @@ namespace GHelper.Properties {
}
}
/// <summary>
/// Looks up a localized string similar to Updates.
/// </summary>
internal static string Updates {
get {
return ResourceManager.GetString("Updates", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Version.
/// </summary>

View File

@@ -201,6 +201,9 @@
<data name="BatteryChargeLimit" xml:space="preserve">
<value>Battery Charge Limit</value>
</data>
<data name="BiosAndDriverUpdates" xml:space="preserve">
<value>BIOS and Driver Updates</value>
</data>
<data name="Boot" xml:space="preserve">
<value>Boot</value>
</data>
@@ -228,6 +231,9 @@
<data name="DownloadUpdate" xml:space="preserve">
<value>Download Update</value>
</data>
<data name="DriverAndSoftware" xml:space="preserve">
<value>Drivers and Software</value>
</data>
<data name="EcoGPUTooltip" xml:space="preserve">
<value>Disables dGPU for battery savings</value>
</data>
@@ -462,6 +468,9 @@
<data name="UltimateMode" xml:space="preserve">
<value>Ultimate</value>
</data>
<data name="Updates" xml:space="preserve">
<value>Updates</value>
</data>
<data name="VersionLabel" xml:space="preserve">
<value>Version</value>
</data>

Binary file not shown.

After

Width:  |  Height:  |  Size: 362 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 645 B

664
app/Settings.Designer.cs generated

File diff suppressed because it is too large Load Diff

View File

@@ -28,6 +28,7 @@ namespace GHelper
public AniMatrix matrix;
public Fans fans;
public Extra keyb;
public Updates updates;
static long lastRefresh;
@@ -71,6 +72,7 @@ namespace GHelper
buttonMatrix.Text = Properties.Strings.PictureGif;
buttonQuit.Text = Properties.Strings.Quit;
buttonUpdates.Text = Properties.Strings.Updates;
FormClosing += SettingsForm_FormClosing;
@@ -157,6 +159,8 @@ namespace GHelper
button120Hz.MouseMove += Button120Hz_MouseHover;
button120Hz.MouseLeave += ButtonScreen_MouseLeave;
buttonUpdates.Click += ButtonUpdates_Click;
sliderBattery.ValueChanged += SliderBattery_ValueChanged;
Program.trayIcon.MouseMove += TrayIcon_MouseMove;
@@ -184,6 +188,18 @@ namespace GHelper
}
private void ButtonUpdates_Click(object? sender, EventArgs e)
{
if (updates == null || updates.Text == "")
{
updates = new Updates();
updates.Show();
}
else
{
updates.Close();
}
}
protected override void WndProc(ref Message m)
{
@@ -1187,6 +1203,8 @@ namespace GHelper
bool applyPower = AppConfig.getConfigPerf("auto_apply_power") == 1;
bool applyGPU = true;
//if (applyPower) Program.acpi.DeviceSet(AsusACPI.PerformanceMode, AsusACPI.PerformanceManual, "CustomMode");
if (delay > 0)
{
var timer = new System.Timers.Timer(delay);
@@ -1474,7 +1492,7 @@ namespace GHelper
UltimateUI(mux == 1);
if (eco < 0)
if (eco < 0 && mux < 0)
{
isGpuSection = tableGPU.Visible = false;
SetContextMenu();

215
app/Updates.Designer.cs generated Normal file
View File

@@ -0,0 +1,215 @@
namespace GHelper
{
partial class Updates
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Updates));
tableBios = new TableLayoutPanel();
labelBIOS = new Label();
pictureBios = new PictureBox();
panelBiosTitle = new Panel();
panelBios = new Panel();
panelDrivers = new Panel();
tableDrivers = new TableLayoutPanel();
panelDriversTitle = new Panel();
labelDrivers = new Label();
pictureDrivers = new PictureBox();
((System.ComponentModel.ISupportInitialize)pictureBios).BeginInit();
panelBiosTitle.SuspendLayout();
panelBios.SuspendLayout();
panelDrivers.SuspendLayout();
panelDriversTitle.SuspendLayout();
((System.ComponentModel.ISupportInitialize)pictureDrivers).BeginInit();
SuspendLayout();
//
// tableBios
//
tableBios.AutoSize = true;
tableBios.AutoSizeMode = AutoSizeMode.GrowAndShrink;
tableBios.ColumnCount = 3;
tableBios.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 25F));
tableBios.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 50F));
tableBios.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 25F));
tableBios.Dock = DockStyle.Top;
tableBios.Location = new Point(10, 10);
tableBios.Margin = new Padding(2);
tableBios.MinimumSize = new Size(550, 0);
tableBios.Name = "tableBios";
tableBios.Size = new Size(608, 0);
tableBios.TabIndex = 0;
//
// labelBIOS
//
labelBIOS.AutoSize = true;
labelBIOS.Font = new Font("Segoe UI", 9F, FontStyle.Bold, GraphicsUnit.Point);
labelBIOS.Location = new Point(34, 14);
labelBIOS.Margin = new Padding(2, 0, 2, 0);
labelBIOS.Name = "labelBIOS";
labelBIOS.Size = new Size(35, 15);
labelBIOS.TabIndex = 1;
labelBIOS.Text = "BIOS";
//
// pictureBios
//
pictureBios.BackgroundImage = (Image)resources.GetObject("pictureBios.BackgroundImage");
pictureBios.BackgroundImageLayout = ImageLayout.Zoom;
pictureBios.Location = new Point(14, 14);
pictureBios.Margin = new Padding(2);
pictureBios.Name = "pictureBios";
pictureBios.Size = new Size(16, 16);
pictureBios.TabIndex = 2;
pictureBios.TabStop = false;
//
// panelBiosTitle
//
panelBiosTitle.Controls.Add(labelBIOS);
panelBiosTitle.Controls.Add(pictureBios);
panelBiosTitle.Dock = DockStyle.Top;
panelBiosTitle.Location = new Point(0, 0);
panelBiosTitle.Margin = new Padding(2);
panelBiosTitle.Name = "panelBiosTitle";
panelBiosTitle.Size = new Size(628, 31);
panelBiosTitle.TabIndex = 3;
//
// panelBios
//
panelBios.AutoSize = true;
panelBios.Controls.Add(tableBios);
panelBios.Dock = DockStyle.Top;
panelBios.Location = new Point(0, 31);
panelBios.Margin = new Padding(2);
panelBios.Name = "panelBios";
panelBios.Padding = new Padding(10);
panelBios.Size = new Size(628, 20);
panelBios.TabIndex = 4;
//
// panelDrivers
//
panelDrivers.AutoSize = true;
panelDrivers.Controls.Add(tableDrivers);
panelDrivers.Dock = DockStyle.Top;
panelDrivers.Location = new Point(0, 73);
panelDrivers.Margin = new Padding(2);
panelDrivers.Name = "panelDrivers";
panelDrivers.Padding = new Padding(10);
panelDrivers.Size = new Size(628, 20);
panelDrivers.TabIndex = 6;
//
// tableDrivers
//
tableDrivers.AutoSize = true;
tableDrivers.AutoSizeMode = AutoSizeMode.GrowAndShrink;
tableDrivers.ColumnCount = 3;
tableDrivers.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 25F));
tableDrivers.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 50F));
tableDrivers.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 25F));
tableDrivers.Dock = DockStyle.Top;
tableDrivers.Location = new Point(10, 10);
tableDrivers.Margin = new Padding(2);
tableDrivers.MinimumSize = new Size(550, 0);
tableDrivers.Name = "tableDrivers";
tableDrivers.Size = new Size(608, 0);
tableDrivers.TabIndex = 0;
//
// panelDriversTitle
//
panelDriversTitle.Controls.Add(labelDrivers);
panelDriversTitle.Controls.Add(pictureDrivers);
panelDriversTitle.Dock = DockStyle.Top;
panelDriversTitle.Location = new Point(0, 51);
panelDriversTitle.Margin = new Padding(2);
panelDriversTitle.Name = "panelDriversTitle";
panelDriversTitle.Size = new Size(628, 22);
panelDriversTitle.TabIndex = 5;
//
// labelDrivers
//
labelDrivers.AutoSize = true;
labelDrivers.Font = new Font("Segoe UI", 9F, FontStyle.Bold, GraphicsUnit.Point);
labelDrivers.Location = new Point(34, 4);
labelDrivers.Margin = new Padding(2, 0, 2, 0);
labelDrivers.Name = "labelDrivers";
labelDrivers.Size = new Size(126, 15);
labelDrivers.TabIndex = 1;
labelDrivers.Text = "Drivers and Software";
//
// pictureDrivers
//
pictureDrivers.BackgroundImage = (Image)resources.GetObject("pictureDrivers.BackgroundImage");
pictureDrivers.BackgroundImageLayout = ImageLayout.Zoom;
pictureDrivers.Location = new Point(14, 4);
pictureDrivers.Margin = new Padding(2);
pictureDrivers.Name = "pictureDrivers";
pictureDrivers.Size = new Size(16, 16);
pictureDrivers.TabIndex = 2;
pictureDrivers.TabStop = false;
//
// Updates
//
AutoScaleDimensions = new SizeF(96F, 96F);
AutoScaleMode = AutoScaleMode.Dpi;
AutoScroll = true;
ClientSize = new Size(628, 345);
Controls.Add(panelDrivers);
Controls.Add(panelDriversTitle);
Controls.Add(panelBios);
Controls.Add(panelBiosTitle);
Margin = new Padding(2);
MinimizeBox = false;
Name = "Updates";
ShowIcon = false;
ShowInTaskbar = false;
Text = "BIOS and Driver Updates";
((System.ComponentModel.ISupportInitialize)pictureBios).EndInit();
panelBiosTitle.ResumeLayout(false);
panelBiosTitle.PerformLayout();
panelBios.ResumeLayout(false);
panelBios.PerformLayout();
panelDrivers.ResumeLayout(false);
panelDrivers.PerformLayout();
panelDriversTitle.ResumeLayout(false);
panelDriversTitle.PerformLayout();
((System.ComponentModel.ISupportInitialize)pictureDrivers).EndInit();
ResumeLayout(false);
PerformLayout();
}
#endregion
private TableLayoutPanel tableBios;
private Label labelBIOS;
private PictureBox pictureBios;
private Panel panelBiosTitle;
private Panel panelBios;
private Panel panelDrivers;
private TableLayoutPanel tableDrivers;
private Panel panelDriversTitle;
private Label labelDrivers;
private PictureBox pictureDrivers;
}
}

185
app/Updates.cs Normal file
View File

@@ -0,0 +1,185 @@
using CustomControls;
using System.Diagnostics;
using System.Management;
using System.Text.Json;
namespace GHelper
{
public partial class Updates : RForm
{
//static int rowCount = 0;
static string model = AppConfig.GetModelShort();
public Updates()
{
InitializeComponent();
InitTheme();
Text = Properties.Strings.BiosAndDriverUpdates + ": " + model + " " + GetBiosVersion();
labelBIOS.Text = "BIOS";
labelDrivers.Text = Properties.Strings.DriverAndSoftware;
SuspendLayout();
tableBios.Visible = false;
tableDrivers.Visible = false;
Task.Run(async () =>
{
DriversAsync($"https://rog.asus.com/support/webapi/product/GetPDBIOS?website=global&model={model}&cpu=", 1, tableBios);
});
Task.Run(async () =>
{
DriversAsync($"https://rog.asus.com/support/webapi/product/GetPDDrivers?website=global&model={model}&osid=52", 0, tableDrivers);
});
Shown += Updates_Shown;
}
private void Updates_Shown(object? sender, EventArgs e)
{
Height = Program.settingsForm.Height;
Top = Program.settingsForm.Top;
Left = Program.settingsForm.Left - Width - 5;
}
private Dictionary<string, string> GetDeviceVersions()
{
ManagementObjectSearcher objSearcher = new ManagementObjectSearcher("Select * from Win32_PnPSignedDriver");
ManagementObjectCollection objCollection = objSearcher.Get();
Dictionary<string, string> list = new();
foreach (ManagementObject obj in objCollection)
{
if (obj["DeviceID"] is not null && obj["DriverVersion"] is not null)
list[obj["DeviceID"].ToString()] = obj["DriverVersion"].ToString();
}
return list;
}
private string GetBiosVersion()
{
ManagementObjectSearcher objSearcher = new ManagementObjectSearcher("SELECT * FROM Win32_BIOS");
ManagementObjectCollection objCollection = objSearcher.Get();
foreach (ManagementObject obj in objCollection)
if (obj["SMBIOSBIOSVersion"] is not null)
{
var bios = obj["SMBIOSBIOSVersion"].ToString();
int trim = bios.LastIndexOf(".");
if (trim > 0) return bios.Substring(trim + 1);
else return bios;
}
return "";
}
public async void DriversAsync(string url, int type, TableLayoutPanel table)
{
try
{
Dictionary<string, string> devices = new();
string biosVersion = "";
if (type == 0) devices = GetDeviceVersions();
else biosVersion = GetBiosVersion();
//Debug.WriteLine(biosVersion);
using (var httpClient = new HttpClient())
{
httpClient.DefaultRequestHeaders.Add("User-Agent", "C# App");
var json = await httpClient.GetStringAsync(url);
var data = JsonSerializer.Deserialize<JsonElement>(json);
var groups = data.GetProperty("Result").GetProperty("Obj");
List<string> skipList = new() { "Armoury Crate & Aura Creator Installer", "MyASUS", "ASUS Smart Display Control", "Aura Wallpaper" };
for (int i = 0; i < groups.GetArrayLength(); i++)
{
var categoryName = groups[i].GetProperty("Name").ToString();
var files = groups[i].GetProperty("Files");
var oldTitle = "";
for (int j = 0; j < files.GetArrayLength(); j++)
{
var file = files[j];
var title = file.GetProperty("Title").ToString();
var version = file.GetProperty("Version").ToString().Replace("V", "");
var downloadUrl = file.GetProperty("DownloadUrl").GetProperty("Global").ToString();
//Debug.WriteLine(" - " + title + " " + version + " " + downloadUrl);
if (oldTitle != title && !skipList.Contains(title))
{
JsonElement hardwares = file.GetProperty("HardwareInfoList");
bool newer = false;
if (type == 0 && hardwares.ToString().Length > 0)
for (int k = 0; k < hardwares.GetArrayLength(); k++)
{
var deviceID = hardwares[k].GetProperty("hardwareid").ToString();
var localVersion = devices.Where(p => p.Key.Contains(deviceID)).Select(p => p.Value).FirstOrDefault();
if (localVersion is not null)
{
newer = (new Version(version).CompareTo(new Version(localVersion)) > 0);
break;
}
}
if (type == 1)
{
newer = Int32.Parse(version) > Int32.Parse(biosVersion);
}
BeginInvoke(delegate
{
string versionText = version.Replace("latest version at the ", "");
Label versionLabel = new Label { Text = versionText, Anchor = AnchorStyles.Left, Dock = DockStyle.Fill, Height = 50 };
versionLabel.Cursor = Cursors.Hand;
versionLabel.Font = new Font(versionLabel.Font, newer ? FontStyle.Underline | FontStyle.Bold : FontStyle.Underline);
versionLabel.ForeColor = newer ? colorTurbo : colorEco;
versionLabel.Padding = new Padding(5, 5, 5, 5);
versionLabel.Click += delegate
{
Process.Start(new ProcessStartInfo(downloadUrl) { UseShellExecute = true });
};
table.RowStyles.Add(new RowStyle(SizeType.AutoSize));
table.Controls.Add(new Label { Text = categoryName, Anchor = AnchorStyles.Left, Dock = DockStyle.Fill, Padding = new Padding(5, 5, 5, 5) }, 0, table.RowCount);
table.Controls.Add(new Label { Text = title, Anchor = AnchorStyles.Left, Dock = DockStyle.Fill, Padding = new Padding(5, 5, 5, 5) }, 1, table.RowCount);
table.Controls.Add(versionLabel, 2, table.RowCount);
table.RowCount++;
});
}
oldTitle = title;
}
}
BeginInvoke(delegate
{
table.Visible = true;
ResumeLayout(false);
PerformLayout();
});
}
}
catch (Exception ex)
{
Debug.WriteLine(ex.ToString());
}
}
}
}

149
app/Updates.resx Normal file
View File

@@ -0,0 +1,149 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing"">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="pictureBios.BackgroundImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAL
DAAACwwBP0AiyAAAAWlJREFUaEPtmN1Kw0AQhVOkoo8q7ZUiguid9ULwZaS+g3jtnT6FCv4g2DOhA23I
LrvHzKTCfPBRkuFsT9JCyDZBEASBB7fwE960R9tcwze4aI+2sZhRfMHf9WeXDygz+exiMaOQxdQu3jOK
3ILes2ImcAYf4eaC3s7hFFaxB+9g34JjeA/3YTHHsG+hMT2BxbxADZ7C6p9wAA7gOdQeT7CYH6jBqp9u
YOS7tce3nChFQ+LYUF1SIXlCvsPBnpAFpLpkSYXk8S7nXtsjH1JdsqRCcuflIq7aIx9SXbJQISOoLlTI
CKoLFTKC6kKFjKC6UCEjqC5UyAiqCxUygupChYygulAhI6guVMgIqgsVMoLqQoWMoLr8+xeaZ6jBMzjG
RRzCC6g9ql4pL6EGd0XZaChG7vgubassYfW/QDa2juAD7FvUS9lc+/OuyOaCXbxnFLkFvWcU7Fa4xYxC
X+b7tlO8Z0EQBMFQNM0KZ46+F5QUhV4AAAAASUVORK5CYII=
</value>
</data>
<data name="pictureDrivers.BackgroundImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAL
DAAACwwBP0AiyAAAAnJJREFUaEPtmL1qlEEUhhdF8Acbo51/KGKRWhvBP7S0Ve9AvAQxuYwUFkkjioro
DdgogqJipxa2giIqamOiieZ5IQuH4ezOmf2+3R3ke+CBsLvnzJnZmfnOptfR0dHx33AYr+JtfI1f8PeG
+luv3UJ95hBWwWa8jE/xL/4Lqs8q5hJuwqlwDt+hV2CJb/AsToxteAO9Ypq4gFtxrOzBF+gVoG3xGOfw
JO7H7bgDj+Ip1HsvcdB2e4YzOBZU/FtMB13DRZzFKEfwDnoT0Zbaja2ibeOt/Ac8gaNyDN9jmvc5trqd
Bu35P6ibpAm78BGmuXUmWuE8psmtbUxiC3qTaHw76Z5Pr0ptGxVtX2vrm0i3k85Do+eEHlI2oQ6s9ryK
HcckjmN6sC/iyOhpaZPptumTTmIVr2FT7qId8wmOhHobuxr6O70q+5NQ8Rf0Qgvoik3HPYjFqOnqJ5F6
SHloEm2svOUV2rGvYDHqHG2S6xhlH97Hnxs+RD2No8yjHfsmFqP21yZRexBBxX9FGyu/od6LcAZtrL6R
YtTD2yQHMIJW3sZZ72EEfVs27jMWs4I2iRqzCNoyNs76AyPsRBu3jMX8QptE/VCEYRP4jhG0WDZOtRTz
CW2SvRhBB9bGWXXHR9BZsXEfsRj17TbJaYyg/asDa2OlzlR0EdJDrE64mCW0SUrueq2gDqz2vNTKR4sX
GsuOrVrC2MAazeIF1WQWL6gms3hBNZnFC6rJLF5QTWbxgmoyixdUk1m8oJrM4gXVZJZh3eS0DXWzD9AL
rkH9WMqibtL7SThtVZP+YxFCnWO/m/SSTVLVoJUPF9/R0dExKXq9dc3qWY2Pp0GbAAAAAElFTkSuQmCC
</value>
</data>
</root>

View File

@@ -199,7 +199,7 @@ App supports custom actions for M3, M4 and FN+F4 hotkeys. To set them select "Cu
2. To simulate any windows key - put appropriate keycode into "action" field, for example ``0x2C`` for Print screen.
Full list of keycodes https://learn.microsoft.com/en-us/windows/win32/inputdev/virtual-key-codes
![Screenshot 2023-04-13 172537](https://user-images.githubusercontent.com/5920850/231837470-df913847-cf8a-43e1-80b6-5eb6e9eaee4e.png)
![Screenshot 2023-06-04 232848](https://github.com/seerge/g-helper/assets/5920850/3db6f058-af2b-4220-9ac9-3b812ab09903)
### Workaround for [bugged bios on G15](https://github.com/seerge/g-helper/issues/253) when external monitor is connected