Fixed: Built-in updater for mono version

pull/6/head
Qstick 3 years ago
parent 1c292ed190
commit 0c7de90e40

@ -23,7 +23,10 @@ namespace NzbDrone.Common.EnvironmentInfo
serviceProvider.ServiceExist(ServiceProvider.SERVICE_NAME) &&
serviceProvider.GetStatus(ServiceProvider.SERVICE_NAME) == ServiceControllerStatus.StartPending;
//Guarded to avoid issues when running in a non-managed process
#if NETCOREAPP
// net5.0 will return Radarr.dll for entry assembly, we need the actual
// executable name (Radarr on linux). On mono this will return the location of
// the mono executable itself, which is not what we want.
var entry = Process.GetCurrentProcess().MainModule;
if (entry != null)
@ -31,6 +34,12 @@ namespace NzbDrone.Common.EnvironmentInfo
ExecutingApplication = entry.FileName;
IsWindowsTray = OsInfo.IsWindows && entry.ModuleName == $"{ProcessProvider.PROWLARR_PROCESS_NAME}.exe";
}
#else
// On mono we need to get the location of the Radarr assembly, not Mono.
// Can't be running tray app in mono.
ExecutingApplication = Assembly.GetEntryAssembly()?.Location;
#endif
}
static RuntimeInfo()

@ -1,4 +1,5 @@
using System;
using System.Diagnostics;
using System.Reflection;
using System.Text;
using System.Threading;
@ -22,7 +23,13 @@ namespace Prowlarr.Host
{
try
{
Logger.Info("Starting Prowlarr - {0} - Version {1}", Assembly.GetCallingAssembly().Location, Assembly.GetExecutingAssembly().GetName().Version);
Logger.Info("Starting Prowlarr - {0} - Version {1}",
#if NETCOREAPP
Process.GetCurrentProcess().MainModule.FileName,
#else
Assembly.GetCallingAssembly().Location,
#endif
Assembly.GetExecutingAssembly().GetName().Version);
if (!PlatformValidation.IsValidate(userAlert))
{

Loading…
Cancel
Save