mirror of
https://github.com/openhardwaremonitor/openhardwaremonitor
synced 2025-08-29 13:28:04 +00:00
Added code to delete any kernel driver service that can't be opened before reinstalling it.
This commit is contained in:
parent
d1a963aa55
commit
46e4752c8f
@ -112,7 +112,9 @@ namespace OpenHardwareMonitor.Hardware {
|
||||
driver.Open();
|
||||
|
||||
if (!driver.IsOpen) {
|
||||
// driver is not loaded, try to install and open
|
||||
// driver is not loaded, try to reinstall and open
|
||||
|
||||
driver.Delete();
|
||||
string fileName = Path.GetTempFileName();
|
||||
if (ExtractDriver(fileName)) {
|
||||
if (driver.Install(fileName)) {
|
||||
@ -124,7 +126,9 @@ namespace OpenHardwareMonitor.Hardware {
|
||||
report.AppendLine("Status: Opening driver failed");
|
||||
}
|
||||
} else {
|
||||
report.AppendLine("Status: Installing driver failed");
|
||||
report.AppendLine("Status: Installing driver \"" +
|
||||
fileName + "\" failed" +
|
||||
(File.Exists(fileName) ? " and file exists" : ""));
|
||||
report.AppendLine();
|
||||
report.Append("Exception: " + Marshal.GetExceptionForHR(
|
||||
Marshal.GetHRForLastWin32Error()).Message);
|
||||
|
@ -16,7 +16,7 @@
|
||||
|
||||
The Initial Developer of the Original Code is
|
||||
Michael Möller <m.moeller@gmx.ch>.
|
||||
Portions created by the Initial Developer are Copyright (C) 2009-2010
|
||||
Portions created by the Initial Developer are Copyright (C) 2009-2011
|
||||
the Initial Developer. All Rights Reserved.
|
||||
|
||||
Contributor(s):
|
||||
@ -37,5 +37,5 @@
|
||||
|
||||
using System.Reflection;
|
||||
|
||||
[assembly: AssemblyVersion("0.2.1.12")]
|
||||
[assembly: AssemblyInformationalVersion("0.2.1.12 Alpha")]
|
||||
[assembly: AssemblyVersion("0.2.1.13")]
|
||||
[assembly: AssemblyInformationalVersion("0.2.1.13 Alpha")]
|
Loading…
x
Reference in New Issue
Block a user