Formatting cleanup

This commit is contained in:
Matt Nadareski
2026-01-25 13:38:52 -05:00
parent 5dfe6aefb0
commit 2959d82231
8 changed files with 17 additions and 17 deletions

View File

@@ -12,4 +12,4 @@ namespace SabreTools.Data.Models.InstallShieldExecutable
/// </summary>
public const string ISSetupSignatureString = "ISSetupStream";
}
}
}

View File

@@ -27,7 +27,7 @@ namespace SabreTools.Data.Models.InstallShieldExecutable
/// Length of the file. Stored in the installshield executable as a string.
/// </summary>
public ulong Length { get; set; }
/// <summary>
/// Offset of the file.
/// </summary>

View File

@@ -17,12 +17,12 @@ namespace SabreTools.Serialization.Readers
try
{
var sfx = new SFX();
// Cache the initial offset
long initialOffset = data.Position;
var sfxList = new List<FileEntry>();
while (data.Position < data.Length)
{
// Try to parse the entry
@@ -38,10 +38,10 @@ namespace SabreTools.Serialization.Readers
data.SeekIfPossible(length, SeekOrigin.Current);
sfxList.Add(fileEntry);
}
if (sfxList.Count == 0)
return null;
sfx.Entries = [.. sfxList];
return sfx;
}
@@ -62,14 +62,14 @@ namespace SabreTools.Serialization.Readers
string? name = data.ReadNullTerminatedAnsiString();
if (name == null)
return null;
// Both of these strings indicate that this is a different kind of encrypted and/or compressed format of
// ISEXE that is not yet supported, but will be in the future.
// ISEXE that is not yet supported, but will be in the future.
// They return early because no extraction can be performed, like how MsCab currently returns if a folder
// is LZX or Quantum.
if (name == ISSignatureString)
return null;
if (name == ISSetupSignatureString)
return null;
@@ -91,7 +91,7 @@ namespace SabreTools.Serialization.Readers
obj.Version = version;
obj.Length = lengthValue;
obj.Offset = data.Position - initialOffset;
return obj;
}
}

View File

@@ -18,12 +18,12 @@ namespace SabreTools.Serialization.Wrappers
{
var entry = Entries[i];
_dataSource.SeekIfPossible(entry.Offset, SeekOrigin.Begin);
// Get the length, and make sure it won't EOF
long length = (long)entry.Length;
if (length > _dataSource.Length - _dataSource.Position)
break;
// Ensure directory separators are consistent
var filename = entry.Path.TrimEnd('\0');
if (Path.DirectorySeparatorChar == '\\')

View File

@@ -16,7 +16,7 @@ namespace SabreTools.Serialization.Wrappers
/// <inheritdoc cref="SFX.FileEntry"/>
public FileEntry[] Entries => Model.Entries;
#endregion
#region Constructors

View File

@@ -539,7 +539,7 @@ namespace SabreTools.Serialization.Wrappers
// Attempt to extract package
return MatroschkaPackage.Extract(outputDirectory, includeDebug);
}
/// <summary>
/// Extract data from an Installshield Executable
/// </summary>

View File

@@ -257,7 +257,7 @@ namespace SabreTools.Serialization.Wrappers
}
}
} = null;
/// <summary>
/// InstallShield Executable wrapper, if it exists
/// </summary>
@@ -289,7 +289,7 @@ namespace SabreTools.Serialization.Wrappers
_installshieldExecutableFailed = true;
return null;
}
// Parse the package
lock (_dataSourceLock)
{
@@ -1087,7 +1087,7 @@ namespace SabreTools.Serialization.Wrappers
/// Cached attempt at creation for <see cref="InstallShieldExecutable"/>
/// </summary>
private bool _installshieldExecutableFailed = false;
/// <summary>
/// Lock object for <see cref="MatroschkaPackage"/>
/// </summary>