Skip to content

Commit 8bacc51

Browse files
author
Aytackydln
committed
make a prompt for automatic unsecure driver uninstall
1 parent c115228 commit 8bacc51

File tree

2 files changed

+22
-4
lines changed

2 files changed

+22
-4
lines changed

Project-Aurora/Project-Aurora/Modules/HardwareMonitorModule.cs

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
using System.ComponentModel;
22
using System.Threading.Tasks;
3+
using System.Windows;
34
using AuroraRgb.Modules.HardwareMonitor;
45
using AuroraRgb.Nodes;
56
using AuroraRgb.Utils;
@@ -9,6 +10,8 @@ namespace AuroraRgb.Modules;
910

1011
public sealed class HardwareMonitorModule : AuroraModule
1112
{
13+
private const string PromptMessage = "Would you like Aurora to automatically uninstall unsecure drivers?\n(inputx64 and WinRing0)";
14+
1215
protected override Task Initialize()
1316
{
1417
Global.Configuration.PropertyChanged += ConfigurationOnPropertyChanged;
@@ -17,14 +20,28 @@ protected override Task Initialize()
1720
LocalPcInformation.HardwareMonitor = new HardwareMonitor.HardwareMonitor();
1821
}
1922

20-
if (!Global.Configuration.EnableAmdCpuMonitor)
23+
if (Global.Configuration.AutoRemoveUnsecureDrivers is null)
2124
{
22-
UnsecureDrivers.DeleteDriver(UnsecureDrivers.InpOutDriverName, true);
25+
var result = MessageBox.Show(PromptMessage, "AuroraRgb", MessageBoxButton.YesNo);
26+
Global.Configuration.AutoInstallGsi = result switch
27+
{
28+
MessageBoxResult.Yes => true,
29+
MessageBoxResult.No => false,
30+
_ => true,
31+
};
2332
}
2433

25-
if (!Global.Configuration.EnableWinRing0Monitor)
34+
if(Global.Configuration.AutoRemoveUnsecureDrivers ?? true)
2635
{
27-
UnsecureDrivers.DeleteDriver(UnsecureDrivers.WinRing0DriverName, true);
36+
if (!Global.Configuration.EnableAmdCpuMonitor)
37+
{
38+
UnsecureDrivers.DeleteDriver(UnsecureDrivers.InpOutDriverName, true);
39+
}
40+
41+
if (!Global.Configuration.EnableWinRing0Monitor)
42+
{
43+
UnsecureDrivers.DeleteDriver(UnsecureDrivers.WinRing0DriverName, true);
44+
}
2845
}
2946

3047
return Task.CompletedTask;

Project-Aurora/Project-Aurora/Settings/Configuration.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,7 @@ public class Configuration : INotifyPropertyChanged, IAuroraConfig
211211
public IList<string> Migrations { get; set; } = [];
212212

213213
public bool? AutoInstallGsi { get; set; }
214+
public bool? AutoRemoveUnsecureDrivers { get; set; }
214215

215216
/// <summary>
216217
/// Called after the configuration file has been deserialized or created for the first time.

0 commit comments

Comments
 (0)