From 4c600a8c66d32ef036b38afce7aee810dfd9ce43 Mon Sep 17 00:00:00 2001 From: Markus Hofknecht Date: Fri, 7 Jan 2022 18:24:17 +0100 Subject: [PATCH] [Feature] Executable to show the menu (#276), version 1.2.0.12 --- Business/Program.cs | 13 +++++-------- Properties/AssemblyInfo.cs | 4 ++-- SystemTrayMenu.csproj | 2 +- Utilities/AppRestart.cs | 6 +++--- 4 files changed, 11 insertions(+), 14 deletions(-) diff --git a/Business/Program.cs b/Business/Program.cs index 383cc9d..d9c61c6 100644 --- a/Business/Program.cs +++ b/Business/Program.cs @@ -18,15 +18,12 @@ namespace SystemTrayMenu { try { - bool killOtherInstances = false; - if (args != null && args.Length > 0) + bool killOtherInstances = true; + if (args != null && args.Length > 0 && + (args[0] == "-h" || args[0] == "-hotkey")) { - if (args[0] == "-r") - { - args = null; - } - - killOtherInstances = true; + args = null; + killOtherInstances = false; } Log.Initialize(); diff --git a/Properties/AssemblyInfo.cs b/Properties/AssemblyInfo.cs index e4f6194..9d5dae5 100644 --- a/Properties/AssemblyInfo.cs +++ b/Properties/AssemblyInfo.cs @@ -39,5 +39,5 @@ using System.Runtime.InteropServices; // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.2.0.11")] -[assembly: AssemblyFileVersion("1.2.0.11")] +[assembly: AssemblyVersion("1.2.0.12")] +[assembly: AssemblyFileVersion("1.2.0.12")] diff --git a/SystemTrayMenu.csproj b/SystemTrayMenu.csproj index 5040feb..62676f3 100644 --- a/SystemTrayMenu.csproj +++ b/SystemTrayMenu.csproj @@ -323,7 +323,7 @@ taskkill /fi "pid gt 0" /im SystemTrayMenu.exe -REM taskkill /f /fi "pid gt 0" /im SystemTrayMenu.exe +taskkill /f /fi "pid gt 0" /im SystemTrayMenu.exe EXIT 0 https://github.com/Hofknecht/SystemTrayMenu icon.png diff --git a/Utilities/AppRestart.cs b/Utilities/AppRestart.cs index baf1ca1..4915ebb 100644 --- a/Utilities/AppRestart.cs +++ b/Utilities/AppRestart.cs @@ -47,9 +47,9 @@ namespace SystemTrayMenu.Utilities using (Process p = new()) { - p.StartInfo = new ProcessStartInfo( - Process.GetCurrentProcess().MainModule.FileName, - "-r"); + string fileName = Process.GetCurrentProcess().MainModule.FileName; + p.StartInfo = new ProcessStartInfo(fileName); + try { p.Start();