Log when running tray app

pull/2119/merge
Mark McDowall 7 years ago
parent bc32ad064e
commit 728f553802
No known key found for this signature in database
GPG Key ID: D4CEFA9A718052E0

@ -1,5 +1,3 @@
using System;
namespace NzbDrone.Common.EnvironmentInfo
{
public interface IRuntimeInfo
@ -7,8 +5,9 @@ namespace NzbDrone.Common.EnvironmentInfo
bool IsUserInteractive { get; }
bool IsAdmin { get; }
bool IsWindowsService { get; }
bool IsWindowsTray { get; }
bool IsExiting { get; set; }
bool RestartPending { get; set; }
string ExecutingApplication { get; }
}
}
}

@ -1,10 +1,11 @@
using System;
using System;
using System.Diagnostics;
using System.IO;
using System.Reflection;
using System.Security.Principal;
using System.ServiceProcess;
using NLog;
using NzbDrone.Common.Processes;
namespace NzbDrone.Common.EnvironmentInfo
{
@ -27,6 +28,7 @@ namespace NzbDrone.Common.EnvironmentInfo
if (entry != null)
{
ExecutingApplication = entry.Location;
IsWindowsTray = entry.ManifestModule.Name == $"{ProcessProvider.NZB_DRONE_PROCESS_NAME}.exe";
}
}
@ -102,5 +104,7 @@ namespace NzbDrone.Common.EnvironmentInfo
return true;
}
public bool IsWindowsTray { get; private set; }
}
}

@ -1,6 +1,7 @@
using NLog;
using NzbDrone.Common;
using NzbDrone.Common.Composition;
using NzbDrone.Common.EnvironmentInfo;
using NzbDrone.Core.Datastore;
namespace NzbDrone.Host
@ -10,18 +11,21 @@ namespace NzbDrone.Host
private readonly INzbDroneServiceFactory _nzbDroneServiceFactory;
private readonly IServiceProvider _serviceProvider;
private readonly IConsoleService _consoleService;
private readonly IRuntimeInfo _runtimeInfo;
private readonly IContainer _container;
private readonly Logger _logger;
public Router(INzbDroneServiceFactory nzbDroneServiceFactory,
IServiceProvider serviceProvider,
IConsoleService consoleService,
IRuntimeInfo runtimeInfo,
IContainer container,
Logger logger)
{
_nzbDroneServiceFactory = nzbDroneServiceFactory;
_serviceProvider = serviceProvider;
_consoleService = consoleService;
_runtimeInfo = runtimeInfo;
_container = container;
_logger = logger;
}
@ -44,7 +48,7 @@ namespace NzbDrone.Host
case ApplicationModes.Interactive:
{
_logger.Debug("Console selected");
_logger.Debug(_runtimeInfo.IsWindowsTray ? "Tray selected" : "Console selected");
DbFactory.RegisterDatabase(_container);
_nzbDroneServiceFactory.Start();

Loading…
Cancel
Save