diff --git a/Interface/Actions/UnpackGameAction.cs b/Interface/Actions/UnpackGameAction.cs index e3e94a1..37444c7 100644 --- a/Interface/Actions/UnpackGameAction.cs +++ b/Interface/Actions/UnpackGameAction.cs @@ -30,15 +30,21 @@ public void Execute(Dictionary args) var contentPath = args[FezContentDirectory]; var outputDir = args[DestinationFolder]; - var packagePaths = new string[] { "Essentials.pak", "Music.pak", "Other.pak", "Updates.pak" } - .Select(path => Path.Combine(contentPath, path)).ToArray(); - - foreach (var packagePath in packagePaths) + var packagePaths = Directory.GetFiles(contentPath, "*.pak").OrderBy(f => f).ToList(); + Console.WriteLine($"Found directories: {string.Join(", ", packagePaths.Select(Path.GetFileName))}"); + + var updatesPak = packagePaths.FirstOrDefault(f => f.EndsWith("Updates.pak")); + if (!string.IsNullOrEmpty(updatesPak)) { - if (!File.Exists(packagePath)) - { - throw new Exception($"Given directory is not FEZ's Content directory (missing {Path.GetFileName(packagePath)})."); - } + // Files from this directory are overwritten on top of existing ones, so process them last. + packagePaths.Remove(updatesPak); + packagePaths.Add(updatesPak); + } + else + { + Console.WriteLine("\n WARNING! Updates.pak directory was not found."); + Console.WriteLine(" Only older versions of the game (usually released before the current 1.12)"); + Console.WriteLine(" may not have this directory!\n"); } var settings = new FormatConverterSettings