indygreg / apple-platform-rs

Rust crates supporting Apple platform development
565 stars 38 forks source link

How to create a DMG ? #110

Closed iTrooz closed 9 months ago

iTrooz commented 10 months ago

Hey ! I just read through https://github.com/indygreg/apple-platform-rs/issues/2 and https://github.com/indygreg/apple-platform-rs/tree/main/apple-dmg, but I still can't figure out the command needed to create a dmg file.

Would it be possible to add documentation on this ? Thanks !

indygreg commented 9 months ago

apple-dmg is a library crate. There is no CLI. And it only has basic support for creating DMGs.

DMGs often contain an embedded filesystem (like HFS+ or APFS). To create a DMG from random files sitting around on disk you would need to first pack those files into a filesystem then include that blob in a DMG. The last I looked at this several months ago, nobody had yet written a Rust packer for these filesystems. However, there are various C/C++ libraries for HFS+ in existence. For example, Firefox uses https://github.com/mozilla/libdmg-hfsplus to produce DMGs from Linux.

If I had infinite time I would have already implemented a basic HFS+ reader/writer in Rust to facilitate building DMGs using pure Rust. That's essentially what #2 is tracking.