mirror of
https://github.com/SabreTools/SabreTools.Models.git
synced 2026-02-06 21:29:42 +00:00
Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
25b6493249 | ||
|
|
a551363c0b | ||
|
|
2fd92aea8f | ||
|
|
a61b3d0ed9 |
21
InstallShieldArchiveV3/Archive.cs
Normal file
21
InstallShieldArchiveV3/Archive.cs
Normal 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; }
|
||||
}
|
||||
}
|
||||
10
InstallShieldArchiveV3/Directory.cs
Normal file
10
InstallShieldArchiveV3/Directory.cs
Normal 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; }
|
||||
}
|
||||
}
|
||||
11
InstallShieldArchiveV3/Enums.cs
Normal file
11
InstallShieldArchiveV3/Enums.cs
Normal file
@@ -0,0 +1,11 @@
|
||||
namespace SabreTools.Models.InstallShieldArchiveV3
|
||||
{
|
||||
public enum Attributes : byte
|
||||
{
|
||||
READONLY = 0x01,
|
||||
HIDDEN = 0x02,
|
||||
SYSTEM = 0x04,
|
||||
UNCOMPRESSED = 0x10,
|
||||
ARCHIVE = 0x20,
|
||||
}
|
||||
}
|
||||
32
InstallShieldArchiveV3/File.cs
Normal file
32
InstallShieldArchiveV3/File.cs
Normal 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; }
|
||||
}
|
||||
}
|
||||
50
InstallShieldArchiveV3/Header.cs
Normal file
50
InstallShieldArchiveV3/Header.cs
Normal 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; }
|
||||
}
|
||||
}
|
||||
@@ -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;
|
||||
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user