List of installed programs

List of installed programs

am 21.10.2007 07:14:03 von 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\CurrentVersi on\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.

Re: List of installed programs

am 22.10.2007 10:58:32 von RAD

On Sun, 21 Oct 2007 07:14:03 +0200, "Tom Rahav"
wrote:

>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\CurrentVers ion\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

--
http://bytes.thinkersroom.com

Re: List of installed programs

am 22.10.2007 15:08:57 von Tom Rahav

I wasn't aware of that class, but I will check right now.... thanks!

"Rad [Visual C# MVP]" wrote in message
news:qkmoh35ugvo51casbv974pbk9rm40dejn8@4ax.com...
> On Sun, 21 Oct 2007 07:14:03 +0200, "Tom Rahav"
> wrote:
>
>>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\CurrentVer sion\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
>
> --
> http://bytes.thinkersroom.com