Fixed Issue 223.
authormoel.mich
Thu, 19 May 2011 07:22:06 +0000
changeset 29161c3d984fb2d
parent 290 22214a7e85a9
child 292 6b9c44598a5d
Fixed Issue 223.
GUI/MainForm.cs
Program.cs
     1.1 --- a/GUI/MainForm.cs	Wed May 18 19:58:57 2011 +0000
     1.2 +++ b/GUI/MainForm.cs	Thu May 19 07:22:06 2011 +0000
     1.3 @@ -40,6 +40,7 @@
     1.4  using System.ComponentModel;
     1.5  using System.Drawing;
     1.6  using System.IO;
     1.7 +using System.Reflection;
     1.8  using System.Windows.Forms;
     1.9  using Aga.Controls.Tree;
    1.10  using Aga.Controls.Tree.NodeControls;
    1.11 @@ -81,6 +82,15 @@
    1.12      public MainForm() {      
    1.13        InitializeComponent();
    1.14  
    1.15 +      // check if the OpenHardwareMonitorLib assembly has the correct version
    1.16 +      if (Assembly.GetAssembly(typeof(Computer)).GetName().Version !=
    1.17 +        Assembly.GetExecutingAssembly().GetName().Version) {
    1.18 +        MessageBox.Show(
    1.19 +          "The version of the file OpenHardwareMonitorLib.dll is incompatible.",
    1.20 +          "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
    1.21 +        Environment.Exit(0);
    1.22 +      }
    1.23 +
    1.24        this.settings = new PersistentSettings();      
    1.25        this.settings.Load(Path.ChangeExtension(
    1.26          Application.ExecutablePath, ".config"));
     2.1 --- a/Program.cs	Wed May 18 19:58:57 2011 +0000
     2.2 +++ b/Program.cs	Thu May 19 07:22:06 2011 +0000
     2.3 @@ -37,12 +37,10 @@
     2.4  
     2.5  using System;
     2.6  using System.IO;
     2.7 -using System.Reflection;
     2.8  using System.Text;
     2.9  using System.Threading;
    2.10  using System.Windows.Forms;
    2.11  using OpenHardwareMonitor.GUI;
    2.12 -using OpenHardwareMonitor.Hardware;
    2.13  
    2.14  namespace OpenHardwareMonitor {
    2.15    public static class Program {
    2.16 @@ -91,15 +89,6 @@
    2.17        if (!IsFileAvailable("OpenHardwareMonitorLib.dll"))
    2.18          return false;
    2.19  
    2.20 -      // check if the OpenHardwareMonitorLib assembly has the correct version
    2.21 -      if (Assembly.GetAssembly(typeof(Computer)).GetName().Version !=
    2.22 -        Assembly.GetExecutingAssembly().GetName().Version) {
    2.23 -        MessageBox.Show(
    2.24 -          "The version of the file OpenHardwareMonitorLib.dll is incompatible.", 
    2.25 -          "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
    2.26 -        return false;
    2.27 -      }
    2.28 -
    2.29        return true;
    2.30      }
    2.31