sbt-install4j is available for sbt-1.x.
sbt-install4j plugin to use
addSbtPlugin("com.github.jpsacha" % "sbt-install4j" % "1.3.1")
Sample use, add following to your
exportJars := true
This will export dependent JARs that will be copied to the installer
enablePlugins(SBTInstall4J) install4jProjectFile := "installer/example.install4j"
Available Tasks and Settings
SBT tasks provided by
install4j: Task - Builds Install4J project. Simple usage from SBT REPL
It will build project defined in by setting
It can take optional arguments that are passed by to the Install4J compiler. Refer to
install4jcdocumentation in Install4J Help for list of supported command line options. You can print option summary from SBT REPL using
sbt> install4j --help
Example of only building
sbt> install4j -m windows
install4jCopyDependedJars: Task - Copies project dependencies to directory
SBT settings provided by
install4jCopyDependedJarsExclusions: Seq[String] - List of regex expressions that match files that will be excluded from copying.
install4jCopyDependedJarsEnabled: Boolean - if
truedependent jars will be copies, if
falsethey will be not.
install4jcFile: File - Location of the install4j's command line compiler
install4jc[.exe]. It can be found in the
bindirectory of the install4j installation. Default can be set with environment variable
install4jcFile := file("C:/Program Files/install4j8/bin/install4jc.exe")
install4jProjectFile: String - Relative path to the install4j project file that should be build.
install4jDependedJarsDir: String - Location where dependent jars will be copied.
install4jExtraOptions: Seq[String] - "Additional command line options passed to the compiler."
install4jVerbose: Boolean - Enables verbose mode.
install4jRelease: String - Override the application version. Version number components can be alphanumeric and should be separated by dots, dashes or underscores.
install4jCompilerVariables: Map[String, String] - Override a compiler variable with a different value. In the map, the
keyis variable's name, the
valueis variable's value.
install4jHomeDir: File - Deprecated. Install4J installation directory. It assumes that Install4J compiler is in subdirectory
bin. Default can be set with environment variable
INSTALL4J_HOME. This option is deprecated, use environment variable
Determining location of Install4J compiler
sbt-install4j executes Install4J compiler. It needs to know its location. It will attempts to determine location base on the OS used. On Windows it is assumed to be:
On Mac OS X:
If the Install4J is installed in a different location you can specify location of the compiler using the environment variable
INSTALL4JC_FILE or setting
install4jcFile. For multi-platform builds it is preferred to use the environment variable
You can set the environment variable when starting SBT using
-D option, for instance:
$ sbt -DINSTALL4JC_FILE="C:/Program Files/install4j8/bin/install4jc.exe"
Tips & Tricks
To see debugging information set SBT logging level to
Look in the log for lines prefixed with
sbt-install4j is licensed under Apache 2.0 license.