From 785442e60ecfad63b5abf9920efa01b8d8dd9556 Mon Sep 17 00:00:00 2001 From: Jarrod Doyle Date: Wed, 15 Jan 2025 21:24:19 +0000 Subject: [PATCH] Unzip resources in reverse order and overwrite --- KeepersCompound.LGS/ResourcePathManager.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/KeepersCompound.LGS/ResourcePathManager.cs b/KeepersCompound.LGS/ResourcePathManager.cs index 1841d6a..caac27f 100644 --- a/KeepersCompound.LGS/ResourcePathManager.cs +++ b/KeepersCompound.LGS/ResourcePathManager.cs @@ -189,11 +189,12 @@ public class ResourcePathManager // Do the extraction bro // The path order is a priority order, so we don't want to overwrite any files when extracting // TODO: Check if there's any problems caused by case sensitivity - foreach (var zipPath in zipPaths) + for (var i = 0; i < zipPaths.Count; i++) { + var zipPath = zipPaths[^(i + 1)]; var resType = Path.GetFileNameWithoutExtension(zipPath); var extractPath = Path.Join(_extractionPath, resType); - ZipFile.OpenRead(zipPath).ExtractToDirectory(extractPath, false); + ZipFile.OpenRead(zipPath).ExtractToDirectory(extractPath, true); } if (!FindConfigVar(installCfgLines, "load_path", out var omsPath))