GPO – Deploying Java 8 Update 60

Update 19/05/2016: Added other version info.

Extracting the MSI

To extract the MSI, run the “jre-8u60-windows-i586.exe” or  “jre-8u60-windows-x64.exe” EXE do not proceed with the installation. Open the folder “%LOCALAPPDATA%Low\Oracle\Java”, depending if you ran the i586 or x64 version you will see one of the following folders.

  • jre1.8.0_60
  • jre1.8.0_60_x64

Open up the correct folder, and within the folder you will see the MSI file “jre1.8.0_60.msi”. Copy this MSI to another location then cancel the installation.

Silent Install Error

Now that you have the MSI file you have probably tried to install it from the command line using “msiexec /qb /i jre1.8.0_60.msi”. If you used a command prompt that isn’t elevated you get the following error in the event viewer, even though you elevate the MSI installation.

“Error 1722. There is a problem with this Windows Installer package. A program run as part of the setup did not finish as expected. Contact your support personnel or package vendor.”

MSI Fixes

The reason for the error above is that the MSI executes an installer that is embedded into the MSI, but when it runs this installer it doesn’t run it with administrative privileges instead it runs it in the logged on users security context. To fix this you need to modify the MSI DB with an MSI DB editor such as Orca (My personal preference is InstED http://www.instedit.com/). Open the MSI in your editor of choice and open up the table “CustomAction” and select the row “installexe” and change the value of the field “Type” to decimal 3090 or hexadecimal 0x0C12. This will set the msidbCustomActionTypeNoImpersonate bit so that it runs the embedded installer with administrative privileges.

Once the change above has been made the installer will now fail with the following error.

“Unable to install Java. Unable to open file C:\ProgramData\Oracle\Java\java.settings.cfg. Check that the configuration file exists and that the path to the file is correct.”

To fix this error an empty configuration file “java.settings.cfg” needs to be added to the “%ALLUSERSPROFILE%\Oracle\Java” folder by the installer. To do this we need to add 6 new entries to various tables in the MSI DB.

Once again open the MSI in your editor of choice and perform the following:

  1. Insert a new row into the table “Directory”
    • Directory Field = CommonAppDataFolder
    • Directory_Parent Field = TARGETDIR
    • DefaultDir Field = .:Common~1|CommonAppData
  2. Insert a new row into the table “Directory”
    • Directory Field = OracleDir
    • Directory_Parent Field = CommonAppDataFolder
    • DefaultDir Field = Oracle
  3. Insert a new row into the table “Directory”
    • Directory Field = JavaDir
    • Directory_Parent Field = OracleDir
    • DefaultDir Field = Java
  4. Insert a new row into the table “Component”
    • Component Field = emptycfgComponent
    • ComponentId Field = <Insert GUID>
    • Directory_  Field = JavaDir
    • Attributes Field = Decimal 0 or Hexadecimal 0x0000
    • Condition Field = <null>
    • KeyPath Field = <null>
  5. Insert a new row into the table “FeatureComponents”
    • Feature_ Field = jrecore
    • Component_ Field = emptycfgComponent
  6. Insert a new row into the table “File”
    • File Field = java.settings.cfg
    • Component_ Field = emptycfgComponent
    • FileName Field = java~1.cfg|java.settings.cfg
    • FileSize Field = 0
    • Version Field = <null>
    • Language Field = <null>
    • Attributes Field = Decimal 8192 or Hexidecimal 0x2000
    • Sequence Field = 2
  7. Insert a new row into the table “Media”
    • DiskId Field = 2
    • LastSequence Field = 2
    • DiskPrompt Field = <null>
    • Cabinet Field = <null>
    • VolumeLabel Field = <null>
    • Source Field = <null>
  8. Insert a new row into the table “RemoveFile”
    • FileKey Field = java.settings.cfg
    • Component_ Field = emptycfgComponent
    • FileName Field = java~1.cfg|java.settings.cfg
    • DirProperty Field = JavaDir
    • InstallMode Field = 3

This adds a reference to the file in the installer DB, now you need to create an empty “java.settings.cfg” file. To do this open the folder where the MSI is located and create the folder structure “CommonAppData\Oracle\Java” and then within the “Java” folder create an empty file called “java.settings.cfg”.

The last thing to be done is to set the embedded installer so that it installs silently when the UI level is set to “Basic UI” (/qb switch) , the current configuration is that it only installs silently if the UI level is set to “No UI” (/qn switch). To change this open the MSI in your editor and open the table “InstallExecuteSequence”, within that table locate the action “SetSilentInstall” and change the condition from “UILevel=2” to “UILevel<=3”.

With the changes above you will find that the MSI installer should work as expected.

Customisations

There are many articles out on the web on how to customise the installation of Java 7 by changing/adding properties to the “Properties” table in the MSI, the same properties still apply. Here are the ones that I’ve chosen to set in our deployment.

Disable Java Auto Update

  • AUTO_UPDATE=0
  • AUTOUPDATECHECK=0
  • JU=0
  • JAVAUPDATE=0

Disable the EULA

  • EULA=0

Disable the installation Java with sponsored software

  • SPONSORS=0

Lower the web Java security level (Note: High is the lowest setting in Java 8)

  • WEB_JAVA_SECURITY_LEVEL=H

Disable the sending of  installation-related statistics to Oracle

  • WEB_ANALYTICS=0

Transform File (MST)

Once I’ve amended the MSI file I create a transform file, with InstED this is an easy process of comparing your modified MSI with an unmodified file. I then use this for both the X86 and X64 versions of the Java MSI and it’ll hopefully it’ll be compatible with the next version that comes out, which saves time and effort of doing this again :-).

