Skip to content

Commit

Permalink
Replace directives with GetDistro function
Browse files Browse the repository at this point in the history
  • Loading branch information
rankynbass committed Jun 25, 2023
1 parent 8fd716d commit 380e62a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 11 deletions.
2 changes: 1 addition & 1 deletion lib/FFXIVQuickLauncher
19 changes: 9 additions & 10 deletions src/XIVLauncher.Core/WineManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,6 @@ public enum WineVersion

public static class WineManager
{
#if WINE_XIV_ARCH_LINUX
private const string DISTRO = "arch";
#elif WINE_XIV_FEDORA_LINUX
private const string DISTRO = "fedora";
#else
private const string DISTRO = "ubuntu";
#endif

public static WineRunner Initialize()
{
var winepath = "";
Expand All @@ -62,12 +54,12 @@ public static WineRunner Initialize()
{
case WineVersion.Wine8_5:
folder = "wine-xiv-staging-fsync-git-8.5.r4.g4211bac7";
url = $"https://github.com/goatcorp/wine-xiv-git/releases/download/8.5.r4.g4211bac7/wine-xiv-staging-fsync-git-{DISTRO}-8.5.r4.g4211bac7.tar.xz";
url = $"https://github.com/goatcorp/wine-xiv-git/releases/download/8.5.r4.g4211bac7/wine-xiv-staging-fsync-git-{GetDistro()}-8.5.r4.g4211bac7.tar.xz";
break;

case WineVersion.Wine7_10:
folder = "wine-xiv-staging-fsync-git-7.10.r3.g560db77d";
url = $"https://github.com/goatcorp/wine-xiv-git/releases/download/7.10.r3.g560db77d/wine-xiv-staging-fsync-git-{DISTRO}-7.10.r3.g560db77d.tar.xz";
url = $"https://github.com/goatcorp/wine-xiv-git/releases/download/7.10.r3.g560db77d/wine-xiv-staging-fsync-git-{GetDistro()}-7.10.r3.g560db77d.tar.xz";
break;

default:
Expand All @@ -90,6 +82,13 @@ public static WineRunner Initialize()

return new WineRunner(winepath, wineargs, folder, url, Program.storage.Root.FullName, env);
}

private static string GetDistro()
{
if (File.Exists("/etc/arch-release")) return "arch";
if (File.Exists("/etc/fedora-release")) return "fedora";
return "ubuntu";
}
}


Expand Down

0 comments on commit 380e62a

Please sign in to comment.