I\'ve made my first Qt application for Mac OS X. Now I want to create nice .dmg file that will allow user to easily install it. I am thinking about something like firefox ha
You can do that with Finder:
disk utility
in Launchpad). Then click on "Images" in the menu bar and choose "Resize...". You will get a window to open a file, open the empty DMG file.Untitled
should appear. Rename it to the name that you want (you probably want to give it the same name as your program).Open that device. You should see something like this:
If everything is white except the shortcut to the Applications folder, press Cmd+J and a window will be opened. On the bottom of that window, there is a square with the label "Drag image here". Click on that square and an Open dialog will open. In that dialog, press Cmd+Shift+G and type /Volumes/(whatever you called the device in step 3)/.image
and select image.png.
Everything here except the shortcut to the Applications folder is just a background image. You might want to change the background image (which contains the background color and the arrow). To do so, open the file /Volumes/(whatever you called the device in step 3)/.image/image.png
in an image editor and edit it to whatever you want. After you've done this, you might need to unmount the device and remount it by opening the DMG file to see the changes. Depending on what you put in the image, you might also need to move the shortcut to the Applications folder around to fit the new background image.
Drag your .app file to the beginning of the arrow in the window where the device from the DMG file is opened so that it looks like this:
You might get an error saying that there isn't enough free space. If that's the case, go back to step 2 and resize the DMG file to a larger size.
Unmount the device by clicking on the arrow next to the device name in Finder:
Convert the DMG file to read only. To do this, open the terminal and type this (replace /path/to/dmg/file
by the path to the DMG file and nameOfDmgFile.dmg
by the name of the DMG file):
cd /path/to/dmg/file
hdiutil convert -format UDZO -o newNameOfDmgFile.dmg nameOfDmgFile.dmg
This will create a new DMG file called newNameOfDmgFile.dmg
(or whatever other name you used above), which is the file that you want.