# HG changeset patch # User moel.mich # Date 1305789726 0 # Node ID 61c3d984fb2d4caddbd629a061219091fa10ef92 # Parent 22214a7e85a9520a3728a0b691f45b695fc734d4 Fixed Issue 223. diff -r 22214a7e85a9 -r 61c3d984fb2d GUI/MainForm.cs --- a/GUI/MainForm.cs Wed May 18 19:58:57 2011 +0000 +++ b/GUI/MainForm.cs Thu May 19 07:22:06 2011 +0000 @@ -40,6 +40,7 @@ using System.ComponentModel; using System.Drawing; using System.IO; +using System.Reflection; using System.Windows.Forms; using Aga.Controls.Tree; using Aga.Controls.Tree.NodeControls; @@ -81,6 +82,15 @@ public MainForm() { InitializeComponent(); + // check if the OpenHardwareMonitorLib assembly has the correct version + if (Assembly.GetAssembly(typeof(Computer)).GetName().Version != + Assembly.GetExecutingAssembly().GetName().Version) { + MessageBox.Show( + "The version of the file OpenHardwareMonitorLib.dll is incompatible.", + "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); + Environment.Exit(0); + } + this.settings = new PersistentSettings(); this.settings.Load(Path.ChangeExtension( Application.ExecutablePath, ".config")); diff -r 22214a7e85a9 -r 61c3d984fb2d Program.cs --- a/Program.cs Wed May 18 19:58:57 2011 +0000 +++ b/Program.cs Thu May 19 07:22:06 2011 +0000 @@ -37,12 +37,10 @@ using System; using System.IO; -using System.Reflection; using System.Text; using System.Threading; using System.Windows.Forms; using OpenHardwareMonitor.GUI; -using OpenHardwareMonitor.Hardware; namespace OpenHardwareMonitor { public static class Program { @@ -91,15 +89,6 @@ if (!IsFileAvailable("OpenHardwareMonitorLib.dll")) return false; - // check if the OpenHardwareMonitorLib assembly has the correct version - if (Assembly.GetAssembly(typeof(Computer)).GetName().Version != - Assembly.GetExecutingAssembly().GetName().Version) { - MessageBox.Show( - "The version of the file OpenHardwareMonitorLib.dll is incompatible.", - "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); - return false; - } - return true; }