Skip to content

Commit

Permalink
Rework troubleshooing option to only delete official wine versions, a…
Browse files Browse the repository at this point in the history
…nd leave custom wine
  • Loading branch information
rankynbass committed Sep 15, 2023
1 parent 7e58294 commit c18ef3b
Show file tree
Hide file tree
Showing 4 changed files with 60 additions and 31 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public override void Draw()
Program.ClearPrefix();
}

ImGui.Text("\nClear the managed Wine install and DXVK");
ImGui.Text("\nClear the managed Wine and DXVK installs. Custom versions won't be touched.");
if (ImGui.Button("Clear Wine & DXVK"))
{
Program.ClearTools(true);
Expand All @@ -61,6 +61,12 @@ public override void Draw()
Program.ClearAll(true);
}

ImGui.Text("\nOpen the .xlcore folder in your file browser.");
if (ImGui.Button("Open .xlcore"))
{
PlatformHelpers.OpenBrowser(Program.storage.Root.FullName);
}

ImGui.Text("\nGenerate a troubleshooting pack to upload to the official Discord channel");
if (ImGui.Button("Generate tspack"))
{
Expand Down
19 changes: 16 additions & 3 deletions src/XIVLauncher.Core/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -418,9 +418,22 @@ public static void ClearPlugins(bool tsbutton = false)

public static void ClearTools(bool tsbutton = false)
{
storage.GetFolder("compatibilitytool").Delete(true);
storage.GetFolder("compatibilitytool/wine");
storage.GetFolder("compatibilitytool/dxvk");
foreach (var winetool in Wine.Versions)
{
if (winetool.Value.ContainsKey("url"))
if (!string.IsNullOrEmpty(winetool.Value["url"]))
storage.GetFolder($"compatibilitytool/wine/{winetool.Key}").Delete(true);
}
foreach (var dxvktool in Dxvk.Versions)
{
if (dxvktool.Value.ContainsKey("url"))
if (!string.IsNullOrEmpty(dxvktool.Value["url"]))
storage.GetFolder($"compatibilitytool/dxvk/{dxvktool.Key}").Delete(true);
}
// Re-initialize Versions so they get *Download* marks back.
Wine.Initialize();
Dxvk.Initialize();

if (tsbutton) CreateCompatToolsInstance();
}

Expand Down
36 changes: 21 additions & 15 deletions src/XIVLauncher.Core/UnixCompatibility/Dxvk.cs
Original file line number Diff line number Diff line change
Expand Up @@ -61,24 +61,30 @@ public static class Dxvk

static Dxvk()
{
Versions = new Dictionary<string, Dictionary<string, string>>()
{
{ "dxvk-2.3", new Dictionary<string, string>()
{ {"name", "DXVK 2.3"}, {"desc", "Latest version, using Graphics Pipeline Libs. Async no longer needed."},
{"label", "Current"}, {"url", "https://github.com/doitsujin/dxvk/releases/download/v2.3/dxvk-2.3.tar.gz"},
{"mark", "Download" } } },
{ "dxvk-async-1.10.3", new Dictionary<string, string>()
{ {"name", "DXVK 1.10.3"}, {"desc", "Legacy version with high compatibility. Includes async patch."},
{"label", "Legacy"}, {"url", "https://github.com/Sporif/dxvk-async/releases/download/1.10.3/dxvk-async-1.10.3.tar.gz"},
{"mark", "Download" } } },
{ "DISABLED", new Dictionary<string, string>()
{ {"name", "WineD3D"}, {"desc", "Use WineD3D (OpenGL) instead of DXVK. For old GPUs without Vulkan support."},
{"label", "Disabled"} } },
};
Versions = new Dictionary<string, Dictionary<string, string>>();
}

public static void Initialize()
{
// Add default versions.
Versions["dxvk-2.3"] = new Dictionary<string, string>()
{
{"name", "DXVK 2.3"}, {"desc", "Latest version, using Graphics Pipeline Libs. Async no longer needed."},
{"label", "Current"}, {"url", "https://github.com/doitsujin/dxvk/releases/download/v2.3/dxvk-2.3.tar.gz"},
{"mark", "Download" }
};
Versions["dxvk-async-1.10.3"] = new Dictionary<string, string>()
{
{"name", "DXVK 1.10.3"}, {"desc", "Legacy version with high compatibility. Includes async patch."},
{"label", "Legacy"}, {"url", "https://github.com/Sporif/dxvk-async/releases/download/1.10.3/dxvk-async-1.10.3.tar.gz"},
{"mark", "Download" }
};
Versions["DISABLED"] = new Dictionary<string, string>()
{
{"name", "WineD3D"}, {"desc", "Use WineD3D (OpenGL) instead of DXVK. For old GPUs without Vulkan support."},
{"label", "Disabled"}
};

var toolDirectory = new DirectoryInfo(Path.Combine(Program.storage.Root.FullName, "compatibilitytool", "dxvk"));

if (!toolDirectory.Exists)
Expand All @@ -99,7 +105,7 @@ public static void Initialize()
Versions[dxvkDir.Name].Remove("mark");
continue;
}
Versions.Add(dxvkDir.Name, new Dictionary<string, string>() { {"label", "Custom"} });
Versions[dxvkDir.Name] = new Dictionary<string, string>() { {"label", "Custom"} };
}
}
}
Expand Down
28 changes: 16 additions & 12 deletions src/XIVLauncher.Core/UnixCompatibility/Wine.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,21 +34,25 @@ public static class Wine

