views:

1373

answers:

7
+4  Q: 

Create DMG file

I am developing an application in Cocoa. I need to create a DMG file to install my application like Adium (which provides a nice UI to drag the app file to Application folder). Is there a tool for this?

+5  A: 

Disk Utility (It's in Applications\Utilities)

Go to File > New > Disk Image From Folder, then select the folder you want to create an image of. The resulting .dmg will replicate the folder you used to make the image, down to the positions of the icons.

Amber
+3  A: 

Dr. Nic put together a nice ruby gem that does most of this work for you, you just need to supply the xcode project and some graphics. The link is here:

http://drnicwilliams.com/2009/02/03/choctop-packaging-and-deployment-of-cocoa-applications/

It is a great package, takes care of tasks that are otherwise a pain...

-- Evan

Evan
Thanks for mentioning this, just what I was looking for.
Lou Z.
+3  A: 

Try DropDMG.

Nicholas Riley
+4  A: 

You could also try DMG Canvas

weichsel
Oooh, shiny! For a DMG custom with precise layout, that looks extremely nice...
Quinn Taylor
+5  A: 
Quinn Taylor
+2  A: 

And because there aren't enough answers already...

I created a read-write DMG with the layout I wanted -- background image, size, shortcut to Application icon, and an empty folder to stand in for my application. I wrote a simple bash script to make a copy of this DMG, mount it, copy my application over the empty folder, unmount the DMG, and then convert it to read-only.

But DMG Canvas can do this whole process for you, and also provides a command line tool you can use to automate this process from your Xcode builds, so I would really recommend that over my solution.

Alex
+1  A: 

MacBreak Dev did a nice little screencast about creating DMG files using an Automator workflow. Makes things very easy, very quick and you can have a custom background to your DMG. You can see it at: http://www.pixelcorps.tv/mbkd_010

Ian Turner