Using SCCM to migrate client computers from Java version 6 to version 7

Original article can be found here: http://seth.killey.me/?p=753

 

I’m in the process of upgrading all client computers from Java version 6.31 to Java 7.4.  Like all major version upgrades of Java if you simply install the new version the old version will remain installed.  Therefore, I’ve included instructions that allows you to remove the old version of Java, install the latest version, and then apply an update policy to fit your needs.

  1. To uninstall the old Java, navigate to the registry key that gives you the proper uninstall string.
    If you are using 32-bit version of Windows it should be under HKLM\Software\Microsoft\Windows\CurrentVersion\Uninstall
    For 64-bit Windows you might need to go to HKLM\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall
    Navigate to the key under the uninstall key associated with Java (may be a long ID).  There will be an UninstallString item that will be something like MsiExec /X{________}.  This will be the first part of your batch file.  I include /quiet and /norestart switches (see below)
  2. Next, on a test computer I downloaded Java and acquired the .msi file (see http://java.com/en/download/help/msi_install.xml).  The instructions are for Java version 6, but still apply.  The next line in your batch file will use this .msi file to install Java ex: jre.msi /qn
  3. Finally, on your test computer I set my update policy so that it does not look for updates because my user accounts are standard user accounts and would prohibit users from installing any updates.  To be clear, I diligently patch all computers but I just like to control this process versus having a nagging update balloon show up for users when they can’t do anything about it.  You can change your update policy by clicking on the Java icon in control panel.  Your update policy can be found in registry under HKLM\SOFTWARE\JavaSoft\Java Update\Policy.  I also manually create a binary key EnableJavaUpdate (if it doesn’t exist already) and set it to 0 (as in zero).  Once you’re satisfied with this policy, export the entire Policy key as a .reg file.  The final line in your batch file will look like regedit.exe /s JavaPolicy.reg
    My policy looked like this when finished:
  4. In your Java package you should have 3 files.  A batch file which fires off all the commands, the Java 7 msi install file, and the exported reg file.  My batch file has the following:
    @echo off
    REM Uninstall Java 6 Update 31
    MsiExec.exe /X{26A24AE4-039D-4CA4-87B4-2F83216031FF} /quiet /norestart
    REM Install Java 7 Update 4
    jre1.7.0_04-c.msi /qn
    REM Update registry to prevent users being prompted to update java
    regedit.exe /s JavaPolicy.reg
    exit
  5. On SCCM, you will need to either create a new package or update an existing package by updating all distribution points with your 3 files.
    Included are screenshots of parameters for the SCCM program which points to my batch script as well as parameters for the advertisement.