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 |