nishan
Posts: 4
Joined: Mon Jul 18, 2005 11:33 am

Conditional JRE installation

I can't figure out how to perform a search to check if a particular version of JRE is already installed on the target machine.

Using the result of the search I would like to install JRE if the version on the target is less than 1.4.2_03 or if JRE is not installed at all.

Judging by posting on the forum, I need to do this using a custom action. Is there some example code I can use?

Any help would be greatly apreciated.
ciprian
Posts: 259
Joined: Thu Jul 14, 2005 12:56 pm
Location: Craiova, Romania
Contact: Website

Hi,

In order to install Java Runtime Environment (JRE) you must use the "Prerequisites" feature. Advanced Installer already has a list of the most commonly used prerequisites. Among them it is JRE.

To set up JRE as a prerequisite, go to the "Media" page and select the "Prerequisite" tab. Use the [Add...] button to select the "Java Runtime Environment" option. In the newly appeared window select the location of your JRE package (your disk or an URL location).

In order for this prerequisite to be installed only if the version on the target computer is less than 1.4.2_03 or doesn't exist at all, you must edit the "Required Version / Minimum" field to 1.4.2_03.

All the best,
Ciprian
Ciprian Burca
Advanced Installer Team
http://www.advancedinstaller.com
Guest

Ciprian

I had tried a similar setting using the [New...] button in the "Prerequisite" tab on the "Media" page.

I have now followed your suggestion and used the [Add...] button. Unfortunately this still doesn't work.

When running the installation executable the JRE installation dialog is still brought up even if JRE 1.4.2_03 is already installed. Naturally the options to modify or delete the existing JRE version are diaplayed in the dialog. I am using trial version 2.6.5 of Advanced Installer.

I have pasted the contents of the ".ini" file.

[PREREQUISITES]
App1=Java Runtime Environment
[App1]
SetupFile=j2re-1_4_2_03-windows-i586-p.exe
SearchType=1
SearchString=HKLM\SOFTWARE\JavaSoft\Java Runtime Environment
VerMin=1.4.2_30
VerMax=1.4.3

Any suggestions?
ciprian
Posts: 259
Joined: Thu Jul 14, 2005 12:56 pm
Location: Craiova, Romania
Contact: Website

Hi,

We couldn't replicate your problem. In order to figure out what is going on please tell us more about what you did

Your problem may reside in the values you set for the minimal and maximal required versions.

You can take a look in the registry in " HKLM\Software\JavaSoft\Java Runtime Environment" key and write here what versions of JRE are installed. It is possible that the installed versions are not the ones you expect.

Also you can send us the AIP file to support at advancedinstaller dot com.

Regards,
Ciprian
Last edited by ciprian on Tue Oct 25, 2005 8:28 am, edited 1 time in total.
Ciprian Burca
Advanced Installer Team
http://www.advancedinstaller.com
nishan
Posts: 4
Joined: Mon Jul 18, 2005 11:33 am

Thanks very much for your help I have finally got it working.

The problem was with the min, max versions I used.

Solved by using min:1.4.2, max:1.4.3
instead of min:1.4.2_30, max 1.4.3

Return to “Common Problems”