This project has moved. For the latest updates, please go here.

HOW TO: Deploy Java 8 (while uninstalling previous versions)

Topics: Publishing Issue
Mar 3, 2015 at 5:12 PM
Edited May 15, 2015 at 7:38 PM
First of all a big thanks to developers, for the great product, thanks to anyone who contributes to this board and thanks to DParks256 for posting a guide for Java 7.

I have finally started deploying Java 8 in our network, and decided share this short guide that I've created for internal use.
It's nothing new, but a good step by step manual on how to publish Java 8 using WPP. Any feedback is welcome.

Also, FYI, I've test deployed Java 8 Update 31 MSI on our XP machines, and so far it works without issues, with the apps that we need it for.

My current MSI installation command looks like this:

msiexec /i jre1.8.0_XX.msi JU=0 JAVAUPDATE=0 AUTOUPDATECHECK=0 RebootYesNo=No WEB_JAVA=1 /q /norestart /log C:\JavaInstall.log

The guide
  1. Extract MSI from EXE:
    • Run the Java Installation executable, don't need to install
    • Go to C:\Users\<yourusername>\AppData\LocalLow\Sun\Java\ and copy your version's MSI file to some dedicated work folder/location.
  2. Read MSI ProductCode using WPP's MSI-reader function and copy it to a text file in a work folder. Looks like this {26A24AE4-039D-4CA4-87B4-2F83218031F0}
    • WSUS Package Publisher>Tools>MSI Reader
    • Find and copy Product Code field under Properties.
  3. Create a Java8_XXInstall.bat (replace XX with your update version) file with the following content: this will uninstall the previous versions of Java(7) and install Java 8, (the list for 7 might not be complete, so modify if needed). You can get more GUIDs from here http://www.74k.org/java-uninstall-remove-guids-strings
    ...........................................................
    REM Uninstall Java 7 Update 45
    msiexec /x {26A24AE4-039D-4CA4-87B4-2F83217045FF} /q
    REM Uninstall Java 7 Update 51
    msiexec /x {26A24AE4-039D-4CA4-87B4-2F83217051FF} /q
    REM Uninstall Java 7 Update 55
    msiexec /x {26A24AE4-039D-4CA4-87B4-2F83217055FF} /q
    REM Uninstall Java 7 Update 60
    msiexec /x {26A24AE4-039D-4CA4-87B4-2F03217060FF} /q
    REM Uninstall Java 7 Update 65
    msiexec /x {26A24AE4-039D-4CA4-87B4-2F03217065FF} /q
    REM Uninstall Java 7 Update 67
    msiexec /x {26A24AE4-039D-4CA4-87B4-2F03217067FF} /q
    REM Uninstall Java 7 Update 71
    msiexec /x {26A24AE4-039D-4CA4-87B4-2F03217071FF} /q
    REM Uninstall Java 7 Update 75
    msiexec /x {26A24AE4-039D-4CA4-87B4-2F03217075FF} /q
    REM Install Latest Java Version X86
    msiexec /i jre1.8.0_XX.msi JU=0 JAVAUPDATE=0 AUTOUPDATECHECK=0 RebootYesNo=No WEB_JAVA=1 /q /norestart /log C:\JavaInstall.log
    ...........................................................
  4. Create a new Custom Update:
    • Open WSUS Package Publisher>Updates>Create Custom Update
    • Add "Decalre variable to store data and use it later" - name it ReturnCode, type - Int
    • Add "Allow to execute a file":
      Path to file: Java_8_XX_Install.bat
      Parameters: leave empty
      Kill process after 30 minutes
      Store Return Code to select our "ReturnCode" variable
    • Add "Allow to define a return code for this custom update “Select Variable, choose ReturnCode.
We are now done with custom update XML generator, continue on.
  • Add the .MSI and the Java_8_XX_Install.bat file to the package; Mark it as an Update - Critical update. Next>
  • IsInstalled. Add rule “MSI Product Installed” - For MSI Product Code use the value copied to the text file in step 2. Next>
  • IsInstallable. If deploying 32bit and 64bit versions of Java and if Itanum machines report to your WSUS, then you can add the “Processor Architecture” rule. You should also be able to use Reverse rule for Processor Architecture = Architecture IA64 (not equal to Itanium) if you want to just skip IA64 machines. If you are deploying either just 32bit or just 64bit version across the board then you can leave this section alone. Publish>
