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.
Once the change above has been made the installer will now fail with the following error.
Once again open the MSI in your editor of choice and perform the following:
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.
Disable Java Auto Update
- jre1.8.0_60
- jre1.8.0_60_x64
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:
- Insert a new row into the table “Directory”
- Directory Field = CommonAppDataFolder
- Directory_Parent Field = TARGETDIR
- DefaultDir Field = .:Common~1|CommonAppData
- Insert a new row into the table “Directory”
- Directory Field = OracleDir
- Directory_Parent Field = CommonAppDataFolder
- DefaultDir Field = Oracle
- Insert a new row into the table “Directory”
- Directory Field = JavaDir
- Directory_Parent Field = OracleDir
- DefaultDir Field = Java
- Insert a new row into the table “Component”
- Component Field = emptycfgComponent
- ComponentId Field =
- Directory_ Field = JavaDir
- Attributes Field = Decimal 0 or Hexadecimal 0x0000
- Condition Field =
- KeyPath Field =
- Insert a new row into the table “FeatureComponents”
- Feature_ Field = jrecore
- Component_ Field = emptycfgComponent
- 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 =
- Language Field =
- Attributes Field = Decimal 8192 or Hexidecimal 0x2000
- Sequence Field = 2
- Insert a new row into the table “Media”
- DiskId Field = 2
- LastSequence Field = 2
- DiskPrompt Field =
- Cabinet Field =
- VolumeLabel Field =
- Source Field =
- 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
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
- EULA=0
- SPONSORS=0
- WEB_JAVA_SECURITY_LEVEL=H
- WEB_ANALYTICS=0