简体   繁体   中英

How can I add a license to an exe-installer created by javafx-maven-plugin?

I want to add a simple click-through license to an exe-installer I create with the javafx-maven-plugin (version 8.1.3) which itself uses Inno Setup.

From what I understand from the Oracle documentation this can only be done with Inno Setup, not with MSI – which would be fine as well. In the Ant Task it seems one has to use a <fx:fileset> with type license :

Resources of type license are used as a source of content for a click-through license or a license embedded into the package.

Now I know that the icon for the application has to be placed in the folder src/main/deploy/windows/ . But is this also the folder where I have to place the license file? Will it be picked up automatically? And does it have to follow a specific naming convention ("license.rtf" for instance)?

Disclaimer: I'm the maintainer of the javafx-maven-plugin .

I've modified some small dummy-project of mine and came up with the following solution:

<plugin>
    <groupId>com.zenjava</groupId>
    <artifactId>javafx-maven-plugin</artifactId>
    <version>8.4.0</version>
    <configuration>
        <mainClass>your.path.to.the.mainclass</mainClass>
        <verbose>true</verbose>
        <bundleArguments>
            <licenseFile>someFileThatIsTheLicense.rtf</licenseFile>
        </bundleArguments>
        <additionalAppResources>src/main/additionalAppResources</additionalAppResources><!-- name does not matter, it's just some folder :D -->
    </configuration>
</plugin>

The special thing is the new <additionalAppResources> -property I added to the plugin, this makes it possible to add stuff to the generated native app including all created installers. As the license-file is some special thing for installers, it is set via some <bundleArguments> inside your plugin-configuration.

Just set <licenseFile> to the name of your license, but be aware : the FILENAME itself does not matter (no auto-detection stuff here), but it matters case-sensitivity AND i suggest to NOT put that file in some subfolder, because the license-file-detection is a bit flawed here inside the packagers themselves!

It works for MSI- and for EXE-installer on Windows, and for Mac and Linux too ;)

Oh, and you can update to the latest javafx-maven-plugin version too :D

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM