Beispiel #1
0
        public static void Main(string[] args)
        {
            try
            {
                var startupArgs = new StartupContext(args);
                NzbDroneLogger.Register(startupArgs, false, true);
                Bootstrap.Start(startupArgs, new ConsoleAlerts());
            }
            catch (SocketException exception)
            {
                System.Console.WriteLine("");
                System.Console.WriteLine("");
                Logger.Fatal(exception.Message + ". This can happen if another instance of Sonarr is already running another application is using the same port (default: 8989) or the user has insufficient permissions");
                System.Console.WriteLine("Press any key to exit...");
                System.Console.ReadLine();
                Environment.Exit(1);
            }
            catch (Exception e)
            {
                System.Console.WriteLine("");
                System.Console.WriteLine("");
                Logger.FatalException("EPIC FAIL!", e);
                System.Console.WriteLine("Press any key to exit...");
                System.Console.ReadLine();
                Environment.Exit(1);
            }

            Logger.Info("Exiting main.");

            //Need this to terminate on mono (thanks nlog)
            LogManager.Configuration = null;
            Environment.Exit(0);
        }
Beispiel #2
0
        public static void Main(string[] args)
        {
            try
            {
                var startupArgs = new StartupContext(args);
                try
                {
                    NzbDroneLogger.Register(startupArgs, false, true);
                }
                catch (Exception ex)
                {
                    System.Console.WriteLine("NLog Exception: " + ex.ToString());
                    throw;
                }
                Bootstrap.Start(startupArgs, new ConsoleAlerts());
            }
            catch (SocketException e)
            {
                System.Console.WriteLine("");
                System.Console.WriteLine("");
                Logger.Fatal(e.Message + ". This can happen if another instance of Radarr is already running another application is using the same port (default: 7878) or the user has insufficient permissions");
                Exit(ExitCodes.RecoverableFailure);
            }
            catch (Exception e)
            {
                System.Console.WriteLine("");
                System.Console.WriteLine("");
                Logger.Fatal(e, "EPIC FAIL!");
                Exit(ExitCodes.UnknownFailure);
            }

            Logger.Info("Exiting main.");

            Exit(ExitCodes.Normal);
        }
Beispiel #3
0
        public static void Main(string[] args)
        {
            try
            {
                var startupContext = new StartupContext(args);
                NzbDroneLogger.Register(startupContext, true, true);

                Logger.Info("Starting Prowlarr Update Client");

                var container = new Container(rules => rules.WithNzbDroneRules())
                                .AutoAddServices(new List <string> {
                    "Prowlarr.Update"
                })
                                .AddNzbDroneLogger()
                                .AddStartupContext(startupContext);

                container.Resolve <InitializeLogger>().Initialize();
                container.Resolve <UpdateApp>().Start(args);

                Logger.Info("Update completed successfully");
            }
            catch (Exception e)
            {
                Logger.Fatal(e, "An error has occurred while applying update package.");
            }
        }
Beispiel #4
0
        static void Main(string[] args)
        {
            try
            {
                var oldColor = Console.ForegroundColor;

                Console.ForegroundColor = ConsoleColor.Red;
                Console.WriteLine("AGN Gaming Radarr Hotpatch Loading...");
                Console.WriteLine("Attempting to bootstrap Radarr, here goes!");
                Console.ForegroundColor = oldColor;

                var patchManager = new PatchManager();

                var startupArgs = new StartupContext(args);
                try
                {
                    NzbDroneLogger.Register(startupArgs, false, true);
                }
                catch (Exception ex)
                {
                    System.Console.WriteLine("NLog Exception: " + ex.ToString());
                    throw;
                }

                if (patchManager.BeginPatching())
                {
                    Utility.WriteToConsole("All patches successful, starting Radarr.", ConsoleColor.Green);
                    Bootstrap.Start(startupArgs, new ConsoleAlerts());
                }
                else
                {
                    Console.WriteLine("");
                    Console.WriteLine("");
                    Logger.Fatal("Some HotPatch patches were not applied successfully.  Are you using a supported version of Radarr?");
                    Exit(ExitCodes.UnknownFailure);
                }
            }
            catch (SocketException e)
            {
                System.Console.WriteLine("");
                System.Console.WriteLine("");
                Logger.Fatal(e.Message + ". This can happen if another instance of Radarr is already running another application is using the same port (default: 7878) or the user has insufficient permissions");
                Exit(ExitCodes.RecoverableFailure);
            }
            catch (Exception e)
            {
                System.Console.WriteLine("");
                System.Console.WriteLine("");
                Logger.Fatal(e, "EPIC FAIL!");
                Exit(ExitCodes.UnknownFailure);
            }
        }
Beispiel #5
0
        public static void Main(string[] args)
        {
            try
            {
                var startupArgs = new StartupContext(args);

                NzbDroneLogger.Register(startupArgs, false, true);

                Bootstrap.Start(args, e =>
                {
                    e.ConfigureServices((_, s) => s.AddSingleton <IHostedService, SystemTrayApp>());
                });
            }
            catch (Exception e)
            {
                Logger.Fatal(e, "EPIC FAIL");
                MessageBox.Show($"{e.GetType().Name}: {e.Message}", buttons: MessageBoxButtons.OK, icon: MessageBoxIcon.Error, caption: "Epic Fail!");
            }
        }
