Skip to content

Latest commit

 

History

History
175 lines (147 loc) · 14.5 KB

File metadata and controls

175 lines (147 loc) · 14.5 KB

Windows specific properties

<winConfig>

    <!-- general properties -->
    <icoFile>path/to/icon.ico</icoFile>
    <generateSetup>true|false</generateSetup>
    <generateMsi>true|false</generateMsi>
    <generateMsm>true|false</generateMsm>

    <!-- exe creation properties -->
    <headerType>gui|console</headerType>
    <wrapJar>true|false</wrapJar>
    <companyName>${organizationName}</companyName>
    <fileVersion>1.0.0.0</fileVersion>
    <txtFileVersion>${version}</txtFileVersion>
    <productVersion>1.0.0.0</productVersion>
    <txtProductVersion>${version}</txtProductVersion>
    <fileDescription>${description}</fileDescription>
    <copyright>${organizationName}</copyright>
    <productName>${name}</productName>
    <internalName>${name}</internalName>
    <shortcutName>${name}</shortcutName>
    <originalFilename>${name}.exe</originalFilename>

    <!-- choose EXE creation tool -->
    <exeCreationTool>launch4j|winrun4j|why</exeCreationTool>
    <vmLocation>relative/path/to/jvm.dll</vmLocation>

    <!-- setup generation properties -->
    <setupMode>installForAllUsers|installForCurrentUser|askTheUser</setupMode>
    <setupLanguages>
        <english>compiler:Default.isl</english>
        <german>compiler:Languages\German.isl</german>
        <spanish>compiler:Languages\Spanish.isl,${project.basedir}\languages\Custom_es.isl</english>
        [...]
    </setupLanguages>
    <disableDirPage>true|false</disableDirPage>
    <disableProgramGroupPage>true|false</disableProgramGroupPage>
    <disableFinishedPage>true|false</disableFinishedPage>
    <disableRunAfterInstall>true|false</disableRunAfterInstall>
    <disableWelcomePage>true|false</disableWelcomePage>
    <createDesktopIconTask>true|false</createDesktopIconTask>
    <removeOldLibs>true|false</removeOldLibs>

    <!-- signing properties -->
    <signing>
        <keystore>path/to/keystore</keystore>
        <storepass>password</storepass>
        <alias>cert_alias</alias>            
        [...]
    </signing>

    <!-- windows registry entries added during installation -->
    <registry>
        <entries>
            <entry>
                <key>root:path/to/my/key</key>
                <valueName>name</valueName>
                <valueType>type</valueType>
                <valueData>data</valueData>
            </entry>
            [...]
        </entries>
    </registry>

</winConfig>
Property Mandatory Default value Description
icoFile ❌ null Icon file. If null, takes the default one.
generateSetup ❌ true Generates Setup installer.
generateMsi ❌ true Generates MSI installer.
generateMsm ❌ false Generates MSI merge module.

Exe creation properties

Property Mandatory Default value Description
headerType ❌ "gui" EXE header type: console or gui.
wrapJar ❌ true Wrap JAR file in native EXE.
companyName ❌ ${organizationName} EXE company name.
fileVersion ❌ "1.0.0.0" EXE file version.
txtFileVersion ❌ ${version} EXE txt file version.
productVersion ❌ "1.0.0.0" EXE product version.
txtProductVersion ❌ ${version} EXE txt product version.
fileDescription ❌ ${description} EXE file description.
copyright ❌ ${organizationName} EXE copyright.
productName ❌ ${name} EXE product name.
internalName ❌ ${name} EXE internal name.
originalFilename ❌ ${name}.exe EXE original filename.
trademark ❌ EXE trademark.
language ❌ EXE language.
exeCreationTool ❌ launch4j EXE creation tool: launch4j, winrun4j or why.
vmLocation ❌ jvm.dll path relative to the bundled JRE. Only for WinRun4J. *1

*1: If a JRE is bundled and vmLocation is not specified, it uses bin\client\jvm.dll or bin\server\jvm.dll as VM location by default.

Setup generation properties

Property Mandatory Default value Description
setupMode ❌ installForAllUsers Setup installation mode: require administrative privileges or not. *
setupLanguages ❌ <english>compiler:Default.isl</english><spanish>compiler:Languages\Spanish.isl</spanish> Map with setup languages.
shortcutName ❌ ${name} Sets the name of the user optional shortcut created on the desktop
disableDirPage ❌ true If this is set to true, Setup will not show the Select Destination Location wizard page.
disableProgramGroupPage ❌ true If this is set to true, Setup will not show the Select Start Menu Folder wizard page.
disableFinishedPage ❌ true If this is set to true, Setup will not show the Setup Completed wizard page.
disableRunAfterInstall ❌ true If this is set to true, Setup will not launch the application after install.
disableWelcomePage ❌ true If this is set to true, Setup will not show Welcome Page.
createDesktopIconTask ❌ true If this is set to true, Setup will ask for desktop icon creation.
removeOldLibs ❌ false If there's a previous installation, removes old libs folder before install.

SetupMode

Property winConfig.setupMode can be set with 3 possible values:

  • installForAllUsers (default value): installs the app for the all users in %ProgramFiles% folder (behaviour can be changed when running setup installer from command-line with /currentuser argument).
  • installForCurrentUser: installs the app for the current user in %USERPROFILE%\AppData\Local\Programs folder (behaviour can be changed when running setup installer from command-line with /allusers argument).
  • askTheUser: asks to the final user if the app has to be installed for all users or only for the current user.

Signing properties

Mandatory Default value Description
storetype ❌ JKS The type of the keystore: JKS (Java keystore), PKCS12 (.p12 or .pfx files), PKCS11.
keystore ✔️, unless certfile and keyfile are specified. The keystore file, or the SunPKCS11 configuration file.
certfile ✔️, unless keystore is specified. The file containing the PKCS#7 certificate chain (.p7b or .spc files).
keyfile ✔️, unless keystore is specified. The file containing the private key. PEM and PVK files are supported.
storepass ❌ The password to open the keystore.
alias ✔️, if keystore is specified and more than one alias exist. The alias of the certificate used for signing in the keystore. Java code signing certificates can be used for Authenticode signatures.
keypass ❌ The password of the private key. When using a keystore, this parameter can be omitted if the keystore shares the same password.
alg ❌ SHA-256 The digest algorithm (SHA-1, SHA-256, SHA-384 or SHA-512).

Example using a Java KeyStore

<signing>
    <keystore>c:\Users\fvarrui\keystore.jks</keystore>
    <storepass>123456</storepass>
    <alias>fvarrui</alias>
</signing>

Add values to the Windows Registry

This property allows to specify Windows Registry values to be added during installation. These values will be removed during uninstallation.

Structure of an entry:

Mandatory Default value Description
key ✔️ Key path, composed by root (HKCU, HKLM, HKU, HKCC, HKCR), ":" and subkey.
valueName ✔️ Value name.
valueType ❌ REG_SZ Value type: REG_SZ, REG_EXPAND_SZ, REG_MULTI_SZ, REG_DWORD, REG_QWORD, REG_BINARY.
valueData ❌ "" Data to be stored.

Example

Next configuration will add a value named greeting in MyApp key, under HKEY_CURRENT_USER (HKCU) root, of type REG_SZ (string), with value hello:

<registry>
    <entries>
        <entry>
            <key>HKCU:MyApp</key>
            <valueName>greeting</valueName>
            <valueType>REG_SZ</valueType>
            <valueData>hello</valueData>
        </entry>
    </entries>
</registry>