Skip to content

Commit

Permalink
Added ManufacturerId to CDBuilder
Browse files Browse the repository at this point in the history
  • Loading branch information
LTRData committed Mar 3, 2024
1 parent 6f1b093 commit bb90ea6
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 1 deletion.
3 changes: 3 additions & 0 deletions Library/DiscUtils.Iso9660/BuildParameters.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,13 @@ internal class BuildParameters
{
public BuildParameters()
{
ManufacturerId = ".NET DiscUtils";
VolumeIdentifier = string.Empty;
UseJoliet = true;
}

public string ManufacturerId { get; set; }

public bool UseJoliet { get; set; }

public string VolumeIdentifier { get; set; }
Expand Down
25 changes: 24 additions & 1 deletion Library/DiscUtils.Iso9660/CDBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,26 @@ public string VolumeIdentifier
}
}

/// <summary>
/// Gets or sets the Manufacturer ID for the ISO file.
/// </summary>
/// <remarks>
/// Must be a valid identifier, i.e. max 23 characters.
/// </remarks>
public string ManufacturerId
{
get => _buildParams.ManufacturerId;

set
{
if (value.Length > 23)
{
throw new ArgumentException("Not a valid volume identifier");
}
_buildParams.ManufacturerId = value;
}
}

/// <summary>
/// Sets the boot image for the ISO image.
/// </summary>
Expand Down Expand Up @@ -272,7 +292,10 @@ protected override List<BuilderExtent> FixExtents(out long totalLength)
focus += MathUtilities.RoundUp(bootImageExtent.Length, IsoUtilities.SectorSize);

var bootCatalog = new byte[IsoUtilities.SectorSize];
var bve = new BootValidationEntry();
var bve = new BootValidationEntry
{
ManfId = ManufacturerId
};
bve.WriteTo(bootCatalog, 0x00);
_bootEntry.ImageStart = (uint)MathUtilities.Ceil(bootImagePos, IsoUtilities.SectorSize);
if (_bootEntry.BootMediaType == BootDeviceEmulation.NoEmulation)
Expand Down

0 comments on commit bb90ea6

Please sign in to comment.