Click here to Skip to main content
6,305,776 members and growing! (16,792 online)
Email Password   helpLost your password?
Desktop Development » Files and Folders » Utilities     Beginner License: The Code Project Open License (CPOL)

Software's List Installed on Windows Machine

By surendrakishor

This program gets the list of softwares installed on windows running machine
C# (C# 2.0, C# 3.0), VB (VB 8.0), Windows (Win2K, WinXP, Win2003, Vista), .NET (.NET 2.0, .NET 3.0, .NET 3.5), Visual Studio (VS2005, VS2008), Architect, Dev
Posted:30 Sep 2008
Views:8,594
Bookmarked:21 times
Unedited contribution
Announcements
Loading...
 
Search    
Advanced Search
printPrint   Broken Article?Report       add Share
  Discuss Discuss   Recommend Article Email
12 votes for this article.
Popularity: 2.72 Rating: 2.52 out of 5
2 votes, 16.7%
1
5 votes, 41.7%
2
1 vote, 8.3%
3
2 votes, 16.7%
4
2 votes, 16.7%
5

Introduction

Many of us dont know what softwares are installed and strive to check them programatically. here's a simple way to get that list. this is als very much useful when to create an installer for your projects, which helps you in checking the right version of minimal software requirements for your projects on clients machine. 

Background

There's nothing complicated code in this, if you have basic knowledge of Windows Registry thats enough. but be sure you make a backup of your registry before doing anything with that as that a good n safe way of programming. 

Using the code 

I have took a simple Console Application in C#, created an object for registry accesed the right path i.e SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall.

This registry path has all the list of softwares installed on your machine. following is the code to achieve it in C# 

In C#:  

class Program
    {
        static void Main(string[] args)
        {
          // Do back up of ur registry before running it.
          //Registry path which has information of all the softwares installed on machine
            string uninstallKey = @"SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall";
            using (RegistryKey rk = Registry.LocalMachine.OpenSubKey(uninstallKey))
            {
                foreach (string skName in rk.GetSubKeyNames())
                {
                    using (RegistryKey sk = rk.OpenSubKey(skName))
                    {
                        // we have many attributes other than these which are useful.
                        Console.WriteLine(sk.GetValue("DisplayName") + "  " + sk.GetValue("DisplayVersion"));
                    }
                    
                }
            }
            Console.ReadLine(); // To make the o/p readable.
        }        
    }
	

In VB.NET: 

Imports System 
Imports System.Collections.Generic 
Imports System.Text 
Imports Microsoft.Win32 

Namespace SEList 
    Class Program 
        Private Shared Sub Main(args As String()) 
           ' Do back up of ur registry before running it. 
           'Registry path which has information of all the softwares installed on machine 
       Dim uninstallKey As String = "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall" 
            Using rk As RegistryKey = Registry.LocalMachine.OpenSubKey(uninstallKey) 
                For Each skName As String In rk.GetSubKeyNames() 
                    Using sk As RegistryKey = rk.OpenSubKey(skName) 
                        ' we have many attributes other than these which are useful. 
     Console.WriteLine(sk.GetValue("DisplayName") + " " + sk.GetValue("DisplayVersion")) 
                   
        End Using 
         Next 
        End Using 
        Console.ReadLine() ' To make the o/p readable. 
        End Sub 
    End Class 
End Namespace	 

output.jpg

Points of Interest 

This code snippet is handy for developers working on creating installer for project, which gives them flexibility to check the correct version of softwares installed on client machine to avoid confusion later. its a good way of creating the installers. this is useful for all kinds applications developed in Microsoft.NET environment. 

History

This is my First article in this site, hope to post more useful code snippets in future. leave me aith your suggestion and comments as these are the things which boosts us and helps us in giving more relevant and error free code snippets.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

About the Author

surendrakishor


Member

Occupation: Web Developer
Location: India India

Other popular Files and Folders articles:

Article Top
You must Sign In to use this message board.
FAQ FAQ 
 
Noise Tolerance  Layout  Per page   
 Msgs 1 to 6 of 6 (Total in Forum: 6) (Refresh)FirstPrevNext
GeneralThanks PinmemberRavinderSingroha3:02 15 May '09  
GeneralIs using the uninstall registry the perfect solution? Pinmemberlwiji-tn3:08 4 Mar '09  
GeneralGet more information from the registry... PinmemberPaw Jershauge11:28 30 Sep '08  
QuestionRe: Get more information from the registry... Pinmembermasterkid9:26 4 Oct '08  
AnswerRe: Get more information from the registry... PinmemberPaw Jershauge22:12 5 Oct '08  
General[Message Removed] Pinmemberped2ped4:31 30 Sep '08  

General General    News News    Question Question    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

PermaLink | Privacy | Terms of Use
Last Updated: 30 Sep 2008
Editor: Chris Maunder
Copyright 2008 by surendrakishor
Everything else Copyright © CodeProject, 1999-2009
Web16 | Advertise on the Code Project