navigation bar left navigation bar right

Secunia CSI7
navigation left tab Advisories navigation right tab
navigation left tab Research navigation right tab
navigation left tab Forums navigation right tab
navigation left tab Create Profile navigation right tab
navigation left tab Our Commitment navigation right tab
PSI
PSI API
CSI
OSI
xSI
Vulnerabilities
Programs
Open Discussions
My Threads
Create Thread
Statistics
About

Forum Thread: Uninstalling Java 6.x: help needed for creating an uninstall package

You are currently viewing a forum thread in the Secunia Community Forum. Please note that opinions expressed here are not of Secunia but solely reflect those of the user who wrote it.

This thread was submitted in the following forum:
CSI

This thread has been marked as locked.
Pla_IIS Uninstalling Java 6.x: help needed for creating an uninstall package
Member 6th Mar, 2013 21:50
Ranking: 1
Posts: 24
User Since: 1st Jan, 1970
System Score: N/A
Location: DE
How can I create a package to uninstall all versions (or at lease a specified version) of Java 6.x?

I found a method to manually uninstall Java silently and without the need for user interaction from the command line. The command is:

MsiExec /qn /X{26A24AE4-039D-4CA4-87B4-2F83216041FF} /norestart

and must be started with admin rights. That command is for version 6.41 only (the version is coded in the last 4 digits: \"41ff \" identifies version 6.41, \"39ff\" version 6.39 and so on.

Entering the command manually works fine, but I would like to create a Secunia package which should do that task automatically (I have to remove Java 6 from about 2.000 PCs...).

Who can help?

SmithJoe RE: Uninstalling Java 6.x: help needed for creating an uninstall package
Contributor 7th Mar, 2013 10:56
Score: 143
Posts: 36
User Since: 14th Jun 2011
System Score: N/A
Location: DE
Last edited on 7th Mar, 2013 10:59
i just did the same thing because we needed to swith from Java6 -> Java7.
you can create a batch file with all the commands to uninstall java6 and run that as an update to java6 in the csi console.

my batch files looks like this, use at own risk ;-)


@ECHO OFF


SET REG_PATH1=HKLM\SOFTWARE\Wow6432Node\Microsoft\Wind ows\CurrentVersion\Uninstall
SET REG_PATH2=HKLM\SOFTWARE\Microsoft\Windows\CurrentV ersion\Uninstall

CALL :SingleEntries {26A24AE4-039D-4CA4-87B4-2F86416043FF}
CALL :SingleEntries {26A24AE4-039D-4CA4-87B4-2F83216043FF}

CALL :SingleEntries {26A24AE4-039D-4CA4-87B4-2F86416041FF}
CALL :SingleEntries {26A24AE4-039D-4CA4-87B4-2F83216041FF}

CALL :SingleEntries {26A24AE4-039D-4CA4-87B4-2F86416039FF}
CALL :SingleEntries {26A24AE4-039D-4CA4-87B4-2F83216039FF}

CALL :SingleEntries {26A24AE4-039D-4CA4-87B4-2F86416038FF}
CALL :SingleEntries {26A24AE4-039D-4CA4-87B4-2F83216038FF}

CALL :SingleEntries {26A24AE4-039D-4CA4-87B4-2F86416037FF}
CALL :SingleEntries {26A24AE4-039D-4CA4-87B4-2F83216037FF}

CALL :SingleEntries {26A24AE4-039D-4CA4-87B4-2F86416036FF}
CALL :SingleEntries {26A24AE4-039D-4CA4-87B4-2F83216036FF}

CALL :SingleEntries {26A24AE4-039D-4CA4-87B4-2F86416035FF}
CALL :SingleEntries {26A24AE4-039D-4CA4-87B4-2F83216035FF}

CALL :SingleEntries {26A24AE4-039D-4CA4-87B4-2F86416034FF}
CALL :SingleEntries {26A24AE4-039D-4CA4-87B4-2F83216034FF}

