Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Creating a .DMG

Tags:

macos

dmg

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.

like image 208
lostInTransit Avatar asked Dec 15 '08 08:12

lostInTransit


People also ask

What is a DMG file on Mac?

(Disk iMaGe) The file format used in the Mac for distributing software. Mac install packages appear as a virtual disk drive on the Mac. When the DMG file icon is double clicked, the virtual drive is "mounted" on the desktop. The DMG format harks back to the days when the Mac was a floppy-only machine.


1 Answers

To do this manually:

Method 1:

  • Make a folder with the files your DMG will contain.

enter image description here

  • Open Disk Utility (It's in /Applications/Utilities/)

enter image description here

  • Go to File > New > New Image from Folder (Cmd + Shift + N)

enter image description here

  • Choose the folder containing you files
  • Make sure "Compressed" is checked, then set where you want to save the created DMG

enter image description here

enter image description here

enter image description here

Method 2:

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 mydmg.dmg

enter image description here

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/

like image 79
dbr Avatar answered Oct 25 '22 09:10

dbr