Attempt at fixing Issue 253 without breaking Issue 159 once more.
authormoel.mich
Tue, 17 Jul 2012 16:10:59 +0000
changeset 36425ef2c489ce8
parent 363 daa9590e1bee
child 365 a8a8ff22d959
Attempt at fixing Issue 253 without breaking Issue 159 once more.
Hardware/Ring0.cs
Properties/AssemblyVersion.cs
     1.1 --- a/Hardware/Ring0.cs	Sat Jul 14 19:24:04 2012 +0000
     1.2 +++ b/Hardware/Ring0.cs	Tue Jul 17 16:10:59 2012 +0000
     1.3 @@ -123,9 +123,8 @@
     1.4        driver.Open();
     1.5  
     1.6        if (!driver.IsOpen) {
     1.7 -        // driver is not loaded, try to reinstall and open
     1.8 +        // driver is not loaded, try to install and open
     1.9  
    1.10 -        driver.Delete();
    1.11          fileName = GetTempFileName();
    1.12          if (fileName != null && ExtractDriver(fileName)) {
    1.13            if (driver.Install(fileName)) {
    1.14 @@ -133,15 +132,28 @@
    1.15  
    1.16              if (!driver.IsOpen) {
    1.17                driver.Delete();
    1.18 -              report.AppendLine("Status: Opening driver failed");
    1.19 +              report.AppendLine("Status: Opening driver failed after install");
    1.20              }
    1.21            } else {
    1.22 -            report.AppendLine("Status: Installing driver \"" +
    1.23 -              fileName + "\" failed" +
    1.24 -              (File.Exists(fileName) ? " and file exists" : ""));
    1.25 -            report.AppendLine();
    1.26 -            report.Append("Exception: " + Marshal.GetExceptionForHR(
    1.27 -              Marshal.GetHRForLastWin32Error()).Message);
    1.28 +            // install failed, try to delete and reinstall
    1.29 +            driver.Delete();
    1.30 +
    1.31 +            if (driver.Install(fileName)) {
    1.32 +              driver.Open();
    1.33 +
    1.34 +              if (!driver.IsOpen) {
    1.35 +                driver.Delete();
    1.36 +                report.AppendLine(
    1.37 +                  "Status: Opening driver failed after reinstall");
    1.38 +              }
    1.39 +            } else {
    1.40 +              report.AppendLine("Status: Installing driver \"" +
    1.41 +                fileName + "\" failed" +
    1.42 +                (File.Exists(fileName) ? " and file exists" : ""));
    1.43 +              report.AppendLine();
    1.44 +              report.Append("Exception: " + Marshal.GetExceptionForHR(
    1.45 +                Marshal.GetHRForLastWin32Error()).Message);
    1.46 +            }
    1.47            }
    1.48          } else {
    1.49            report.AppendLine("Status: Extracting driver failed");
     2.1 --- a/Properties/AssemblyVersion.cs	Sat Jul 14 19:24:04 2012 +0000
     2.2 +++ b/Properties/AssemblyVersion.cs	Tue Jul 17 16:10:59 2012 +0000
     2.3 @@ -10,5 +10,5 @@
     2.4  
     2.5  using System.Reflection;
     2.6  
     2.7 -[assembly: AssemblyVersion("0.4.0.16")]
     2.8 -[assembly: AssemblyInformationalVersion("0.4.0.16 Alpha")]
     2.9 \ No newline at end of file
    2.10 +[assembly: AssemblyVersion("0.4.0.17")]
    2.11 +[assembly: AssemblyInformationalVersion("0.4.0.17 Alpha")]
    2.12 \ No newline at end of file