Creating a nice dmg "installer" for Mac OS X

I made my first Qt application for Mac OS X. Now I want to create a good .dmg file that will allow the user to easily install it. I am thinking of something like firefox (see picture): enter image description here

I am completely new to this, so I don’t even know where to start.

+71
installation dmg macos
Dec 30 2018-11-12T00:
source share
7 answers

You can check out this ( http://codevarium.gameka.com.br/how-to-create-your-own-beautiful-dmg-files/ ) manual. It shows step by step how to create beautiful DMGs only using iDMG (which is free software), Finder and terminal. This is pretty easy.

UPDATE:

The link above was dead for sozme now time.

Here is the latest copy from the online archive

+22
Jan 08 2018-12-12T00:
source share

Updating this question by providing this answer.

appdmg is a simple, easy to use, open source command line program that creates dmg files from a simple json specification. Take a look at readme on the official website:

https://github.com/LinusU/node-appdmg

Quick example:

  • Install appdmg

     npm install -g appdmg 
  • Write a json file ( spec.json )

     { "title": "Test Title", "background": "background.png", "icon-size": 80, "contents": [ { "x": 192, "y": 344, "type": "file", "path": "TestApp.app" }, { "x": 448, "y": 344, "type": "link", "path": "/Applications" } ] } 
  • Run the program

     appdmg spec.json test.dmg 

(disclaimer. I am the creator of appdmg)

+74
Nov 15 '13 at 3:49
source share

It's quite simple - the main idea is that you create an empty image using Disk Utility (make it large enough to at least hold your things - the exact size does not matter), open this image using Finder , place your material and place it the way you want it (use the right mouse button and Show viewing options to set options such as icon size or background image). That's almost all - all that remains is to convert this image to a compressed image: pull it out and use Convert in Disk Utility to convert it to a compressed image.

+18
Dec 31 2018-11-12T00:
source share

None of the existing answers really did this for me; one answer is manual, and the other two options - iDMG and node-appdmg - both include applescripting crawler, which is not perfect.

The best way to do this as an automatic assembly step is to create template.dmg that will look exactly the way you want (following the usual instructions, for example, Simon Urbanek, answer, but do not do the last compression step), then in your build script:

  • Use hdiutil to attach image
  • Use cp, etc. to copy the application to the mounted image.
  • hdiutil detach
  • image compression: hdiutil convert "in.dmg" -quiet -format UDZO -imagekey zlib-level = 9 -o "MyApp-0.3.dmg"

There is a makefile at https://github.com/remko/fancy-dmg/ that contains these steps.

+8
Nov 25 '13 at 13:54
source share

This script greatly simplifies the creation of DMG: https://github.com/andreyvit/create-dmg

Also there is no node dependency :-)

+3
Apr 21 '15 at 17:16
source share

You can do this with Finder:

  • Download and unzip this empty DMG file (I created and uploaded it)
  • Resize the DMG file to the appropriate size (the corresponding size is usually the current size plus the size of your .app file). To do this, open the utility on disk (if you do not know how to do this, search for disk utility in Launchpad). Then click "Images" on the menu bar and select "Resize ...". You open a window to open a file, open an empty DMG file.
  • Double-click the DMG file to mount it. A device should appear on the desktop with the name Untitled . Rename it to the name you want (you probably want to give it the same name as your program).
  • Open this device. You should see something like this:

    enter image description here

    If everything is white, except for the shortcut in the Applications folder, press Cmd + J and a window will open. At the bottom of this window there is a square labeled "Drag the image here." Click on this square and the Open dialog box will open. In this dialog box, press Cmd + Shift + G and type /Volumes/ (whatever you called the device in step 3) /.image and select image.png.

    Everything except the shortcut for the Applications folder is just a background image. You might want to change the background image (which contains the background color and arrow). To do this, open the file /Volumes/ (whatever you called the device in step 3) /.image/image.png in the image editor and edit it as you want. After you have done this, you may need to unmount the device and remount it by opening the DMG file to view the changes. Depending on what you put in the image, you may also need to move the shortcut to the Applications folder to match the new background image.

  • Drag the .app file to the beginning of the arrow in the window where the device from the DMG file opens, so that it looks like this:

    enter image description here

    You may receive a message that there is not enough free space. If this happens, go back to step 2 and resize the DMG file to a larger size.

  • Disconnect the device by clicking on the arrow next to the device name in Finder:

    enter image description here

  • Convert DMG file read-only. To do this, open a terminal and enter it (replace /path/to/dmg/file with 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 any other name you used above), this is the file you want.

0
Nov 02 '17 at 11:53 on
source share

You can use Disk Utility for this, but if you need a picture in the background, you need some additional directions.

First open Disk Utility
Then click File> New Image> Blank Image.
He will ask you about the size and name.
After that, you can put files into it, and that’s it!

NOTE: this has been tested on Mac OS Mojave. I do not know about previous versions.

0
Dec 19 '18 at 20:58
source share



All Articles