Compare commits

...

9 Commits
1.5.4 ... 1.5.5

Author SHA1 Message Date
Matt Nadareski
1b819d96a5 Bump version 2024-04-24 10:17:14 -04:00
Matt Nadareski
ad2bfc31bc Update SabreTools.Models 2024-04-24 10:15:27 -04:00
Matt Nadareski
66b4f12fb3 Port one more extension from UnshieldSharp 2024-04-24 00:39:27 -04:00
Matt Nadareski
40de2575bb Add last extension property from UnshieldSharp 2024-04-24 00:33:24 -04:00
Matt Nadareski
be4a95fe91 Handle nullable better 2024-04-24 00:30:03 -04:00
Matt Nadareski
c685b5e679 Add extension properties from UnshieldSharp 2024-04-24 00:29:27 -04:00
Matt Nadareski
99baeba735 Make Linux publish script executable 2024-04-23 22:27:35 -04:00
Matt Nadareski
bc6b6d39da Add publish scripts 2024-04-23 22:27:26 -04:00
Matt Nadareski
2bb814e170 Remove now-unnecessary code 2024-04-23 22:22:04 -04:00
5 changed files with 99 additions and 13 deletions

View File

@@ -49,12 +49,12 @@ namespace SabreTools.Serialization.Deserializers
var directories = new List<Models.InstallShieldArchiveV3.Directory>();
for (int i = 0; i < header.DirCount; i++)
{
var directory = ParseDirectory(data, out uint chunkSize);
var directory = ParseDirectory(data);
if (directory?.Name == null)
return null;
directories.Add(directory);
data.Seek(chunkSize - directory.Name.Length - 6, SeekOrigin.Current);
data.Seek(directory.ChunkSize - directory.Name.Length - 6, SeekOrigin.Current);
}
// Set the directories
@@ -112,16 +112,9 @@ namespace SabreTools.Serialization.Deserializers
/// </summary>
/// <param name="data">Stream to parse</param>
/// <returns>Filled directory on success, null on error</returns>
public static Models.InstallShieldArchiveV3.Directory? ParseDirectory(Stream data, out uint chunkSize)
public static Models.InstallShieldArchiveV3.Directory? ParseDirectory(Stream data)
{
// TODO: Use ReadType when model is fixed
var directory = new Models.InstallShieldArchiveV3.Directory();
directory.FileCount = data.ReadUInt16();
chunkSize = data.ReadUInt16(); // TODO: Add to model and remove from output params
directory.Name = data.ReadPrefixedAnsiString();
return directory;
return data.ReadType<Models.InstallShieldArchiveV3.Directory>();
}
/// <summary>

View File

@@ -8,7 +8,7 @@
<LangVersion>latest</LangVersion>
<Nullable>enable</Nullable>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<Version>1.5.4</Version>
<Version>1.5.5</Version>
<!-- Package Properties -->
<Authors>Matt Nadareski</Authors>
@@ -30,7 +30,7 @@
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
<PackageReference Include="SabreTools.Hashing" Version="1.2.0" />
<PackageReference Include="SabreTools.IO" Version="1.4.0" />
<PackageReference Include="SabreTools.Models" Version="1.4.4" />
<PackageReference Include="SabreTools.Models" Version="1.4.5" />
</ItemGroup>
</Project>

View File

@@ -15,6 +15,37 @@ namespace SabreTools.Serialization.Wrappers
#region Extension Properties
/// <summary>
/// Reference to the next cabinet header
/// </summary>
/// <remarks>Only used in multi-file</remarks>
public InstallShieldCabinet? Next { get; set; }
/// <summary>
/// Number of components in the cabinet set
/// </summary>
public int ComponentCount => Model.Components?.Length ?? 0;
/// <summary>
/// Number of directories in the cabinet set
/// </summary>
public ushort DirectoryCount => Model.Descriptor?.DirectoryCount ?? 0;
/// <summary>
/// Number of files in the cabinet set
/// </summary>
public uint FileCount => Model.Descriptor?.FileCount ?? 0;
/// <summary>
/// Number of file groups in the cabinet set
/// </summary>
public int FileGroupCount => Model.FileGroups?.Length ?? 0;
/// <summary>
/// Indicates if Unicode strings are used
/// </summary>
public bool IsUnicode => MajorVersion >= 17;
/// <summary>
/// The major version of the cabinet
/// </summary>

36
publish-nix.sh Executable file
View File

@@ -0,0 +1,36 @@
#! /bin/bash
# This batch file assumes the following:
# - .NET 8.0 (or newer) SDK is installed and in PATH
#
# If any of these are not satisfied, the operation may fail
# in an unpredictable way and result in an incomplete output.
# Optional parameters
NO_BUILD=false
while getopts "uba" OPTION
do
case $OPTION in
b)
NO_BUILD=true
;;
*)
echo "Invalid option provided"
exit 1
;;
esac
done
# Set the current directory as a variable
BUILD_FOLDER=$PWD
# Only build if requested
if [ $NO_BUILD = false ]
then
# Restore Nuget packages for all builds
echo "Restoring Nuget packages"
dotnet restore
# Create Nuget Package
dotnet pack SabreTools.Serialization/SabreTools.Serialization.csproj --output $BUILD_FOLDER
fi

26
publish-win.ps1 Normal file
View File

@@ -0,0 +1,26 @@
# This batch file assumes the following:
# - .NET 8.0 (or newer) SDK is installed and in PATH
#
# If any of these are not satisfied, the operation may fail
# in an unpredictable way and result in an incomplete output.
# Optional parameters
param(
[Parameter(Mandatory = $false)]
[Alias("NoBuild")]
[switch]$NO_BUILD
)
# Set the current directory as a variable
$BUILD_FOLDER = $PSScriptRoot
# Only build if requested
if (!$NO_BUILD.IsPresent)
{
# Restore Nuget packages for all builds
Write-Host "Restoring Nuget packages"
dotnet restore
# Create Nuget Package
dotnet pack SabreTools.Serialization\SabreTools.Serialization.csproj --output $BUILD_FOLDER
}