예제 #1
0
        public static bool IsValidate(IUserAlert userAlert)
        {
            if (OsInfo.IsMono)
            {
                return true;
            }

            if (!IsAssemblyAvailable("System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"))
            {
                userAlert.Alert("It looks like you don't have full version of .NET Framework installed. You will now be directed the download page.");

                try
                {
                    Process.Start("http://www.microsoft.com/en-ca/download/details.aspx?id=30653");
                }
                catch (Exception e)
                {
                    userAlert.Alert("Oops. can't start default browser. Please visit http://www.microsoft.com/en-ca/download/details.aspx?id=30653 to download .NET Framework 4.5.");
                }

                return false;
            }

            return true;
        }
예제 #2
0
        public static bool IsValidate(IUserAlert userAlert)
        {
            if (OsInfo.IsNotWindows)
            {
                return(true);
            }

            if (!IsAssemblyAvailable("System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"))
            {
                userAlert.Alert("It looks like you don't have the correct version of .NET Framework installed. You will now be directed the download page.");

                try
                {
                    Process.Start(DOWNLOAD_LINK);
                }
                catch (Exception)
                {
                    userAlert.Alert("Oops. Couldn't start your browser. Please visit http://www.microsoft.com/net to download the latest version of .NET Framework");
                }

                return(false);
            }

            return(true);
        }
예제 #3
0
        public static bool IsValidate(IUserAlert userAlert)
        {
            if (OsInfo.IsMono)
            {
                return(true);
            }

            if (!IsAssemblyAvailable("System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"))
            {
                userAlert.Alert("It looks like you don't have full version of .NET Framework installed. You will now be directed the download page.");

                try
                {
                    Process.Start("http://www.microsoft.com/en-ca/download/details.aspx?id=30653");
                }
                catch (Exception e)
                {
                    userAlert.Alert("Oops. can't start default browser. Please visit http://www.microsoft.com/en-ca/download/details.aspx?id=30653 to download .NET Framework 4.5.");
                }

                return(false);
            }

            return(true);
        }
예제 #4
0
        public static bool IsValidate(IUserAlert userAlert)
        {
            if (OsInfo.IsNotWindows)
            {
                return true;
            }

            if (!IsAssemblyAvailable("System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"))
            {
                userAlert.Alert("It looks like you don't have the correct version of .NET Framework installed. You will now be directed the download page.");

                try
                {
                    Process.Start(DOWNLOAD_LINK);
                }
                catch (Exception)
                {
                    userAlert.Alert("Oops. Couldn't start your browser. Please visit http://www.microsoft.com/net to download the latest version of .NET Framework");
                }

                return false;
            }

            return true;
        }
예제 #5
0
        public static void Start(StartupContext startupContext, IUserAlert userAlert, Action <IContainer> startCallback = null)
        {
            try
            {
                SecurityProtocolPolicy.Register();
                X509CertificateValidationPolicy.Register();

                Logger.Info("Starting Gamearr - {0} - Version {1}", Assembly.GetCallingAssembly().Location, Assembly.GetExecutingAssembly().GetName().Version);

                if (!PlatformValidation.IsValidate(userAlert))
                {
                    throw new TerminateApplicationException("Missing system requirements");
                }

                LongPathSupport.Enable();

                _container = MainAppContainerBuilder.BuildContainer(startupContext);
                _container.Resolve <InitializeLogger>().Initialize();
                _container.Resolve <IAppFolderFactory>().Register();
                _container.Resolve <IProvidePidFile>().Write();

                var appMode = GetApplicationMode(startupContext);

                Start(appMode, startupContext);

                if (startCallback != null)
                {
                    startCallback(_container);
                }

                else
                {
                    SpinToExit(appMode);
                }
            }
            catch (InvalidConfigFileException ex)
            {
                throw new GamearrStartupException(ex);
            }
            catch (AccessDeniedConfigFileException ex)
            {
                throw new GamearrStartupException(ex);
            }
            catch (TerminateApplicationException ex)
            {
                Logger.Info(ex.Message);
                LogManager.Configuration = null;
            }
        }
