Skip to content

DSL of Windows Builder

Volker Berlin edited this page Nov 26, 2019 · 5 revisions

The msi tasks are responsible for building Windows .msi style packages using Setup Builder.

The following options are available to the msi task:

msi {

    // optional, architecture to build. Defaults to x64.
    // Allows: x86, x64, ia64, x86-only
    arch = "x64"
    
    // A banner file for the installer with a typical size of 493 x 58
    bannerBmp = "banner.bmp"
    
    // A dialog banner file for the installer with a size of 493 x 312
    dialogBmp = "dialog.bmp"
    
    // Set up information about the signtool
    signTool { ... }
    
    // add a launch4j configuration to create an executable first
    // can be added multiple times
    launch4j { ... }
    
    // optional, set a custom WXS template
    wxsTemplate = "my-application.wxs"
    
    // optional, list of languages to build the setup for. By default all languages will be build
    languages = [ "en-US", "de-DE" ]
    
    // set the minimum OS version for this installer to work on. See below
    minOS = 10.0
    
    // optional, indicated that the application can be installed as multiple instances
    multiInstanceCount = 1
    
    // optional, a VB-Script to allow the setup of multiple instances
    multiInstanceScript = "multi-instance-setup.vb"
    
    // optional, set the installation scope to one of either `perUser` or `perMachine`
    installScope = perMachine
    
    // optional, add a VB-Script or Jscript to run before the setup GUI is displayed.
    // Note: this script does not run with elevated permissions
    // can be added multiple times.
    preGui "<script>"
    
    // optional, make the run after application optional. An option will be displayed to the user in the setup.
    runAfterIsOptional = false
    
    // add customized localizations to the wix builder
    i18n { ... }
    
    // add multiple desktop starter to handle the given protocol
    protocolHandler { ... }

    // add extra wxs files for external fragments like custom ui elements
    // See setupBuilder.gradle under testBuilds directory for sample usage of dialog defined as external fragment.
    external file('fragmentDlg.wxs')
    // or
    externals = [file('fragmentDlg_2.wxs'), file('fragmentDlg_1.wxs')]
}

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

Hints

Property: signtool

The signtool property allows to set up the information required for signing the application.

signtool {

    // the certificate store / file
    certificate = "certificate.p12"
    
    // the password of the certificate store
    password = "123456"
    
    // the certificate signature reuired for the /sha1 parameter of the signtool
    sha1 = "<signature>"
    
    // set a list of alternative timestamp servers used for signing
    timestamp = [ "timestamp.server.com", "timestamp.server2.com" ]
}

Property: minOS

Sets the minimum OS version that is supported by this installer package. The following OS version numbers a known:

  • 10.0 - Windows 10
  • 10.0 - Windows Server 2016
  • 6.3 - Windows 8.1
  • 6.3 - Windows Server 2012 R2
  • 6.2 - Windows 8
  • 6.2 - Windows Server 2012
  • 6.1 - Windows 7
  • 6.1 - Windows Server 2008 R2
  • 6.0 - Windows Server 2008
  • 6.0 - Windows Vista
  • 5.2 - Windows Server 2003 R2
  • 5.2 - Windows Server 2003
  • 5.2 - Windows XP 64-Bit Edition
  • 5.1 - Windows XP
  • 5.0 - Windows 2000

Property: i18n

Add multiple custom localizations to the setup.

i18n {
    // Microsoft Locale
    local = "en-US"
    
    // the localization resource file
    resource = "localization-en-US.txt"
    
    // true, if the given resource contains strings that may be overriden
    overridable = true
}

Property: protocolHandler

The setup allows to define extra applications as protocol handlers. They are exactly the same as the desktopStarter except for the following properties: mimeTypes, categories, location and documentType.

Property: launch4j

The launch4j property can be used multiple times to create binaries. The property re-uses the same properties as the desktopStarter and adds the following:

launch4j {

    // optional, request the given execution level, defaults to "requireAdministrator"
    requestedExecutionLevel = "requireAdministrator"
}