0

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
Pascal DUTOIT
  • 121
  • 1
  • 13
  • You may have an easier time using the jmod and jlink tools included with the JDK in Java 9 and later. They will create a file tree which has its own customized bin/java or bin/java.exe. See https://stackoverflow.com/questions/53453212/how-to-deploy-a-javafx-11-desktop-application-with-a-jre. – VGR Dec 13 '18 at 18:30
  • VGR: The suggested way seems to be not very easy. Another suggestion? – Pascal DUTOIT Dec 13 '18 at 22:15
  • It’s not easy, but it’s not as bad as it sounds. It’s really just module-info, jar, jmod, jlink. The jmod/jlink approach also has the advantage that no additional tools are needed. If you aren’t comfortable with that, I would go with javapackager, which I’ve used in the past with success. – VGR Dec 13 '18 at 22:30
  • I have used javapackager of the last jdk (1.8.0_191) and that works as a self-contained application. – Pascal DUTOIT Dec 14 '18 at 15:13

0 Answers0