diff --git a/CreamInstaller/CreamInstaller.csproj b/CreamInstaller/CreamInstaller.csproj index 30597f3..c5d2b4d 100644 --- a/CreamInstaller/CreamInstaller.csproj +++ b/CreamInstaller/CreamInstaller.csproj @@ -5,7 +5,7 @@ True Resources\ini.ico true - 3.4.0.3 + 3.4.0.4 Resources\ini.ico LICENSE 2021, pointfeev (https://github.com/pointfeev) diff --git a/CreamInstaller/Epic/EpicLibrary.cs b/CreamInstaller/Epic/EpicLibrary.cs index 9db641c..5a8b00e 100644 --- a/CreamInstaller/Epic/EpicLibrary.cs +++ b/CreamInstaller/Epic/EpicLibrary.cs @@ -11,22 +11,25 @@ namespace CreamInstaller.Epic; internal static class EpicLibrary { - private static string epicAppDataPath; - internal static string EpicAppDataPath + private static string epicManifestsPath; + internal static string EpicManifestsPath { get { - epicAppDataPath ??= Registry.GetValue(@"HKEY_LOCAL_MACHINE\SOFTWARE\Epic Games\EpicGamesLauncher", "AppDataPath", null) as string; - epicAppDataPath ??= Registry.GetValue(@"HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Epic Games\EpicGamesLauncher", "AppDataPath", null) as string; - return epicAppDataPath; + epicManifestsPath ??= Registry.GetValue(@"HKEY_CURRENT_USER\Software\Epic Games\EOS", "ModSdkMetadataDir", null) as string; + epicManifestsPath ??= Registry.GetValue(@"HKEY_CURRENT_USER\Software\Wow6432Node\Epic Games\EOS", "ModSdkMetadataDir", null) as string; + epicManifestsPath ??= Registry.GetValue(@"HKEY_LOCAL_MACHINE\SOFTWARE\Epic Games\EpicGamesLauncher", "AppDataPath", null) as string; + epicManifestsPath ??= Registry.GetValue(@"HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Epic Games\EpicGamesLauncher", "AppDataPath", null) as string; + if (epicManifestsPath.EndsWith(@"\Data")) epicManifestsPath += @"\Manifests"; + return epicManifestsPath; } } internal static async Task> GetGames() => await Task.Run(() => { List games = new(); - if (!Directory.Exists(EpicAppDataPath)) return games; - string manifests = EpicAppDataPath + @"\Manifests"; + if (!Directory.Exists(EpicManifestsPath)) return games; + string manifests = EpicManifestsPath; if (!Directory.Exists(manifests)) return games; string[] files = Directory.GetFiles(manifests, "*.item"); foreach (string file in files) diff --git a/CreamInstaller/Forms/SelectForm.cs b/CreamInstaller/Forms/SelectForm.cs index 32303a1..5fd6030 100644 --- a/CreamInstaller/Forms/SelectForm.cs +++ b/CreamInstaller/Forms/SelectForm.cs @@ -260,7 +260,7 @@ internal partial class SelectForm : CustomForm appTasks.Add(task); } } - if (Directory.Exists(EpicLibrary.EpicAppDataPath) && ProgramsToScan.Any(c => c.platform == "Epic")) + if (Directory.Exists(EpicLibrary.EpicManifestsPath) && ProgramsToScan.Any(c => c.platform == "Epic")) { List epicGames = await EpicLibrary.GetGames(); foreach (Manifest manifest in epicGames) @@ -417,7 +417,7 @@ internal partial class SelectForm : CustomForm foreach (Tuple program in await SteamLibrary.GetGames()) if (!Program.IsGameBlocked(program.Item1, program.Item5)) gameChoices.Add(("Steam", program.Item1, program.Item2, ProgramsToScan is not null && ProgramsToScan.Any(p => p.id == program.Item1))); - if (Directory.Exists(EpicLibrary.EpicAppDataPath)) + if (Directory.Exists(EpicLibrary.EpicManifestsPath)) foreach (Manifest manifest in await EpicLibrary.GetGames()) if (!Program.IsGameBlocked(manifest.DisplayName, manifest.InstallLocation)) gameChoices.Add(("Epic", manifest.CatalogNamespace, manifest.DisplayName, ProgramsToScan is not null && ProgramsToScan.Any(p => p.id == manifest.CatalogNamespace)));