Generate beautiful DMG-images for your OS X applications.
npm install -g appdmg
appdmg <json-path> <dmg-path>
json-path
: Path to the JSON Specification filedmg-path
: Path at which to place the final DMG
To produce a test DMG to your desktop, run the following command:
appdmg test/appdmg.json ~/Desktop/test.dmg
The specification for the image is a simple json file, example provided below. All paths are relative to the json-file's path. (Comments are not allowed, I'm only using them for demonstration purposes.)
{
// The title of the produced DMG, which will be shown when mounted
"title": "Test Title",
// Path to your .app
"app": "TestApp.app",
// Path to your background
"background": "TestBkg.png",
// Path to your icon, which will be shown when mounted
"icon": "TestIcon.icns",
// Size and position of the icons in the DMG
// Positions are specified as X and Y in the center of said icon
// "app" is your application
// "alias" is an alias to the Applications folder
"icons": {
"size": 80,
"app": [192, 344],
"alias": [448, 344]
}
}
The application can also be called from within another javascript file, example:
var appdmg = require('appdmg');
appdmg('test/appdmg.json', 'test.dmg', function (err, path) {
// err is an potential error
// path is the path to the final DMG
});
Currently the only supported os is Mac OS X.
Supporing other operating systems would involve writing a custom
.DS_Store
writer, but if accomplished would bring improvements
even to the Mac platform since we could drop all the apple script
stuff which currently adds ~15 seconds to the build time and pops
up the Finder.