From 8ed6399a0ef5e00a590602222fc2533a0b8bed55 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20M=C3=B6ller?= Date: Thu, 19 May 2011 07:22:06 +0000 Subject: [PATCH] Fixed Issue 223. --- GUI/MainForm.cs | 10 ++++++++++ Program.cs | 11 ----------- 2 files changed, 10 insertions(+), 11 deletions(-) diff --git a/GUI/MainForm.cs b/GUI/MainForm.cs index 473f9d2..f1a7b1d 100644 --- a/GUI/MainForm.cs +++ b/GUI/MainForm.cs @@ -40,6 +40,7 @@ using System.Collections.Generic; 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 @@ namespace OpenHardwareMonitor.GUI { 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 --git a/Program.cs b/Program.cs index ae5fd1e..2861afd 100644 --- a/Program.cs +++ b/Program.cs @@ -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 @@ namespace OpenHardwareMonitor { 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; }