Topic
  • 28 replies
  • Latest Post - ‏2014-05-14T20:16:14Z by jgstew
heru_h91
heru_h91
14 Posts

Pinned topic Uninstall any MSI application

‏2009-07-31T03:41:32Z |
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?
  • MattBoyd
    MattBoyd
    227 Posts

    Re: Uninstall any MSI application

    ‏2009-07-31T14:47:39Z  
    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
  • heru_h91
    heru_h91
    14 Posts

    Re: Uninstall any MSI application

    ‏2009-08-03T09:51:06Z  
    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}}
  • sstroffo91
    sstroffo91
    9 Posts

    Re: Uninstall any MSI application

    ‏2009-08-03T12:40:04Z  
    Try to remove the space after /X
  • heru_h91
    heru_h91
    14 Posts

    Re: Uninstall any MSI application

    ‏2009-08-04T09:35:39Z  
    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.
  • BenKus
    BenKus
    1408 Posts

    Re: Uninstall any MSI application

    ‏2009-08-05T04:48:29Z  
    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
  • heru_h91
    heru_h91
    14 Posts

    Re: Uninstall any MSI application

    ‏2009-08-05T09:04:11Z  
    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?
  • sstroffo91
    sstroffo91
    9 Posts

    Re: Uninstall any MSI application

    ‏2009-08-05T12:06:26Z  
    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}
  • heru_h91
    heru_h91
    14 Posts

    Re: Uninstall any MSI application

    ‏2009-08-06T01:35:55Z  
    Sorry there is typo, but still doesn’t work.
  • sstroffo91
    sstroffo91
    9 Posts

    Re: Uninstall any MSI application

    ‏2009-08-06T13:15:01Z  
    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
  • heru_h91
    heru_h91
    14 Posts

    Re: Uninstall any MSI application

    ‏2009-08-10T07:17:37Z  
    Thanks, now it works.
  • sienz91
    sienz91
    3 Posts

    Re: Uninstall any MSI application

    ‏2009-08-17T17:21:20Z  
    Hi heru, what is the final script for this case?
  • heru_h91
    heru_h91
    14 Posts

    Re: Uninstall any MSI application

    ‏2009-08-20T01:10:45Z  
    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}
  • russwm91
    russwm91
    7 Posts

    Re: Uninstall any MSI application

    ‏2010-05-14T22:52:48Z  
    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
  • tscott91
    tscott91
    108 Posts

    Re: Uninstall any MSI application

    ‏2010-05-18T12:05:26Z  
    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
  • tscott91
    tscott91
    108 Posts

    Re: Uninstall any MSI application

    ‏2010-07-24T02:57:57Z  
    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.
  • BenKus
    BenKus
    1408 Posts

    Re: Uninstall any MSI application

    ‏2010-07-24T05:02:51Z  
    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
  • tscott91
    tscott91
    108 Posts

    Re: Uninstall any MSI application

    ‏2010-07-24T11:05:18Z  
    Ben... You freaking rock! I can't wait until I can do these on my own.. The power of BigFix is insanely awesome!
  • JackCoates91
    JackCoates91
    122 Posts

    Re: Uninstall any MSI application

    ‏2010-10-06T15:50:17Z  
    64 bit windows makes things a little tougher with registry redirection, here's some ugly relevance that should be more complete.

    q: (IF (x64 of operating system) THEN ((values "displayname" of it, values "UninstallString" of it) of keys of key "HKLM\software\microsoft\windows\currentversion\uninstall" of native registry, (values "displayname" of it, values "UninstallString" of it) of keys of key "HKLM\software\microsoft\windows\currentversion\uninstall" of x32 registry) ELSE (values "displayname" of it, values "UninstallString" of it as strings) of keys of key "HKLM\software\microsoft\windows\currentversion\uninstall" of registry)

    Relevance golf?
  • JackCoates91
    JackCoates91
    122 Posts

    Re: Uninstall any MSI application

    ‏2010-10-22T23:25:25Z  
    Thanks to Noah for some assistance in improving this:
    q: (IF (x64 of operating system) THEN ((it as string) of (values "displayname" of it, values "uninstallstring" of it) of keys whose (exists (values "displayname" of it, values "uninstallstring" of it)) of key "HKLM\software\microsoft\windows\currentversion\uninstall" of native registry; (it as string) of (values "displayname" of it, values "uninstallstring" of it) of keys whose (exists (values "displayname" of it, values "uninstallstring" of it)) of key "HKLM\software\microsoft\windows\currentversion\uninstall" of x32 registry) ELSE ((it as string) of (values "displayname" of it, values "uninstallstring" of it as string) of keys whose (exists (values "displayname" of it, values "uninstallstring" of it)) of key "HKLM\software\microsoft\windows\currentversion\uninstall" of registry))
  • JackCoates91
    JackCoates91
    122 Posts

    Re: Uninstall any MSI application

    ‏2010-10-23T00:09:22Z  
    This version checks that there's a value in there to report, and blocks Windows patches from showing up (you'll still see Office patches though). I'm using this as an analysis now:

    (it as string) whose (it as lowercase does not contain "spuninst.exe") of (IF (x64 of operating system) THEN ((it as string) of (values "displayname" of it, values "uninstallstring" of it) of keys whose (length of (value "displayname" of it as string) > 0 and exists (values "uninstallstring" of it)) of key "HKLM\software\microsoft\windows\currentversion\uninstall" of native registry; (it as string) of (values "displayname" of it, values "uninstallstring" of it) of keys whose (length of (value "displayname" of it as string) > 0 and exists (values "uninstallstring" of it)) of key "HKLM\software\microsoft\windows\currentversion\uninstall" of x32 registry) ELSE ((it as string) of (values "displayname" of it, values "uninstallstring" of it as string) of keys whose (length of (values "displayname" of it as string) > 0 and exists (values "uninstallstring" of it)) of key "HKLM\software\microsoft\windows\currentversion\uninstall" of registry))
  • lunchboxfl91
    lunchboxfl91
    27 Posts

    Re: Uninstall any MSI application

    ‏2011-04-12T19:22:44Z  
    How do I get this information...I tried analysis,but nothing. I am new any help would be great. Thanks.
  • NoahSalzman
    NoahSalzman
    676 Posts

    Re: Uninstall any MSI application

    ‏2011-04-12T19:29:15Z  
    "Nothing" is a little odd. Did you target the Analysis at a group of computers?
  • lunchboxfl91
    lunchboxfl91
    27 Posts

    Re: Uninstall any MSI application

    ‏2011-04-13T10:34:34Z  
    Yes at a group of computer names.. Maybe I just have to wait longer. So I just paste the code from Jack above in an analysis and it should take care of it right?
  • lunchboxfl91
    lunchboxfl91
    27 Posts

    Re: Uninstall any MSI application

    ‏2011-04-13T14:27:14Z  
    Nevermind I got it to work. Thanks.