![]() |
You can start the install4j compiler from
gradle with the install4j gradle plugin.
To make the gradle plugin available to your build script, you have to add the ej-technologies repository
to the class path of the build script and declare a dependency of the build script on the install4j plugin:
buildscript { repositories { maven { url 'https://maven.ej-technologies.com/repository' } } dependencies { classpath group: 'com.install4j', name: 'install4j-gradle', version: '6.0' } } Then you can apply the install4j plugin to your build script: apply plugin: 'install4j'
The plugin has two parts: The global configuration with the top-level The global configuration block must specify the install4j installation directory: install4j { installDir = file('/path/to/install4j_home') }
On macOS, the installation directory is inside the application bundle, for the default application directory the full path is
In addition, the global configuration block can set defaults for the |
![]() |
The install4j task supports the following parameters:
The "Global" column shows if a parameter can also be specified in the global Simple example: install4j { installDir = file('/opt/install4j') } task media(type: com.install4j.gradle.Install4jTask) { projectFile = file('myProject.install4j') } Larger example: if (!hasProperty('install4jHomeDir')) { File propertiesFile = file("${System.getProperty('user.home')}/.gradle/gradle.properties") throw new RuntimeException("Specify install4jHomeDir in $propertiesFile") } boolean dev = hasProperty('dev') install4j { installDir = file(install4jHomeDir) faster = dev disableSigning = dev winKeystorePassword = 'supersecretWin' macKeystorePassword = 'supersecretMac' if (dev) { mediaTypes = ['windows'] } } task media(type: com.install4j.gradle.Install4jTask) { dependsOn 'dist' // example task that prepares the distribution for install4j projectFile = 'myProject.install4j' variables = [majorVersion: version.substring(0, 1), build: 1234] variableFiles = ['var1.txt', 'var2.txt'] } |
![]() |
The "hello" sample project includes a gradle build script that shows how to setup
the install4j task. To install the sample projects, invoke
Project->Open Sample Project from the install4j IDE. When you
do this for the first time, the sample projects are copied to the "Documents" folder in your
home directory.
In the gradle media
to start the build. If you have not defined install4jHomeDir in |