From 4d952fc754980c28b60e22343d062c7bf17a9600 Mon Sep 17 00:00:00 2001 From: kaso17 Date: Thu, 26 Jan 2017 15:12:15 +0100 Subject: [PATCH] check for mono-devel --- src/Jackett/Services/ServerService.cs | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/Jackett/Services/ServerService.cs b/src/Jackett/Services/ServerService.cs index 999b2f5fa..c0bff0b47 100644 --- a/src/Jackett/Services/ServerService.cs +++ b/src/Jackett/Services/ServerService.cs @@ -153,7 +153,8 @@ namespace Jackett.Services try { var x = Environment.OSVersion; - logger.Info("Environment version: " + Environment.Version.ToString() + " (" + RuntimeEnvironment.GetRuntimeDirectory() + ")"); + var runtimedir = RuntimeEnvironment.GetRuntimeDirectory(); + logger.Info("Environment version: " + Environment.Version.ToString() + " (" + runtimedir + ")"); logger.Info("OS version: " + Environment.OSVersion.ToString() + (Environment.Is64BitOperatingSystem ? " (64bit OS)" : "") + (Environment.Is64BitProcess ? " (64bit process)" : "")); Type monotype = Type.GetType("Mono.Runtime"); if (monotype != null) @@ -164,6 +165,21 @@ namespace Jackett.Services monoVersion = displayName.Invoke(null, null).ToString(); logger.Info("mono version: " + monoVersion); + try + { + // Check for mono-devel + // Is there any better way which doesn't involve a hard cashes? + var mono_devel_file = Path.Combine(runtimedir, "mono-api-info.exe"); + if (!File.Exists(mono_devel_file)) + { + logger.Error("It looks like the mono-devel package is not installed, please make sure it's installed to avoid crashes."); + } + } + catch (Exception e) + { + logger.Error(e, "Error while checking for mono-devel"); + } + try { Encoding.GetEncoding("windows-1255");