CALL :SingleEntries {26A24AE4-039D-4CA4-87B4-2F86416033FF}
CALL :SingleEntries {26A24AE4-039D-4CA4-87B4-2F83216033FF}

CALL :SingleEntries {26A24AE4-039D-4CA4-87B4-2F86416032FF}
CALL :SingleEntries {26A24AE4-039D-4CA4-87B4-2F83216032FF}

CALL :SingleEntries {26A24AE4-039D-4CA4-87B4-2F86416031FF}
CALL :SingleEntries {26A24AE4-039D-4CA4-87B4-2F83216031FF}

CALL :SingleEntries {26A24AE4-039D-4CA4-87B4-2F86416030FF}
CALL :SingleEntries {26A24AE4-039D-4CA4-87B4-2F83216030FF}

CALL :SingleEntries {26A24AE4-039D-4CA4-87B4-2F86416029FF}
CALL :SingleEntries {26A24AE4-039D-4CA4-87B4-2F83216029FF}

CALL :SingleEntries {26A24AE4-039D-4CA4-87B4-2F86416028FF}
CALL :SingleEntries {26A24AE4-039D-4CA4-87B4-2F83216028FF}

CALL :SingleEntries {26A24AE4-039D-4CA4-87B4-2F86416027FF}
CALL :SingleEntries {26A24AE4-039D-4CA4-87B4-2F83216027FF}

CALL :SingleEntries {26A24AE4-039D-4CA4-87B4-2F86416026FF}
CALL :SingleEntries {26A24AE4-039D-4CA4-87B4-2F83216026FF}

CALL :SingleEntries {26A24AE4-039D-4CA4-87B4-2F86416025FF}
CALL :SingleEntries {26A24AE4-039D-4CA4-87B4-2F83216025FF}

CALL :SingleEntries {26A24AE4-039D-4CA4-87B4-2F86416024FF}
CALL :SingleEntries {26A24AE4-039D-4CA4-87B4-2F83216024FF}

CALL :SingleEntries {26A24AE4-039D-4CA4-87B4-2F86416023FF}
CALL :SingleEntries {26A24AE4-039D-4CA4-87B4-2F83216023FF}

CALL :SingleEntries {3248F0A8-6813-11D6-A77B-00B0D0160220}

CALL :SingleEntries {3248F0A8-6813-11D6-A77B-00B0D0160210}

CALL :SingleEntries {3248F0A8-6813-11D6-A77B-00B0D0160200}

CALL :SingleEntries {3248F0A8-6813-11D6-A77B-00B0D0160190}

CALL :SingleEntries {3248F0A8-6813-11D6-A77B-00B0D0160180}

CALL :SingleEntries {3248F0A8-6813-11D6-A77B-00B0D0160170}

CALL :SingleEntries {3248F0A8-6813-11D6-A77B-00B0D0160160}

CALL :SingleEntries {3248F0A8-6813-11D6-A77B-00B0D0160150}

CALL :SingleEntries {3248F0A8-6813-11D6-A77B-00B0D0160140}

CALL :SingleEntries {3248F0A8-6813-11D6-A77B-00B0D0160130}

CALL :SingleEntries {3248F0A8-6813-11D6-A77B-00B0D0160120}

CALL :SingleEntries {3248F0A8-6813-11D6-A77B-00B0D0160110}

CALL :SingleEntries {3248F0A8-6813-11D6-A77B-00B0D0160100}

CALL :SingleEntries {3248F0A8-6813-11D6-A77B-00B0D0160090}

CALL :SingleEntries {3248F0A8-6813-11D6-A77B-00B0D0160080}

CALL :SingleEntries {3248F0A8-6813-11D6-A77B-00B0D0160070}

CALL :SingleEntries {3248F0A8-6813-11D6-A77B-00B0D0160060}

CALL :SingleEntries {3248F0A8-6813-11D6-A77B-00B0D0160050}

CALL :SingleEntries {3248F0A8-6813-11D6-A77B-00B0D0160040}

