Is it possible to build a .dmg file (for distributing apps) from a non-Mac platform? And if yes, how?
DMG files are for Mac and EXE files are for Windows, so the only way to use a DMG program on Windows is to download its equivalent from the developer (if one exists); there aren't any DMG file to EXE file converters.
Double-click the DMG file to make its content available (the name will show up in the Finder sidebar), and a window generally opens also showing the content. Drag the application from the DMG window into the Applications directory to install (you may need an administrator password). Wait for the copy process to finish.
Yep, mkfs.hfsplus does it.
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 mounted on a mac. It can also be mounted on linux, with something like
mount -o loop /tmp/foo.dmg /mnt/foo
after wich you just copy the content you want to it (in /mnt/foo). Unmount it, and the dmg can be copied over to a mac and mounted there.
A project I work 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 fancy, you can steal the .DS_Store
file from a DMG made on a Mac with a volume name progname
and app bundle called progname.app
(i.e., matching what you want to create off the Mac) where you've put a background in .background/background.png
and a symbolic link to /Applications in the root dir, and put that in dmgdir
along with your own a symbolic link to /Applications
.
Finally, if you want to create a compressed DMG, get the dmg tool from libdmg-hfsplus:
dmg uncompressed.dmg compressed.dmg
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With