tags:

views:

1109

answers:

4
+3  Q: 

Creating a .DMG

Hi

I want to create a dmg file for my Mac project. Can someone please tell me how to do this? This being my first Mac project, I do not have any idea how to proceed. I also want to give the user an option of running the app on start-up. How do I do this?

Thanks.

P.S. I also want to add a custom license agreement.

+3  A: 

Here you go: How to Make a DMG File on a Mac

Marc Novakowski
Note that I don't think this method will auto-open the window, and will be the size you specify - to sort that, you recreate the DMG as a read-only image (which shrinks to the content-size, and auto-opens)
dbr
A: 

I'd suggest digging around Mac Update, you'll find there many software for doing this.

Keltia
+3  A: 

To do this manually:

  • Make a folder with the files your DMG will contain.
  • Open Disk Utility (It's in /Applications/Utilities/)
  • Go to File > New > New Image from Folder (Cmd + Shift + N)
  • Choose the folder containing you files
  • Make sure "Compressed" is checked, then set where you want to save the created DMG

To do things like setting a background image can be a bit convoluted (You basically add the background image to the DMG, set the windows properties to use that image, using the command line you move the background image from background.png to .background.png to make it hidden)

I would recommend iDMG, which makes things a bit less tedious.

You can also script the creation of DMGs using the command hdiutil. Something along the lines of

hdiutil create -srcfolder mydirtodmg

As for the custom license agreement, you should look into the tool included with the Developer Tools "PackageMaker" - it's pretty self-explanatory. It's in /Developers/Application/Utilities/

dbr
+1  A: 

why don't you just run a script from your xcode project. try something like this:

# be sure to check the man page for hdiutil
# it is very powerful and has tons of options...

hdiutil create -megabytes 54 -fs HFS+ -volname awesome_app_install myAwesomeApplication.dmg
hdiutil mount myAwesomeApplication.dmg
cp -r /build/Release/AwesomeApplication.app /Volumes/awesome_app_install/

then save your script as something like 'makeDMG.sh' and in your target,

select add->new build phase->run script build phase
and drag your script into this build phase.

once you've done all that, then when you build your project the script will create the disk image and copy your release build into it...

of course you should spice your script to flavor... these three lines are just the raw meat

ps: your custom EULA should get built into your packagemaker project (which you can also script very nicely)

kent