fix: Updater parse multiple space path

This commit is contained in:
ChsBuffer
2020-10-21 21:40:55 +08:00
parent 591f8e5a5c
commit f8bcef7ac9
2 changed files with 3 additions and 4 deletions

View File

@@ -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}\""
});
}
}

View File

@@ -25,11 +25,10 @@ namespace NetchUpdater
UpdaterFriendlyName = Path.GetFileName(UpdaterFullName);
}
public static void Main(string[] args1)
public static void Main(string[] args)
{
var result = false;
var args = args1.Aggregate((s, s1) => $"{s} {s1}").Split('|').Select(s => s.Trim()).ToArray();
try
{
#region Check Arguments
@@ -87,7 +86,7 @@ namespace NetchUpdater
Process.Start(new ProcessStartInfo
{
FileName = newUpdaterPath,
Arguments = $"{port}|{updatePath}|{targetPath}",
Arguments = $"{port} \"{updatePath}\" \"{targetPath}\"",
WorkingDirectory = tempPath,
UseShellExecute = false
});