Raiyan Kabir
Raiyan Kabir

Reputation: 1016

How I make a dmg installer that will automatically open after download?

I have seen some dmg's which not only mounts after download but also copies the installer in the download folder and open the installer in Installer Application.

I don't know how to do it?

Can anyone help?

Upvotes: 7

Views: 8098

Answers (4)

Dean Liu
Dean Liu

Reputation: 511

Script that will do this for you:

https://github.com/andreyvit/create-dmg

Example:

#!/bin/sh
test -f Application-Installer.dmg && rm Application-Installer.dmg
create-dmg \
--volname "Application Installer" \
--volicon "application\_icon.icns" \
--background "installer\_background.png" \
--window-pos 200 120 \
--window-size 800 400 \
--icon-size 100 \
--icon "Application.app" 200 190 \
--hide-extension "Application.app" \
--app-drop-link 600 185 \
"Application-Installer.dmg" \
"source_folder/"

Upvotes: 2

OJJG
OJJG

Reputation: 71

the --folder option is not necessary if just want the dmg to open the finder folder window automatically once mounted

bless /Volumes/NAME --openfolder /Volumes/DIRECTORY

The NAME is the mounted folder name and DIRECTORY is the directory that you wish to open automatically, often NAME and DIRECTORY are the same.

Upvotes: 7

Atte Kotiranta
Atte Kotiranta

Reputation: 121

I haven't seen automatically opening dmg files, but it's possible to make folder open automatically after user mounts the dmg file.

Once you have created the dmg file, mount it and then issue following command:

bless --folder /Volumes/NAME --openfolder /Volumes/DIRECTORY

The NAME is your the mounted folder name and DIRECTORY is the directory that you wish to open automatically, often NAME and DIRECTORY are the same.

Upvotes: 8

Anne
Anne

Reputation: 27073

DropDMG works great for me:
http://c-command.com/dropdmg/

I don't know how to achieve this otherwise (free alternative / manually).

Upvotes: 4

Related Questions