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:
parent
9550631064
commit
fbd82bbce8
1 changed files with 7 additions and 0 deletions
|
|
@ -95,7 +95,14 @@ Console.WriteLine($"To be able to run {tshock_path} yourself set the environment
|
||||||
Environment.SetEnvironmentVariable("DOTNET_ROOT", dotnet_root);
|
Environment.SetEnvironmentVariable("DOTNET_ROOT", dotnet_root);
|
||||||
|
|
||||||
Console.WriteLine($"Extracted, launching: {tshock_path}");
|
Console.WriteLine($"Extracted, launching: {tshock_path}");
|
||||||
|
|
||||||
var proc = new Process();
|
var proc = new Process();
|
||||||
|
|
||||||
|
Console.CancelKeyPress += (sender, e) =>
|
||||||
|
{
|
||||||
|
e.Cancel = !proc.HasExited;
|
||||||
|
};
|
||||||
|
|
||||||
proc.StartInfo = new()
|
proc.StartInfo = new()
|
||||||
{
|
{
|
||||||
FileName = tshock_path,
|
FileName = tshock_path,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue