Is it possible to create via Install4J a single media file for Windows that can run in both cases when user has 32bit or 64bit JRE installed?
I have a case where I’m wrapping an application that has no need for 64bit OS features. So I have selected a 32bit (Install4J) executable to be generated. Eventually we experienced problems when we have tried to install on 64bit Win7 that has 64bit JRE installed. Installer complained about a missing 32bit JRE.
In Help Guide of Install4J I have found the following:
On Windows, a native executable can be either a 32-bit or a 64-bit executable. If you need a 64-bit JRE for your application you can choose to generate 64-bit installers and launchers for a media file. Note that it is not possible to create launchers that work with both 64-bit and 32-bit JREs. Since the launcher starts the JVM with the JNI interface by loading the JVM DLL, the architecture has to be the same. If you target both 32-bit and 64-bit JREs and operating systems, you have to generate different media files for them.
I’m hoping that bold is referring for those cases when you do need specific 64bit features.
Any help? Thanks in advance.
I have managed to found the solution that is actually a “hack”.
The idea is to pack appropriate 32bit Java as bundle and to instruct Install4J not to use user’s Java and not to depend on it. As output Install4J will create “jre” folder on the same level where the app itself is installed. By doing so it is even possible to run both installer and app when user has no JRE installed on the machine.
The way I have created such Install4J configuration is following: