Deploy Java 7 with GPO

Deploying Java 7 Update 5 through your Organization with GPO and Scripts…




Java is a critical component for your computer. A lot of software and web sites rely on the existing of Java on your computer. Probably, without even noticing, you are using Java either for playing Online games, or printing a document or using an application on a smartphone… While Java is a great technology and widely used, it can be harmful for your computer if you don’t keep it up to date. Because Java is an environment where it can execute commands, Oracle is working on the software in order to correct all the security issues. If you are responsible for your workstations on your company, than you are directly responsible to deploy and keep up to date Java. I consider Java as it’s a part of the OS.

Speaking of the devil, Oracle has just updated Java to version 7 Update 5. Here, I’ll explain how to deploy this version to all of your computers at your company whether an older version is already installed or not…

Of course, there is more than 1 way to deploy an application… I’m more a script guy and really lazy… So my method works and easy to implement. Here we go,

First of all, determine if you want to uninstall older versions that are already installed on your computers. It’s highly recommended to do so. In order to uninstall Java silently and centrally, you need to know the “GUID” of the versions that are installed. I covered this part on my last post. Once you have this information, we can start to write our little script that will do all the magic for you. But one more thing, I assume that you already have a shared folder where you can put you setup files and scripts that is accessible from all the computers in your company. For example purposes only, let’s say your file server name is “FILE” and your shared folder is called “Shared” and everything you need to deploy about Java is inside a folder called “Java”. For this type of scenario, here is the code.

@echo off
REM next line uninstalls Java 6u31 X86
msiexec /X{26A24AE4-039D-4CA4-87B4-2F83216031FF} /qn REBOOT=ReallySuppress

REM next line uninstalls Java 6u31 X64
msiexec /X{26A24AE4-039D-4CA4-87B4-2F86416031FF} /qn REBOOT=ReallySuppress


REM next line uninstalls Java 7u4 X86
msiexec /X{26A24AE4-039D-4CA4-87B4-2F83217004FF} /qn REBOOT=ReallySuppress


REM next line uninstalls Java 7u4 X64
msiexec /X{26A24AE4-039D-4CA4-87B4-2F86417004FF} /qn REBOOT=ReallySuppress


REM next line Installs Java 7u5 X86 and creates a LOG file.
"\\FILE\SHARED\JAVA\jre-7u5-windows-i586.exe" /s IEXPLORER=1 MOZILLA=1 /L C:\javaupdate7u5.log REBOOT=ReallySuppress JAVAUPDATE=0


REM next line Installs Java 7u5 X64 and creates a LOG file.
"\\FILE\SHARED\JAVA\jre-7u5-windows-x64.exe" /s IEXPLORER=1 MOZILLA=1 /L C:\javaupdate7u5-X64.log REBOOT=ReallySuppress JAVAUPDATE=0


1- Create a batch file with this code.

2- Download and place your offline installers from http://java.com/en/download/manual.jsp

3- Create a GPO and link it to the OU that has all your computer accounts.

4- Edit the GPO. Browse to “Computer Configuration\Policies\Windows Settings\Scripts (Startup/Shutdown)”. On the right pane, double click on “Startup”. This will bring up the “Startup Properties” window. Click on “Show Files”, this will open the folder where you need to put your Batch file. Copy your script in this folder and close explorer.

5- Now, click on “Add” and “Browse” to choose your script. Click “Open” and “OK

6- Finally click on “Apply

7- You can disable “User Configuration Settings” from this GPO because it does not contain anything in “User Configuration”. This will speed up the processing operation of this GPO. To do that, right click on your GPO and choose “GPO Status” and click on “User Configuration Settings Disabled

With this method, the installation will occur during start up. End user won’t see any activity while this is processed. The only problem with this script, it will run every time you start your computer even if it’s already installed. But when the same version is already installed, it won’t reinstall everything; it will just ignore and not proceed with the setup. The good thing with this method is when folks at Oracle decide to deploy a new version; all you need to do to deploy the latest version is add 2 more lines in your script.
The first lines of this batch file will uninstall the version 6u31 and 7u4 if they are resident, if these version are not installed, you can still leave these lines. Last two lines start the installation from your shared network folder with the necessary switches in order to install JAVA silently and deactivate the auto update feature. You don’t want every computer to download and install Java seperatly by users. So deactivating the AutoUpdate is a must.

Comments

Popular posts from this blog

System.Messaging.MessageQueueException (0x80004005): A workgroup installation computer does not support the operation (Public Queue create issue)

Veeam Backup Error : Failed to prepare guest for hot backup. Error: VSSControl

warning: Win32API is deprecated after Ruby 1.9.1; use fiddle directly instead - Chef Development Kit Update