Re-enable stream extraction for MScab (#58)

* Re-enable extraction from stream

* Remove todo pre PR

* Properly support all situations, remove whitespace
This commit is contained in:
HeroponRikiBestest
2026-01-25 12:24:28 -05:00
committed by GitHub
parent 4bfaf36e24
commit 7f7d0f84ef

View File

@@ -171,26 +171,32 @@ namespace SabreTools.Serialization.Wrappers
// Display warning in debug runs
if (includeDebug) Console.WriteLine("WARNING: LZX and Quantum compression schemes are not supported so some files may be skipped!");
// Only extract if a physical file is present
// TODO: Revisit if partial extraction should be supported
if (Filename == null)
MicrosoftCabinet? cabinet;
if (Filename != null)
{
// Open the full set if possible
cabinet = OpenSet(Filename, includeDebug);
if (cabinet == null)
{
if (includeDebug) Console.WriteLine($"Cabinet set could not be opened!");
cabinet = this;
}
else
{
// If we have anything but the first file, avoid extraction to avoid repeat extracts
// TODO: This is going to have to take missing parts into account for MSI support
if (Filename != cabinet.Filename)
{
string firstCabName = Path.GetFileName(cabinet.Filename) ?? string.Empty;
if (includeDebug) Console.WriteLine($"Only the first cabinet {firstCabName} will be extracted!");
return false;
}
}
}
else
{
if (includeDebug) Console.WriteLine($"Cabinet set could not be opened!");
return false;
}
// Open the full set if possible
var cabinet = OpenSet(Filename, includeDebug);
if (cabinet == null)
return false;
// If we have anything but the first file, avoid extraction to avoid repeat extracts
// TODO: This is going to have to take missing parts into account for MSI support
if (Filename != cabinet.Filename)
{
string firstCabName = Path.GetFileName(cabinet.Filename) ?? string.Empty;
if (includeDebug) Console.WriteLine($"Only the first cabinet {firstCabName} will be extracted!");
return false;
cabinet = this;
}
// If the archive is invalid