None of the existing answers really did this for me; one answer is manual, and the other two options - iDMG and node-appdmg - both include applescripting crawler, which is not perfect.
The best way to do this as an automatic assembly step is to create template.dmg that will look exactly the way you want (following the usual instructions, for example, Simon Urbanek, answer, but do not do the last compression step), then in your build script:
- Use hdiutil to attach image
- Use cp, etc. to copy the application to the mounted image.
- hdiutil detach
- image compression: hdiutil convert "in.dmg" -quiet -format UDZO -imagekey zlib-level = 9 -o "MyApp-0.3.dmg"
There is a makefile at https://github.com/remko/fancy-dmg/ that contains these steps.
JosephH Nov 25 '13 at 13:54 2013-11-25 13:54
source share