Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 14 additions & 8 deletions Interface/Actions/UnpackGameAction.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,21 @@ public void Execute(Dictionary<string, string> 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
Expand Down