jpackage将文件添加到installdir。

huangapple go评论106阅读模式
英文:

jpackage add files to installdir

问题

我正在使用 Java 15 的 jpackage 来为我的 JavaFX 应用程序创建安装程序。因为其中一个库需要一些 Visual C++ 的 DLL 文件,我也想把它们包含进来。它们应该放在主 .exe 和 .ico 文件所在的目录中。

我不太明白如何编写 overrides.wxi 来实现这一点。
链接:https://docs.oracle.com/en/java/javase/14/jpackage/override-jpackage-resources.html#GUID-1B718F8B-B68D-4D46-B1DB-003D7729AAB6
这里是我找到的关于这个的所有信息。

英文:

I'm using jpackage from Java 15 to create an installer for my javafx application. Because one of the libraries requires some visual c++ dlls, I want to include them too. They should be placed into the directory where the main .exe and .ico resides.

I don't understand how to write an overrides.wxi to achieve that.
https://docs.oracle.com/en/java/javase/14/jpackage/override-jpackage-resources.html#GUID-1B718F8B-B68D-4D46-B1DB-003D7729AAB6
Here is all information I found about this.

答案1

得分: 4

最简单的解决方案是将您的dll文件放入“input”文件夹中,并通过jpackage的$APPDIR参数更改library.path,例如:

jpackage --input input --java-options '-Djava.library.path=$APPDIR' ...

这就是我为自己的需要dll的项目所做的方式,它可以正常工作。

英文:

The easiest solution is to include your dll in your "input" folder and to change the library.path to include that folder via jpackage $APPDIR parameter like this:

jpackage --input input --java-options '-Djava.library.path=$APPDIR' ...

This is how I did it for my own project that needs dll and it works.

huangapple
  • 本文由 发表于 2020年10月13日 23:57:55
  • 转载请务必保留本文链接:https://go.coder-hub.com/64338849.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定