Beispiel #6
0
        public static void Main(string[] args)
        {
            try
            {
                var startupContext = new StartupContext(args);
                NzbDroneLogger.Register(startupContext, true, true);

                Logger.Info("Starting Lidarr Update Client");

                _container = UpdateContainerBuilder.Build(startupContext);
                _container.Resolve <InitializeLogger>().Initialize();
                _container.Resolve <UpdateApp>().Start(args);

                Logger.Info("Update completed successfully");
            }
            catch (Exception e)
            {
                Logger.Fatal(e, "An error has occurred while applying update package.");
            }
        }
Beispiel #7
0
        public static void Main(string[] args)
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.SetHighDpiMode(HighDpiMode.SystemAware);

            try
            {
                var startupArgs = new StartupContext(args);

                NzbDroneLogger.Register(startupArgs, false, true);

                Bootstrap.Start(args, e => { e.ConfigureServices((_, s) => s.AddSingleton <IHostedService, SystemTrayApp>()); });
            }
            catch (Exception e)
            {
                Logger.Fatal(e, "EPIC FAIL");
                MessageBox.Show($"{e.GetType().Name}: {e}", buttons: MessageBoxButtons.OK, icon: MessageBoxIcon.Error, caption: "Epic Fail!");
            }
        }
Beispiel #8
0
        public static void Main(string[] args)
        {
            try
            {
                var startupArgs = new StartupContext(args);

                NzbDroneLogger.Register(startupArgs, false, true);

                Bootstrap.Start(startupArgs, new MessageBoxUserAlert(), container =>
                {
                    container.Register <ISystemTrayApp, SystemTrayApp>();
                    var trayApp = container.Resolve <ISystemTrayApp>();
                    trayApp.Start();
                });
            }
            catch (Exception e)
            {
                Logger.Fatal(e, "EPIC FAIL");
                MessageBox.Show($"{e.GetType().Name}: {e.Message}", buttons: MessageBoxButtons.OK, icon: MessageBoxIcon.Error, caption: "Epic Fail!");
            }
        }
Beispiel #9
0
        public static void Main(string[] args)
        {
            try
            {
                var startupArgument = new StartupContext(args);
                NzbDroneLogger.Register(startupArgument, true, true);

                Logger.Info("Starting Sonarr Update Client");

                X509CertificateValidationPolicy.Register();

                _container = UpdateContainerBuilder.Build(startupArgument);

                Logger.Info("Updating Sonarr to version {0}", BuildInfo.Version);
                _container.Resolve <UpdateApp>().Start(args);

                Logger.Info("Update completed successfully");
            }
            catch (Exception e)
            {
                Logger.FatalException("An error has occurred while applying update package.", e);
            }
        }
Beispiel #10
0
        public static void Main(string[] args)
        {
            StartupContext startupArgs = null;

            try
            {
                startupArgs = new StartupContext(args);
                try
                {
                    NzbDroneLogger.Register(startupArgs, false, true);
                }
                catch (Exception ex)
                {
                    System.Console.WriteLine("NLog Exception: " + ex.ToString());
                    throw;
                }

                Bootstrap.Start(args);
            }
            catch (ReadarrStartupException ex)
            {
                System.Console.WriteLine("");
                System.Console.WriteLine("");
                Logger.Fatal(ex, "EPIC FAIL!");
                Exit(ExitCodes.NonRecoverableFailure, startupArgs);
            }
            catch (SocketException ex)
            {
                System.Console.WriteLine("");
                System.Console.WriteLine("");
                Logger.Fatal(ex.Message + ". This can happen if another instance of Readarr is already running another application is using the same port (default: 8787) or the user has insufficient permissions");
                Exit(ExitCodes.RecoverableFailure, startupArgs);
            }
            catch (IOException ex)
            {
                if (ex.InnerException is AddressInUseException)
                {
                    System.Console.WriteLine("");
                    System.Console.WriteLine("");
                    Logger.Fatal(ex.Message + " This can happen if another instance of Readarr is already running another application is using the same port (default: 8787) or the user has insufficient permissions");
                    Exit(ExitCodes.RecoverableFailure, startupArgs);
                }
                else
                {
                    throw;
                }
            }
            catch (RemoteAccessException ex)
            {
                System.Console.WriteLine("");
                System.Console.WriteLine("");
                Logger.Fatal(ex, "EPIC FAIL!");
                Exit(ExitCodes.Normal, startupArgs);
            }
            catch (Exception ex)
            {
                System.Console.WriteLine("");
                System.Console.WriteLine("");
                Logger.Fatal(ex, "EPIC FAIL!");
                Exit(ExitCodes.UnknownFailure, startupArgs);
            }

            Logger.Info("Exiting main.");

            Exit(ExitCodes.Normal, startupArgs);
        }