11using  System . ComponentModel ; 
22using  System . Threading . Tasks ; 
3+ using  System . Windows ; 
34using  AuroraRgb . Modules . HardwareMonitor ; 
45using  AuroraRgb . Nodes ; 
56using  AuroraRgb . Utils ; 
@@ -9,6 +10,8 @@ namespace AuroraRgb.Modules;
910
1011public  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 ; 
0 commit comments