From d4b62c2068b64b683dea383c3e266707f0379eb8 Mon Sep 17 00:00:00 2001 From: pointfeev Date: Mon, 21 Feb 2022 16:42:03 -0500 Subject: [PATCH] v2.4.3.1 - Paradox Launcher CreamAPI configuration will now stay consistent after repair --- CreamInstaller/CreamInstaller.csproj | 2 +- CreamInstaller/Forms/SelectForm.cs | 10 +++++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/CreamInstaller/CreamInstaller.csproj b/CreamInstaller/CreamInstaller.csproj index 0b8ba75..1ae18bf 100644 --- a/CreamInstaller/CreamInstaller.csproj +++ b/CreamInstaller/CreamInstaller.csproj @@ -5,7 +5,7 @@ True Resources\ini.ico true - 2.4.3.0 + 2.4.3.1 Resources\ini.ico Automatically generates and installs CreamAPI files for Steam games on the user's computer. It can also generate and install CreamAPI for the Paradox Launcher should the user select a Paradox Interactive game. diff --git a/CreamInstaller/Forms/SelectForm.cs b/CreamInstaller/Forms/SelectForm.cs index 2b18412..63f58cd 100644 --- a/CreamInstaller/Forms/SelectForm.cs +++ b/CreamInstaller/Forms/SelectForm.cs @@ -561,13 +561,14 @@ internal partial class SelectForm : CustomForm new EventHandler(async (sender, e) => { if (!Program.IsProgramRunningDialog(this, selection)) return; - bool shouldReinstall = false; + byte[] cApiIni = null; byte[] properApi = null; byte[] properApi64 = null; foreach (string directory in selection.SteamApiDllDirectories) { directory.GetApiComponents(out string api, out string api_o, out string api64, out string api64_o, out string cApi); - shouldReinstall = File.Exists(cApi); + if (cApiIni is null && File.Exists(cApi)) + cApiIni = File.ReadAllBytes(cApi); await InstallForm.UninstallCreamAPI(directory); if (properApi is null && File.Exists(api) && !FileResourceExtensions.Equals(Properties.Resources.API, api)) properApi = File.ReadAllBytes(api); @@ -590,8 +591,11 @@ internal partial class SelectForm : CustomForm properApi64.Write(api64); neededRepair = true; } - if (shouldReinstall) + if (cApiIni is not null) + { await InstallForm.InstallCreamAPI(directory, selection); + cApiIni.Write(cApi); + } } if (neededRepair) new DialogForm(this).Show("Paradox Launcher Repair", Icon, "Paradox Launcher successfully repaired!", "OK");