CALL :SingleEntries {3248F0A8-6813-11D6-A77B-00B0D0160030}

CALL :SingleEntries {3248F0A8-6813-11D6-A77B-00B0D0160020}

CALL :SingleEntries {3248F0A8-6813-11D6-A77B-00B0D0160010}

CALL :SingleEntries {3248F0A8-6813-11D6-A77B-00B0D0160000}

REG QUERY %REG_PATH1%|FIND "{26A24AE4-039D-4CA4-87B4-2F832160">%temp%\uninsta ll1.txt
FOR /F "Tokens=8 Delims=\" %%I in (%temp%\uninstall.txt) DO CALL :Uninstall32 %%I

REG QUERY %REG_PATH2%|FIND "{26A24AE4-039D-4CA4-87B4-2F832160">%temp%\uninsta ll2.txt
FOR /F "Tokens=7 Delims=\" %%I in (%temp%\uninstall.txt) DO CALL :Uninstall64 %%I


REG QUERY %REG_PATH1%|FIND "{26A24AE4-039D-4CA4-87B4-2F864160">%temp%\uninsta ll3.txt
FOR /F "Tokens=8 Delims=\" %%I in (%temp%\uninstall.txt) DO CALL :Uninstall32 %%I

REG QUERY %REG_PATH2%|FIND "{26A24AE4-039D-4CA4-87B4-2F864160">%temp%\uninsta ll4.txt
FOR /F "Tokens=7 Delims=\" %%I in (%temp%\uninstall.txt) DO CALL :Uninstall64 %%I


REG QUERY %REG_PATH1%|FIND "{3248F0A8-6813-11D6-A77B-00B0D0160">%temp%\uninst all5.txt
FOR /F "Tokens=8 Delims=\" %%I in (%temp%\uninstall.txt) DO CALL :Uninstall32 %%I

REG QUERY %REG_PATH2%|FIND "{3248F0A8-6813-11D6-A77B-00B0D0160">%temp%\uninst all6.txt
FOR /F "Tokens=7 Delims=\" %%I in (%temp%\uninstall.txt) DO CALL :Uninstall64 %%I

GOTO END

:SingleEntries
SET GUID=%1
CALL :Uninstall32 %GUID%
CALL :Uninstall64 %GUID%
CALL :Uninstall3264 %GUID%

GOTO END

:Uninstall32
SET GUID=%1
ECHO %GUID% (32)>>%temp%\uninstall_log.txt
REG QUERY %REG_PATH1%\%GUID% >>%temp%\uninstall_log.txt
REG QUERY %REG_PATH1%\%GUID% /v DisplayName|FIND "DisplayName" >>%temp%\uninstall_log.txt
IF %ERRORLEVEL%==0 (
REG QUERY %REG_PATH1%\%GUID% /v InstallLocation|FIND "\Java\jre" && GOTO KILLER
)
GOTO END

:Uninstall64
SET GUID=%1
ECHO %GUID% (64)>>%temp%\uninstall_log.txt
REG QUERY %REG_PATH2%\%GUID% >>%temp%\uninstall_log.txt
REG QUERY %REG_PATH2%\%GUID% /v DisplayName|FIND "DisplayName" >>%temp%\uninstall_log.txt
IF %ERRORLEVEL%==0 (
REG QUERY %REG_PATH2%\%GUID% /v InstallLocation|FIND "\Java\jre" && GOTO KILLER
)
GOTO END