예제 #6
0
        public static void Start(StartupContext startupContext, IUserAlert userAlert, Action <IContainer> startCallback = null)
        {
            try
            {
                Logger.Info("Starting Radarr - {0} - Version {1}",
#if NETCOREAPP
                            Process.GetCurrentProcess().MainModule.FileName,
#else
                            Assembly.GetCallingAssembly().Location,
#endif
                            Assembly.GetExecutingAssembly().GetName().Version);

                if (!PlatformValidation.IsValidate(userAlert))
                {
                    throw new TerminateApplicationException("Missing system requirements");
                }

                Encoding.RegisterProvider(CodePagesEncodingProvider.Instance);

                _container = MainAppContainerBuilder.BuildContainer(startupContext);
                _container.Resolve <InitializeLogger>().Initialize();
                _container.Resolve <IAppFolderFactory>().Register();
                _container.Resolve <IProvidePidFile>().Write();

                var appMode = GetApplicationMode(startupContext);

                Start(appMode, startupContext);

                _container.Resolve <ICancelHandler>().Attach();

                if (startCallback != null)
                {
                    startCallback(_container);
                }
                else
                {
                    SpinToExit(appMode);
                }
            }
            catch (InvalidConfigFileException ex)
            {
                throw new RadarrStartupException(ex);
            }
            catch (TerminateApplicationException e)
            {
                Logger.Info(e.Message);
                LogManager.Configuration = null;
            }
        }
예제 #7
0
        public static void Start(StartupContext startupContext, IUserAlert userAlert, Action <IContainer> startCallback = null)
        {
            LogTargets.Register(startupContext, false, true);

            try
            {
                GlobalExceptionHandlers.Register();
                IgnoreCertErrorPolicy.Register();

                Logger.Info("Starting NzbDrone - {0} - Version {1}", Assembly.GetCallingAssembly().Location, Assembly.GetExecutingAssembly().GetName().Version);

                if (!PlatformValidation.IsValidate(userAlert))
                {
                    throw new TerminateApplicationException("Missing system requirements");
                }

                _container = MainAppContainerBuilder.BuildContainer(startupContext);
                _container.Resolve <IAppFolderFactory>().Register();
                _container.Resolve <IProvidePidFile>().Write();

                var appMode = GetApplicationMode(startupContext);

                Start(appMode, startupContext);

                if (startCallback != null)
                {
                    startCallback(_container);
                }

                else
                {
                    SpinToExit(appMode);
                }
            }
            catch (TerminateApplicationException e)
            {
                Logger.Info(e.Message);
                LogManager.Configuration = null;
            }
        }
예제 #8
0
파일: Bootstrap.cs 프로젝트: BO45/NzbDrone
        public static void Start(StartupContext startupContext, IUserAlert userAlert, Action<IContainer> startCallback = null)
        {
            LogTargets.Register(startupContext, false, true);

            try
            {
                GlobalExceptionHandlers.Register();
                IgnoreCertErrorPolicy.Register();

                Logger.Info("Starting NzbDrone - {0} - Version {1}", Assembly.GetCallingAssembly().Location, Assembly.GetExecutingAssembly().GetName().Version);

                if (!PlatformValidation.IsValidate(userAlert))
                {
                    throw new TerminateApplicationException("Missing system requirements");
                }

                _container = MainAppContainerBuilder.BuildContainer(startupContext);
                _container.Resolve<IAppFolderFactory>().Register();
                _container.Resolve<IProvidePidFile>().Write();

                var appMode = GetApplicationMode(startupContext);

                Start(appMode, startupContext);

                if (startCallback != null)
                {
                    startCallback(_container);
                }

                else
                {
                    SpinToExit(appMode);
                }
            }
            catch (TerminateApplicationException e)
            {
                Logger.Info(e.Message);
                LogManager.Configuration = null;
            }
        }
예제 #9
0
        public static IContainer Start(StartupArguments args, IUserAlert userAlert)
        {
            var logger = NzbDroneLogger.GetLogger();

            GlobalExceptionHandlers.Register();
            IgnoreCertErrorPolicy.Register();

            logger.Info("Starting NzbDrone Console. Version {0}", Assembly.GetExecutingAssembly().GetName().Version);


            if (!PlatformValidation.IsValidate(userAlert))
            {
                throw new TerminateApplicationException();
            }

            var container = MainAppContainerBuilder.BuildContainer(args);

            DbFactory.RegisterDatabase(container);
            container.Resolve <Router>().Route();

            return(container);
        }
예제 #10
0
        public static IContainer Start(StartupArguments args, IUserAlert userAlert)
        {
            var logger = NzbDroneLogger.GetLogger();

            GlobalExceptionHandlers.Register();
            IgnoreCertErrorPolicy.Register();

            logger.Info("Starting NzbDrone Console. Version {0}", Assembly.GetExecutingAssembly().GetName().Version);


            if (!PlatformValidation.IsValidate(userAlert))
            {
                throw new TerminateApplicationException();
            }

            var container = MainAppContainerBuilder.BuildContainer(args);

            DbFactory.RegisterDatabase(container);
            container.Resolve<Router>().Route();

            return container;
        }