[Feature] Executable to show the menu (#276), version 1.2.0.12

This commit is contained in:
Markus Hofknecht 2022-01-07 18:24:17 +01:00
parent 2659d19283
commit 4c600a8c66
4 changed files with 11 additions and 14 deletions

View file

@ -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();

View file

@ -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")]

View file

@ -323,7 +323,7 @@
</ItemGroup>
<PropertyGroup>
<PreBuildEvent>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</PreBuildEvent>
<RepositoryUrl>https://github.com/Hofknecht/SystemTrayMenu</RepositoryUrl>
<PackageIcon>icon.png</PackageIcon>

View file

@ -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();