Attempt to handle not found System.Runtime.InteropServices.RuntimeInformation

https://github.com/Jackett/Jackett/issues/3816
This commit is contained in:
flightlevel
2018-09-24 19:24:17 +10:00
parent 2f378210d9
commit f9b4b5a76c
5 changed files with 35 additions and 14 deletions

View File

@@ -10,7 +10,6 @@ using NLog;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading.Tasks;
using static Jackett.Common.Models.IndexerConfig.ConfigurationData;
@@ -177,10 +176,9 @@ namespace Jackett.Common.Indexers
//TODO: Remove this section once users have moved off DPAPI
private bool MigratedFromDPAPI(JToken jsonConfig)
{
bool runningOnDotNetCore = RuntimeInformation.FrameworkDescription.IndexOf("core", StringComparison.OrdinalIgnoreCase) >= 0;
bool isWindows = Environment.OSVersion.Platform == PlatformID.Win32NT;
if (!isWindows && runningOnDotNetCore)
if (!isWindows && DotNetCoreUtil.IsRunningOnDotNetCore)
{
// User isn't running Windows, but is running on .NET Core framework, no access to the DPAPI, so don't bother trying to migrate
return false;