Jump to content


This is a ready-only archive of the InstallSite Forum. You cannot post any new content here. / Dies ist ein Archiv des InstallSite Forums. Hier können keine neuen Beiträge veröffentlicht werden.
Photo

find out if java is installed


3 replies to this topic

der gini

der gini
  • Members
  • 2 posts

Posted 02 January 2002 - 16:20

Hi,

I just want to know if java is installed on my system. until now i tried with:
FindFile(WINSYSDIR, "java.exe"...
but there are people with java installed in another directory and PATH=...

any ideas?

best regards,
gini


Perotin

Perotin
  • Full Members
  • 407 posts

Posted 03 January 2002 - 09:51

If JRE is installed with the original installer (and not just copied and included into path) you can check for the registry key HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Runtime Environment, here you will find the variable "CurrentVersion" which gives the version.
The subkey with the version number has a variable cvalled "JavaHome" which gives the path to the JRE and in the subdirectory bin of this path you find java.exe etc.

der gini

der gini
  • Members
  • 2 posts

Posted 04 January 2002 - 11:44

thanks. but i want a solution for any java installation - and a trainee found it:

nResult = LaunchApp('javaw.exe','');
if(nResult < 0) then
  // do it.
endif;

that's it :-)

regards, gini


Perotin

Perotin
  • Full Members
  • 407 posts

Posted 04 January 2002 - 14:06

This solution only works if javaw.exe ist registered with its application path ...
So if an application copies the complete jre and uses just the programs with their relative path to the starting program/batch you could fail with the suggested solution.
But in most cases this should work :-)