So, another quarter goes by, another set of Oracle updates http://www.zdnet.com/oracle-fixes-many-vulnerabilities-in-dozens-of-products-7000031640/
Oracle Java 7 has been updated to update 65 so time to update the SCCM deployments.
Having a quick review we have:
Java files are copied while the offline install is running, from
C:\Users\<username>\AppData\LocalLow\Sun\Java\jre1.7.0_65 and
C:\Users\<username>\AppData\LocalLow\Sun\Java\jre1.7.0_65_x64
for x86 and x64 respectively
Java is offered via Software Center and runs an install script and an uninstall script.
The install script (.cmd file) kills off some local processes which might interfere with the install.
It then installs x86 and if a 'program files (x86)' directory exists, installs x64 also.
Lastly it disables automatic update checks.
taskkill /F /IM iexplorer.exe
taskkill /F /IM iexplore.exe
taskkill /F /IM firefox.exe
taskkill /F /IM chrome.exe
taskkill /F /IM javaw.exe
taskkill /F /IM jqs.exe
taskkill /F /IM jusched.exe
REM Call the uninstall script
cscript %~dp0\Java_Uninstall.vbs
REM Install JRE x86
msiexec.exe /i %~dp0\jre1.7.0_65_x86\jre1.7.0_65.msi /passive /norestart /l*v c:\windows\temp\Java7x86.log
REM Installing JRE x64
if exist %ProgramFiles(x86)%
msiexec.exe /i %~dp0\jre1.7.0_65_x64\jre1.7.0_65.msi /passive /norestart /l*v c:\windows\temp\Java7x64.log
REM Disable automatic updates
reg delete "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run" /v SunJavaUpdateSched /f
reg add "HKEY_LOCAL_MACHINE\Software\JavaSoft\Java Update\Policy" /v EnableJavaUpdate /t REG_DWORD /d 0 /f
REM Return the exit code to SCCM
exit /B %EXIT_CODE%
The uninstall script (.vbs) queries WMI to uninstall all versions of java
On Error Resume Next
strComputer = "."
Set objWMIService = GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
'Uninstall Java 2 Runtime Environment, J2SE Runtime Environment
Set colJava4dot3 = objWMIService.ExecQuery("Select * from Win32_Product Where Name like 'Java 2 Runtime Environment Standard Edition %'")
For Each objSoftware in colJava4dot3
objSoftware.Uninstall()
Next
'Uninstall Java 2 Runtime Environment, J2SE Runtime Environment
Set colJava4dot3 = objWMIService.ExecQuery("Select * from Win32_Product Where Name like 'J2SE Runtime Environment %'")
For Each objSoftware in colJava4dot3
objSoftware.Uninstall()
Next
'Uninstall Java 2 Runtime Environment, SE *
Set colJava4dot3 = objWMIService.ExecQuery("Select * from Win32_Product Where Name like 'Java 2 Runtime Environment, SE %'")
For Each objSoftware in colJava4dot3
objSoftware.Uninstall()
Next
'Uninstall Java(TM) 6 Update *
Set colJava6dot = objWMIService.ExecQuery("Select * from Win32_Product Where Name like 'Java(TM) 6 Update %'")
For Each objSoftware in colJava6dot
objSoftware.Uninstall()
Next
'Uninstall Java(TM) 7 Update *
Set colJava7dot = objWMIService.ExecQuery("Select * from Win32_Product Where Name like 'Java(TM) 7 Update %'")
For Each objSoftware in colJava7dot
objSoftware.Uninstall()
Next
'Uninstall Java(TM) 7 *
Set colJava7 = objWMIService.ExecQuery("Select * from Win32_Product Where Name like 'Java(TM) %'")
For Each objSoftware in colJava7
objSoftware.Uninstall()
Next
'Uninstall Java(TM) 7 *
Set colJava7 = objWMIService.ExecQuery("Select * from Win32_Product Where Name like 'Java 7 %'")
For Each objSoftware in colJava7
objSoftware.Uninstall()
Next
If you're deploying as an application, remember to update the product codes and detection method (in this case the MSI code changed to {26A24AE4-039D-4CA4-87B4-2F03217065FF} - the last 4 characters changed from 55FF to 65FF
Update the distribution points, and test!
Oracle Java 7 has been updated to update 65 so time to update the SCCM deployments.
Having a quick review we have:
Java files are copied while the offline install is running, from
C:\Users\<username>\AppData\LocalLow\Sun\Java\jre1.7.0_65 and
C:\Users\<username>\AppData\LocalLow\Sun\Java\jre1.7.0_65_x64
for x86 and x64 respectively
Java is offered via Software Center and runs an install script and an uninstall script.
The install script (.cmd file) kills off some local processes which might interfere with the install.
It then installs x86 and if a 'program files (x86)' directory exists, installs x64 also.
Lastly it disables automatic update checks.
taskkill /F /IM iexplorer.exe
taskkill /F /IM iexplore.exe
taskkill /F /IM firefox.exe
taskkill /F /IM chrome.exe
taskkill /F /IM javaw.exe
taskkill /F /IM jqs.exe
taskkill /F /IM jusched.exe
REM Call the uninstall script
cscript %~dp0\Java_Uninstall.vbs
REM Install JRE x86
msiexec.exe /i %~dp0\jre1.7.0_65_x86\jre1.7.0_65.msi /passive /norestart /l*v c:\windows\temp\Java7x86.log
REM Installing JRE x64
if exist %ProgramFiles(x86)%
msiexec.exe /i %~dp0\jre1.7.0_65_x64\jre1.7.0_65.msi /passive /norestart /l*v c:\windows\temp\Java7x64.log
REM Disable automatic updates
reg delete "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run" /v SunJavaUpdateSched /f
reg add "HKEY_LOCAL_MACHINE\Software\JavaSoft\Java Update\Policy" /v EnableJavaUpdate /t REG_DWORD /d 0 /f
REM Return the exit code to SCCM
exit /B %EXIT_CODE%
The uninstall script (.vbs) queries WMI to uninstall all versions of java
On Error Resume Next
strComputer = "."
Set objWMIService = GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
'Uninstall Java 2 Runtime Environment, J2SE Runtime Environment
Set colJava4dot3 = objWMIService.ExecQuery("Select * from Win32_Product Where Name like 'Java 2 Runtime Environment Standard Edition %'")
For Each objSoftware in colJava4dot3
objSoftware.Uninstall()
Next
'Uninstall Java 2 Runtime Environment, J2SE Runtime Environment
Set colJava4dot3 = objWMIService.ExecQuery("Select * from Win32_Product Where Name like 'J2SE Runtime Environment %'")
For Each objSoftware in colJava4dot3
objSoftware.Uninstall()
Next
'Uninstall Java 2 Runtime Environment, SE *
Set colJava4dot3 = objWMIService.ExecQuery("Select * from Win32_Product Where Name like 'Java 2 Runtime Environment, SE %'")
For Each objSoftware in colJava4dot3
objSoftware.Uninstall()
Next
'Uninstall Java(TM) 6 Update *
Set colJava6dot = objWMIService.ExecQuery("Select * from Win32_Product Where Name like 'Java(TM) 6 Update %'")
For Each objSoftware in colJava6dot
objSoftware.Uninstall()
Next
'Uninstall Java(TM) 7 Update *
Set colJava7dot = objWMIService.ExecQuery("Select * from Win32_Product Where Name like 'Java(TM) 7 Update %'")
For Each objSoftware in colJava7dot
objSoftware.Uninstall()
Next
'Uninstall Java(TM) 7 *
Set colJava7 = objWMIService.ExecQuery("Select * from Win32_Product Where Name like 'Java(TM) %'")
For Each objSoftware in colJava7
objSoftware.Uninstall()
Next
'Uninstall Java(TM) 7 *
Set colJava7 = objWMIService.ExecQuery("Select * from Win32_Product Where Name like 'Java 7 %'")
For Each objSoftware in colJava7
objSoftware.Uninstall()
Next
If you're deploying as an application, remember to update the product codes and detection method (in this case the MSI code changed to {26A24AE4-039D-4CA4-87B4-2F03217065FF} - the last 4 characters changed from 55FF to 65FF
Update the distribution points, and test!
Comments
Post a Comment