diff --git a/Program.cs b/Program.cs index 2378903..ae5fd1e 100644 --- a/Program.cs +++ b/Program.cs @@ -37,10 +37,12 @@ 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 { @@ -88,6 +90,16 @@ namespace OpenHardwareMonitor { return false; 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; }