static Wine()
{
Versions = new Dictionary<string, Dictionary<string, string>>()
{
{ "wine-xiv-staging-fsync-git-7.10.r3.g560db77d", new Dictionary<string, string>()
{ {"name", "Wine-XIV 7.10"}, {"desc","Patched version of Wine Staging 7.10. Default."},
{"label", "Official"}, {"url", $"https://github.com/goatcorp/wine-xiv-git/releases/download/7.10.r3.g560db77d/wine-xiv-staging-fsync-git-{OSInfo.Package.ToString()}-7.10.r3.g560db77d.tar.xz"},
{"mark", "Download"} } },
{ "wine-xiv-staging-fsync-git-8.5.r4.g4211bac7", new Dictionary<string, string>()
{ {"name", "Wine-XIV 8.5"}, {"desc", "Patched version of Wine Staging 8.5. Change Windows version to 7 for best results."},
{"label", "Official"}, {"url", $"https://github.com/goatcorp/wine-xiv-git/releases/download/8.5.r4.g4211bac7/wine-xiv-staging-fsync-git-{OSInfo.Package.ToString()}-8.5.r4.g4211bac7.tar.xz"},
{"mark", "Download"} } },
};
Versions = new Dictionary<string, Dictionary<string, string>>();
}

public static void Initialize()
{
// Add default versions.
Versions["wine-xiv-staging-fsync-git-7.10.r3.g560db77d"] = new Dictionary<string, string>()
{
{"name", "Wine-XIV 7.10"}, {"desc","Patched version of Wine Staging 7.10. Default."},
{"label", "Official"}, {"url", $"https://github.com/goatcorp/wine-xiv-git/releases/download/7.10.r3.g560db77d/wine-xiv-staging-fsync-git-{OSInfo.Package.ToString()}-7.10.r3.g560db77d.tar.xz"},
{"mark", "Download"}
};
Versions["wine-xiv-staging-fsync-git-8.5.r4.g4211bac7"] = new Dictionary<string, string>()
{
{"name", "Wine-XIV 8.5"}, {"desc", "Patched version of Wine Staging 8.5. Change Windows version to 7 for best results."},
{"label", "Official"}, {"url", $"https://github.com/goatcorp/wine-xiv-git/releases/download/8.5.r4.g4211bac7/wine-xiv-staging-fsync-git-{OSInfo.Package.ToString()}-8.5.r4.g4211bac7.tar.xz"},
{"mark", "Download"}
};

var toolDirectory = new DirectoryInfo(Path.Combine(Program.storage.Root.FullName, "compatibilitytool", "wine"));

if (!toolDirectory.Exists)
Expand All @@ -67,7 +71,7 @@ public static void Initialize()
Versions[wineDir.Name].Remove("mark");
continue;
}
Versions.Add(wineDir.Name, new Dictionary<string, string>() {{"label", "Custom"}});
Versions[wineDir.Name] = new Dictionary<string, string>() { {"label", "Custom"} };
}
}
}
Expand Down

0 comments on commit c18ef3b

Please sign in to comment.