From d19a270d7c8fd7b98dc65b0acc39f4246462d83e Mon Sep 17 00:00:00 2001 From: pointfeev Date: Sun, 15 Aug 2021 20:30:26 -0400 Subject: [PATCH] Fix paradox launcher root directory --- CreamInstaller/SelectForm.cs | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/CreamInstaller/SelectForm.cs b/CreamInstaller/SelectForm.cs index 0d44a8d..72a97c1 100644 --- a/CreamInstaller/SelectForm.cs +++ b/CreamInstaller/SelectForm.cs @@ -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 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;