List of installed programs

T

Tom Rahav

Dear All,
I'm looking for an efficient way to get a list of all the installed
application on a computer and the path to their executable files. I develop
using .NET 2005 (VB and C#) and my idea is to develop a tool that will
automatically find and display all the installed application, and when I
click on an application's name it will run it.
In order to get the list of installed applications I tried to use the
Uninstall list of the registry. What I did is I read all the sub-keys of
this registy key
("HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Uninstall")
as displayed the value of their "DisplayName" property.
I had two problems with this method:
1. The list contains alot (!) of applications, because it includes all the
security fixes of windows, etc... and I don't need it all; I'm looking only
for the list which appears in the "Add/Remove Program" menu of the control
panel.
2. The second problem wass that this registy list does not contain
information about the path of the executable file...

Does anyone have an idea how can I do it better?
Thanks in advanced,
Tom.
 
R

Rad [Visual C# MVP]

Dear All,
I'm looking for an efficient way to get a list of all the installed
application on a computer and the path to their executable files. I develop
using .NET 2005 (VB and C#) and my idea is to develop a tool that will
automatically find and display all the installed application, and when I
click on an application's name it will run it.
In order to get the list of installed applications I tried to use the
Uninstall list of the registry. What I did is I read all the sub-keys of
this registy key
("HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Uninstall")
as displayed the value of their "DisplayName" property.
I had two problems with this method:
1. The list contains alot (!) of applications, because it includes all the
security fixes of windows, etc... and I don't need it all; I'm looking only
for the list which appears in the "Add/Remove Program" menu of the control
panel.
2. The second problem wass that this registy list does not contain
information about the path of the executable file...

Does anyone have an idea how can I do it better?
Thanks in advanced,
Tom.

Hey Tom,

Rather than using the registry directly I think a better way would be
to query the WMI Win32_Product class. Not only is it easier than
mucking about the registry, one of the properties of the returned
objects is the InstallLocation that will give you the location of the
installed product
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top