Link to home
Start Free TrialLog in
Avatar of marrj
marrj

asked on

Powershell - Script Java JRE Upgrade

I currently run the Java JRE on my 2000+ workstations.  Unfortunately, I don't have a good enterprise deployment method for Java.  Historically, I have relied on the version that would have been installed upon image deployment to last the OS through its lifetime in the enterprise.  Once the machine needs to be reimaged, a new version of Java will be installed as part of the imaging process.  This has worked well, until now.  I have now been informed that the version of my JRE on the majority of my machines is too old to support a business application that is widely used.  I'm now faced with the question of how to update many older versions of Java to something more recent.

I'm thinking that a Powershell script might be the way to go, as this is my language of choice.  Would it be possible to pull a value from the registry into a variable that would then allow me to uninstall an old version?  I have many different updates of Java 7 installed in my enterprise, so not all machines will have the same versioning.  I then need to script an unattended install of Java 7.65 (or newest version) to upgrade the machines.  In my experience, the Java installer does not replace old versions, it only installs two versions side-by-side.

What would be the best way to conquer this task?
Avatar of becraig
becraig
Flag of United States of America image

I would say an easy route would be querying the registry for the version value you need.

If the version is less than the current expected version then copy and run the msi that you would use to install the latest version.


If you can give me an example of the output from a computer where you query for the version installed. maybe I can give more details.
ASKER CERTIFIED SOLUTION
Avatar of footech
footech
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial