5 Replies Latest reply on Jan 3, 2008 10:52 AM by Jared Barneck

    Application uninstall string from the registry

    pettittsa Apprentice


      We have a whole load of non-standard applications that we have to clean off users' PCs.  It would be extremely useful if, in the inventory we could include the "UninstallString" key from each application's entry from HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\ so that we don't have to check each PC individually.  Is this easy (or indeed possible)?



      Thanks in advance,






        • 1. Re: Application uninstall string from the registry
          phoffmann SupportEmployee

          Sort of - depends what exactly you're after.


          First off - the question is are you looking for ALL application's uninstall strings, or only for a specific set?


          The reason I ask this, is because you MUST define the registry path you want to scan - there's at present no way to say "scan all values where name = X for all subdirectories" or any logic like that at present.


          If you know what you want, then this is no problem - just list the registry keys and the custom-data location you want in the LDAPPL3 (see the thread http://community.landesk.com/support/message/1477 for more information, includes both a LANDesk doc and one less formal one I did), and you're done.


          If you want "all", you'll need to do some batch/VB-scripting or something like that, essentially script up something that'll get the values you want, and then put them all into a single registry location (for example - "HKLM\SOFTWARE\UninstallKeys\"- and then read THAT location out for the values - i.e. "app1 / app2 / app3" and so on).


          Either way, I would advise some caution if you want to go for the latter - it's a dangerous thing to collect "all information" on anything, as the tendancy is often that people drown in a flood of data, and it becomes useless on account of just spamming everything. So be sure to know what you need to know, so that the data you do collect is useful to you :).


          Hope this helps.


          Paul Hoffmann

          LANDesk EMEA Technical Lead.

          1 of 1 people found this helpful
          • 2. Re: Application uninstall string from the registry
            pettittsa Apprentice

            Thanks for the information.



            Ideally I would like the UninstallString for ALL applications as at the moment I don't know exactly what I need to remove. I'm starting with all the 3rd-party toolbars for IE that cause issues with one of our web-based apps due to their pop-up blockers, but if the process of identifying a way to remove other unauthorised software was simple I'd start to tackle those too. I may have to just settle for removing the worst offenders!




            • 3. Re: Application uninstall string from the registry
              phoffmann SupportEmployee

              Hmm - realistically, I think SLM's / SLM autodiscovery would be better suited here - as this could give you an easier rundown on the numbers too, as well as an interface to deny their usage.


              If you're going to be going for the "scripted collection into a specific registry key" the problem you face is still one of identifiers. You COULD of course just have the batch/script do entries like this in the registry:


              Software1 == UninstallString_1

              Software2 == UninstallString_2

              Software3 == UninstallString_3

              Software4 == UninstallString_4

              ... (and so on)


              however, the problem arises that in most likely cases, you'll end up having an entry for "Software2" on PC_A be "Bob's application", while on PC_B it could be "MyFavouriteEditor" - or scenarios like this, which will make that sort of data VERY difficult to collect, and collect in such a manner that it's actually useful. On top of that, you cannot just wildcard those values, as currently this simply cannot be read that way - the registry key/values you want to read must be specified top to bottom. And while a simple static list of "Software1" to "Software100" (or however long you want it to be) is easy to do, you end up with the problem that different PC's will mismatch ...


              ... which is to say nothing of querying this information - that'll be quite a painful thing to query for (and would REQUIRE you to do so through SQL, realistically),


              I am assuming from the general tone of your posts, that you DON'T know what the current worst offenders are - which is something that probably will be a lot easier to find out through regular inventory and/or SLM, I would think - once you have the ID's you want to track, things become easier ... biggest for you problem is to identify those GUID's at the moment. And I think that SLM will be the better way to come up with a short(-ish) list of things you actually want to pick up through Inventory (if it's still needed).


              Paul Hoffmann

              LANDesk EMEA Technical Lead.

              • 4. Re: Application uninstall string from the registry


                Uninstalling a product based upon registry strings can be even more complicated than you think.



                In many cases, the uninstall string contained in the registry is for an MSI based installation.  The uninstall string usually takes the form of MSIEXEC /I.  As you may have realized, this isn't the actual uninstall string but does bring up the maintenance mode for an installed product where the user has to make a choice whether to reinstall, repair or uninstall the product.   The correct uninstall string for a silent, MSI based install is MSIEXEC /X /QN.  You'd need to read the uninstall string, parse it and add/replace switches as appropriate.



                So what if it's not an MSI based install?  Now you're into custom (un)installers and each has its own special place in hades.  You need to know what kind of uninstaller it is to correctly formulate the uninstall command - remember, most software authors do not put the unattended, silent uninstall command in the registry.  Their uninstallers are intended to be interactive and require user input to work correctly.






                • 5. Re: Application uninstall string from the registry
                  Jared Barneck SupportEmployee

                  Sometimes there are other registry values under the Uninstall key that work perfectly already:






                  I started to write a VBScript to take advantage of these, but I have low VBscripting skills.


                  Here it is, maybe someone with great VBScripting skills can take more advantage.


                  Somewhere I had a newer version that used both the keys above but I can't find it.