问题
Steam does not accept to launch a batch file that installs (with an installer) a specific JRE and then launches my app on it. So, for avoiding this problem, I want to create a "self contained app packaging" and provides a "simple" .exe to Steam, this file including the JRE and my app.
I saw https://docs.oracle.com/javafx/2/deployment/self-contained-packaging.htm#A1324980 but it is a little bit complicated. I only noticed that Innosetup could help me to generate this .exe file.
But another solution cold be to use javafxpackager (from C:\Program Files\Java\jdk1.8.0_xxx\bin)
Does anyone have experience of generating an executable with innosetup and javafxpackager in order to share it with the community, especially in the Steam context? What are the traps to avoid when the ouput file is generated?
Thanks
Note: At this time, innosetup and jdk1.8.0_191 (including javapackager.exe) are installed respectively in C:\Program Files (x86)\Inno Setup 5 and C:\Program Files\Java\jdk1.8.0_191 . In a dedicated folder (steam_hg), I have the app (hg.jar) that can be launched from the JRE.
Note: Here is an example of batch file that installs the JRE (if necessary) and then launches the app:
@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
来源:https://stackoverflow.com/questions/53767622/self-contained-application-packaging-for-a-javafx-app-on-windows-innosetup-or-j