Auto server update should work now

This commit is contained in:
sardelka9515 2022-08-21 19:56:59 +08:00
parent c17b234057
commit 01492a0c55
2 changed files with 2 additions and 1 deletions

View File

@ -147,7 +147,7 @@ namespace RageCoop.Server
MainNetServer.Shutdown("Server updating"); MainNetServer.Shutdown("Server updating");
Logger.Info("Server shutting down!"); Logger.Info("Server shutting down!");
Logger.Flush(); Logger.Flush();
Process.Start(Path.Combine("Update", RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? "RageCoop.Server.exe": "RageCoop.Server"), "update \"" + AppDomain.CurrentDomain.BaseDirectory + "\""); Process.Start(Path.Combine("Update", RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? "RageCoop.Server.exe": "RageCoop.Server"), "update \"" + AppDomain.CurrentDomain.BaseDirectory[0..^1] + "\"");
Environment.Exit(0); Environment.Exit(0);
} }
catch(Exception ex) catch(Exception ex)

View File

@ -25,6 +25,7 @@ namespace RageCoop.Server
try try
{ {
Console.WriteLine("Applying update to "+target); Console.WriteLine("Applying update to "+target);
CoreUtils.CopyFilesRecursively(new(AppDomain.CurrentDomain.BaseDirectory), new(target)); CoreUtils.CopyFilesRecursively(new(AppDomain.CurrentDomain.BaseDirectory), new(target));
Process.Start(Path.Combine(target, "RageCoop.Server")); Process.Start(Path.Combine(target, "RageCoop.Server"));
Environment.Exit(0); Environment.Exit(0);