Uninstall any MSI application

(imported topic written by heru_h91)

I have created action script for uninstalling any MSI application; here is the action script I created:

action parameter query “Name” with description “Please enter the Program Name”

waithidden “{pathname of system folder & “\msiexec.exe”}” /QN REBOOT=ReallySuppress /X “{name of key whose (value “DisplayName” of it =”{parameter “Name” of action as string}" and name of it starts with “{”) of key “HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall” of registry}

When I input the name of MSI application that I want to uninstall, it still shows failed status. But when I remove all the action parameter query script, it works perfectly:

waithidden “{pathname of system folder & “\msiexec.exe”}” /QN REBOOT=ReallySuppress /X "{name of key whose (value “DisplayName” of it =“Microsoft Office PowerPoint Viewer 2007 (English)” and name of it starts with “{”) of key “HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall” of registry}

Can anybody help me for this problem?

1 Like

(imported comment written by MattBoyd)

I think you need to escape the curly brace that is in your relevance code… here’s a similar example: http://forum.bigfix.com/viewtopic.php?id=530

(imported comment written by heru_h91)

I already try it but still fail. Here is the relevance:

action parameter query “name” with description “Please enter the Program Name”

waithidden “{pathname of system folder & “\msiexec.exe”}” /QN REBOOT=ReallySuppress /X “{name of key whose (value “DisplayName” of it =”{parameter “Name” of action as string}" and name of it starts with “{”) of key “HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall” of registry}}

(imported comment written by sstroffo91)

Try to remove the space after /X

(imported comment written by heru_h91)

still not working.

Ben, can help me for this problem? I just want to create task that can uninstall MSI application so I don’t need to edit the task, just by input the name of application in action parameter, that task will automatically run the uninstall command.

(imported comment written by BenKus)

I haven’t tested it, but I think it should work similar to what you have and what Steve and boyd suggested

with a bit of syntax fixes:

action parameter query “name” with description “Please enter the Program Name”

waithidden “{pathname of system folder & “\msiexec.exe”}” /QN REBOOT=ReallySuppress /X"{name of key whose (value “DisplayName” of it =(parameter “Name” of action) and name of it starts with “{”) of key “HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall” of registry}

Ben

(imported comment written by heru_h91)

Ben, it still not working.

waithidden “{pathname of system folder & “\msiexec.exe”}” /QN REBOOT=ReallySuppress /X"{name of key whose (value “DisplayName” of it =“Microsoft Office PowerPoint Viewer 2003” and name of it starts with “{”) of key “HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall” of registry} —> this one works

==========================================================================

action parameter query “name” with description “Please enter the Program Name”

waithidden “{pathname of system folder & “\msiexec.exe”}” /QN REBOOT=ReallySuppress /X"{name of key whose (value “DisplayName” of it =(parameter “Name” of action) and name of it starts with “{”) of key “HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall” of registry} —> this one doesn’t work

how to perfectly combine action parameter with the first action script?

(imported comment written by sstroffo91)

Make sure that the parameter is case sensitive - ‘name’ vs ‘Name’

action parameter query “Name” with description “Please enter the Program Name”

waithidden “{pathname of system folder & “\msiexec.exe”}” /QN REBOOT=ReallySuppress /X"{name of key whose (value “DisplayName” of it =(parameter “Name” of action) and name of it starts with “{”) of key “HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall” of registry}

(imported comment written by heru_h91)

Sorry there is typo, but still doesn’t work.

(imported comment written by sstroffo91)

Remove the " after /X

waithidden “{pathname of system folder & “\msiexec.exe”}” /QN REBOOT=ReallySuppress /X{name of key whose (value “DisplayName” of it =(parameter “Name” of action) and name of it starts with “{”) of key “HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall” of registry}

If this does not work,

  • Can you look/post the information in the local LOG file after the action runs.
  • Are there more than 1 items in the registry with the DisplayName paramater passed?
  • Are there already msiexec.exe’s running prior to the action
  • Are there any Event Log entries

(imported comment written by heru_h91)

Thanks, now it works.

(imported comment written by sienz91)

Hi heru, what is the final script for this case?

(imported comment written by heru_h91)

Hi Sienz.

try this:

action parameter query “Name” with description “Please enter the Program Name”

waithidden “{pathname of system folder & “\msiexec.exe”}” /QN REBOOT=ReallySuppress /X{name of key whose (value “DisplayName” of it =(parameter “Name” of action) and name of it starts with “{”) of key “HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall” of registry}

(imported comment written by russwm91)

Hello All,

if {exists key “HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall{044CF88E-88FD-4DD1-B9DA-42362CB530A2}” of registry}

waithidden MsiExec.exe /x {{044CF88E-88FD-4DD1-B9DA-42362CB530A2} /passive

endif

The above statement is what I have setup for a custom action script it fails in the action script but passes in relevancy debug check for the HKLM exist. Is this best practice for you to check the MSI uninstall key a head of time before you have it do the waithidden MsiExec.exe /x command. Is there a better way for the uninstaller to check this before it runs. I don’t really want to place this in my relevancy check since this is only to have the action script skip things that are not needed if previously done before.

Thanks,

Russ

(imported comment written by FSINJ)

Help!

I know this is old thread but I’m new to BigFix (now is IBM Endpoint Manager). Did you anyone responded to your question? Did you get this to work? If you do, can you share it with me because I have tried to do same exact thing but it keeps failing.

Anyone can chime in and your help will be greatly appreciated.

Thanks,

FSINJ

(imported comment written by jgstew)

It would help if you made a separate post to the forums with a link to this thread. You’re asking for help buried deep within a very old thread.

(imported comment written by tscott91)

I’m new to BigFix… How do you set this up? I see where to create custom actions but it looks like you were able to get a prompt to enter the app name etc? Thanks

(imported comment written by tscott91)

This is a great fixlet… One question… Does anyone know a way to pull the uninstall strings for all programs installed on a PC? It is a real PITA connecting to remote registry, drilling all they way down to the correct reg key and then searching for the program you want to uninstall…

What I’m doing is uninstalling all Adobe products from my PC’s… I’ve already gone through and gotten all the Reader versions but I figured there has to be a way to get this info via a Fixlet.

(imported comment written by BenKus)

You just want to pull the app name and uninstall string? Try this:

q: (values “displayname” of it, values “UninstallString” of it) of keys of key “HKLM\software\microsoft\windows\currentversion\uninstall” of registry

Ben

(imported comment written by tscott91)

Ben… You freaking rock! I can’t wait until I can do these on my own… The power of BigFix is insanely awesome!