Related links/documents:
https://wsuspackagepublisher.codeplex.com/discussions/570492
https://wsuspackagepublisher.codeplex.com/discussions/462519
https://www.codeplex.com/Download?ProjectName=WsusPackagePublisher&DownloadId=903843
Editor
Mar 16, 2015 at 9:02 PM
For all who speak a little german, i have create a small tool for Uninstall any Java Version and Install any Java Version:
http://www.wsus.de/uninstall2install
Mar 17, 2015 at 8:32 AM
Hi Winfried,

thanks for this tool. One suggestion: It would be great to have the possibilty to add some more parameters to the install-string instead of using a MST (f.e. AUTO_UPDATE=0).
Mar 19, 2015 at 7:32 PM
Edited Mar 19, 2015 at 7:39 PM
I followed this tutorial and the documentation Installing Java 7u21 without Java Auto Updater

I tried several times but I have not been successful.

I approved the update for installation, on the client there is no version of java but the console and windowsupdate.log report that there are no pending updates.

The update for Adobe Reader and Flash are successful.

Custom updates not.

Any idea why? where am I doing wrong?
Editor
Mar 19, 2015 at 10:01 PM
trcc wrote:
thanks for this tool. One suggestion: It would be great to have the possibilty to add some more parameters to the install-string instead of using a MST (f.e. >AUTO_UPDATE=0).
Hmm, this was never planned. ;) Never i am using this Commandline parameters for install, to configure autoupdate i am using ADM-Templates within Group Policys. One time configured, allways there.
Apr 16, 2015 at 4:12 PM
Thanks for the great walkthrough. This worked perfect for me to uninstall all previous versions and install version 8 update 40. However I just followed this again for update 45 and updated my batch script to include the GUID for Update 40 for removal. However it looks like since this was installed through windows update it doesn't have a GUID in the registry for uninstall. What would be the best method for removing the previous install of Java that was install through WSUS Package Publisher?

Thanks.
Editor
Apr 16, 2015 at 4:19 PM
I'm using Winfried's tool for uninstalling previous versions of Java. I deployed Update 40 a while ago and today Update 45 with preceding uninstallation of Update 40 (uninstall2install with the GUID from 40). No problems here.

Regards
Norbert
Apr 16, 2015 at 6:31 PM
NorbertFe wrote:
I'm using Winfried's tool for uninstalling previous versions of Java. I deployed Update 40 a while ago and today Update 45 with preceding uninstallation of Update 40 (uninstall2install with the GUID from 40). No problems here.

Regards
Norbert
I like to have the ability to turn off auto update.

It looks like I made the package wrong (I deleted the customupdate.exe), however now when I made it correctly, I get a not applicable regardless of what I do. I setup a temp VM and nothing is installed and I still get not applicable. Weird. I'll keep messing with it and report back.
Apr 16, 2015 at 7:25 PM
Well, it looks like I fixed it. When I made the update, on the second screen after I had to enter the GUID as stated in step "MSI Product Installed", it appears to be the same screen I entered the GUID again but made it reversed by hitting the Reverse Rule Checkbox so I got this:

Image

Hope this helps anyone that ran into this.
Coordinator
Apr 16, 2015 at 8:17 PM
The first screen allows you to define rules used by WUA to determine if the update is installed. The second screen allows you to define rules to determine if the update is installable (needed)
Editor
Apr 16, 2015 at 8:26 PM
nebulight wrote:
I like to have the ability to turn off auto update.
This is the reason for using Group Policys in this case.

By
Winfried
May 15, 2015 at 7:36 PM
nebulight wrote:
Thanks for the great walkthrough. This worked perfect for me to uninstall all previous versions and install version 8 update 40. However I just followed this again for update 45 and updated my batch script to include the GUID for Update 40 for removal. However it looks like since this was installed through windows update it doesn't have a GUID in the registry for uninstall. What would be the best method for removing the previous install of Java that was install through WSUS Package Publisher?

Thanks.
The GUID should stay the same if you are using the original MSI.
You can use MSI reader to find the one from 8u40.

Also I needed to find ones for version 6 and came a cross this great page. - http://www.74k.org/java-uninstall-remove-guids-strings