Maven NSIS Plug-in dIon Gillard
  1. Customizing
  2. Default Templates
  3. Default Template Scripts
  4. Custom Templates

You can customize the resultant executable installer either by providing your own scripts that the existing templates includes, or you can provide your own templates.

Of these, the easiest is to provide your own scripts to supplement the default templates. The most complex is to provide your own custom templates.

No matter which way you decide to customize the installation process, you will need to be familiar with NSIS and have easy access to the NSIS Docs.

We've also found the HM NIS EDIT tool, which is a free NSIS Editor/IDE, very useful.

The plugin provides two templates by default:

  1. project.jelly to get access to information in project.xml from within NSIS scripts.
  2. setup.jelly which generates the final script for NSIS compilation.

This template produces a file (${maven.build.dir}/project.nsi) which is included in the generated setup file.

The template makes available select values from the project.xml for use in the installation process as constants, i.e. using the NSIS !define statement.

Constant Value
ORGANIZATION ${pom.organization}
PROJECT_BUILD_DIR ${maven.build.dir}
PROJECT_FINAL_NAME ${maven.final.name}
PROJECT_LICENSE_FILE ${maven.license.licenseFile}
PROJECT_LICENSE_TEXT ${maven.nsis.license.text}
PROJECT_NAME ${pom.name}
PROJECT_REG_KEY SOFTWARE\${pom.organization}\${pom.name}\${pom.currentVersion}
PROJECT_REG_UNINSTALL_KEY Software\Microsoft\Windows\CurrentVersion\Uninstall\${pom.name} ${pom.currentVersion}
PROJECT_STARTMENU_FOLDER $$SMPROGRAMS\${pom.organization}\${pom.name} ${pom.currentVersion}
PROJECT_VERSION ${pom.currentVersion}
PROJECT_DIST_BIN_DIR ${maven.dist.bin.assembly.dir}
PROJECT_DIST_DIR ${maven.dist.dir}
PROJECT_LOGO ${maven.nsis.logo}