Need to uninstall all version of Java Update 8 below version 8.0.920.14. Is there an easy way to create a fixlet to do so?
This will create a text file with all of the keys for any Java version other than Java 8 Update 92 and then it creates a powershell script to run msiexec on each key in the text file.
IF{exists keys whose (value "DisplayName" of it as string as lowercase contains "java" AND (value "Publisher" of it as string as lowercase contains "oracle" OR value "Publisher" of it as string as lowercase contains "sun") AND value "DisplayName" of it as string as lowercase does not contain "java auto updater" AND value "DisplayName" of it as string as lowercase does not contain "java 8 update 92") of keys "hklm\software\microsoft\windows\currentversion\uninstall" of (native registry;registry)}
delete __appendfile
appendfile {concatenation "%0d%0a" of (name of it) of keys whose (value "DisplayName" of it as string as lowercase contains "java" AND (value "Publisher" of it as string as lowercase contains "oracle" OR value "Publisher" of it as string as lowercase contains "sun") AND value "DisplayName" of it as string as lowercase does not contain "java auto updater" AND value "DisplayName" of it as string as lowercase does not contain "java 8 update 92") of keys "hklm\software\microsoft\windows\currentversion\uninstall" of (native registry;registry)}
delete c:\windows\temp\javaUninstall.txt
copy __appendfile c:\windows\temp\javaUninstall.txt
endif
delete __createfile
createfile until EOF
if(Test-Path "c:\windows\temp\javaUninstall.txt"){
foreach ($key in get-content "c:\windows\temp\javaUninstall.txt"){
(start-process -FilePath "msiexec.exe" -ArgumentList "/x $key /qn REBOOT=ReallySuppress" -wait -passthru)
}
}
exit
EOF
delete c:\windows\temp\javaUninstall.ps1
copy __createfile c:\windows\temp\javaUninstall.ps1
runhidden cmd /K powershell.exe -ExecutionPolicy Bypass c:\windows\temp\javaUninstall.ps1
What I usually do is create a baseline for the new Java versions each time a version is released. The baseline includes both the “Java 8.x availalbe - x32” and “Java 8.x available - x64”, and then at the end of the baseline I include the “Multiple Java 32-bit” and “Multiple Java 64-bit” Fixlets from the “Updates for Windows Applications” site. Those last two will uninstall all but the highest-versioned Java runtimes. Let me know if you can’t find them and I’ll get the Fixlet IDs and full names.
We do it in the action script like this.
waithidden MsiExec.exe /X {{26A24AE4-039D-4CA4-87B4-2F83218040F0} /qn
waithidden MsiExec.exe /X {{26A24AE4-039D-4CA4-87B4-2F83218045F0} /qn
waithidden MsiExec.exe /X {{26A24AE4-039D-4CA4-87B4-2F83218051F0} /qn
waithidden MsiExec.exe /X {{26A24AE4-039D-4CA4-87B4-2F83218060F0} /qn
waithidden MsiExec.exe /X {{26A24AE4-039D-4CA4-87B4-2F83218066F0} /qn
waithidden MsiExec.exe /X {{26A24AE4-039D-4CA4-87B4-2F83218072F0} /qn
waithidden MsiExec.exe /X {{26A24AE4-039D-4CA4-87B4-2F83218074F0} /qn
prefetch jre1.8.0_77.msi sha1:f1d889a3c461ae80432631e2354749a474d19b28 size:59224064 http://ms01ais11:52311/Uploads/CustomeFixlets/Java/J8u77-64Bit/jre8u92.msi
waithidden msiexec /i “__Download\jre8u92.msi” /QN ALLUSERS=2 WEB_JAVA_SECURITY_LEVEL=M
prefetch deleteJAVAfolder.vbs sha1:2b9ac6edd34a9f40bf48f570a9ca792373e3a0ad size:255 http://ms01ais11:52311/Uploads/CustomFixlets/Java/deleteJAVAfolder.vbs
waithidden cscript.exe //B “__Download\deleteJAVAfolder.vbs”
Can you send me a copy of post the copy of the baseline. Im having a hard time with the older version of java. I want to remove all and prvious version then I will just push an install of the last
Thanks