From 00e89c5a36b907cd48c52a41c5e937969888801b Mon Sep 17 00:00:00 2001 From: Puk06 <86549420+puk06@users.noreply.github.com> Date: Fri, 19 Jul 2024 23:13:06 +0900 Subject: [PATCH] =?UTF-8?q?=E3=82=BD=E3=83=95=E3=83=88=E3=81=AE=E3=83=91?= =?UTF-8?q?=E3=82=B9=E3=81=AE=E7=A9=BA=E7=99=BD=E6=96=87=E5=AD=97=E3=81=AE?= =?UTF-8?q?=E5=AF=BE=E7=AD=96=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Forms/AddSoftware.Designer.cs | 1 - Forms/AddSoftware.cs | 5 +++++ Forms/EditSoftware.cs | 5 +++++ Forms/Main.cs | 3 ++- 4 files changed, 12 insertions(+), 2 deletions(-) diff --git a/Forms/AddSoftware.Designer.cs b/Forms/AddSoftware.Designer.cs index 7940154..d9b6b97 100644 --- a/Forms/AddSoftware.Designer.cs +++ b/Forms/AddSoftware.Designer.cs @@ -188,7 +188,6 @@ private void InitializeComponent() this.Text = "Add Software"; this.ResumeLayout(false); this.PerformLayout(); - } #endregion diff --git a/Forms/AddSoftware.cs b/Forms/AddSoftware.cs index 12be936..623e992 100644 --- a/Forms/AddSoftware.cs +++ b/Forms/AddSoftware.cs @@ -99,6 +99,11 @@ private IEnumerable CheckValue() Main.AddValueToArray(ref reasons, "❌️ Path does not exist"); } + if (PATH_TEXTBOX.Text.Contains("ㅤ")) + { + Main.AddValueToArray(ref reasons, "❌️ Path contains invalid characters"); + } + return reasons; } diff --git a/Forms/EditSoftware.cs b/Forms/EditSoftware.cs index beffae0..8c3e177 100644 --- a/Forms/EditSoftware.cs +++ b/Forms/EditSoftware.cs @@ -101,6 +101,11 @@ private IEnumerable CheckValue() Main.AddValueToArray(ref reasons, "❌️ Path does not exist"); } + if (PATH_TEXTBOX.Text.Contains("ㅤ")) + { + Main.AddValueToArray(ref reasons, "❌️ Path contains invalid characters"); + } + return reasons; } diff --git a/Forms/Main.cs b/Forms/Main.cs index 61e236c..0925969 100644 --- a/Forms/Main.cs +++ b/Forms/Main.cs @@ -454,7 +454,8 @@ private void LaunchSoftwares() if (software.Name != checkBox.Name) continue; string softwarePath = software.Path; string workingDirectory = Path.GetDirectoryName(softwarePath); - if (!File.Exists(softwarePath) || string.IsNullOrEmpty(workingDirectory)) continue; + if (!File.Exists(softwarePath) || string.IsNullOrEmpty(workingDirectory)) + throw new Exception("The software could not be found."); ProcessStartInfo softwareStartInfo = new ProcessStartInfo { FileName = softwarePath,