Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > python script to find Installed programs in Uninstall folder in registry

Reply
Thread Tools

python script to find Installed programs in Uninstall folder in registry

 
 
KishoreRP
Guest
Posts: n/a
 
      03-15-2011
I am working on creating a python script to find Installed programs in
Uninstall folder in registry, the script works perfectly fine on 32
bit machines but errors out with a wmi error on 64 bit machines. Am
not able to get hold of a wmi module for python on 64 bit machines.Is
there one at all? Please ignore indentation errors. I found this
script in some forum, apologies for not giving due credit to the
corresponding author
r = wmi.Registry()
result, names = r.EnumKey (hDefKey=HKEY_LOCAL_MACHINE,
sSubKeyName=r"Software\Microsoft\Windows\CurrentVe rsion\Uninstall")

separator = "*" * 80
keyPath = r"Software\Microsoft\Windows\CurrentVersion\Uninst all"
for subkey in names:
try:

path = keyPath + "\\" + subkey
key = OpenKey(HKEY_LOCAL_MACHINE, path, 0, KEY_ALL_ACCESS)

try:
temp = QueryValueEx(key, 'DisplayName')
temp1 = QueryValueEx(key, 'DisplayVersion')
temp2 = QueryValueEx(key, 'Publisher')
display = str(temp[0])
display_ver=str(temp1[0])
display_p=str(temp2[0])

print ('Display Name: ' + display + '\nDisplay
version: ' + display_ver + '\nVendor/Publisher: ' + display_p
+'\nRegkey: ' + subkey + '\n')

except:
print ('Regkey: ' + subkey + '\n')


except:
fp = StringIO.StringIO()
traceback.print_exc(file=fp)
errorMessage = fp.getvalue()
#error = 'Error for ' + key + '. Message follows:\n' +
errorMessage
#HelperFuncs.LogError(error)
 
Reply With Quote
 
 
 
 
Tim Golden
Guest
Posts: n/a
 
      03-15-2011
On 15/03/2011 03:42, KishoreRP wrote:
> I am working on creating a python script to find Installed programs in
> Uninstall folder in registry, the script works perfectly fine on 32
> bit machines but errors out with a wmi error on 64 bit machines.


You don't say what the error is (and your snippet doesn't run without
some alterations) so would you mind showing just enough code for
the error to occur plus a cut-and-paste of the traceback?

> Am not able to get hold of a wmi module for python on 64 bit machines.
> Is there one at all?


The wmi module is pure Python, relying only on Python & the pywin32
extensions. If you have both of those installed as 64-bit you can
just drop the wmi.py module into the right place and go from there.


TJG
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
'make uninstall' - manual uninstall DBD::Oracle; fix perllocal.pod Am Nym Perl Misc 4 05-21-2012 01:58 PM
32bit Program installed to the Program Files folder and not the PFx86 folder murdock69u@gmail.com Windows 64bit 1 04-30-2009 01:30 PM
Smart Client Install/Uninstall broken - Not able to Uninstall Rahul ASP .Net Web Services 0 04-24-2008 10:59 AM
Python 2.4 Uninstall Entry in WinXP Registry Brad Tilley Python 5 12-01-2004 09:37 PM
How to Verify Programs Running with Installed Programs? Edge Computer Information 9 01-19-2004 11:35 PM



Advertisments