Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #19758

Re: Registry entries set up by the Windows installer

Date 2012-02-02 11:28 +1100
From Mark Hammond <skippy.hammond@gmail.com>
Subject Re: Registry entries set up by the Windows installer
References <85db953e-15fe-43ad-b128-7437dde7e7b3@m2g2000vbc.googlegroups.com>
Newsgroups comp.lang.python
Message-ID <mailman.5338.1328142537.27778.python-list@python.org> (permalink)

Show all headers | View raw


On 2/02/2012 2:09 AM, Paul Moore wrote:
> I'm trying to get information on what registry entries are set up by
> the Python Windows installer, and what variations exist. I don't know
> enough about MSI to easily read the source, so I'm hoping someone who
> knows can help :-)
>
> As far as I can see on my PC, the installer puts entries
>
> HKLM\Software\Python\PythonCore\x.y
>
> with various bits underneath. I think I've seen indications that
> sometimes these are in HKCU, presumably for a "per user" install? If I
> manually hack around in the registry, and have both HKLM and HKCU,
> which one will Python use?

For setting PYTHONPATH it uses both - HKEY_CURRENT_USER is added before 
HKEY_LOCAL_MACHINE.  I can't recall which one distutils generated 
(bdist_wininst) installers will use - it may even offer the choice.

> Furthermore, more of a Windows question than Python, but there's a
> similar question with regard to the .py and .pyw file associations -
> they can be in HKLM\Software\Classes or HKCU\Software\Classes. Which
> takes precedence?

No idea I'm afraid, but I'd expect it to use HKCU

> I assume that the installer writes to HKLM for all
> users and HKCU for per-user installs.

Yep, I think that is correct.

> Is there anything else I've missed?

I'm also not sure which one the pylauncher project will prefer, which 
may become relevant should that get rolled into Python itself.

> The reason I ask, is that I'm starting to work with virtualenv, and I
> want to see what would be involved in (re-)setting the registry
> entries to match the currently active virtualenv. virtualenvwrapper-
> powershell seems to only deal with HKCU (which is a big plus on
> Windows 7, as it avoids endless elevation requests :-)) but that
> doesn't work completely cleanly with my all-users install. (Note: I'm
> not entirely sure that changing global settings like this to patch a
> per-console virtualenv is a good idea, but I'd like to know how hard
> it is before dismissing it...)

Out of interest, what is the reason forcing you to look at that - 
bdist_wininst installers?  FWIW, my encounters with virtualenv haven't 
forced me to hack the registry - I just install bdist_wininst packages 
into the "parent" Python which isn't ideal but works fine for me.  This 
was a year or so ago, so the world might have changed since then.

Mark

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Registry entries set up by the Windows installer Paul  Moore <p.f.moore@gmail.com> - 2012-02-01 07:09 -0800
  Re: Registry entries set up by the Windows installer Mark Hammond <skippy.hammond@gmail.com> - 2012-02-02 11:28 +1100
  Re: Registry entries set up by the Windows installer Paul Moore <p.f.moore@gmail.com> - 2012-02-02 08:09 +0000

csiph-web