views:

82

answers:

3

Hi,

The same compiled .Net / C++ / Com program does different things on two seemingly same computers. Both have DOZENS of things installed on them. I would like to figure out what the difference between the two is by looking at an ASCII diff. Before that I need to "serialize" the list of installed things in a plain readable format - sorted alphabetically + one item per line.

A Python script would be ideal, but I also have Perl, PowerShell installed.

Thank you.

+1  A: 

You can get the list of installed programs from the registry. It's under HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall

If this is a once-off exercise you may not even need to write any code - just use Regedit to export the key to a .REG file. If you do want to automate it Python provides the _winreg module for registry access.

Evgeny
You can also use a simple powershell script to do this, Something like (Get-Item $RegPath).Property might be useful here.
Amit Wadhwa
+1  A: 

There are two tools from Microsoft that may be what you need: RegDump and RegDiff. You can download them from various places, including as part of the Microsoft Vista Logo Testing Toolkit.

Also, there is Microsoft Support article How to Use WinDiff to Compare Registry Files.

For a Pythonic way, here is an ActiveState recipe for getting formatted output of all the subkeys for a particular key (HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall for example).

Tim
+1  A: 

Personally I always liked sysinternals' stuff (powerfull, light, actual tools - no need to install)

There is command line tool psinfo that can get you what you want (and then some) in various formats, distinguishing hotfixes and installed software, on local or remote computer (providing system policies allow it on remote).

You can also run it live from here, so though not strictly pythonic you could plug it in quite nicely.

Unreason

related questions