Archive: JRE installed


JRE installed
Hello,
I want to use NSIS to make the install of an application.
I need to install the jre 1.5. But I would like to test if it is not already installed an the computer before?
This example get the current version
readRegStr $0 HKLM "SOFTWARE\JavaSoft\Java Runtime Environment" CurrentVersion
But even if the current version is 1.6 perhaps the version 1.5 is already installed.
Do you have information about this? How to do?
I have got he same problème with the database Postrges, I have to install it but I would like to test if it is already installed.
Thank you for your help

MissCeline33:)


Can't you use the VersionCompare function?

Stu


Oui effectivement si je voulais comparer la version courante avec 1.5, je pourrais utiliser cette fonction.
Mais je me demande si la liste des jre présent sur la machine est stockée quelque part. Car même si la version courante est la version 1.6, cla ne veut pas dire que la version 1.5 n'est pas présente sur le PC...si?


Oui effectivement si je voulais comparer la version courante avec 1.5, je pourrais utiliser cette fonction.
Mais je me demande si la liste des jre présent sur la machine est stockée quelque part. Car même si la version courante est la version 1.6, cla ne veut pas dire que la version 1.5 n'est pas présente sur le PC...si?
Translation:
Yes, effectively if I wanted to compare the current version with 1.5, I could use that function.
But I wonder if the list of JRE present on the machine is saved somewhere. Because even if the current version is version 1.6, that doesn't mean that version 1.5 is present on the PC...right?

I think you could find if 1.5 is installed by looking for the registry key HKLM\SOFTWARE\JavaSoft\Java Runtime Environment\1.5

ClearErrors
ReadRegStr $0 HKLM "SOFTWARE\JavaSoft\Java Runtime Environment\1.5" "JavaHome"
IfErrors noJRE15 JRE15found
noJRE15:
; need to install jre 1.5
JRE15found:
...
Don