Deployment

I’ve only tested the deployment through the command line with both elevated and un-elevated command prompts, other people have deployed Java 8 based on my previous post via GPO successfully so it will more than likely work for this version as well.

Other Versions

There have been reports in the comments that this will also works for the newer versions of Java 8. I haven’t personally verified that they work as my work and home life are hectic at the moment, and at the time of writing I believe it works for the following versions.

  • Java 8 Update 92
  • Java 8 Update 91
  • Java 8 Update 77
  • Java 8 Update 74
  • Java 8 Update 73
  • Java 8 Update 72
  • Java 8 Update 71
  • Java 8 Update 66
  • Java 8 Update 65

63 responses to “GPO – Deploying Java 8 Update 60

      • table looks like:
        FILE
        File Field = installerexe
        Component_ Field = jz
        FileName Field = c_otytcr.exe|installer.exe
        FileSize Field = 92743776
        Version Field = 8.0.600.27
        Language Field = 1033
        Attributes Field = 0
        Sequence Field = 1

        File Field = java.settings.cfg
        Component_ Field = emptycfgComponent
        FileName Field = java~1.cfg|java.settings.cfg
        FileSize Field = 0
        Version Field =
        Language Field =
        Attributes Field = 8192
        Sequence Field = 2

        MEDIA
        DiskId Field = 1
        LastSequence Field = 1
        DiskPrompt Field = 1
        Cabinet Field = #Data1.cab
        VolumeLabel Field = DISK1
        Source Field =

        DiskId Field = 2
        LastSequence Field = 2
        DiskPrompt Field =
        Cabinet Field =
        VolumeLabel Field =
        Source Field =

        Like

  1. Getting error, while using GPO, in Event Viewer:

    Product: Java 8 Update 60 — Error 1722. There is a problem with this Windows Installer package. A program run as part of the setup did not finish as expected. Contact your support personnel or package vendor. Action installexe, location: C:\Program Files (x86)\Java\jre1.8.0_60\installer.exe, command: /s INSTALLDIR=”C:\Program Files (x86)\Java\jre1.8.0_60\\” REPAIRMODE=0 ProductCode={26A24AE4-039D-4CA4-87B4-2F83218060F0}

    Like

  2. Hello Maddog,
    Thank you for your post, he was very helpful.
    I am now trying to deploy the version “Java 8 Update 65” and I encounter the following error when I take the parameters you specify for version “Java 8 Update 60” :
    “MSI (s) (BC:0C) [16:51:00:010]: Executing op: SetTargetFolder(Folder=C:\ProgramData\Oracle\Java\)
    MSI (s) (BC:0C) [16:51:00:010]: Executing op: SetSourceFolder(Folder=1\Common~1\Oracle\Java\|CommonAppData\Oracle\Java\)
    MSI (s) (BC:0C) [16:51:00:010]: Executing op: ChangeMedia(,MediaPrompt=Please insert the disk: ,,BytesPerTick=65536,CopierType=0,,,,,,IsFirstPhysicalMedia=0)
    MSI (s) (BC:0C) [16:51:00:010]: Executing op: FileCopy(SourceName=java~1.cfg|java.settings.cfg,SourceCabKey=java.settings.cfg,DestName=java.settings.cfg,Attributes=8192,FileSize=0,PerTick=65536,,VerifyMedia=1,,,,,CheckCRC=0,,,InstallMode=58982400,,,,,,,)
    MSI (s) (BC:0C) [16:51:00:011]: File: C:\ProgramData\Oracle\Java\java.settings.cfg; To be installed; Won’t patch; No existing file
    MSI (s) (BC:0C) [16:51:00:011]: Source for file ‘java.settings.cfg’ is uncompressed, at ‘C:\Windows\ccmcache\d8\’.
    MSI (s) (BC:0C) [16:51:00:013]: Note: 1: 1308 2: C:\Windows\ccmcache\d8\java.settings.cfg
    MSI (s) (BC:0C) [16:51:00:013]: Product: Java 8 Update 65 — Error 1308. Source file not found: C:\Windows\ccmcache\d8\java.settings.cfg. Verify that the file exists and that you can access it.
    Error 1308. Source file not found: C:\Windows\ccmcache\d8\java.settings.cfg. Verify that the file exists and that you can access it.”
    The only way I found to solve this problem is to place the file “java.settings.cfg” directly in the same directory as the file “jre1.8.0_65.msi” is not in the sub folder “CommonAppData\Oracle\Java” as you indicated in your post.
    Have you renconté this problem? do you have an idea of its cause?

    Like

  3. Pingback: Java Silent Update Part 2 – The Preparation | Schwenk Solutions, LLC

  4. Pingback: 使用GPO群組原則發佈Oracle Java (版本8) | 中小學資訊人員根本不算MIS

  5. I successfully deploy Java 8u65 using this fix. It doesn’t work with u66 tho. We’re back to 1722 error. I notice, that with with update 25, you change “installexe” value to “3074”, then starting with u40 it changed to “3090”. Maybe u66 needs new value? Someone did deploy u66?

    Like

  6. Hi Guy; I am a net admin for a big company made of small offices. I manage, sql, BE, Vmware, AD Vault, AD, Dell San solution etc… plus a bit of dev and scripting. So I manage a lot of stuff but I never have time to invest a lot of time and ressource in each soft, env etc… Lately I wound up with Altiris on top of everything else, we’ll keep wsus for MS patches and Altiris for third parties, so far so good until JAVA !!! Usually through google I can manage… Problem is : Java 8 Update 71… I tried editing the msi with Orca, I always wind up with errors… I tried just using the offline installer and using a .cfg file, works fine locally but through altiris, it always tell me that there is an error with the config file. I must have spend 12 hours so far on this stuff and I am going crazy… is there an easy way to just patch my systems with the latest java, (uninstall old version) . Why cant they just provide a .msi ? it is used on lots of system and it aint like we have tons of time to go through all the white papers. If you guys can help me; if you come down In quebec I’ll buy the beers and wings 🙂 Regards

    Like

  7. Hey Maddog,

    We have a nightmare in our office every time a new version of Java comes out and your guides are incredibly useful. I wondered if you had any experience with the latest Java Runtime, version 8 Update 71?

    I’ve tried installing this via GPO with the same process as above and I seem to get a sort of corrupted installation, where the entry in Programs & Features is missing its icon, and although the version verifies ok it doesn’t seem to work.

    I’ve still some testing to do but if you had any advice on update 71 it might just save my life!

    Thanks

    Like

  8. That would be fantastic! Thanks for your reply. If I find anything in my further tests I’ll be sure to post back, but unfortunately my knowledge of MSI editing is a bit limited!

    Thanks again,

    Like

  9. I am in the process of testing this with 8u71 so I will be looking forward to any updated information. I am curious though, under your Customization’s I read it to imply all changes were under the “Property” table and all options already had entries but the values just needed changed. If that is the case i am missing 6 options from the Property table. Were those supposed to be manually created or is that another thing Oracle messed with again?

    Like

  10. Hi,
    I’ve created your TRANSFORM but it won’t work with 8u71. The error is ‘There is a problem with this Windows installer package…’

    I’ve created the CFG as per Oracle’s instructions but it won’t work with the x86 version only the x64. My CFG is:
    WEB_ANALYTICS=0
    EULA=0
    REBOOT=0
    NOSTARTMENU=0
    SPONSORS=0
    REMOVEOUTOFDATEJRES=1
    INSTALL_SILENT=1
    STATIC=0
    AUTO_UPDATE=0
    WEB_JAVA=1
    WEB_JAVA_SECURITY_LEVEL=H

    The x86 error log gives the error -2147287037

    Like

  11. So this sounds crazy. I am able to silently install the x86 version using the MSI with a few command line properties.
    I can then only install the x64 version using the .EXE and the above CFG file.
    I can’t get the x86 EXE or the x64 MSI to install silently at all.

    Like

  12. I made the sames mods to th 71 MSI as I had on 60 and 65, and it is deploying via Group Policy with no errors. Running the Java version test page after gpupdate /force is showing I have the most recent version and it is functional.

    Capturing the MSI file was trickier, because it looks like Oracle removed a dialog box which used to be the “hold point” that allowed me to steal the MSI from the temp install folder.

    Like

  13. @BrianRoden :

    That’s interesting. Can you check in the Add/Remove programs list and see if the Java entry has the proper Java coffee cup icon, or just the default Windows program icon?

    I didn’t see errors when installing either, so I wonder if I was just having web page issues on my test machine when verifying. However, the entry in Add/Remove Programs definitely didn’t have a proper icon.

    I’ll do another test and report back
    Cheers

    Like

  14. I would like to report hat I used followed this tutorial for the latest update 73 and all seems to be working very well. I did not use an mst though. I just edited the msi package and saved it. I am deploying via GPO as well. My icon is the default Windows icon in the programs list and the verify java check worked perfect!

    Like

  15. Tried this with Java 8 Update 73 (2) – got error 2715.

    Then tried the msi the usual way – edit Property Table: Java_Update = 0 and Autoupdatecheck = 0 . Deployed via GPO without errors for both versions.

    Like

    • Sorry everyone, haven’t had chance to test this until this week.

      Pleased to say that although the installation listing for Java 8u71 still doesn’t have its icon (just the generic windows program icon), it has installed and works in the browser without errors using the instructions for the previous version above.

      Cheers all!

      Like

  16. WOW. I spend countless hours trying to figure out why it wasn’t installing. Thank you so much. Tried this on Java 8 u73 and worked like a charm. Instead of adding additional table to create the config file I just had GPO copy the file and dump it in that directory prior to running the MSI. Saved me a lot of time. Thanks again.

    Liked by 1 person

  17. This worked for me as well, with Java 8 73, using Shukria’s comment to just create the needed CFG file on the Users PC. I used LogMeIn’s one2many as not all our PC are on our Domain. Worked find with just added the few changes to the MSI as suggested. Thank you so much for posting your method!!

    Like

  18. I just used all of this for version 8 Update 77.
    Only thing it threw at me while testing (need to test further using SCCM 2012) is that it needed the java.settings.cfg file in the directory where the MSI resides).
    After that, the setup ran fine and installed java.

    Oracle sucks donkeyballs, but thank you for this page. Really helped me so far.
    Now I just hope SCCM won’t complain, which it has with every other method so far…

    Like

  19. I did this with a GPO in Windows 2012R2 functional level domain with Windows 10 as the client OS. I used “Advanced” deployment so I could add the .MST to the installation.

    I created a .MST with Orca and followed the directions above exactly – with some caveats below.

    Everything was successful, the same .MST worked on both the 32 & 64-bit .MSI installer.

    EventViewer (EventID 302, Application Management Group Policy)
    The install of application Java 8 Update 77 (32-bit) from policy Install Java Runtimes succeeded.
    The install of application Java 8 Update 77 (64-bit) from policy Install Java Runtimes succeeded.

    CAVEATS

    I configured the following options and they appear to be successful:

    AUTOUPDATECHECK=0
    JAVAUPDATE=0
    EULA=0
    SPONSORS=0

    I placed the java.settings.cfg in both the root of the source directory as well as in the subfolder as described above, based on feedback in these comments. I’m not sure which worked, but I am sure I can test it at some point to find out what’s the case.

    Like

  20. Update: I was able to modify and successfully install (in VM) and verify from Java.com both 32-bit & 64-bit versions of version 8 ru 77. I followed steps 1 – 8 as well as the customization’s (modified the properties I found, added the ones I did not find minus security level). I did not do anything for silent install as I am not sure that applies in my case. What I found the last time I tried this (ru71?) and how I installed this time was to place the empty java.settings.cfg file in the folder with the .msi file. After stumbling through the Transform process I was finally able to create a transform file and applied it to the 64-bit .MSI file. Both files using the same generated GUID ID which did not seem to cause complications.

    Questions:

    1) Is there any known way to have the .MSI installer uninstall the previous version of Java automatically?

    2) In the future when another version of Java is released, do I need to get a new GUID ID or can I just continue using the same ID?

    3) Even though I appeared to be able to use the same GUID ID for both the 32-bit and 64-bit .MSI files, should I be doing so?

    Thank you for all the work you have put into making this information available to everyone.

    Like

  21. Since there is no information on here about Java 8 update 91, I will mention that I have successfully deployed it via GPO. I followed the original road map. However, instead of creating a transform file (I couldn’t get it to work deploying with a MST) I saved the changes directly to the MSI. Deployment worked like a charm!!

    Like

  22. Worked for me for 8u91 bith 32bit and 64bit versions deployed though GPO. Tested both MSI with transform and modified MSI.

    Had to move “java.settings.cfg” to the MSI’s directory as someone already stated above. Otherwise the installation would fail…

    Like

    • I’m having a lot of trouble with 8 Update 91. I follow the instructions here but I’m still unable to get java to remove previous versions. I have the java.settings.cfg in both locations. I’ve even tried the Java Enterprise MSI too. It installs but doesn’t uninstall previous versions. Every thing work tho when using a batch file, but when using the MSI in GPO, it fails to uninstall previous versions.

      Win7 Enterprise x64
      Server 2008 GPO
      Java 8u91 x86

      Any help would be appreciated

      Like

  23. Why not simply deploy by running the .exe? What’s the benefit of using the msi?

    Working example:
    “jre-8u92-windows-i586.exe INSTALL_SILENT=Enable STATIC=Disable AUTO_UPDATE=Disable WEB_JAVA=Enable WEB_JAVA_SECURITY_LEVEL=H WEB_ANALYTICS=Disable EULA=Disable REBOOT=Disable NOSTARTMENU=Disable SPONSORS=Disable REMOVEOUTOFDATEJRES=1”

    Using a file with the config isn’t an option for me because you have to enter the full path to the file. “jre-8u92-windows-i586.exe INSTALLCFG=settings.cfg” is not working without path. And I don’t have a path during deployment from multiple source servers.

    Like

    • Thanks, but using a .exe batch file/logon/startup script method will cause delayed logons. Using a logon script, the install may not complete, and users may try to use to applications which use Java and cause some issues when installing/un-installing Java

      Like

  24. I just wanted to update everyone. I believe the instructions are continuing to work on the newly released 8u101 version of Java. My workflow is using a transform file that I created off of 8u77 and applying it to 8u101 then saving as a .msi. I do not currently deploy using GP so I cannot say one way or the other how GP works with this .msi file. But simply executing the .msi file installed 8u101 and I had no pop-ups or install verification browser launch (which I did not expect to have). After the install I looked in Programs and Features and verified 8u101 was listed as being installed (it was). I then opened Firefox and went to the java website and verified that the installed version was 8u101 (it was).

    The only thing that would make this even better is if there was a way to make the .msi installer also uninstall older versions.

    Like

  25. Seems to works with JRE 8 Update 101. The “java.settings.cfg” have to be empty refering to the MSI/MST Filesize field. Or the same Byte count with your predefined options. It has to be in the same directory with the MSI, others websites describes the folder “CommonAppData\Oracle\Java” beside the MSI file. This won’t work at the moment i think. (With that you should no need to do the java.settings.cfg customize settings in MSI). I tried also prepopulate the “java.settings.cfg” to “%ALLUSERSPROFILE%\Oracle\Java\java.settings.cfg”, that did not work for me, too. (without editing the MSI for java.settings.cfg).

    Like

  26. Hi,

    I’m trying to install extracted MSI of JRE 8 Update 65.

    After doing “Open the MSI in your editor of choice and open up the table “CustomAction” and select the row “installexe” and change the value of the field “Type” to decimal 3090 or hexadecimal 0x0C12. This will set the msidbCustomActionTypeNoImpersonate bit so that it runs the embedded installer with administrative privileges.” Change i am able to install MSI without any problem. But same MSI installation is not happing with GPO.

    GPO Error in Windows Event log:
    Product: Java 8 Update 65 — Error 1722. There is a problem with this Windows Installer package. A program required for this install to complete could not be run. Contact your support personnel or package vendor. Action: installexe, location: C:\Program Files (x86)\Java\jre1.8.0_65\installer.exe, command: INSTALLDIR=”C:\Program Files (x86)\Java\jre1.8.0_65\\” REPAIRMODE=0 ProductCode={26A24AE4-039D-4CA4-87B4-2F83218065F0}

    Could you please help on this. Even i tried with all steps mention in the Blog.

    Like

    • For those here that are deploying via Group Policy, are you targeting the Computer or the User? I can deploy the uncustomsed 8u101 MSI by targeting the computer but I get the 1722 error above when targeting the user (have also tried with customised MSIs and MSI/MST combos for targeting user but no success…)

      Like

      • Java .msi isn’t a user-based installer. It goes into the C:\Program Files or C:\Program Files (x86) folders and requires administrative elevation to install.

        Further, when installing via GPO, the installation is performed with the SYSTEM account. There are limitations around this. You’d essentially have to use a script that runs in user context with administrative privilege to install.

        In brief, target computers. Java was meant to work this way.

        Like

  27. Running this with Java 8 Update 101, everything worked fine except that it was looking for the java.settings.cfg file in the same folder as the MSI file. So, instead of creating the CommonAppData/Oracle/Java folder structure and putting the CFG file there, just create the empty CFG file next to the MSI file.

    As a side note, Java 8 Update 101 was the most recent “offline” version that you could download although the Java auto updater is downloading Java 8 Update 111. Just another way Oracle is trying to make things difficult for those who don’t pay them? I’d guess so.

    Like

  28. The install works with Java 8 update 111, but what do I need to change in the MSI to get the old version to uninstall?

    I have the REMOVEOLDERJRES set to =1 in the InstallExecuteSequence table but it doesn’t work.

    What are the tables that I need to edit to get the MSI to uninstall the old version?

    Like

  29. Pingback: Bookmarks – 站点标题

  30. I’m using this way to deploy java for an extended time and currently we are on 8.0.131. The install itself runs fine, but I found a bug that is causing many issues with many applications.

    If you run the EXE installer it creates a junkction to a random folder name. just run DIR command in C:\ProgramData\Oracle\Java.

    21.06.2017 23:18 javapath [C:\ProgramData\Oracle\Java\javapath_target_170354171]
    21.06.2017 23:18 javapath_target_170354171

    Additonally the EXE updates the PATH variable and extends ity with “C:\ProgramData\Oracle\Java\javapath”. This way every software can find a javaws.exe and java.exe automatically. Otherwise Java software does not start and reports missing java. Eclipse is one example. To test you can run “java.exe -version” from any folder and should get the version of the current installed java

    Any idea how to fix this issue?

    Like

    • It might also be worth trying removing the msidbCustomActionTypeNoImpersonate flag from the custom action and running the MSIEXEC from an elevated command prompt to see if the symbolic link is created. As this may be removing the permission for the embedded EXE installer to create the symbolic links, as when this is set it is ran as SYSTEM which doesn’t have this permission

      Like

Leave a comment