Steps to deploy Java with GPO to client machines automatically
- Register a free Oracle account and download Java Runtime 6u27-Windows x86 Offline .
- Double click on the downloaded exe file and stop at the screen below
- Copy the MSI & CAB files from %userprofile%\appdata\locallow\Sun\Java and save it in C:\Temp
-
Download and install Orca MSI Editor to make a Transform file (MST) to disable Java Auto Update
-
Launch Orca MSI Editor and open the downloaded jre1.6.0_27.msi file. Click on Properties to modify the following values
Properties | Values | Remarks |
---|---|---|
AUTOUPDATECHECK | 0 | Turn Off Auto Update |
ENDDIALOG | 0 | Turn Off install finished notice |
JAVAUPDATE | 0 | Turn Off Auto Update |
JU | 0 | Turn Off Auto Update |
IEXPLORER | 1 | Install to Internet Explorer (IE) |
RebootYesNo | 0 | Stop Auto Reboot |
- Click New Transform and Generate Transform to generate the Tranform File (MST). Save the generated .mst file to C:\temp
- Copy the jre1.6.0_27.msi, j6.mst and cab file to Network Share Folder
-
Create a new GPO for Computer Configuration and right click on Software Installation to create a new Software Installation Package
- Select jre1.6.0_27.msi
- Select Advanced
- Go to Modifications adn add the MST file
- Link the GPO to the OU and the Java6 will be automatically installed to computer (Restart of computer is required for GPO to be applied)
To uninstall existing JAVA 7 or 8 if detected
1. We noticed that any JAVA 7 or 8 installed on existing workstations, the installed JRE6 U27 will not be used when opening the Oracle Application.
- Prepare a Computer Startup script to uninstall any JAVA 7 or 8 installed
$Java8 = Get-WmiObject -Class Win32_Product | Where-Object {$_.Name -like 'Java 8*'}
$Java7 = Get-WmiObject -Class Win32_Product | Where-Object {$_.Name -like 'Java 7*'}
if ($Java7) {
$Java7Version = $Java7.IdentifyingNumber
$Command = "msiexec /x $Java7Version /qn"
cmd /c $Command
}
elseif ($Java8) {
$Java8Version = $Java8.IdentifyingNumber
$Command = "msiexec /x $Java8Version /qn"
cmd /c $Command
}
else {
}
Redeploy Software via GPO
GPO will keep track of installed Software Package in the registry. If you uninstall the deployed applications manually, the application will NOT be redeployed again even you reboot your workstations.
You will need to manually delete the key represented the Applications in HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Group Policy\AppMgmt to let the applications redeployed again from GPO
Reference
1. https://www.mysysadmintips.com/windows/active-directory/210-force-applications-to-be-re-installed-by-group-policy