Google Answers Logo
View Question
 
Q: programmatically the installed programs ( No Answer,   2 Comments )
Question  
Subject: programmatically the installed programs
Category: Computers > Programming
Asked by: freund-ga
List Price: $23.00
Posted: 14 Apr 2003 09:09 PDT
Expires: 14 Apr 2003 22:02 PDT
Question ID: 190304
How can I find programmatically the installed programs (windos XP)and
their location (folders) Prefereed language "C"
Answer  
There is no answer at this time.

Comments  
Subject: Re: programmatically the installed programs
From: eadfrith-ga on 14 Apr 2003 10:51 PDT
 
Hi freund,

You can access the list of installed application on Windows XP by
examining
the windows registry at the following location:

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

Each entry under this location has many keys, but the two you're
probably
interested in are "DisplayName" and "InstallLocation". (I include a
link
to a programmatic approach below, but if you wish to examine your
machine
to see get an idea of the structure you can do so by running the
windows
registry editor - type 'regedit' into the Start->Run dialog).

Of course, this will only give you applications that have registered
themselves
upon installation. Some simple applications are installed by simply
unpacking
themselves to your hard drive; these will not show up in the list.

Here's a link to simple batch script that will output the list of
intsalled
applications, useful for testing purposes:

http://www.fpschultze.de/bsh.htm#a18

And here's a tutorial with VB code that show's you how to read list of
installed programs from the registry:

http://www.mvps.org/vbnet/index.html?code/reg/reguninstall.htm

I wasn't able to find any C code for your specific requirements, but
here are some links on how to access the registry using C/C++:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnppc2k/html/ppc_stry.asp

http://www4.ncsu.edu:8030/~jgbishop/codetips/general/registry_access_advanced.html

Also, here's a discussion as to why you can't always trust the 
list found in the registry:

http://www.karenware.com/newsletters/2000/2000-05-29.asp

Basically, some programs don't get removed when they're uninstalled.
This
link includes VB code to prune the registry of dead entries - you
could incorporate some of this code to prune the list you get from
above?

Cheers,

Eadfrith
Subject: Re: programmatically the installed programs
From: eadfrith-ga on 14 Apr 2003 10:55 PDT
 
Apologies for the messed up formatting - I need to stop hitting the
return key at the end of a line! Also, a preview feature would be nice
(hint hint).

Cheers,

Eadrith

Important Disclaimer: Answers and comments provided on Google Answers are general information, and are not intended to substitute for informed professional medical, psychiatric, psychological, tax, legal, investment, accounting, or other professional advice. Google does not endorse, and expressly disclaims liability for any product, manufacturer, distributor, service or service provider mentioned or any opinion expressed in answers or comments. Please read carefully the Google Answers Terms of Service.

If you feel that you have found inappropriate content, please let us know by emailing us at answers-support@google.com with the question ID listed above. Thank you.
Search Google Answers for
Google Answers  


Google Home - Answers FAQ - Terms of Service - Privacy Policy