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 6091189
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T12:17:56+00:00 2026-05-23T12:17:56+00:00

I would to get installed version of an application (say, MyApp) using C#. I

  • 0

I would to get installed version of an application (say, MyApp) using C#.
I will do this much,
1. Create a ‘Set Up’ for MyApp of version 5.6
2. Install MyApp.

I will create another application (say VersionTracker)to get the version of installed applications. So if I pass the name ‘MyApp’ I would like to get the version as ‘5.6’. If another application say Adobe Reader is installed in my system, I want to get the version of Adobe Reader if I pass ‘Adobe Reader’.

I need to know how to build ‘VersionTracker’

  • 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-23T12:17:57+00:00Added an answer on May 23, 2026 at 12:17 pm

    The first and the most important thing is that not all applications do save their version somewhere in the system. To be honest, only a few of them do that. The place where you should look are the Windows Registry. Most of installed applications put their installation data into the following place:

    HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall
    

    However, it’s not that easy – on 64bit Windows, the 32bit (x86) applications save their installation data into another key, which is:

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

    In these keys there are many keys, some of them have got “easy-readable” name, such as Google Chrome, some of them got names such as {63E5CDBF-8214-4F03-84F8-CD3CE48639AD}. You must parse all these keys into your application and start looking for the application names. There are usually in DisplayName value, but it’s not always true. The version of the application is usually in DisplayVersion value, but some installers do use another values, such as Inno Setup: Setup Version, … Some application do have their version written in their name, so it’s possible that the application version is already in the DisplayName value.

    Note: It’s not easy to parse all these registry keys and values and to “pick” the correct values. Not all installers save the application data into these keys, some of them do not save the application version there, etcetera. However, it’s usual that the application use these registry keys. [Source: StackOverflow: Detecting installed programs via registry, browsing my own registry]

    Alright, so now when you know where you should look, you have to program it all in C#. I won’t write the application for you, but I’ll tell you what classes you should use and how to. First, you need these:

    using System;
    using Microsoft.Win32;      
    

    To get to your HKEY_LOCAL_MACHINE, create a RegistryKey like this:

    RegistryKey baseRegistryKey = Registry.LocalMachine;
    

    Now you need to define subkeys:

    string subKey = "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall";
    // or "SOFTWARE\\Wow6432Node\\Microsoft\\Windows\\CurrentVersion\\Uninstall"
    

    Now you need to go to the subkey, so create a new RegistryKey:

    RegistryKey uninstallKey = baseRegistryKey.OpenSubKey(subKey);
    

    Now you need to go thru all the subkeys that are there, so first we get the names of all the subkeys:

    string[] allApplications = uninstallKey.GetSubKeyNames();
    

    Now you must go thru all the subkeys yourself, one by one, by creating a new registry key (you don’t have to, but I’ll do it):

    RegistryKey appKey = baseRegistryKey.OpenSubKey(subKey + "\\" + applicationSubKeyName);
    

    where applicationSubKeyName is the name of the subkey you’re currently checking. I recommend foreach statement, which helps you (you must however have some experience with C# already, I’m not going to tell you how to use foreach here).

    Now check the application’s name and compare it with name of your desired application (you cannot rely on the subkey name, because, as I already said, they can be called for example {63E5CDBF-8214-4F03-84F8-CD3CE48639AD}, so you must check the name here):

    string appName = (string)appKey.GetValue("DisplayName");
    

    If it’s the correct application (you must check it yourself), find the version:

    string appVersion = (string)appKey.GetValue("DisplayVersion");
    

    Et voilà, you have the version. At least there’s like a 60 – 80% chance you have…

    Remember! If some key or value doesn’t exist, the method returns null. Remember to check if the returned value is null everytime, otherwise your application will crash.

    Where to find more? The Code Project: Read, write and delete from registry with C#

    I really hope I helped you. And if you wanted to know something else and I didn’t understand your question, then, please, ask better next time. 🙂

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

Sidebar

Related Questions

while developing an application how to get current operating system version installed in mobile
Can someone please shed some light on how I would get this to work:
I would like my application to download and install Silverlight 4, NOT Silverlight 5.
I'm trying to get a PHP 5 application working on IIS7. This application appears
How would get find an average from an array? If I have the array:
Following is how you would get the current solution directory from an add-in: _applicationObject
Could someone supply some code that would get the xpath of a System.Xml.XmlNode instance?
I was wondering if in Java I would get any odd behaviour if I
Just wanted to know if overriding UITabBarController would get my app rejected? Is it
I'm looking for a method or an event that would get fired when a

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.