using System; using System.Diagnostics; internal class Restarter { private static void Main() { Console.CursorVisible = false; Console.Title = "Little Holo Restarter - by Dentas (ragezone name)"; Console.WriteLine("Little Holo Restarter - by Dentas (ragezone name)"); Console.ForegroundColor = ConsoleColor.DarkGray; Console.WriteLine(" Description: A little program, written in C#, to restart the Holograph Emulator, if it crashs.\nIf you want to close Holograph Emulator, close this program FIRST!\nThis Program will start the Hlograph Emulator and will only watch this Holograph Emulator Process! (If you started Holograph Emulator before, Little Holo Restarter won't watch this Process."); Console.ForegroundColor = ConsoleColor.Gray; Console.WriteLine("Written by Dentas (ragezone name)."); Console.WriteLine(); Console.ForegroundColor = ConsoleColor.Gray; Console.Write("["); Console.Write(DateTime.Now.ToString() + "] "); Console.ForegroundColor = ConsoleColor.DarkGreen; Console.Write("Starting Holograph Emulator.."); Console.WriteLine(); StartHolo(); } private static void StartHolo() { try { Process process = new Process(); process.StartInfo.FileName = "Holograph Emulator.exe"; process.Start(); process.WaitForExit(); Console.ForegroundColor = ConsoleColor.Gray; Console.Write("["); Console.Write(DateTime.Now.ToString() + "] "); Console.ForegroundColor = ConsoleColor.Red; Console.Write("Holograph Emulator was crashing or closing! Restarting..\n"); Console.ForegroundColor = ConsoleColor.Gray; Console.Beep(); StartHolo(); } catch { Console.Beep(); Console.ForegroundColor = ConsoleColor.Gray; Console.Write("["); Console.Write(DateTime.Now.ToString() + "] "); Console.ForegroundColor = ConsoleColor.Red; Console.Write("No Holograph Emulator.exe found! Place 'Little Holo Restarter' in same directory, where is Holograph Emulator.exe located!"); } Label_00C8: goto Label_00C8; } }