473,624 Members | 2,248 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Getting a list of installed programs on windows using C#

Hi

I need some help here. I would appreciate it if any one can help me. My
2 questions is this:

1. How do you get a list of installed applications on Windows?
2. How do I get a program's description from a exe?
(Example - sqlservr.exe = Microsoft SQL Server 2000)

I am using C# with Visual Studio .net 2003. Thanks in advance...
Paul Horn
Pretoria
South Africa

Nov 17 '05 #1
5 43255
While not exactly programmatic, I’d suggest looking into Belarc Advisor
(http://www.belarc.com/free_download.html).

Brendan
"Paul Horn" wrote:
Hi

I need some help here. I would appreciate it if any one can help me. My
2 questions is this:

1. How do you get a list of installed applications on Windows?
2. How do I get a program's description from a exe?
(Example - sqlservr.exe = Microsoft SQL Server 2000)

I am using C# with Visual Studio .net 2003. Thanks in advance...
Paul Horn
Pretoria
South Africa

Nov 17 '05 #2
Try,
Microsoft.Win32 .RegistryKey subKey1 =
regKey.OpenSubK ey("SOFTWARE\\M icrosoft\\Windo ws\\CurrentVers ion\\Uninstall" );
string[] subKeyNames = subKey1.GetSubK eyNames();

foreach (string subKeyName in subKeyNames)
{
Microsoft.Win32 .RegistryKey subKey2 = subKey1.OpenSub Key(subKeyName) ;

if (ValueNameExist s(subKey2.GetVa lueNames(), "DisplayNam e") &&
ValueNameExists (subKey2.GetVal ueNames(), "DisplayVersion "))
{
listViewApps.It ems.Add(new ListViewItem(ne w string[]{
subKey2.GetValu e("DisplayName" ).ToString(),
subKey2.GetValu e("DisplayVersi on").ToString () }));
}

subKey2.Close() ;
}

subKey1.Close() ;

and...

private bool ValueNameExists (string[] valueNames, string valueName)
{
foreach (string s in valueNames)
{
if (s.ToLower() == valueName.ToLow er()) return true;
}

return false;
}

Regards,
Phil.

"Paul Horn" wrote:
Hi

I need some help here. I would appreciate it if any one can help me. My
2 questions is this:

1. How do you get a list of installed applications on Windows?
2. How do I get a program's description from a exe?
(Example - sqlservr.exe = Microsoft SQL Server 2000)

I am using C# with Visual Studio .net 2003. Thanks in advance...
Paul Horn
Pretoria
South Africa

Nov 17 '05 #3
Forgot about the file description.

Try,

System.Diagnost ics.FileVersion Info fileVersionInfo =
System.Diagnost ics.FileVersion Info.GetVersion Info(fileName);
string fileDescription = fileVersionInfo .FileDescriptio n;

Regards,
Phil.

"Paul Horn" wrote:
Hi

I need some help here. I would appreciate it if any one can help me. My
2 questions is this:

1. How do you get a list of installed applications on Windows?
2. How do I get a program's description from a exe?
(Example - sqlservr.exe = Microsoft SQL Server 2000)

I am using C# with Visual Studio .net 2003. Thanks in advance...
Paul Horn
Pretoria
South Africa

Nov 17 '05 #4
Forgot to add this line at the beginning

Microsoft.Win32 .RegistryKey regKey = Microsoft.Win32 .Registry.Local Machine;

Regards,
Phil.

"Phil Williams" wrote:
Try,
Microsoft.Win32 .RegistryKey subKey1 =
regKey.OpenSubK ey("SOFTWARE\\M icrosoft\\Windo ws\\CurrentVers ion\\Uninstall" );
string[] subKeyNames = subKey1.GetSubK eyNames();

foreach (string subKeyName in subKeyNames)
{
Microsoft.Win32 .RegistryKey subKey2 = subKey1.OpenSub Key(subKeyName) ;

if (ValueNameExist s(subKey2.GetVa lueNames(), "DisplayNam e") &&
ValueNameExists (subKey2.GetVal ueNames(), "DisplayVersion "))
{
listViewApps.It ems.Add(new ListViewItem(ne w string[]{
subKey2.GetValu e("DisplayName" ).ToString(),
subKey2.GetValu e("DisplayVersi on").ToString () }));
}

subKey2.Close() ;
}

subKey1.Close() ;

and...

private bool ValueNameExists (string[] valueNames, string valueName)
{
foreach (string s in valueNames)
{
if (s.ToLower() == valueName.ToLow er()) return true;
}

return false;
}

Regards,
Phil.

"Paul Horn" wrote:
Hi

I need some help here. I would appreciate it if any one can help me. My
2 questions is this:

1. How do you get a list of installed applications on Windows?
2. How do I get a program's description from a exe?
(Example - sqlservr.exe = Microsoft SQL Server 2000)

I am using C# with Visual Studio .net 2003. Thanks in advance...
Paul Horn
Pretoria
South Africa

Nov 17 '05 #5
Thanx Phil, I will have a look.

Nov 17 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
1762
by: Pavel Koryakin | last post by:
Guys, does anybody knows how can I get a list of all windows which I see on my taskbar? Thank you. Pavel.
3
2250
by: BobTheDatabaseBoy | last post by:
.... got: win2K, v8.1.6 login to win2K is to the network: user; bob13, domain; foo it's a win2K domain. i then login to my local db as db2admin. LIST APPLICATIONS fails with security error. tells me bob13 doesn't have the rights. bob13 has all rights in CC user maintenance. bob13 is member of Administrators in win2K on the box. i'm not logged in to DB2 as bob13, just the box(? domain).
1
3392
by: Paige W. | last post by:
I have added a mainmenu object to my windows form and would like to display an MRU list on it. Is there an easy way? or do I have to do it programatically? Can anyone point me to a good tutorial. Thanks for the help. Paige W.
1
1330
by: Ansari | last post by:
hi gurus; I m building an asp.net 1.1 application on Windows XP Machine. I m getting error message "SQL Server does not exists or Access Deined" when I want to establish connection to a sql server 2000 installed on windows 2003 server. Note that there is no domain controller on the network. But strange thing is that when i try to connect with a windows application
1
2641
by: Lars Netzel | last post by:
Hi How can I get list of the installed Programs on a computer in VB.NET code, I need to list them in an application I'm creating? best regards/ Lars Netzel
3
2063
by: Klint Gore | last post by:
Does anyone know of a mailing list for application developers using postgres? It'd probably be more relevant than pgsql-general for my question. Failing that, what do people use to generate reports with a postgres back end? I have a requirement to produce a reporting daemon on linux that doesn't require X windows (has to render the report and write it back to a blob). I've been down a couple of paths that ended with...
0
1572
by: sandeepk84 | last post by:
Hi all... I am facing a problem in getting attachments from Yahoo Classic using JavaMail. My program reads the attachments from gmail and Yahoo Beta. But attachments of type pdf or txt from classic Yahoo are having the problem. I use isMymeType function to check the type, can anyone say how the type should be checked for files from classic yahoo? ie. for gmail part.isMimeType("text/plain") or part.isMimeType("multipart/*") will work....
12
7187
by: mdfidahussain | last post by:
hi, Can anyone help me out "how to get Version of Installed software product using VB Script" Thnx FH
2
2238
by: yaddesh | last post by:
how can i detect installed sqlserver(s) using VB6
1
2084
by: tarunsingh19 | last post by:
pls anybody tell me wether oracle 8i can be installed in windows xp sevice pack 2?or will it work in XP2, if yes then where we get this software free download file?
0
8233
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
1
8334
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8474
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7158
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6108
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4078
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4173
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1784
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1482
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.