4 Commits
1.2.0 ... 1.3.0

Author SHA1 Message Date
Matt Nadareski
25b6493249 Bump version 2023-11-21 11:15:24 -05:00
Matt Nadareski
a551363c0b Support .NET Framework 2.0 2023-11-20 23:44:05 -05:00
Matt Nadareski
2fd92aea8f Support .NET Framework 3.5 2023-11-20 21:10:43 -05:00
Matt Nadareski
a61b3d0ed9 Add IS Archive V3 models 2023-11-15 14:30:25 -05:00
7 changed files with 133 additions and 6 deletions

View File

@@ -0,0 +1,21 @@
namespace SabreTools.Models.InstallShieldArchiveV3
{
/// <see href="https://github.com/wfr/unshieldv3/blob/master/ISArchiveV3.cpp"/>
public class Archive
{
/// <summary>
/// Archive header information
/// </summary>
public Header? Header { get; set; }
/// <summary>
/// Directories found in the archive
/// </summary>
public Directory[]? Directories { get; set; }
/// <summary>
/// Files found in the archive
/// </summary>
public File[]? Files { get; set; }
}
}

View File

@@ -0,0 +1,10 @@
namespace SabreTools.Models.InstallShieldArchiveV3
{
/// <see href="https://github.com/wfr/unshieldv3/blob/master/ISArchiveV3.cpp"/>
public class Directory
{
public string? Name { get; set; }
public ushort FileCount { get; set; }
}
}

View File

@@ -0,0 +1,11 @@
namespace SabreTools.Models.InstallShieldArchiveV3
{
public enum Attributes : byte
{
READONLY = 0x01,
HIDDEN = 0x02,
SYSTEM = 0x04,
UNCOMPRESSED = 0x10,
ARCHIVE = 0x20,
}
}

View File

@@ -0,0 +1,32 @@
namespace SabreTools.Models.InstallShieldArchiveV3
{
/// <see href="https://github.com/wfr/unshieldv3/blob/master/ISArchiveV3.h"/>
public class File
{
public byte VolumeEnd { get; set; }
public ushort Index { get; set; }
public uint UncompressedSize { get; set; }
public uint CompressedSize { get; set; }
public uint Offset { get; set; }
public uint DateTime { get; set; }
public uint Reserved0 { get; set; }
public ushort ChunkSize { get; set; }
public Attributes Attrib { get; set; }
public byte IsSplit { get; set; }
public byte Reserved1 { get; set; }
public byte VolumeStart { get; set; }
public string? Name { get; set; }
}
}

View File

@@ -0,0 +1,50 @@
namespace SabreTools.Models.InstallShieldArchiveV3
{
/// <see href="https://github.com/wfr/unshieldv3/blob/master/ISArchiveV3.h"/>
public class Header
{
public uint Signature1 { get; set; }
public uint Signature2 { get; set; }
public ushort Reserved0 { get; set; }
public ushort IsMultivolume { get; set; }
public ushort FileCount { get; set; }
public uint DateTime { get; set; }
public uint CompressedSize { get; set; }
public uint UncompressedSize { get; set; }
public uint Reserved1 { get; set; }
/// <remarks>
/// Set in first vol only, zero in subsequent vols
/// </remarks>
public byte VolumeTotal { get; set; }
/// <remarks>
/// [1...n]
/// </remarks>
public byte VolumeNumber { get; set; }
public byte Reserved2 { get; set; }
public uint SplitBeginAddress { get; set; }
public uint SplitEndAddress { get; set; }
public uint TocAddress { get; set; }
public uint Reserved3 { get; set; }
public ushort DirCount { get; set; }
public uint Reserved4 { get; set; }
public uint Reserved5 { get; set; }
}
}

View File

@@ -126,11 +126,11 @@ namespace SabreTools.Models.Metadata
string? asString = Read<string>(key);
if (asString != null)
return new string[] { asString };
return [asString];
asString = this[key]!.ToString();
if (asString != null)
return new string[] { asString };
return [asString];
return null;
}
@@ -140,7 +140,7 @@ namespace SabreTools.Models.Metadata
/// </summary>
private bool ValidateKey(string key)
{
if (string.IsNullOrWhiteSpace(key))
if (string.IsNullOrEmpty(key))
return false;
else if (!ContainsKey(key))
return false;

View File

@@ -2,12 +2,12 @@
<PropertyGroup>
<!-- Assembly Properties -->
<TargetFrameworks>net40;net452;net462;net472;net48;netcoreapp3.1;net5.0;net6.0;net7.0;net8.0</TargetFrameworks>
<TargetFrameworks>net20;net35;net40;net452;net462;net472;net48;netcoreapp3.1;net5.0;net6.0;net7.0;net8.0</TargetFrameworks>
<RuntimeIdentifiers>win-x86;win-x64;win-arm64;linux-x64;linux-arm64;osx-x64;osx-arm64</RuntimeIdentifiers>
<LangVersion>latest</LangVersion>
<Nullable>enable</Nullable>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<Version>1.2.0</Version>
<Version>1.3.0</Version>
<!-- Package Properties -->
<Authors>Matt Nadareski</Authors>
@@ -22,10 +22,13 @@
</PropertyGroup>
<ItemGroup>
<None Include="README.md" Pack="true" PackagePath=""/>
<None Include="README.md" Pack="true" PackagePath="" />
</ItemGroup>
<!-- Support for old .NET versions -->
<ItemGroup Condition="$(TargetFramework.StartsWith(`net2`)) OR $(TargetFramework.StartsWith(`net3`))">
<PackageReference Include="MinValueTupleBridge" Version="0.2.0" />
</ItemGroup>
<ItemGroup Condition="$(TargetFramework.StartsWith(`net4`))">
<PackageReference Include="System.ValueTuple" Version="4.5.0" />
</ItemGroup>