- Qbs Manual
- Qbs 2.1.1

AppleDiskImage

# AppleApplicationDiskImage

Apple application drag 'n' drop disk image installer. More...

Since: | Qbs 1.9
Inherits: | AppleDiskImage

- List of all members, including inherited members

## Properties

- sourceBase : string
- symlinks : stringList

## Detailed Description

An AppleApplicationDiskImage item is a product of the type `"dmg.dmg"` that has a dependency on the dmg module. In addition, it has rules and properties specific to building drag 'n' drop disk image installers with an application bundle and symbolic link to the `/Applications` directory.

Any artifacts of product dependencies that are tagged `"installable"` will be copied into the disk image, provided their file paths are relative to the path specified by the sourceBase property (that is, are located in that directory). Any artifacts tagged `"installable"` that are not relative to sourceBase will be ignored.

Here is what the project file could look like for a simple DMG installer:

     AppleApplicationDiskImage {
         Depends { name: "myapp" }
         name: "My App"
         dmg.volumeName: name
         dmg.iconSize: 128
         dmg.windowWidth: 640
         dmg.windowHeight: 280
         dmg.iconPositions: [
             {"path": "Applications", "x": 128, "y": 128},
             {"path": "My App.app", "x": 256, "y": 128}
         ]
         files: ["background.tiff", "volume-icon.icns"]
         Group {
             files: ["*.lproj/**"] // licenses
             fileTags: ["dmg.license.input"]
         }
     }

For plain disk images whose contents are not a single application bundle, consider the base AppleDiskImage item instead.

## Property Documentation

sourceBase : string

The base directory from which artifacts installed into the disk image will be copied. This directory is always considered to be relative to qbs.installRoot. For example, if the application Example.app exists at `qbs.installRoot/Applications/Example.app`, and the value of this property is `"/Applications"`, the application will be located at`/Example.app` relative to the disk image root. Therefore, its full path when the disk image is mounted would be something like `/Volumes/Example-1.0/Example.app`.

Default: `"/Applications"`

symlinks : stringList

List of symlinks to create in the disk image. This is specified as a list of strings, each string containing two file paths separated by a colon. The first path is the symlink target, and the second path is the name of the symlink relative to the root of the disk image.

Default: `["/Applications:Applications"]`

AppleDiskImage