Home

Jean van Kasteel edited this page Jun 26, 2014 · 1 revision
Clone this wiki locally

yoursway-create-dmg

A shell script to build fancy DMGs.

INSTALLATION

By being a shell script, yoursway-create-dmg installation is very simple. Simply download and run.

git clone https://github.com/andreyvit/yoursway-create-dmg.git
cd yoursway-create-dmg
./create-dmg [options]

USAGE

create-dmg [options...] [output_name.dmg] [source_folder]

All contents of source_folder will be copied into the disk image.

Options:

  • --volname [name]: set volume name (displayed in the Finder sidebar and window title)
  • --volicon [icon.icns]: set volume icon
  • --background [pic.png]: set folder background image (provide png, gif, jpg)
  • --window-pos [x y]: set position the folder window
  • --window-size [width height]: set size of the folder window
  • --icon-size [icon size]: set window icons size (up to 128)
  • --icon [file name] [x y]: set position of the file's icon
  • --hide-extension [file name]: hide the extension of file
  • --custom-icon [file name]/[custom icon]/[sample file] [x y]: set position and custom icon
  • --app-drop-link [x y]: make a drop link to Applications, at location x, y
  • --eula [eula file]: attach a license file to the dmg
  • --no-internet-enable: disable automatic mount&copy
  • --version: show tool version number
  • -h, --help: display the help

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/


----------------------------------------------------------
YourSway create dmg
----------------------------------------------------------
Creates a fancy DMG file, complete with custom image background, 
specified icon positions and set to open in the Icon View. 
----------------------------------------------------------
1. Create a directory (source_folder), then put all the files 
   you'll want in your final .dmg in this directory. Typically this 
   includes your .app, a background.png, and a documentation file.
2. Run the create-dmg script from your terminal, pass in your custom 
   options, and your dmg will be generated!

----------------------------------------------------------
Basic Example: 
----------------------------------------------------------
./create-dmg \
    --volname "YourAppName" \
    --volicon ./yourIcon.icns \
    --background ./yourBackground.png \
    --window-size 500 300 \
    --icon-size 96 \
    --app-drop-link 398 181 \
    --icon "YourApp" 109 181 \
    YourAppName.dmg ./source_folder/

----------------------------------------------------------
Options:
----------------------------------------------------------
  --volname name
      set volume name (displayed in the Finder sidebar & window title)
  --volicon yourIcon.icns
      set volume icon
  --background yourImage.png
      set folder background image (supports png, gif or jpg)
  --window-pos x y
      set position the folder window
  --window-size width height
      set size of the folder window
  --icon-size icon_size
      set window icons size (up to 128)
  --icon file_name x y
      set position of the file's icon
  --hide-extension file_name
      hide the extension of file
  --custom-icon file_name custom_icon_or_sample_file x y
      set position and custom icon
  --app-drop-link x y
      make a drop link to Applications, at location x,y
  --eula eula_file
      attach a license file to the dmg
  --no-internet-enable
      disable automatic mount&copy

----------------------------------------------------------
Requirements:
----------------------------------------------------------
OSX

----------------------------------------------------------
License:
----------------------------------------------------------
This tool is licensed under GNU General Public License, because it 
incorporates portions of GPL-licensed code from Adium repository. 
You can modify this program to suite your needs, but you have to 
provide the source code of any modifications upon request.