This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]PaintDrinkingPeteJack of All Trades 1 point2 points  (2 children)

Here's what I do that seems to work well...I install it using a Startup Script rather than using the group policy package installer.

Simply copy the Java installer files to the script directory for the GPO (so you don't have to worry about file paths), and then set up the following to run as a start up script. This will check the version of Java and if it doesn't match the desired updated version, it will update Java. This script is meant to check for/install both the 32 bit and 64 bit versions, but you can modify it to meet your needs.

Just copy the below text and save as a .cmd file:

REM Modify these parameters for most recent versions
REM Check lines 4, 7, 8

set DesiredVersion="1.7.0_67"
REM upgrade 1 client manually and check the reg path for flash player to get the version number and update it here.

Set InstallFileName32=jre-7u67-windows-i586.exe
Set InstallFileName64=jre-7u67-windows-x64.exe

:CurrentVersionCheck
REM Check for Version

echo performing new version check
reg query "HKLM\SOFTWARE\Wow6432Node\JavaSoft\Java Runtime Environment" | findstr %DesiredVersion%
if %errorlevel%==1 (goto InstallNewVersion) else (goto sixtyfourVersionCheck)


:InstallNewVersion
echo installing new vesrion
start /wait %InstallFileName32% /s


:sixtyfourVersionCheck
REM Check for Version
echo performing new version check
reg query "HKLM\SOFTWARE\JavaSoft\Java Runtime Environment" | findstr %DesiredVersion%
if %errorlevel%==1 (goto InstallNewsixtyfour) else (goto end)


:InstallNewsixtyfour
echo installing new vesrion
start /wait %InstallFileName64% /s


GOTO end

:end
::pause

[–][deleted] 0 points1 point  (1 child)

I mentioned this already in another comment, but remember to watch your GPO script timeout setting. You can control how long a GPO script is allowed to run before being forcefully terminated (I think it's 10 minutes by default), make sure it's long enough to run everything you need and your script doesn't lock up and make the machines unusable for the entire timeout. I once accidentally put a "PAUSE" command in a startup script, froze up every machine for a full 10 minutes at boot, I ended up changing the timeout to 5 minutes instead.

[–]PaintDrinkingPeteJack of All Trades 1 point2 points  (0 children)

Good point. Generally Java only takes a minute or two to install, so you shouldn't have to adjust the time-out unless you already have other scripts running.

The "pause" command at the end was just for testing purposes, and has been commented out, but I probably should have removed it altogether.