Uninstall a version of Java
The product un-install command is MsiExec.exe /X{26A24AE4-039D-4CA4-87B4-2F83217021FF}. I wrote a script:
Directory: $(KACE_SYS_DIR)
File: MsiExec.exe
Wait
Parameters: /X{26A24AE4-039D-4CA4-87B4-2F83217021FF}
The error is :
Running as: SYSTEM Error creating process: C:\WINDOWS\System32\MsiExec.exe /X{26A24AE4-039D-4CA4-87B4-2F83217021FF} : (0) The operation completed successfully. Error Code: 0 Status Code: 1605
Is that problem that on this computer that GUID doesn't exist? Thanks
|
Answers (5)
Roughly 0.5 seconds with Google will tell you that Windows Installer error 1605 is "This action is only valid for products that are currently installed."
Tricky to uninstall products which aren't installed. Add a test for installed status before attempting an uninstall.
Comments:
-
In the KACE inventory it showed that this computer did have that exact version. - jfrasier 11 years ago
If you can point to the MSI for the removal command instead of the GUID you may have better luck.
If you are going to pursue uninstall by GUID, note that the 32 bit and 64 bit installations have slightly different GUIDs. The one you have here is the 32 bit version, perhaps some of your systems have installed the 64bit?
26A24AE4-039D-4CA4-87B4-2F83217021FF
Comments:
-
Noticed that not only the change between 64 & 32, but also the specific version of Java:
For example, version 1.7.0_21 (32-bit):
{26A24AE4-039D-4CA4-87B4-2F83217021FF}
version 1.7.0_25 (32-bit):
{26A24AE4-039D-4CA4-87B4-2F83217025FF} - Joe_SCC 9 years ago
I'm not familiar with Kace but wondering if you need a /qn parameter.
Comments:
-
It did ask me if I wanted to uninstall, so yes having /qn would be a good idea. The problem was that it didn't uninstall. - jfrasier 11 years ago
-
u cn search for correct guid here HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall and give the exact vesrion of ur java application - appfreak 11 years ago
The simple way to solve this is to add a condition to verify which version of Java is installed and execute the uninstall command for each version. As bkelly said, the product code for 64 bits Java is diferent than product code for 32 bits Java.
{26A24AE4-039D-4CA4-87B4-2F83217021FF} - Java x86
{26A24AE4-039D-4CA4-87B4-2F86417021FF} - Java x64.
...you do need to add /qn for a silent uninstall. Another option I use instead of a script is create a MI, check the box for uninstall, add the command line for the uninstall, and target it to the machines you want to uninstall the software from. You've now got a Manged UNinstall!
I've noticed some of the uninstall strings seem to be incorrect and don't work as reported by our Kbox. I used a program that found the string more accurately - I can't remember what it was exactly but it was mentioned on ITNINJA...or if you Google for uninstall string finder something will turn up.
Scripting > Configuration Policy > Uninstall wizard
Especially with the GUID string, i find using this wizard gives me greater success. Yes if its not the right GUID it probably won't work. Hence with the wizard you can build them out quickly for all the different versions you want to remove. - nshah 11 years ago