Esempio n. 1
0
 private static void HandleDetectCommand()
 {
     try
     {
         Console.WriteLine(ExecutableFactory.Get(ExecutableFactory.Type.Detect).Path);
         Environment.Exit(0);
     }
     catch (FileNotFoundException e)
     {
         ErrorExit(e.Message, 4);
         Console.Error.WriteLine(e.Message);
     }
 }
Esempio n. 2
0
        private void Detect()
        {
            Info("Invoked the Loader.Detect command.");
            Info("Attempting to detect executable path.");

            try
            {
                Console.WriteLine(ExecutableFactory.Get(ExecutableFactory.Type.Detect, Output).Path);
            }
            catch (FileNotFoundException e)
            {
                Fail(e.Message, ExitType.Exception);
            }
        }
Esempio n. 3
0
        private static void HandleLoadCommand(string[] args)
        {
            var executable = new Atarashii.Executable(Atarashii.Executable.Name);

            if (args.Length > 1)
            {
                executable = new Atarashii.Executable(args[1]);
            }
            else
            {
                try
                {
                    executable = ExecutableFactory.Get(ExecutableFactory.Type.Detect);
                }
                catch (FileNotFoundException e)
                {
                    ErrorExit(e.Message, 1);
                }
            }

            try
            {
                executable.Load();
            }
            catch (LoaderException e)
            {
                ErrorExit(e.Message, 2);
            }
            catch (Exception e)
            {
                ErrorExit(e.Message, 3);
            }

            Console.WriteLine($"The specified executable '{executable.Path}' has been loaded.");
            Environment.Exit(0);
        }
Esempio n. 4
0
 /// <summary>
 ///     Attempts to detect the path of the HCE executable on the file system.
 /// </summary>
 /// <returns>
 ///     Path to the HCE executable, assuming its installation is legal.
 /// </returns>
 public static string Detect()
 {
     return(ExecutableFactory.Get(ExecutableFactory.Type.Detect).Path);
 }