- Fixed dll directories being incorrectly added if a koaloader-specific config/cache existed
- Fixed paradox launcher repair sometimes leaving behind an incorrect installation
This commit is contained in:
pointfeev 2022-09-24 05:29:21 -04:00
parent 285dd5b521
commit 1722110405
2 changed files with 15 additions and 7 deletions

View file

@ -93,9 +93,13 @@ internal static class ParadoxLauncher
byte[] epicOriginalSdk64 = null; byte[] epicOriginalSdk64 = null;
foreach (string directory in selection.DllDirectories) foreach (string directory in selection.DllDirectories)
{ {
bool koaloaderInstalled = Koaloader.AutoLoadDlls
.Select(pair => (pair.unlocker, path: directory + @"\" + pair.dll))
.Any(pair => File.Exists(pair.path) && pair.path.IsResourceFile());
directory.GetSmokeApiComponents(out string api32, out string api32_o, out string api64, out string api64_o, out string config, out _); directory.GetSmokeApiComponents(out string api32, out string api32_o, out string api64, out string api64_o, out string config, out _);
smokeInstalled = smokeInstalled smokeInstalled = smokeInstalled
|| File.Exists(api32_o) || File.Exists(api64_o) || File.Exists(config) || File.Exists(api32_o) || File.Exists(api64_o)
|| File.Exists(config) && !koaloaderInstalled
|| File.Exists(api32) && api32.IsResourceFile(ResourceIdentifier.Steamworks32) || File.Exists(api32) && api32.IsResourceFile(ResourceIdentifier.Steamworks32)
|| File.Exists(api64) && api64.IsResourceFile(ResourceIdentifier.Steamworks64); || File.Exists(api64) && api64.IsResourceFile(ResourceIdentifier.Steamworks64);
await SmokeAPI.Uninstall(directory, deleteConfig: false); await SmokeAPI.Uninstall(directory, deleteConfig: false);
@ -105,7 +109,8 @@ internal static class ParadoxLauncher
steamOriginalSdk64 = File.ReadAllBytes(api64); steamOriginalSdk64 = File.ReadAllBytes(api64);
directory.GetScreamApiComponents(out api32, out api32_o, out api64, out api64_o, out config); directory.GetScreamApiComponents(out api32, out api32_o, out api64, out api64_o, out config);
screamInstalled = screamInstalled screamInstalled = screamInstalled
|| File.Exists(api32_o) || File.Exists(api64_o) || File.Exists(config) || File.Exists(api32_o) || File.Exists(api64_o)
|| File.Exists(config) && !koaloaderInstalled
|| File.Exists(api32) && api32.IsResourceFile(ResourceIdentifier.EpicOnlineServices32) || File.Exists(api32) && api32.IsResourceFile(ResourceIdentifier.EpicOnlineServices32)
|| File.Exists(api64) && api64.IsResourceFile(ResourceIdentifier.EpicOnlineServices64); || File.Exists(api64) && api64.IsResourceFile(ResourceIdentifier.EpicOnlineServices64);
await ScreamAPI.Uninstall(directory, deleteConfig: false); await ScreamAPI.Uninstall(directory, deleteConfig: false);

View file

@ -128,6 +128,9 @@ internal static class Resources
string subDirectory = directory.BeautifyPath(); string subDirectory = directory.BeautifyPath();
if (!dllDirectories.Contains(subDirectory)) if (!dllDirectories.Contains(subDirectory))
{ {
bool koaloaderInstalled = Koaloader.AutoLoadDlls
.Select(pair => (pair.unlocker, path: directory + @"\" + pair.dll))
.Any(pair => File.Exists(pair.path) && pair.path.IsResourceFile());
if (platform is Platform.Steam or Platform.Paradox) if (platform is Platform.Steam or Platform.Paradox)
{ {
subDirectory.GetSmokeApiComponents(out string api, out string api_o, out string api64, out string api64_o, out string config, out string cache); subDirectory.GetSmokeApiComponents(out string api, out string api_o, out string api64, out string api64_o, out string config, out string cache);
@ -135,8 +138,8 @@ internal static class Resources
|| File.Exists(api_o) || File.Exists(api_o)
|| File.Exists(api64) || File.Exists(api64)
|| File.Exists(api64_o) || File.Exists(api64_o)
|| File.Exists(config) || File.Exists(config) && !koaloaderInstalled
|| File.Exists(cache)) || File.Exists(cache) && !koaloaderInstalled)
dllDirectories.Add(subDirectory); dllDirectories.Add(subDirectory);
} }
if (platform is Platform.Epic or Platform.Paradox) if (platform is Platform.Epic or Platform.Paradox)
@ -146,7 +149,7 @@ internal static class Resources
|| File.Exists(api32_o) || File.Exists(api32_o)
|| File.Exists(api64) || File.Exists(api64)
|| File.Exists(api64_o) || File.Exists(api64_o)
|| File.Exists(config)) || File.Exists(config) && !koaloaderInstalled)
dllDirectories.Add(subDirectory); dllDirectories.Add(subDirectory);
} }
if (platform is Platform.Ubisoft) if (platform is Platform.Ubisoft)
@ -156,7 +159,7 @@ internal static class Resources
|| File.Exists(api32_o) || File.Exists(api32_o)
|| File.Exists(api64) || File.Exists(api64)
|| File.Exists(api64_o) || File.Exists(api64_o)
|| File.Exists(config)) || File.Exists(config) && !koaloaderInstalled)
dllDirectories.Add(subDirectory); dllDirectories.Add(subDirectory);
subDirectory.GetUplayR2Components(out string old_api32, out string old_api64, out api32, out api32_o, out api64, out api64_o, out config); subDirectory.GetUplayR2Components(out string old_api32, out string old_api64, out api32, out api32_o, out api64, out api64_o, out config);
if (File.Exists(old_api32) if (File.Exists(old_api32)
@ -165,7 +168,7 @@ internal static class Resources
|| File.Exists(api32_o) || File.Exists(api32_o)
|| File.Exists(api64) || File.Exists(api64)
|| File.Exists(api64_o) || File.Exists(api64_o)
|| File.Exists(config)) || File.Exists(config) && !koaloaderInstalled)
dllDirectories.Add(subDirectory); dllDirectories.Add(subDirectory);
} }
} }