[英]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. 我想向使用javafx-maven-plugin (版本8.1.3)创建的exe安装程序中添加一个简单的点击许可,该许可证本身使用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. 据我从Oracle文档中了解到的,这只能通过Inno Setup来完成,而不能通过MSI来完成,这也可以。 In the Ant Task it seems one has to use a <fx:fileset>
with type license
: 在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.license
类型的资源用作点击许可证或嵌入到软件包中的许可证的内容源。
Now I know that the icon for the application has to be placed in the folder src/main/deploy/windows/
. 现在我知道该应用程序的图标必须放在文件夹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)? 是否必须遵循特定的命名约定(例如“ license.rtf”)?
Disclaimer: I'm the maintainer of the javafx-maven-plugin . 免责声明:我是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. 特殊的是我添加到插件的新<additionalAppResources>
-property,这使得可以将内容添加到生成的本机应用程序中,包括所有已创建的安装程序。 As the license-file is some special thing for installers, it is set via some <bundleArguments>
inside your plugin-configuration. 由于许可证文件对于安装人员来说是特殊的事情,因此可以通过插件配置中的某些<bundleArguments>
设置。
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! 只需将<licenseFile>
设置为您的许可证名称, 但要注意 :FILENAME本身并不重要(这里没有自动检测的内容),但大小写敏感也很重要,我建议不要将该文件放在某个子文件夹中,因为打包程序本身内部的许可证文件检测有点缺陷!
It works for MSI- and for EXE-installer on Windows, and for Mac and Linux too ;) 它适用于Windows上的MSI和EXE安装程序,也适用于Mac和Linux;)
Oh, and you can update to the latest javafx-maven-plugin version too :D 哦,您也可以更新到最新的javafx-maven-plugin版本:D
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.