:Uninstall3264
SET GUID=%1
ECHO %GUID% (64reg)>>%temp%\uninstall_log.txt
REG QUERY %REG_PATH2%\%GUID% /reg:64 >>%temp%\uninstall_log.txt
REG QUERY %REG_PATH2%\%GUID% /reg:64 /v DisplayName|FIND "DisplayName" >>%temp%\uninstall_log.txt
IF %ERRORLEVEL%==0 (
REG QUERY %REG_PATH2%\%GUID% /reg:64 /v InstallLocation|FIND "\Java\jre" && GOTO KILLER
)
ECHO %GUID% (32reg)>>%temp%\uninstall_log.txt
REG QUERY %REG_PATH2%\%GUID% /reg:32 >>%temp%\uninstall_log.txt
REG QUERY %REG_PATH2%\%GUID% /reg:32 /v DisplayName|FIND "DisplayName" >>%temp%\uninstall_log.txt
IF %ERRORLEVEL%==0 (
REG QUERY %REG_PATH2%\%GUID% /reg:32 /v InstallLocation|FIND "\Java\jre" && GOTO KILLER
)

GOTO END


:KILLER
ECHO Removing %GUID% ...
msiexec /uninstall %GUID% /quiet /qn REBOOT=SUPRESS
GOTO END

:END
Was this reply relevant?
+41
-0
This user no longer exists RE: Uninstalling Java 6.x: help needed for creating an uninstall package
Secunia Official 7th Mar, 2013 19:55
Last edited on 7th Mar, 2013 19:59 Hi,

Secunia CSI supports unattended uninstall packages for Java 6.x by default. You could navigate to Secunia Package System under Patching, where you can see by yourself which programs are supported by Secunia CSI. The information is visible under 'Uninstallable' column (right-most). I just tested this with Java 6.0.33.3 and Java 6.0.410.2. Both entries are labeled with 'Yes' which means that you are free to create default package (Press Next only).

Secondly, your package needs to gain coverage since you have requirement for 2000 systems. Please, make sure you have scanned all of the systems altogether at the same time beforehand. This will result in a program entry under SPS that includes the detection paths of all systems scanned. Thus, SPS will add the same as requirement for your package and will enable it to distribute to the same recipients - the same machines you scanned.

Uninstall Package for Java 6.0.410.2 was tested by me today and it worked great. For my tests I used Java installation on Windows 7 Enterprise, and patch build in Secunia CSI x32 and distributed by WSUS 3.2. The package is completely unattended and uninstalls completely.

Kind regards,
/Rosen Danailov
This user no longer exists RE: Uninstalling Java 6.x: help needed for creating an uninstall package
Secunia Official 7th Mar, 2013 20:14
The correct steps to create Uninstall Package in Secunia CSI 5.x and 6.x are as follows:

1. Navigate to Patching menu.
2. Enter Secunia Package System (SPS)
3. Find 'Uninstallable' column under SPS window
4. Confirm if SPS labeled your program entry of Java 6.x with 'Yes'.
5. Right-click on your program entry for Java and select 'Create Uninstall Package'.
6. Proceed with Next, then press Publish. Go ahead and approve the update for your systems.

Please note that not only one version of Java would be Uninstalled. SPS packages include version scopes which enable the package to target many versions at once. You can see the targeted versions and i installation paths under step 3 of SPS package wizard. You may want to correct the targeted recipients there.

Kind regards,
/Rosen Danailov


This thread has been marked as locked.


 Products Solutions Customers Partner Resources Company
 
 Corporate
Vulnerability Intelligence Manager (VIM)
Corporate Software Inspector (CSI)
Consumer
Personal Software Inspector (PSI)
Online Software Inspector (OSI)
 Industry
Compliance
Technology
Integration
 Customers
Testimonials
 MSSP
Technology Partners
References
 Reports
Webinars
Events
 About us
Careers
Memberships
Newsroom


Secunia is a member of FIRST Secunia is a member of EDUcause Secunia is a member of The Open Group Secunia is a member of FS-ISAC
 
Secunia © 2002-2014 Secunia ApS - Rued Langgaards Vej 8, 4th floor, DK-2300 Copenhagen, Denmark - +45 7020 5144
Terms & Conditions and Copyright - Privacy - Report Vulnerability - Disclaimer
follow Secunia on Facebook follow Secunia on Twitter follow Secunia on LinkedIn follow Secunia on YouTube follow Secunia Xing follow Secunias RSS feed follow Secunia on Google+