You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
content(x =130, y =220, type =DmgContentType.File, name ="MyApp.app")
88
-
content(x =410, y =220, type =DmgContentType.Link, path ="/Applications")
89
-
}
90
+
### Format and Badge Icon
91
+
92
+
Choose a DMG format and optionally overlay a badge icon on the volume icon:
93
+
94
+
```kotlin
95
+
dmg {
96
+
format =DmgFormat.UDZO// UDRW, UDRO, UDCO, UDZO, UDBZ, ULFO
97
+
badgeIcon.set(project.file("icons/badge.icns"))
90
98
}
91
99
```
92
100
101
+
### Content Positioning
102
+
103
+
Use `content()` to place icons at specific coordinates inside the DMG window. The typical pattern is one entry for the app and one entry for an Applications symlink so the user can drag-and-drop to install:
104
+
105
+
```kotlin
106
+
dmg {
107
+
content(x =130, y =220, type =DmgContentType.File, name ="MyApp.app")
108
+
content(x =410, y =220, type =DmgContentType.Link, path ="/Applications")
109
+
}
110
+
```
111
+
112
+
Each `content()` call adds an entry with an `(x, y)` position and a `DmgContentType`:
113
+
114
+
| Type | Description |
115
+
|------|-------------|
116
+
|`DmgContentType.File`| An existing file in the DMG (e.g. the `.app` bundle). Set `name` to match the file. |
117
+
|`DmgContentType.Link`| A symlink. Set `path` to the link target (usually `/Applications`). |
118
+
|`DmgContentType.Dir`| A directory inside the DMG. |
119
+
120
+
!!! tip "Mapping from `create-dmg`"
121
+
If you are migrating from a `create-dmg` shell script, the `content()` DSL maps directly to the `--icon` and `--app-drop-link` flags:
122
+
123
+
| `create-dmg` flag | Nucleus equivalent |
124
+
|---|---|
125
+
| `--icon "MyApp.app" 130 220` | `content(x = 130, y = 220, type = DmgContentType.File, name = "MyApp.app")` |
126
+
| `--app-drop-link 410 220` | `content(x = 410, y = 220, type = DmgContentType.Link, path = "/Applications")` |
127
+
93
128
## Layered Icons (macOS 26+)
94
129
95
130
macOS 26 introduced [layered icons](https://developer.apple.com/design/human-interface-guidelines/app-icons#macOS) that support dynamic tilt and depth effects on the Dock and Spotlight.
@@ -266,9 +301,39 @@ macOS {
266
301
267
302
#### `dmg { window { } }`
268
303
269
-
| Property | Type | Default |
270
-
|----------|------|---------|
271
-
|`x`|`Int?`|`null`|
272
-
|`y`|`Int?`|`null`|
273
-
|`width`|`Int?`|`null`|
274
-
|`height`|`Int?`|`null`|
304
+
| Property | Type | Default | Description |
305
+
|----------|------|---------|-------------|
306
+
|`x`|`Int?`|`null`| Window x position on screen |
307
+
|`y`|`Int?`|`null`| Window y position on screen |
308
+
|`width`|`Int?`|`null`| Window width |
309
+
|`height`|`Int?`|`null`| Window height |
310
+
311
+
#### `dmg { content() }`
312
+
313
+
Adds an icon entry to the DMG window layout. Call multiple times to position several items.
314
+
315
+
```kotlin
316
+
funcontent(
317
+
x:Int,
318
+
y:Int,
319
+
type:DmgContentType? = null,
320
+
name:String? = null,
321
+
path:String? = null,
322
+
)
323
+
```
324
+
325
+
| Parameter | Type | Required | Description |
326
+
|-----------|------|----------|-------------|
327
+
|`x`|`Int`| Yes | Horizontal position inside the DMG window |
328
+
|`y`|`Int`| Yes | Vertical position inside the DMG window |
329
+
|`type`|`DmgContentType?`| No | Kind of content entry (`File`, `Link`, or `Dir`) |
330
+
|`name`|`String?`| No | File name to match (used with `File` / `Dir`) |
331
+
|`path`|`String?`| No | Target path (used with `Link`, e.g. `/Applications`) |
0 commit comments