Skip to content

DSL of macOS Builder

Cole Manning // RVRX edited this page Jun 30, 2021 · 7 revisions

The dmg task is responsible for building MacOS packages using Setup Builder.

The following options are available to the dmg task:

dmg {
    // The user the services will be executed with, defaults to root
    daemonUser = "root" 

    // optional, sets an application identifier for the DMG builder.
    // It is being used as ID in the Info.plist
    applicationIdentifier = "com.acme.App"

    // a background image used for the `.dmg` file
    backgroundImage = "background.png"
    
    // the background image used in the `.pkg` installer file
    setupBackground = "setup.png"

    // the background image used in the `.pkg` installer file for dark mode
    setupDarkBackground = "setup.png"
    
    // optional, the icon of the `.pkg` installer file
    setupIcon = "setup.icns"
    
    // a Java java.awt.Color Object - used as background color in the `.dmg` image
    backgroundColor = new java.awt.Color( 31, 31, 31);
    
    // optional, sets the `.dmg` window width
    windowWidth = 400
    
    // optional, sets the `.dmg` window height
    windowHeight = 300

    // optional, width correction of the `.dmg` window
    // this may be needed if there is a background-image
    // set which does not take the borders of the window into account
    windowWidthCorrection = 0
    
    // optional, height correction of the `.dmg` window
    // this may be needed if there is a background-image
    // set which does not take the borders of the window into account
    windowHeightCorrection = 22

    // optional, the size of the icons in the `.dmg`. Defaults to 128
    iconSize = 128
    
    // optional, the fontSize of the `.dmg` file names displayed below the application items
    fontSize = 14

    // definition of the first page displayed in a package installer
    // can be defined multiple times
    welcomePage { ... }
    
    // definition of the last page displayed in a package installer
    // can be defined multiple times
    conclusionPage { ... }

    // Code Signing information
    codeSign { ... }
}

To allow even more customization during installation you can use several installation script entry points. Please have a look at the specific documentation.

Hints

Properties: welcomePage, conclusionPage

The properties can be defined multiple times and represent localized files with the following structure:

{
    // Language of the given resource
    locale = "en"

    // allowed formats: rtf, rtfd, txt, html
    resource = "welcome.en.txt"
}

Property: codeSign

The codeSign property is required to set up proper code signing information to ensure the software will be installed and runs correctly at targetet macOS distributions.

codeSign {

    // the "Common Name" part of the certificate
    identity = "Application Developer"
    
    //  Specific Identifier to embed in code (option -i)
    identifier = ""
    
    // The keychain used for signing. It has to be unlocked
    keychain = "System"
    
    // password to unlock the keychain
    keychainPassword = "123456"
    
    // if true, will ignore errors during code sign operations
    ignoreError = false
    
    // if true, will perform a deepsign for 3rd party packages as well
    deepsign = true
}