Fix paradox launcher root directory

This commit is contained in:
pointfeev 2021-08-15 20:30:26 -04:00
parent bb7af1b8b1
commit d19a270d7c
No known key found for this signature in database
GPG key ID: AA14DC36C4D7D13C

View file

@ -122,26 +122,23 @@ namespace CreamInstaller
{ {
progress.Report(++curProgress); progress.Report(++curProgress);
if (Program.ProgramSelections.Any(selection => selection.ProgramName == node.Name)) { continue; } if (Program.ProgramSelections.Any(selection => selection.ProgramName == node.Name)) { continue; }
string rootDirectory; string rootDirectory = null;
List<string> directories = null; List<string> directories = null;
if (node.Name == "Paradox Launcher") if (node.Name == "Paradox Launcher")
{ {
rootDirectory = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData); rootDirectory = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData) + "\\Programs\\Paradox Interactive";
string launcherDirectory = rootDirectory + "\\Programs\\Paradox Interactive"; if (Directory.Exists(rootDirectory))
if (Directory.Exists(launcherDirectory))
{ {
directories = GetSteamApiDllDirectoriesFromGameDirectory(launcherDirectory); directories = GetSteamApiDllDirectoriesFromGameDirectory(rootDirectory);
} }
} }
else else
{ {
rootDirectory = null;
directories = null;
foreach (string libraryDirectory in GameLibraryDirectories) foreach (string libraryDirectory in GameLibraryDirectories)
{ {
if (Program.Canceled) { return; } if (Program.Canceled) { return; }
rootDirectory = GetGameDirectoryFromLibraryDirectory(node.Name, libraryDirectory); rootDirectory = GetGameDirectoryFromLibraryDirectory(node.Name, libraryDirectory);
if (rootDirectory != null) if (Directory.Exists(rootDirectory))
{ {
directories = GetSteamApiDllDirectoriesFromGameDirectory(rootDirectory); directories = GetSteamApiDllDirectoriesFromGameDirectory(rootDirectory);
break; break;