使用捆绑的 JRE 创建 32 位安装程序时 Install4j 出现异常

Exception in Install4j when creating an 32 bit Installer with bundled JRE

我使用 Apache ANT 创建了一个 32 位 JRE 1.8.202 的 JRE 包,使用 createbundle.exe:

<property name="CREATEBUNDLE" value="${install4j.path}/bin/createbundle.exe" />

<exec executable="${CREATEBUNDLE}">
<arg value="-o" />
<arg value="${install4jJREBundleDir}/${CURRENT_JRE_NAME}/" />
<!-- input -->
<arg value="${unzippedJREDirectory}/${JREDirName}/" />
</exec>

<!-- Get filename of created JRE Bundle -->
<fileset id="contents" dir="${install4jJREBundleDir}/${CURRENT_JRE_NAME}/" includes="*.tar.gz" />

<pathconvert property="INSTALL4J_JREBUNDLE" refid="contents" />

我尝试使用这个包为我的应用程序创建一个 32 位安装程序:

<target name="installer.internal">
<install4j projectfile="${i4jprojectfile}" verbose="true" mediatypes="${i4jmediatypes}" destination="${dist}" >
<vmParameter value="-Dinstall4j.timestampUrl=${INSTALL4J_TIMESTAMP_URL}"/>
<variable name="BUILD_VERSION" value="${BUILD_VERSION}" />
<variable name="SOFTWARE_VERSION" value="${SOFTWARE_VERSION}" />
<variable name="PLATFORM_DETAIL_STRING" value="${PLATFORM_DETAIL_STRING}" />
<variable name="INSTALL4J_JREBUNDLE" value="${INSTALL4J_JREBUNDLE}" />
</install4j>
</target>

创建安装程序时抛出以下错误:

350 [install4j] com.exe4j.a.d: Cannot bundle a 64-bit JRE with a 32-bit media file.
351 [install4j] at com.install4j.b.g.g.a(ejt:97)
352 [install4j] at com.install4j.b.b.a(ejt:175)
353 [install4j] at com.install4j.b.i$a.c(ejt:846)
354 [install4j] at com.install4j.b.i$a.b(ejt:837)
355 [install4j] at com.install4j.b.i.b(ejt:163)
356 [install4j] at com.install4j.Install4JApplication.c(ejt:479)
357 [install4j] at com.exe4j.a.a(ejt:342)
358 [install4j] at com.install4j.Install4JApplication.main(ejt:94)
359 [install4j] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
360 [install4j] at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
361 [install4j] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
362 [install4j] at java.lang.reflect.Method.invoke(Unknown Source)
363 [install4j] at com.exe4j.runtime.LauncherEngine.launch(LauncherEngine.java:85)
364 [install4j] at com.exe4j.runtime.WinLauncher.main(WinLauncher.java:94)
365 [install4j] at com.install4j.runtime.launcher.WinLauncher.main(WinLauncher.java:25)
    366 [install4j] install4j: compilation failed. Reason: Cannot bundle a 64-bit JRE with a 32-bit media file.

捆绑包中的 JRE 是 32 位的,因此错误没有意义。

编辑:我尝试使用 install4j v7.0.18 和 Install4j8。

体系结构由捆绑文件的绝对路径确定。我们的包文件位于名为 'c:\src\Windows10_x64...' 的文件夹中,因为路径中的 'x64' ('Windows10_x64') Install4j 认为包是 64 位的。

编辑:解决方案是使用捆绑文件的相对路径,省略 'Windows10_x64' 文件夹。