public static void Main(string[] args) { Environment.CurrentDirectory = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); bool useConsole = DetectConsole(); if (useConsole) { CLIProgram.RunCLI(); } else { RunGUI(); } }
static void GlobalExHandler(object sender, UnhandledExceptionEventArgs e) { CLIProgram.LogAndRestart((Exception)e.ExceptionObject); }
static void ThreadExHandler(object sender, ThreadExceptionEventArgs e) { CLIProgram.LogAndRestart(e.Exception); }