@@ -22,65 +22,63 @@ appdmg <json-path> <dmg-path>
2222To produce a test DMG to your desktop, run the following command:
2323
2424``` sh
25- appdmg test/appdmg.json ~ /Desktop/test.dmg
25+ appdmg test/assets/ appdmg.json ~ /Desktop/test.dmg
2626```
2727
28- ## JSON Specification
28+ ## JSON Input
2929
3030![ Visualization] ( /help/help.png?raw=true )
3131
32- The specification for the image is a simple json file, example provided
33- below. All paths are relative to the json-file's path. (Comments are not
34- allowed, I'm only using them for demonstration purposes.)
32+ The JSON input for the image follows a simple structure. All paths are relative to
33+ the JSON file's path.
3534
36- ``` javascript
37- {
38-
39- // The title of the produced DMG, which will be shown when mounted
40- " title" : " Test Title" ,
41-
42- // Path to your icon, which will be shown when mounted
43- " icon" : " TestIcon.icns" ,
44-
45- // Path to your background
46- " background" : " TestBkg.png" ,
35+ ### Example
4736
48- // Background color (accepts css colors)
49- " background-color" : " mintcream" ,
50-
51- // Size of all the icons inside the DMG
37+ ``` json
38+ {
39+ "title" : " Test Application" ,
40+ "icon" : " test-app.icns" ,
41+ "background" : " test-background.png" ,
5242 "icon-size" : 80 ,
53-
54- // Window options
55- " window" : {
56- // Position when opened
57- " position" : { " x" : 250 , " y" : 250 },
58-
59- // Window size
60- " size" : { " width" : 500 , " height" : 500 }
61- },
62-
6343 "contents" : [
64-
65- // This is the contents of your DMG.
66-
67- // Each entry has a position specified by
68- // X and Y in the center of its icon.
69-
70- // `type: link` creates a link to the specified target
7144 { "x" : 448 , "y" : 344 , "type" : " link" , "path" : " /Applications" },
72-
73- // `type: file` adds a file to the DMG
74- { " x" : 192 , " y" : 344 , " type" : " file" , " path" : " TestApp.app" },
75- { " x" : 512 , " y" : 128 , " type" : " file" , " path" : " TestDoc.txt" }
76-
45+ { "x" : 192 , "y" : 344 , "type" : " file" , "path" : " TestApp.app" }
7746 ]
78-
7947}
8048```
8149
82- ` 0.1.x ` used a different format on the specification. This format is still
83- supported but deprecated, please update your json.
50+ ### Specification
51+
52+ + ` title ` (string, required) - The title of the produced DMG, which will be shown when mounted
53+ + ` icon ` (string, optional) - Path to your icon, which will be shown when mounted
54+ + ` background ` (string, optional) - Path to your background
55+ + ` background-color ` (string, optional) - Background color (accepts css colors)
56+ + ` icon-size ` (string, required) - Size of all the icons inside the DMG
57+ + ` window ` (object, optional) - Window options
58+ + ` position ` (object, optional) - Position when opened
59+ + ` x ` (number, required) - X position relative to bottom of the screen
60+ + ` y ` (number, required) - Y position relative to bottom of the screen
61+ + ` size ` (object, optional) - Window size
62+ + ` width ` (number, required) - Window width
63+ + ` height ` (number, required) - Window height
64+ + ` format ` (enum[ string] , optional) - Disk image format
65+ + ` UDRW ` - UDIF read/write image
66+ + ` UDRO ` - UDIF read-only image
67+ + ` UDCO ` - UDIF ADC-compressed image
68+ + ` UDZO ` - UDIF zlib-compressed image
69+ + ` UDBZ ` - UDIF bzip2-compressed image (OS X 10.4+ only)
70+ + ` ULFO ` - UDIF lzfse-compressed image (OS X 10.11+ only)
71+ + ` contents ` (array[ object] , required) - This is the contents of your DMG.
72+ + ` x ` (number, required) - X position relative to icon center
73+ + ` y ` (number, required) - Y position relative to icon center
74+ + ` type ` (enum[ string] , required)
75+ + ` link ` - Creates a link to the specified target
76+ + ` file ` - Adds a file to the DMG
77+ + ` position ` - Positions a present file
78+ + ` path ` (string, required) - Path to the file
79+
80+ ` 0.1.x ` used a different JSON format. This format is still supported but
81+ deprecated, please update your json.
8482
8583### Retina background
8684
@@ -91,18 +89,6 @@ with the same name as the background appended with `@2x`.
9189E.g. if the json contains ` "background": "TestBkg.png" ` then add a file
9290with the name ` TestBkg@2x.png ` into the same folder.
9391
94- ### Image format
95-
96- The specification also accepts an optional ` format ` field specifying which
97- format the resulting image should be in. The following values are accepted:
98-
99- - ` UDRW ` - UDIF read/write image
100- - ` UDRO ` - UDIF read-only image
101- - ` UDCO ` - UDIF ADC-compressed image
102- - ` UDZO ` - UDIF zlib-compressed image
103- - ` UDBZ ` - UDIF bzip2-compressed image (OS X 10.4+ only)
104- - ` ULFO ` - UDIF lzfse-compressed image (OS X 10.11+ only)
105-
10692## API
10793
10894The application can also be called from within
0 commit comments