How to create a dmg file for Mac OS X (on a platform other than Mac)?

Can I create a .dmg file (for application distribution) from a platform other than Mac? And if so, how?

+47
installer dmg macos
Nov 13 '08 at 7:17
source share
7 answers

It seems possible to create DMG files with some third-party tools. A quick Google search shows at least a few commercial tools:

Not sure about any OSS / freeware options, but it at least seems possible if you are so prone.

Edit: I also forgot about MacDrive , which is another great tool for working with HFS + file systems under windows. Because DMGs are just snapshots of the HFS + file system, MacDrive may also be able to create DMGs.

+8
Nov 13 '08 at 10:15
source share

Yep, mkfs.hfsplus does this.

dd if=/dev/zero of=/tmp/foo.dmg bs=1M count=64 mkfs.hfsplus -v ThisIsFoo /tmp/foo.dmg 

This creates a dmg file (in this case 64M) that can be installed on a Mac. It can also be installed on Linux, with something like

 mount -o loop /tmp/foo.dmg /mnt/foo 

after you just copy the content you want to it (in / mnt / foo). Unplug it and dmg can be copied to Mac and installed there.

+32
Sep 23 '10 at 8:14
source share

The project I'm working on creates DMG files on Linux using genisoimage:

 mkdir -p dmgdir/progname.app/Contents/{MacOS,Resources} ...copy your PkgInfo, Info.plist to Contents... ...copy your .icns to Resources... ...copy your other things to where you expect them to go... genisoimage -V progname -D -R -apple -no-pad -o progname.dmg dmgdir 

If you want to be really bizarre, you can steal the .DS_Store file from DMG made on Mac with the progname volume progname and application package called progname.app (i.e. combine what you want to create a Mac) where you put the background in .background/background.png and a symbolic link to / Applications in the root directory, and put this in dmgdir along with your symbolic link to /Applications .

+20
Sep 26 2018-11-11T00:
source share
 git clone https://github.com/hamstergene/libdmg-hfsplus cd libdmg-hfsplus && cmake . && make && cd dmg ./dmg --help 

Makefile:

 dmg: genisoimage -D -V "$(PROJECT) $(VERSION)" -no-pad -r -apple -o project-$(VERSION)-uncompressed.dmg $(DARWIN_DIR) ./dmg dmg project-$(VERSION)-uncompressed.dmg project-$(VERSION).dmg 

uncompressed works out of the box, compression can cause problems - the source / master at least produces a β€œchecksum” error on the snow leopard

+8
Jul 18 '13 at 22:25
source share

See mkfs.hfsplus

+2
Sep 10 '10 at 18:18
source share

I'm not sure anyone is still watching this topic, but I tried TransMac as Nik Reiman recommended.

Using this tool, I was able, while working on Windows 7 , to create dmg files that could be installed on OSX 10.8.3 .




Downside

The only drawback for us is that this tool does not seem to be command line friendly; for us, that is a transaction breaker, because we need to have an automated tool that our build server (based on Windows) can use to create dmg files on the fly.

+2
Jun 03 '13 at 17:27
source share

If you distribute Mac applications, then of course you have a Mac to write and test them. Why not just use the same Mac to create a disk image?

[Change] Alternatively, if you are distributing a portable application, such as a Java.jar file, why bother with a disk image? Macs understand the .zip and .tar.gz archives very well.

I assume that I get, I don’t understand how a DMG disk image might be needed, but it does not have a Mac to create it.

-24
Nov 13 '08 at 7:27
source share



All Articles