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);
if (Program.ProgramSelections.Any(selection => selection.ProgramName == node.Name)) { continue; }
string rootDirectory;
string rootDirectory = null;
List<string> directories = null;
if (node.Name == "Paradox Launcher")
{
rootDirectory = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData);
string launcherDirectory = rootDirectory + "\\Programs\\Paradox Interactive";
if (Directory.Exists(launcherDirectory))
rootDirectory = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData) + "\\Programs\\Paradox Interactive";
if (Directory.Exists(rootDirectory))
{
directories = GetSteamApiDllDirectoriesFromGameDirectory(launcherDirectory);
directories = GetSteamApiDllDirectoriesFromGameDirectory(rootDirectory);
}
}
else
{
rootDirectory = null;
directories = null;
foreach (string libraryDirectory in GameLibraryDirectories)
{
if (Program.Canceled) { return; }
rootDirectory = GetGameDirectoryFromLibraryDirectory(node.Name, libraryDirectory);
if (rootDirectory != null)
if (Directory.Exists(rootDirectory))
{
directories = GetSteamApiDllDirectoriesFromGameDirectory(rootDirectory);
break;