Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 399249
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T16:49:40+00:00 2026-05-12T16:49:40+00:00

As suggested here , I need to iterate through entries in HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\ to find

  • 0

As suggested here, I need to iterate through entries in

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\

to find out the installed path of my application. How to iterate so that I can find out the
InstallLocation value given the DisplayName. How to do it efficiently in C#.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T16:49:41+00:00Added an answer on May 12, 2026 at 4:49 pm

    Below is code to achieve your goal:

    using Microsoft.Win32;
    class Program
    {
        static void Main(string[] args)
        {
            RegistryKey key = Registry.LocalMachine.OpenSubKey("Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall");
            foreach (var v in key.GetSubKeyNames())
            {
                Console.WriteLine(v);
    
                RegistryKey productKey = key.OpenSubKey(v);
                if (productKey != null)
                {
                    foreach (var value in productKey.GetValueNames())
                    {
                        Console.WriteLine("\tValue:" + value);
    
                        // Check for the publisher to ensure it's our product
                        string keyValue = Convert.ToString(productKey.GetValue("Publisher"));
                        if (!keyValue.Equals("MyPublisherCompanyName", StringComparison.OrdinalIgnoreCase))
                            continue;
    
                        string productName = Convert.ToString(productKey.GetValue("DisplayName"));
                        if (!productName.Equals("MyProductName", StringComparison.OrdinalIgnoreCase))
                            return;
    
                        string uninstallPath = Convert.ToString(productKey.GetValue("InstallSource"));
    
                        // Do something with this valuable information
                    }
                }
            }
    
            Console.ReadLine();
        }
    }
    

    Edit: See this method for a more comprehensive way to find an Applications Install Path, it demonstrates the using disposing as suggested in the comments.
    https://stackoverflow.com/a/26686738/495455

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to create some global android variables. Some posts here suggested me to
Here's the issue - I'm writing a program that will iterate through a series
I am trying: install.packages(RGoogleDocs, repos = http://www.omegahat.org/R) As suggested here , but it doesn't
From here I have seen it suggested that an instance of RichTextBox be created
I've tried following the syntax suggested here , but it doesn't work for my
I am using a Gallery based Cover-flow, as suggested here . Is there an
I need help understanding the jquery ui autocomplete example found here: http://jqueryui.com/demos/autocomplete/#remote If you
I'm posting my question here as it was suggested to do so on the
Within a VBScript, I need to make sure the user inputs a integer. Here
I used snippet suggested here Load block outside Magento, and apply current template to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.