如何向 javafx-maven-plugin 创建的 exe 安装程序添加许可证?

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

我想向我使用 javafx-maven-plugin(版本 8.1.3)创建的 exe 安装程序添加一个简单的点击许可,它本身使用 Inno Setup。

据我从 Oracle documentation 中了解到,这只能通过 Inno Setup 完成,而不能通过 MSI 完成——这也可以。在 Ant 任务中,似乎必须使用类型为 license<fx:fileset>

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

现在我知道应用程序的图标必须放在文件夹 src/main/deploy/windows/ 中。但这也是我必须放置许可证文件的文件夹吗?会自动捡起来吗?它是否必须遵循特定的命名约定(例如 "license.rtf")?

免责声明: 我是 javafx-maven-plugin.

的维护者

我修改了我的一些小虚拟项目并提出了以下解决方案:

<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>

特别之处在于我添加到插件中的新 <additionalAppResources>-属性,这使得可以向生成的本机应用程序添加内容,包括所有已创建的安装程序。由于许可证文件对于安装程序来说是一些特殊的东西,它是通过插件配置中的一些 <bundleArguments> 设置的。

只需将 <licenseFile> 设置为您的许可证名称,但请注意:FILENAME 本身并不重要(此处没有自动检测内容),但它重要的是区分大小写,我建议不要将该文件放在某个子文件夹中,因为包装程序本身内部的许可证文件检测有点缺陷!

它适用于 Windows 上的 MSI 和 EXE 安装程序,也适用于 Mac 和 Linux ;)

哦,你也可以更新到最新的 javafx-maven-plugin 版本:D