Fazeem.Mohammed
Posts: 12
Joined: Mon Jun 18, 2012 11:37 am

JRE Version Check

I am developing the AdvanceInstaller software for a java application which can be installed on both 32 bit and 64 bit windows machine .We have to check the JRE version and JRE build number in Prerequisites section
For this purpose we have added FileVersion check "!HKLM\SOFTWARE\JavaSoft\Java Runtime Environment\1.6\JavaHome!\bin\java.exe" in addition to
Normal JRE registry file check of "HKLM\SOFTWARE\JavaSoft\Java Runtime Environment\CurrentVersion" in install conditions of JRE prerequisites.
If any of this check got failed our instllaer will notify the user to Install the JREwhich bundled with the installer

But if we Install the 32 bit JRE 7 on 64 bit Windows .The registry values are created under the new regitry location "HKEY_LOCAL_MACHINE\Software\Wow6432Node\JavaSoft\".so
so can any one help me on How to check JRE while checking "prerequisites" on both 32 bit and 64 bit windows OS
Daniel
Posts: 8283
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: JRE Version Check

Hello and welcome to Advanced Installer forums,

Please keep in mind that on a 64-bit machine the registries entries installed by a 32-bit application are created under the "HKEY_LOCAL_MACHINE\Software\Wow6432Node" key. Please take a look on our article about the Wow6432Node registry key. Also, by default the prerequisite searches use 32-bit locations no matter on what operating system (32-bit or 64-bit) your application runs.

You should be aware that on a 64-bit system which only have the 64-bit JRE installed, your 32-bit JRE prerequisite will be installed too (in 32-bit locations).

As a solution for your scenario you can add two JRE prerequisite to your application package: a 32-bit JRE prerequisite which will run only on 32-bit machines, and a 64-bit prerequisite which will run only on 64-bit machines.

In order to achieve this you should proceed as follows:
- Add the 32-bit JRE prerequisite to your project.
- From "Install Conditions" tab - "Supported Windows Versions" group uncheck "64-bit Windows Versions". In this way the prerequisite will be installed only on 32-bit machines.
- Add the 64-bit JRE prerequisite to your project.
- From "Install Conditions" tab - "Supported Windows Versions" group uncheck "32-bit Windows Versions". Also, enable "Use 64-bit locations when evaluating conditions on a 64-bit machine" option. Thus, the prerequisite searches will use 64-bit locations.

Let us know if this helps, otherwise please give us more details about your scenario.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Fazeem.Mohammed
Posts: 12
Joined: Mon Jun 18, 2012 11:37 am

Re: JRE Version Check

Hi,

Thank you for your advice.It worked properly
But I have one more query...
It seems in AdavanceInstaller 7.7 java prerequisite checking with one JRE(HKLM\SOFTWARE\JavaSoft\Java Runtime Environment\CurrentVersion) prerequisite working for both 32 bit and 64 bit PC.
But if we build the application using AdavanceInstaller 9.2 it doesnt work with one JRE prerequisite we have to set two JRE prerequisite(for 32 bit and 64 bit PC).
what is the reason for this behavior?
Daniel
Posts: 8283
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: JRE Version Check

Hello,

Please keep in mind that in both, 7.7 and 9.2, versions of Advanced Installer our prerequisite support performs searches in the same manner.

The installer package created with version 7.7 of Advanced Installer works on both, 32-bit and 64-bit, machines because the related JRE prerequisite added in your package is a 32-bit package. Also, an installer package, containing only the 32-bit JRE prerequisite, created with version 9.2 of Advanced Installer will work in the same manner.

If you want to have only a 32-bit JRE prerequisite installed on both, 32-bit and 64-bit, operating system then you should add only this prerequisite to your application package. Otherwise, if you want to run a 32-bit JRE prerequisite on 32-bit machines and a 64-bit JRE prerequisite on 64-bit machines you should use the solution from my previous post.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Building Installers”