From f696d20060a3378289c79fde2a5e7cce8449879e Mon Sep 17 00:00:00 2001 From: Milan Hanajik Date: Thu, 18 Aug 2016 11:38:14 +0200 Subject: [PATCH] It is possible to run the 2nd instance of TBF program in off-line mode, ver. 2.9.339 --- TestBenchFramework/Program.cs | 21 +++++++++++-------- TestBenchFramework/Properties/AssemblyInfo.cs | 4 ++-- 2 files changed, 14 insertions(+), 11 deletions(-) diff --git a/TestBenchFramework/Program.cs b/TestBenchFramework/Program.cs index 741d9100f..665a2e74f 100644 --- a/TestBenchFramework/Program.cs +++ b/TestBenchFramework/Program.cs @@ -66,14 +66,6 @@ namespace TBF Version = string.Format("{0}.{1}.{2}", ver.Major, ver.Minor, ver.Build); BuildDateTime = new System.IO.FileInfo(thisAssembly.Location).LastWriteTime; - /// Check if another instance is running - string processName = System.IO.Path.GetFileNameWithoutExtension(thisAssembly.Location); - if (System.Diagnostics.Process.GetProcessesByName(processName).Length > 1) - { - MessageBox.Show(Strings.Another_instance_is_running, Strings.Error, MessageBoxButtons.OK, MessageBoxIcon.Asterisk); - return; - } - /// Local program configuration directory including the trailing backslash string locAppDataDir = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData) + Path.DirectorySeparatorChar + "TestBenchFramework" + Path.DirectorySeparatorChar; @@ -236,7 +228,18 @@ namespace TBF if (authorized) { - log.InfoFormat("Password accepted, bench '{0}' parameters loaded.", + if (LocalSettings.TestBenches[i].IsRealBench) + { + /// This is a real bench ==> check if another instance is running + string processName = System.IO.Path.GetFileNameWithoutExtension(thisAssembly.Location); + if (System.Diagnostics.Process.GetProcessesByName(processName).Length > 1) + { + MessageBox.Show(Strings.Another_instance_is_running, Strings.Error, MessageBoxButtons.OK, MessageBoxIcon.Asterisk); + return; + } + } + + log.InfoFormat("Password accepted, bench '{0}' parameters loaded.", LocalSettings.TestBenches[i].BenchName); /// Copy the selected bench settings to CurrentBench. diff --git a/TestBenchFramework/Properties/AssemblyInfo.cs b/TestBenchFramework/Properties/AssemblyInfo.cs index 89f04936b..2102b3794 100644 --- a/TestBenchFramework/Properties/AssemblyInfo.cs +++ b/TestBenchFramework/Properties/AssemblyInfo.cs @@ -29,5 +29,5 @@ using System.Runtime.InteropServices; // Build Number // Revision // -[assembly: AssemblyVersion("2.9.337.1")] -[assembly: AssemblyFileVersion("2.9.337.1")] +[assembly: AssemblyVersion("2.9.339.1")] +[assembly: AssemblyFileVersion("2.9.339.1")]