This commit is contained in:
23
Program.cs
23
Program.cs
@@ -1,10 +1,20 @@
|
||||
|
||||
global using System.Diagnostics;
|
||||
|
||||
// Prevent from ending if CTL+C is pressed.
|
||||
Console.TreatControlCAsInput = true;
|
||||
Console.WriteLine($"AyaNova server launcher {AyaNovaVersion.VersionString}");
|
||||
//================== LAUNCH AYANOVA SERVER ==================
|
||||
|
||||
var AyaNovaProcess = System.Diagnostics.Process.Start(@"../AyaNova.exe");
|
||||
//Go UP one folder from the current launcher folder which should *always* be contained within the AyaNova.exe containing folder if it was installed
|
||||
var ServerExeFolderPath = Path.GetFullPath(Path.Combine(Directory.GetCurrentDirectory(), ".."));
|
||||
ProcessStartInfo ServerStartInfo = new ProcessStartInfo();
|
||||
ServerStartInfo.FileName = "AyaNova.exe";
|
||||
ServerStartInfo.WorkingDirectory = ServerExeFolderPath;
|
||||
ServerStartInfo.UseShellExecute = true;
|
||||
var ServerProcess = Process.Start(ServerStartInfo);
|
||||
|
||||
|
||||
|
||||
|
||||
Console.WriteLine("#############################################");
|
||||
Console.WriteLine("Press CTL-C key to shut down AyaNova Server");
|
||||
@@ -24,4 +34,11 @@ do
|
||||
Console.WriteLine("Press CTL-C key to shut down AyaNova Server");
|
||||
}
|
||||
//Console.WriteLine(cki.Key.ToString());
|
||||
} while (!Quit);
|
||||
} while (!Quit);
|
||||
|
||||
if (ServerProcess != null)
|
||||
{
|
||||
ServerProcess.CloseMainWindow();
|
||||
ServerProcess.Close();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user