extract python install info from registry

  • Thread starter Laszlo Zsolt Nagy
  • Start date
L

Laszlo Zsolt Nagy

rbt said:
On windows xp, is there an easy way to extract the information that
Python added to the registry as it was installed?
Using regedit.exe, look at the registry keys and values under

HKEY_LOCAL_MACHINE\Software\Python

If you need to know how to read the registry from Python: please install
the python win32 extensions (or use ActivePython).

Les
 
L

Laszlo Zsolt Nagy

There's more to it than that... isn't there? I've used _winreg and the
win32 extensions in the past when working with the registry. I thought
perhaps someone had already scripted something to extract this info.
Ok, if you need to get all changes in the registry, you can use regdiff.

http://p-nand-q.com/download/regdiff.html

Take a snapshot before and after installing Python. However, this is not
a wise approach.
For example:

1. One can have a system drive 'C:\' others 'G:\'
2. One can have Windows installed in \Windows others in \WinNT and
others in \MyWinNT
3. For many registry values, you cannot really tell if you need to
correct a value or not.

As a result, I believe you will only be able to use the 'regdiff' only
on the same type of computer, with the same system drive, same system
directory, same windows version etc. For other computers, there is no
guarantee for that it will work.

Les
 
R

rbt

On windows xp, is there an easy way to extract the information that
Python added to the registry as it was installed?
 
R

rbt

Laszlo said:
Using regedit.exe, look at the registry keys and values under

HKEY_LOCAL_MACHINE\Software\Python

If you need to know how to read the registry from Python: please install
the python win32 extensions (or use ActivePython).

Les

There's more to it than that... isn't there? I've used _winreg and the
win32 extensions in the past when working with the registry. I thought
perhaps someone had already scripted something to extract this info.

I'm creating a Python plugin for Bartpe (Windows Pre-Install
Environment) and it works OK, but to make it work _exactly_ like it does
on XP (.py and .pyw associate with python and pythonw), I need to
extract the reg entries so I can recreate them in the WinPE environment.

Thanks!
 
R

Roger Upole

rbt said:
On windows xp, is there an easy way to extract the information that Python added to the registry as it was installed?

You should be able to find all the entries in msi.py that's used to build the
installer.

Roger
 
T

Trent Mick

[Laszlo Zsolt Nagy wrote]
Using regedit.exe, look at the registry keys and values under

HKEY_LOCAL_MACHINE\Software\Python

If you need to know how to read the registry from Python: please install
the python win32 extensions (or use ActivePython).

Actually you don't need the PyWin32 extensions to read the Windows
registry since the _winreg module was added to the Python core.

Trent
 
P

Peter Hansen

rbt said:
I'm creating a Python plugin for Bartpe (Windows Pre-Install
Environment) and it works OK, but to make it work _exactly_ like it does
on XP (.py and .pyw associate with python and pythonw), I need to
extract the reg entries so I can recreate them in the WinPE environment.

If it's just a matter of creating those associations, I believe you can
do that equally well using the "ftype" and "assoc" console commands, via
os.system() or something similar.

-Peter
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,969
Messages
2,570,161
Members
46,705
Latest member
Stefkari24

Latest Threads

Top