From bcc16a9dfd6be6a3d81a087434e9619688ae7cd1 Mon Sep 17 00:00:00 2001 From: Markus Hofknecht Date: Thu, 16 Jul 2020 12:42:00 +0200 Subject: [PATCH] [BUG] Fix open folder directory that contains commas (#119) --- Business/Menus.cs | 2 +- DataClasses/RowData.cs | 2 +- Properties/AssemblyInfo.cs | 4 ++-- Utilities/Log.cs | 7 ++++++- 4 files changed, 10 insertions(+), 5 deletions(-) diff --git a/Business/Menus.cs b/Business/Menus.cs index 202a2a6..585c545 100644 --- a/Business/Menus.cs +++ b/Business/Menus.cs @@ -591,7 +591,7 @@ namespace SystemTrayMenu.Business private static void OpenFolder() { - Log.ProcessStart("explorer.exe", Config.Path); + Log.ProcessStart("explorer.exe", Config.Path, true); } private Menu Create(MenuData menuData, string title = null) diff --git a/DataClasses/RowData.cs b/DataClasses/RowData.cs index 40cebdf..88d6ffb 100644 --- a/DataClasses/RowData.cs +++ b/DataClasses/RowData.cs @@ -231,7 +231,7 @@ namespace SystemTrayMenu.DataClasses if (ContainsMenu && (e == null || e.Button == MouseButtons.Left)) { - Log.ProcessStart("explorer.exe", TargetFilePath); + Log.ProcessStart("explorer.exe", TargetFilePath, true); } } diff --git a/Properties/AssemblyInfo.cs b/Properties/AssemblyInfo.cs index 0c3bd49..667e9f9 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.0.9.2")] -[assembly: AssemblyFileVersion("1.0.9.2")] +[assembly: AssemblyVersion("1.0.9.3")] +[assembly: AssemblyFileVersion("1.0.9.3")] diff --git a/Utilities/Log.cs b/Utilities/Log.cs index e59cbf2..3c8852a 100644 --- a/Utilities/Log.cs +++ b/Utilities/Log.cs @@ -63,8 +63,13 @@ namespace SystemTrayMenu.Utilities Logger.ShutDown(); } - internal static void ProcessStart(string fileName, string arguments = null) + internal static void ProcessStart(string fileName, string arguments = null, bool doubleQuoteArg = false) { + if (doubleQuoteArg && arguments != null) + { + arguments = "\"" + arguments + "\""; + } + try { using Process p = new Process