DotnetPackaging.Formats.Dmg.Iso 0.0.9

dotnet add package DotnetPackaging.Formats.Dmg.Iso --version 0.0.9
                    
NuGet\Install-Package DotnetPackaging.Formats.Dmg.Iso -Version 0.0.9
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="DotnetPackaging.Formats.Dmg.Iso" Version="0.0.9" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="DotnetPackaging.Formats.Dmg.Iso" Version="0.0.9" />
                    
Directory.Packages.props
<PackageReference Include="DotnetPackaging.Formats.Dmg.Iso" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add DotnetPackaging.Formats.Dmg.Iso --version 0.0.9
                    
#r "nuget: DotnetPackaging.Formats.Dmg.Iso, 0.0.9"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package DotnetPackaging.Formats.Dmg.Iso@0.0.9
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=DotnetPackaging.Formats.Dmg.Iso&version=0.0.9
                    
Install as a Cake Addin
#tool nuget:?package=DotnetPackaging.Formats.Dmg.Iso&version=0.0.9
                    
Install as a Cake Tool

Dotnet.Dmg

Pure .NET tooling to craft macOS DMG images without external macOS tooling.

Highlights

  • Build ISO9660 layouts with Rock Ridge entries in memory and wrap them into UDIF DMGs
  • Dual compression support: UDBZ (bzip2) and UDZO (zlib) - 100% managed code via SharpCompress
  • Minimal Mach-O ad-hoc signer to stamp executables and dylibs during packaging
  • CLI helper to turn a published folder into a .app bundle inside a DMG, including Info.plist and PkgInfo
  • Targets .NET 10; no native dependencies or platform-specific tooling required
  • Structurally compatible with industry-standard DMGs (verified against Parcel output)

Quick start

  1. Publish your app for macOS:

    dotnet publish -c Release -r osx-arm64 -p:PublishSingleFile=true -p:SelfContained=true -o ./publish
    
  2. Build the DMG (app name is optional; defaults to the input folder name with .app appended):

    dotnet run --project Dotnet.Dmg.App -- ./publish ./MyApp.dmg MyGreatApp
    

    The tool uses bzip2 compression by default for optimal file size.

  3. Mount MyApp.dmg on macOS to verify the bundle layout and ad-hoc signatures.

Projects

  • Dotnet.Dmg.App: Console entry point that wires the builders together and emits the final DMG from a publish folder.
  • Dotnet.Dmg.Iso: ISO9660 + Rock Ridge builder with directory, file, and symlink support.
  • Dotnet.Dmg.Udif: UDIF writer that produces compressed DMG streams from an ISO image.
  • Dotnet.Dmg.MachO: Lightweight Mach-O parser and ad-hoc code signer used by the CLI.
  • Dotnet.Dmg.Tests: xUnit test suite covering the core libraries.

NuGet packaging

  • Shared package metadata (authors, license, repo URL, tags, README) lives in Directory.Build.props and is picked up by every packable project.
  • The root README.md is packed into the generated .nupkg files via PackageReadmeFile.
  • Build packages locally with dotnet pack -c Release; Dotnet.Dmg.Tests is excluded via IsPackable=false.

Features

Compression

  • UDBZ (bzip2): Default compression, better ratios (~4% smaller than zlib)
  • UDZO (zlib): Alternative compression, faster but larger output
  • Both implemented as 100% managed code (no P/Invoke or native dependencies)

Programmatic Usage

using Dotnet.Dmg.Udif;

var writer = new UdifWriter 
{ 
    CompressionType = CompressionType.Bzip2  // or CompressionType.Zlib
};
writer.Create(isoStream, dmgStream);

Known gaps

  • Large file support is limited by the ISO builder using 32-bit lengths (roughly 2 GB per entry)
  • Only Rock Ridge extensions are emitted; Joliet and El Torito are not implemented
  • DMG signing of the container itself is not implemented; only ad-hoc signing of Mach-O binaries occurs
  • Optional metadata (checksums, size info) not yet implemented

Contributing

  • Run dotnet test to validate changes.
  • Open issues or PRs with ideas for better compression, real code signing, or broader ISO support.
Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on DotnetPackaging.Formats.Dmg.Iso:

Package Downloads
DotnetPackaging.Formats.Dmg.Udif

Pure .NET tooling to craft macOS DMG images (ISO9660 + UDIF) without external dependencies.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.0.9 200 12/5/2025
0.0.8 207 12/3/2025
0.0.7 667 12/3/2025
0.0.6 677 12/2/2025

Commit: 0cc3178fa68386e267be495dbe4ca96cc65e766b\nSummary: Merge branch 'add-rockridge-er-entry'\nChanges since 0.0.8 (356a25a7c1da7b2d5d4c7ac5adb2bb3485912886):\n\- 0cc3178 Merge branch 'add-rockridge-er-entry'\n\- 8549c98 Add Rock Ridge ER entry to root record