Fix OSX detection

This commit is contained in:
Timothy Baldridge 2021-09-27 17:59:01 -06:00
parent cc0c2d2eac
commit fb8bbfaf7e

View File

@ -127,16 +127,22 @@ namespace Wabbajack.CLI.DTOs
public File FindSource(string downloadVersion)
{
var tuple = (OSDescription.Split(" ").First().Trim(), ProcessArchitecture);
string os = "";
if (IsOSPlatform(OSPlatform.Linux))
os = "Linux";
if (IsOSPlatform(OSPlatform.Windows))
os = "Windows";
if (IsOSPlatform(OSPlatform.OSX))
os = "OSX";
if (OSDescription.StartsWith("Microsoft Windows"))
tuple = ("Windows", tuple.ProcessArchitecture);
var tuple = (os, ProcessArchitecture);
List<Version> versions = new();
if (tuple == ("Linux", Architecture.X64)) versions = Linux64.Versions;
else if (tuple == ("Linux", Architecture.X86)) versions = Linux32.Versions;
else if (tuple == ("Windows", Architecture.X64)) versions = Windows64.Versions;
else if (tuple == ("OSX", Architecture.X64)) versions = Macosx64.Versions;
var version = versions.Where(v => v.CefVersion.StartsWith(downloadVersion + "."))
.OrderByDescending(v => v.ChromiumVersion)