473,397 Members | 2,068 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,397 software developers and data experts.

List of all installed applications (XP)?

Hi all,

I'm trying to generate a (exhaustive) list of all the applications that are
installed on a user's machine. I've written some code that reads the
registry ('App Paths'):

<code>
appKey = win32api.RegOpenKeyEx(win32con.HKEY_LOCAL_MACHINE,
'SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths', 0, win32con.KEY_READ)
sklist = win32api.RegEnumKeyEx(appKey)

for skey in sklist:
print skey[0]

try:
wPath = win32api.RegQueryValue(appKey, skey[0])
print ' ' + wPath
except pywintypes.error,details:
print '### Error [pywintypes.error]: ' + details[2]

win32api.RegCloseKey(appKey)
</code>

This works, but I was wondering wether that is the best way to go about
this? Can I be sure it lists *all* the applications? What does it mean when
a pywintypes.error is thrown (code 13, 'Invalid data')?

Thanks,
g

Jul 19 '05 #1
4 7199
Get Tim Golden's wmi module
(http://tgolden.sc.sabren.com/python/wmi.html). I recently had to help
my brother remove some spyware, and so I used some of the example that
came with WMI to read through the registry to extract startup keys,
services, etc.

Even if your users aren't sophisticated enough to mess with the
registry, rest assured that the software installation programs are.
You should be able to find traces of any installed commercial program
that was released in the past 5 years - I suspect they *all* leave
traces in the registry at this point. Go to
HKEY_LOCAL_MACHINE\SOFTWARE and you will get a list of software
vendors, and you can enumerate keys from there.

Good luck!
-- Paul

Jul 19 '05 #2
On Thu, 23 Jun 2005 10:11:36 GMT, "Guy Lateur" <gu********@b-b.be>
declaimed the following in comp.lang.python:

This works, but I was wondering wether that is the best way to go about
this? Can I be sure it lists *all* the applications? What does it mean when
a pywintypes.error is thrown (code 13, 'Invalid data')?
"All" applications? No... Only those that create registry
entries...

I installed the Eclipse Java IDE, and I'm pretty sure it didn't
do anything with the registry (no "start menu" entry, etc. -- one just
has to know where to find the startup program by hand).

-- ================================================== ============ <
wl*****@ix.netcom.com | Wulfraed Dennis Lee Bieber KD6MOG <
wu******@dm.net | Bestiaria Support Staff <
================================================== ============ <
Home Page: <http://www.dm.net/~wulfraed/> <
Overflow Page: <http://wlfraed.home.netcom.com/> <

Jul 19 '05 #3
| [TJG]
| Hmmm. While I understand your requirement, it's not as
| thought there's some easily-discernible charactersistics
| of "commercial software packages which should have licenses
| but which don't"

No? Really? How disappointing.. ;)
| [TJG]
| By the sound of it, you're almost better off compiling
| a list of .exe from machines and building up a blacklist
| from those.

That was kind of the idea at first. However, we have a file server (H:), and
I've seen apps installed on it. So it's pretty hard to know who actually
uses that app just by the .exe - could be several people, too, I guess.
That's why I thought of the registry - which, as you rightfully pointed out,
isn't a perfect strategy, either.

I do understand that I can remove those apps by removing the .exe (+
containing folder, probably), but I'd also like to get an idea of who is
using what right now (and why). That might come in handy at some point later
on. Btw, is there a module called pyWhy or something? :)

Maybe I should also follow Paul's advice and go through the registry on a
vendor/app basis. I mean, ATM, I'm not really concerned about a user having,
say, Cubase installed without a license. My priority right now is to make
sure we have licenses for certain apps we use professionally/commercially
(ACad, Office, ..).
Thanks for the input, people, much appreciated,
g
Jul 19 '05 #4
Not only is it difficult to tell which applications are installed,
it is difficult to tell if an application is still installed as all too
many applications do not remove all their registry keys upon uninstall.

I was going to suggest using a commercial application due to the
messiness of this problem but the one I tried "Tally Systems WebCensus"
(now owned by Novell) failed to find NuMega BoundsChecker and it also
believes Yahoo Messenger is still installed even though it was uninstalled.

Neil
Jul 19 '05 #5

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

Similar topics

1
by: Pieter Linden | last post by:
Is it possible/does anyone know where there's a code snippet that will allow me to read the contents of HKEY_LOCAL_MACHINE\SOFTWARE or something like that so I can get a complete list of installed...
6
by: IC | last post by:
Hi, I'm building a website and I want to include a mailing list. I just want a form where a user could enter their email address, so I could send them more information. I assume that the best...
11
by: Raquel | last post by:
UDB PE V8.0 on Win XP. I issue the following commands: 1. CONNECT TO SAMPLE USER db2adming USING xxxxx The output is: Database Connection Information Database server = DB2/NT 8.1.3...
1
by: Norman Fritag | last post by:
Hi there I have avoided to use active x controls because I thought they are causing more problems then they are doing any good. I a new application I would want to use the tree and list view...
8
by: vpettes | last post by:
I am new to Access having used Filemaker for many years. My question has to do with displaying and creating a line item database. What I have is a two tables. One has Name, Location, time,...
2
by: 1idMonk | last post by:
Just installed Windows XP Professional Upgrade on my Inspiron 9300 notebook. I had Windows XP Home Edition prior to the upgrade. Visual Basic .NET 2003 is installed and many projects are...
1
by: Will Arrowsmith | last post by:
Hi all, I am trying to create a small form much like the Windows Explorer 'open with...' dialog box, which will contain a list of all applications installed on the local machine and their...
5
by: Velvet | last post by:
Can someone tell me to what process I need to attach to be able to step through my classic ASP code in VS.net 2003. I'm working on an XP box with IIS installed. I also have VS.net 2005 (The...
0
AmberJain
by: AmberJain | last post by:
Windows Autorun FAQs: List of autostart locations Linked from the Original article- "Windows Autorun FAQs: Description". Que: Can you list all the autostart locations for windows? Ans: Here is...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
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...
0
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...
0
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,...
0
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...

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.