Windows上JavaFX应用程序的自包含应用程序打包:InnoSetup还是javafxpackager?

时间:2018-12-13 17:56:19

标签: java javafx-8 inno-setup steam javafx-packager

Steam不接受启动批处理文件,该批处理文件使用安装程序安装特定的JRE,然后在其上启动我的应用程序。因此,为避免出现此问题,我想创建一个“自包含的应用程序包装”,并为Steam提供一个“简单的” .exe,该文件包括JRE和我的应用程序。

我看到了https://docs.oracle.com/javafx/2/deployment/self-contained-packaging.htm#A1324980,但是有点复杂。我只注意到 Innosetup 可以帮助我生成此.exe文件。

但是另一个解决方案是使用 javafxpackager (来自C:\ Program Files \ Java \ jdk1.8.0_xxx \ bin)

是否有人有使用innosetup和javafxpackager生成可执行文件以便与社区共享的经验,特别是在Steam上下文中?生成输出文件时应避免哪些陷阱?

谢谢

注意:目前,innosetup和jdk1.8.0_191(包括javapackager.exe)分别安装在C:\ Program Files(x86)\ Inno Setup 5和C:\ Program Files \ Java \ jdk1.8.0_191中。在专用文件夹(steam_hg)中,我有可以从JRE启动的应用程序(hg.jar)。

注意:这是一个批处理文件的示例,该文件安装JRE(如果需要)然后启动应用程序:

@echo off

REM The game only works on 64 bits
reg Query "HKLM\Hardware\Description\System\CentralProcessor\0" | find /i "x86" > NUL && set OS=32BIT || set OS=64BIT
echo %OS%
if %OS%==32BIT echo Windows is a 32bits operating system. Hyper Galactica only works on Windows 64 bits
if %OS%==32BIT goto fin
if %OS%==64BIT echo Hyper Galactica for Windows 64bits.

REM JRE installer, if it is necessary
if exist jre1.8.0 (echo jre already installed in the jre1.8.0 folder)
if not exist jre1.8.0 (
echo installer command for 1.8.0.191 jre
jre-8u191-windows-x64 /s INSTALLDIR=%~dp0jre1.8.0
)

REM launch the game
start %~dp0jre1.8.0\bin\java.exe -classpath %~dp0 -jar hg.jar

:fin

0 个答案:

没有答案
相关问题