Skip to content

Instantly share code, notes, and snippets.

@jooneyp
Forked from jadeatucker/HOWTODMG.md
Created November 2, 2017 04:25
Show Gist options
  • Select an option

  • Save jooneyp/4194140355fcbfe50d828fe42ac4d184 to your computer and use it in GitHub Desktop.

Select an option

Save jooneyp/4194140355fcbfe50d828fe42ac4d184 to your computer and use it in GitHub Desktop.
How to create a "DMG Installer" for Mac OS X

Creating a "DMG installer" for OS X

##Creating the DMG file #Disk Utility Type Disk Utility into Spotlite CMD+SPACEBAR from Finder or From Terminal: open /Applications/Utilities/Disk\ Utility.app/

File -> New -> Disk Image from Folder or CMD+SHIFT+N Select the folder myapp.app/ when prompted then click Image In the Save As field enter a name for the file like myapp.dmg From the Image Format drop-down select read/write Click Save

#Edit Folder Preferences Mount the dmg and open it by double-clicking the file in Finder or From Terminal: open myapp.dmg open /Volumes/myapp/

Create a link/shortcut to /Applications folder by right-clicking on the Applications folder and selecting Make Alias then drag it into the dmg folder. or From Terminal: cd /Volumes/myapp/ ln -s /Applications Applications

In Finder press CMD+1 to switch to icon view Arrange icons as needed Press CMD+J to show the View Options window Adjust view settings as needed From Background: section choose Picture Drag and drop the image you want to use as the background where it says Drag image here Unmount/Eject the dmg when finished with View Options or From Terminal: umount /Volumes/myapp/

#Compress and convert to Read-only From Disk Utility right-click on myapp.dmg disk image and select Convert "myapp.dmg" In the Save As field enter a new name for the file like myappfinal.dmg From the Image Formate drop-down select read-only Click Save From Terminal: hdiutil convert -format UDZO -o myappfinal.dmg myapp.dmg

Congratulations you are finished! Mount the new dmg to verify it is working properly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment