diff --git a/Luatrauma.AutoUpdater/Program.cs b/Luatrauma.AutoUpdater/Program.cs index c91f6b9..19fbd49 100644 --- a/Luatrauma.AutoUpdater/Program.cs +++ b/Luatrauma.AutoUpdater/Program.cs @@ -23,8 +23,15 @@ public async static Task Start() if (Args.Length > 0) { Console.WriteLine("Starting " + string.Join(" ", Args)); - Process process = Process.Start(Args[0], Args.Skip(1).ToArray()); - await process.WaitForExitAsync(); + + var info = new ProcessStartInfo + { + FileName = Args[0], + Arguments = string.Join(" ", Args.Skip(1)), + WorkingDirectory = Path.GetDirectoryName(Args[0]), + }; + + Process.Start(info); } } } diff --git a/Luatrauma.AutoUpdater/Updater.cs b/Luatrauma.AutoUpdater/Updater.cs index ef8e673..9448f7e 100644 --- a/Luatrauma.AutoUpdater/Updater.cs +++ b/Luatrauma.AutoUpdater/Updater.cs @@ -34,9 +34,10 @@ public async static Task Update() try { using var client = new HttpClient(); - using var s = await client.GetStreamAsync(patchUrl); - using var fs = new FileStream(patchZip, FileMode.OpenOrCreate); - await s.CopyToAsync(fs); + + byte[] fileBytes = await client.GetByteArrayAsync(patchUrl); + + await File.WriteAllBytesAsync(patchZip, fileBytes); } catch (Exception e) {