英文:
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.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论