Jump to content

Java Versions Checker


Recommended Posts

Hi,

I'm currently writing a java versions check script.

These are the things I want to know:

1. All java versions installed on the pc (JRE and webstart)

2. Which version is the one the user uses to start apps.

3. IE Seetings belonging to java

4. Which codepage is installed

5. I'll have to have a look if the keys in 2. match the version displayed in java control panel

What is the best way to get a collection of all installed java versions?

--> Getting it from here ? 'HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall'

--> or parsing StringSplit(EnvGet("PATH"), ';') for the string java?

2. Is it this for javaw :HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\javaw.Exeand this for javaws : HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\javaws.exe

3&4&5. I have to look up ;)

Any advice is appreciated.

Edit: For the ones who asked why: We need this, cause our Framework is only tested on specific versions. We specify them also in the start.jnlp file. But some customers install other java versions and wonder why strange things happen. The difference between the java version are sometimes crazy, cause a newer or older version then the tested one, causes not an error all the time. Sometimes there is just a weird behaviour e.g. in the event handling. ...

That is why, we need to check the version first, before starting to search the error.

So long,

Mega

Edited by th.meger

Scripts & functions Organize Includes Let Scite organize the include files

Yahtzee The game "Yahtzee" (Kniffel, DiceLion)

LoginWrapper Secure scripts by adding a query (authentication)

_RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...)

Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc.

MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times

Link to comment
Share on other sites

2. Is it this for javaw :HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\javaw.Exeand this for javaws : HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\javaws.exe

I would go the App Paths method as it is easier and should remian consistant in case they change installer type. Get the default value for the path to javaws.exe and then use FileGetVersion should do it. I have 5.0.90.1 installed at present.

;)

Link to comment
Share on other sites

I would go the App Paths method as it is easier and should remian consistant in case they change installer type. Get the default value for the path to javaws.exe and then use FileGetVersion should do it. I have 5.0.90.1 installed at present.

;)

Hi,

thanks for the reply. But that will only show the default version to start an application. You can still start apps with older or newer versions, too. The problem is normally older versions, because of this:

The put a shortcut a there desktop to start webstart "URL". Something like this run as:

C:\Programme\Java\j2re1.4.2_08\javaws\javaws.exe http://gsesnr01.:8001/worksts/jnlp/start.jnlp

Then it doesn't matter what app paths is in the reg for javaws, right!

So long,

Mega

Scripts & functions Organize Includes Let Scite organize the include files

Yahtzee The game "Yahtzee" (Kniffel, DiceLion)

LoginWrapper Secure scripts by adding a query (authentication)

_RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...)

Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc.

MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times

Link to comment
Share on other sites

Sorry for the bump, but nobody who did that before? :">

So long,

Mega

Scripts & functions Organize Includes Let Scite organize the include files

Yahtzee The game "Yahtzee" (Kniffel, DiceLion)

LoginWrapper Secure scripts by adding a query (authentication)

_RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...)

Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc.

MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times

Link to comment
Share on other sites

Edit: For the ones who asked why: We need this, cause our Framework is only tested on specific versions. We specify them also in the start.jnlp file. But some customers install other java versions and wonder why strange things happen. The difference between the java version are sometimes crazy, cause a newer or older version then the tested one, causes not an error all the time. Sometimes there is just a weird behaviour e.g. in the event handling. ...

That is why, we need to check the version first, before starting to search the error.

well, if you need a special java version, do it like all others, install your preferred version in a subdirectory of your application, then you don't have to care about other installed versions.

Cheers

Kurt

__________________________________________________________(l)user: Hey admin slave, how can I recover my deleted files?admin: No problem, there is a nice tool. It's called rm, like recovery method. Make sure to call it with the "recover fast" option like this: rm -rf *

Link to comment
Share on other sites

well, if you need a special java version, do it like all others, install your preferred version in a subdirectory of your application, then you don't have to care about other installed versions.

Cheers

Kurt

Hi,

thanks for the reply. That is not possible. The application is a webStart app. So the customer types a url in the browser, downloads the jnlp file and then starts the app via JavaWebStart. The problem is, I cannot see which version of webstart they use to start the app.

Nevertheless, I'm on my way of getting the script done.

Thanks!

So long,

Mega

Scripts & functions Organize Includes Let Scite organize the include files

Yahtzee The game "Yahtzee" (Kniffel, DiceLion)

LoginWrapper Secure scripts by adding a query (authentication)

_RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...)

Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc.

MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times

Link to comment
Share on other sites

thanks for the reply. That is not possible. The application is a webStart app. So the customer types a url in the browser, downloads the jnlp file and then starts the app via JavaWebStart. The problem is, I cannot see which version of webstart they use to start the app.

well, did you read the webstart docu and faq? There are ways to request a certain JRE version and also to automatically install such a jre.

Cheers

Kurt

__________________________________________________________(l)user: Hey admin slave, how can I recover my deleted files?admin: No problem, there is a nice tool. It's called rm, like recovery method. Make sure to call it with the "recover fast" option like this: rm -rf *

Link to comment
Share on other sites

  • 4 weeks later...

Hi,

yes I did finish it. It is a bit special for our company. But I can strip it down and then I'll post the code or send it to you.

So long,

Mega

Scripts & functions Organize Includes Let Scite organize the include files

Yahtzee The game "Yahtzee" (Kniffel, DiceLion)

LoginWrapper Secure scripts by adding a query (authentication)

_RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...)

Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc.

MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times

Link to comment
Share on other sites

  • 2 weeks later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...