get installed program list from add or remove program using C#

Posted on 2009-04-20
Last Modified: 2012-05-06
i am developing a application in which i need to get the list of installted programs on windows xp, from add or remove programs. I am using C#. any idea how to do it.

Question by:pixels123
    LVL 18

    Accepted Solution

    The list can be retrieved from registry key

    HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\Curr entVersion\Uninstall

    Here is an example how to do this

    LVL 1

    Assisted Solution

    Hope the code snippet helps you
    public void GetInstalledApplicationList(List<string> ApplicationNames)
                RegistryKey OurKey = Registry.LocalMachine;
                OurKey = OurKey.OpenSubKey(@"SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall", true);
                string[] subStringNames = OurKey.GetSubKeyNames();
                int Count = OurKey.SubKeyCount;
                for (int Index = 0; Index < Count; Index++)
                    RegistryKey Key = OurKey.OpenSubKey(subStringNames[Index]);
                    string ValueName = Key.GetValue("DisplayName", "").ToString();
                    if (ValueName != "")

    Open in new window


    Featured Post

    Looking for New Ways to Advertise?

    Engage with tech pros in our community with native advertising, as a Vendor Expert, and more.

    Join & Write a Comment

    In order to hide the "ugly" records selectors (triangles) in the rowheaders, here are some suggestions. Microsoft doesn't have a direct method/property to do it. You can only hide the rowheader column. First solution, the easy way The first sol…
    Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
    Need more eyes on your posted question? Go ahead and follow the quick steps in this video to learn how to Request Attention to your question. *Log into your Experts Exchange account *Find the question you want to Request Attention for *Go to the e…
    This video is in connection to the article "The case of a missing mobile phone (". It will help one to understand clearly the steps to track a lost android phone.

    729 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    16 Experts available now in Live!

    Get 1:1 Help Now