Prevent installer from closing via ctrl+c while server remains open

This allows tshock to handle CancelKeyPress as per normal, instead of closing the parent process, leaving the second trigger to never be reached.
see https://github.com/Pryaxis/TShock/blob/general-devel/TShockAPI/TShock.cs#L710
This commit is contained in:
Luke 2022-11-22 16:40:39 +10:00
parent 9550631064
commit fbd82bbce8

View file

@ -95,7 +95,14 @@ Console.WriteLine($"To be able to run {tshock_path} yourself set the environment
Environment.SetEnvironmentVariable("DOTNET_ROOT", dotnet_root);
Console.WriteLine($"Extracted, launching: {tshock_path}");
var proc = new Process();
Console.CancelKeyPress += (sender, e) =>
{
e.Cancel = !proc.HasExited;
};
proc.StartInfo = new()
{
FileName = tshock_path,