在 Install4J 中是否可以更新 sys.preferredJRE 变量?

In Install4J is it possible to update the sys.preferredJRE variable?

我有一个安装程序,其目的是为现有安装更新 JDK 的最大版本(我们需要 JDK,而不是 JRE),并将现有安装指向 运行 与更高版本的 JDK (这是用户预安装和用户指定的)。

在安装程序中,我有从目录选择器表单组件调用 JVM.setPreferredJVM() 的代码。根据 the API for JVMSelector, it says this method will "Set the preferred JRE/JDK for your application." According to the help docs 变量 (sys.preferredJRE),"This variable will only be set after the "“安装文件”操作具有 运行。“

当我 运行 安装程序时,我看到调用了 setPreferredJVM() 方法,但是 sys.preferredJRE 没有设置为我想要的,它仍然引用旧的 JVM。这是一个问题,因为我的后续 "Add VM Options" 步骤使用了 sys.preferredJRE 变量。

我预计调用 JVMSelector.setPreferredJVM() 会更新 sys.preferredJRE,但事实并非如此。我怎样才能做到这一点,以便用户可以在安装过程中设置首选 JVM/JDK?

这是一个错误,将在 6.0.2 中修复。请联系 support@ej-technologies.com 以获得带有修复的临时版本。