Question

I am using install4J to distribute my application . However i am using serial port in my program therefore i will need the below file to be copied to the target JRE folder

%JAVA_HOME%/lib/ext/comm.jar
%JAVA_HOME%/bin/win32com.dll
%JAVA_HOME%/lib/javax.comm.properties

Is there any way i can do it by getting the Java Home Path via Install4J ?

Thanks

Was it helpful?

Solution

Since JAVA_HOME is not a Windows variable, it will be tricky to get it, and Install4J does not have a JAVA_HOME variable to my knowledge. While JAVA_HOME could be set on some computers, it is not safe to assume it is set on all computers.

What I would do, personally, is not touch the user's JRE. Bundle your own custom JRE with those files included into your install file generated with Install4J. That way, your program will always work with its own custom JRE that is independent of the system's JRE.

OTHER TIPS

Copy the files to

${installer:sys.javaHome}

This is the JRE that the installer and subsequently your launchers run with. If you bundle a JRE, the value of this variables changes after the "Install files" action runs.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top