|
|
|
@ -12,7 +12,7 @@ namespace NzbDrone.Update
|
|
|
|
|
{
|
|
|
|
|
private readonly UpdateProvider _updateProvider;
|
|
|
|
|
private readonly ProcessProvider _processProvider;
|
|
|
|
|
private static IContainer _kernel;
|
|
|
|
|
private static IContainer _container;
|
|
|
|
|
|
|
|
|
|
private static readonly Logger logger = LogManager.GetCurrentClassLogger();
|
|
|
|
|
|
|
|
|
@ -27,11 +27,13 @@ namespace NzbDrone.Update
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
Console.WriteLine("Starting NzbDrone Update Client");
|
|
|
|
|
_kernel = new ContainerBuilder().Build();
|
|
|
|
|
var builder = new ContainerBuilder();
|
|
|
|
|
builder.RegisterAssemblyTypes(typeof(UpdateProvider).Assembly).SingleInstance();
|
|
|
|
|
_container = builder.Build();
|
|
|
|
|
InitLoggers();
|
|
|
|
|
|
|
|
|
|
logger.Info("Updating NzbDrone to version {0}", _kernel.Resolve<EnvironmentProvider>().Version);
|
|
|
|
|
_kernel.Resolve<Program>().Start(args);
|
|
|
|
|
logger.Info("Updating NzbDrone to version {0}", _container.Resolve<EnvironmentProvider>().Version);
|
|
|
|
|
_container.Resolve<Program>().Start(args);
|
|
|
|
|
}
|
|
|
|
|
catch (Exception e)
|
|
|
|
|
{
|
|
|
|
@ -46,8 +48,8 @@ namespace NzbDrone.Update
|
|
|
|
|
{
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
var environmentProvider = _kernel.Resolve<EnvironmentProvider>();
|
|
|
|
|
var diskProvider = _kernel.Resolve<DiskProvider>();
|
|
|
|
|
var environmentProvider = _container.Resolve<EnvironmentProvider>();
|
|
|
|
|
var diskProvider = _container.Resolve<DiskProvider>();
|
|
|
|
|
logger.Info("Copying log files to application directory.");
|
|
|
|
|
diskProvider.CopyDirectory(environmentProvider.GetSandboxLogFolder(), environmentProvider.GetUpdateLogFolder());
|
|
|
|
|
}
|
|
|
|
@ -59,7 +61,7 @@ namespace NzbDrone.Update
|
|
|
|
|
|
|
|
|
|
private static void InitLoggers()
|
|
|
|
|
{
|
|
|
|
|
ReportingService.RestProvider = _kernel.Resolve<RestProvider>();
|
|
|
|
|
ReportingService.RestProvider = _container.Resolve<RestProvider>();
|
|
|
|
|
ReportingService.SetupExceptronDriver();
|
|
|
|
|
|
|
|
|
|
LogConfiguration.RegisterRemote();
|
|
|
|
|