mirror of
https://github.com/SabreTools/SabreTools.Serialization.git
synced 2026-02-05 21:34:02 +00:00
Compare commits
9 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1b819d96a5 | ||
|
|
ad2bfc31bc | ||
|
|
66b4f12fb3 | ||
|
|
40de2575bb | ||
|
|
be4a95fe91 | ||
|
|
c685b5e679 | ||
|
|
99baeba735 | ||
|
|
bc6b6d39da | ||
|
|
2bb814e170 |
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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
36
publish-nix.sh
Executable 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
26
publish-win.ps1
Normal 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
|
||||
}
|
||||
Reference in New Issue
Block a user