diff --git a/Netch/Forms/MainForm.Misc.cs b/Netch/Forms/MainForm.Misc.cs index 120c91b9..c89cf30c 100644 --- a/Netch/Forms/MainForm.Misc.cs +++ b/Netch/Forms/MainForm.Misc.cs @@ -73,7 +73,7 @@ namespace Netch.Forms { FileName = Path.Combine(Global.NetchDir, "NetchUpdater.exe"), Arguments = - $"{Global.Settings.UDPSocketPort} {fileFullPath} {Global.NetchDir}" + $"{Global.Settings.UDPSocketPort}|{fileFullPath}|{Global.NetchDir}" }); } } diff --git a/NetchUpdater/Program.cs b/NetchUpdater/Program.cs index 4172f5b2..ca71be17 100644 --- a/NetchUpdater/Program.cs +++ b/NetchUpdater/Program.cs @@ -25,10 +25,11 @@ namespace NetchUpdater UpdaterFriendlyName = Path.GetFileName(UpdaterFullName); } - public static void Main(string[] args) + public static void Main(string[] args1) { var result = false; + var args = args1.Aggregate((s, s1) => $"{s} {s1}").Split('|').Select(s => s.Trim()).ToArray(); try { #region Check Arguments @@ -86,7 +87,7 @@ namespace NetchUpdater Process.Start(new ProcessStartInfo { FileName = newUpdaterPath, - Arguments = $"{port} {updatePath} {targetPath}", + Arguments = $"{port}|{updatePath}|{targetPath}", WorkingDirectory = tempPath, UseShellExecute = false }); @@ -98,9 +99,9 @@ namespace NetchUpdater #endregion - /*while (!Debugger.IsAttached) + /*Console.WriteLine("Waiting Attach"); + while (!Debugger.IsAttached) { - Console.WriteLine("Waiting Attach"); Thread.Sleep(1000); }*/ @@ -221,7 +222,7 @@ namespace NetchUpdater File.WriteAllBytes("7za.exe", Resources._7za); var argument = new StringBuilder(); - argument.Append($" x {archiveFileName} -o{destDirName} "); + argument.Append($" x \"{archiveFileName}\" -o\"{destDirName}\" "); if (overwrite) argument.Append(" -y ");