Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to create drag and drop DMG file, Mac installer

Hi I have created an aplication myprogram.app file. Now I want to create Drag and drop DMG file for that application. Skype and other software does the same thing.

How to create Drag and Drop DMG file foe my application.

Thanks Sunil Kumar Sahoo

like image 606
Sunil Kumar Sahoo Avatar asked Nov 11 '09 05:11

Sunil Kumar Sahoo


People also ask

How do I create a Mac installer package?

Creating Software Package with Single FileNavigate to Software Deployment -> Add Packages -> Mac. Specify a name for the Package and provide the details of the package for your personal reference. Click Installation tab.

Can I install a DMG file in Mac?

Double-click the DMG file to make its content available (the name will show up in the Finder sidebar), and a window generally opens also showing the content. Drag the application from the DMG window into the Applications directory to install (you may need an administrator password).


2 Answers

It's actually pretty easy. You just need to compose some hidden files. Easy way to do this is to just copy someone elses and change to suit your app.

For example, if I mount the MonoDevelop DMG, then I see:

atom:MonoDevelop fak$ ls -al
total 40
drwxr-xr-x   8 fak   staff    340 Nov  4 14:03 .
drwxrwxrwt@ 10 root  admin    340 Nov 10 21:33 ..
-rw-r--r--@  1 fak   staff  12292 Nov  4 14:03 .DS_Store
d-wx-wx-wt   2 fak   staff     68 Nov  4 14:03 .Trashes
drwxr-xr-x   3 fak   staff    102 Nov  4 14:03 .background
drwx------   4 fak   staff    136 Nov  4 14:03 .fseventsd
lrwxr-xr-x   1 fak   staff     13 Nov  4 14:03 Applications -> /Applications
drwxr-xr-x   3 fak   staff    102 Nov  4 14:02 MonoDevelop.app

Here we see .background that is a directory with a PNG file (the background). The app itself (MonoDevelop.app) and a link to /Applications.

The .DS_Store contains the window size, icon positions, etc. Just setup a directory and use the .DS_Store from it.

like image 199
Frank Krueger Avatar answered Sep 28 '22 01:09

Frank Krueger


There's really not any magic to this. You can create a disk image with Disk Utility. Put the stuff on it that you need, and then convert it to a compressed read-only image (again, with Disk Utility).

For some tips on prettying up the appearance of the window, check out this question. If you need to automate this process, check out this other question for some ways to do that.

like image 28
Sixten Otto Avatar answered Sep 28 '22 01:09

Sixten Otto