From b24aa814b163b0e42b2c7f5a4c334c7d4f17106a Mon Sep 17 00:00:00 2001 From: suchmememanyskill <38142618+suchmememanyskill@users.noreply.github.com> Date: Sun, 19 May 2024 22:29:43 +0200 Subject: [PATCH] SteamExporterPlugin: Seperate proton prefixes by version --- SteamExporterPlugin/Exporter.cs | 2 +- SteamExporterPlugin/ProtonWrapper.cs | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/SteamExporterPlugin/Exporter.cs b/SteamExporterPlugin/Exporter.cs index 7c4428c..1c01086 100644 --- a/SteamExporterPlugin/Exporter.cs +++ b/SteamExporterPlugin/Exporter.cs @@ -13,7 +13,7 @@ namespace SteamExporterPlugin; public class Exporter : IGameSource { public string ServiceName => "Steam Exporter"; - public string Version => "v1.2.8"; + public string Version => "v1.2.9"; public string SlugServiceName => "steam-exporter"; public string ShortServiceName => "Steam"; public PluginType Type => PluginType.BootProfile; diff --git a/SteamExporterPlugin/ProtonWrapper.cs b/SteamExporterPlugin/ProtonWrapper.cs index 7f3349e..10b5f6a 100644 --- a/SteamExporterPlugin/ProtonWrapper.cs +++ b/SteamExporterPlugin/ProtonWrapper.cs @@ -79,6 +79,7 @@ private string GetPrefixFolder(GameConfig config, IGame game) { string homeFolder = Environment.GetFolderPath(Environment.SpecialFolder.UserProfile); string prefixBaseFolder = Path.Join(homeFolder, ".proton_alfae"); + string defaultString = $"default_{Name.Replace(" ", "_")}"; if (!Directory.Exists(prefixBaseFolder)) Directory.CreateDirectory(prefixBaseFolder); @@ -87,7 +88,11 @@ private string GetPrefixFolder(GameConfig config, IGame game) if (Directory.Exists(Path.Join(homeFolder, ".proton_launcher")) && !Directory.Exists(Path.Join(prefixBaseFolder, "default"))) Directory.Move(Path.Join(homeFolder, ".proton_launcher"), Path.Join(prefixBaseFolder, "default")); - string prefixFolder = Path.Join(prefixBaseFolder, (config.SeparateProtonPath) ? $"{game.Source.SlugServiceName}.{game.InternalName}" : "default"); + // To keep compatibility with Alfae <= 1.4.3 + if (Directory.Exists(Path.Join(prefixBaseFolder, "default"))) + Directory.Move(Path.Join(prefixBaseFolder, "default"), Path.Join(prefixBaseFolder, defaultString)); + + string prefixFolder = Path.Join(prefixBaseFolder, (config.SeparateProtonPath) ? $"{game.Source.SlugServiceName}.{game.InternalName}" : defaultString); if (!Directory.Exists(prefixFolder)) Directory.CreateDirectory(prefixFolder);