[issue20883] Windows 'for current user' installation - 32/64-bit registrations overwrite each other

2014-03-11 Thread Martin v . Löwis

Martin v. Löwis added the comment:

I haven't tested the per-user installations in the last five years, so I don't 
actually know what the problems are these days. One key issue is the elevated 
privileges topic (UAC). Correct me if I'm wrong: installing per-user still 
requires to run the installer with administrator privileges (i.e. you get the 
UAC prompt), right?

The other (solved) oddity is that the installer needs to include two copies of 
msvcrt, as the merge module only supports installation into the SxS folder.

As for this issue: if somebody provides a complete patch, I'm willing to 
consider it. Make sure to discuss backwards compatibility.

Simultaneous installation of multiple patch levels is out of scope of this 
issue. Note that you can get the installer to support it by editing the 
UpgradeCode in the MSI file with orca.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20883
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue20883] Windows 'for current user' installation - 32/64-bit registrations overwrite each other

2014-03-11 Thread Steve Dower

Steve Dower added the comment:

UAC is still required for the installer - unfortunately MSI just doesn't 
support having a single package that can do both elevated and unelevated 
installs. Still, you can install once per-user and then copy the PythonXY 
folder onto another machine, which does not work as easily with the all-users 
install. I actually have a collection of zipped Python installs and an 
automated test that extracts each one in turn.

I'm not sure what constitutes a complete patch, but I've attached a patch for 
msi.py (though I have no idea how it works and can't test it locally) and 
launcher.c to look at the new keys. If there are tests for these I don't see 
where they are, but I'm happy to extend them.

I don't think backwards compatibility is a concern here. Older versions of 
Python will continue to incorrectly handle side-by-side per-user installations 
with the py.exe launcher and any other tools that use the registry to find 
installations. Existing tools that are not modified will find Python 3.5 
installations with identical mechanics to previously, while those that also 
look for the InstallPath32 and *64 keys will find both installations if they 
are there. Even if the changes are backported as a bugfix, nothing changes for 
tools that are not aware of the new keys.

--
keywords: +patch
Added file: http://bugs.python.org/file34363/20883_1.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20883
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue20883] Windows 'for current user' installation - 32/64-bit registrations overwrite each other

2014-03-10 Thread Jurko Gospodnetić

New submission from Jurko Gospodnetić:

When running the Python Windows installer 'for all users', the 32-bit 
installation and the 64-bit installation each gets a separate registration in 
the Windows registry. E.g. under:

  HKEY_LOCAL_MACHINE\Software\Python\PythonCore\3.4

and:

  HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Python\PythonCore\3.4

However, when running the installer 'for the current user only', the 32-bit and 
the 64-bit installation both use the same Windows registry key:

  HKEY_CURRENT_USER\Software\Python\PythonCore\3.4

Note that a 64-bit installation does not automatically uninstall a previous 
32-bit installation in either case, or vice versa.

As I understand it, whichever installation you use, you should be able to run a 
specific Python interpreter using the py.exe runner, as in:

  py.exe -3.4
  py.exe -3.4-32

As it stands now - both of those run the same interpreter when they have been 
installed 'for the current user only', although when running
'py.exe -3.4-32' the runner will make an extra check and reject running the 
Python executable if the 64-bit version was installed last.

So:
1. If you install the 64-bit version first and then the 32-bit version, both 
'py.exe -3.4'  'py.exe -3.4-32' run the 32-bit executable.
2. If you install the 32-bit version first and then the 64-bit version, 'py.exe 
-3.4' runs the 64-bit version, and 'py.exe -3.4-32' exits with an error.

--
components: Installation, Windows
messages: 213045
nosy: Jurko.Gospodnetić
priority: normal
severity: normal
status: open
title: Windows 'for current user' installation - 32/64-bit registrations 
overwrite each other
versions: Python 3.3, Python 3.4

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20883
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue20883] Windows 'for current user' installation - 32/64-bit registrations overwrite each other

2014-03-10 Thread Jurko Gospodnetić

Jurko Gospodnetić added the comment:

A possible solution would be to update installers and runners to use 
HKEY_CURRENT_USER\Software\Wow6432Node registry entries for 32-bit 'for current 
user only' installations on a 64-bit Windows OS.

To preserve backward compatibility, runners could fall back to reading the 
64-bit HKEY_CURRENT_USER\Software registry entries if their 32-bit counterparts 
can not be found directly.

This way:
  - installations on 32-bit Windows are unaffected
  - new installations work with new runners correctly
  - old installations work with new runners as before
  - old installations work with old runners as before
  - new 64-bit installations work with old runners as before
  - new 32-bit installations do not work with old runners

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20883
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue20883] Windows 'for current user' installation - 32/64-bit registrations overwrite each other

2014-03-10 Thread STINNER Victor

Changes by STINNER Victor victor.stin...@gmail.com:


--
nosy: +loewis, tim.golden

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20883
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue20883] Windows 'for current user' installation - 32/64-bit registrations overwrite each other

2014-03-10 Thread Martin v . Löwis

Martin v. Löwis added the comment:

This is not a bug in Python, but either intentional, or a bug in Windows. 
Processing of Wow64Node is done by Windows, see 

http://msdn.microsoft.com/en-us/library/windows/desktop/aa384253(v=vs.85).aspx

As you can see, the SOFTWARE key is redirected in HKEY_LOCAL_MACHINE, but 
shared in HKEY_CURRENT_USER.

If you think that absolutely something must be done, I would suggest to remove 
the install for current user feature altogether - it has too many flaws 
imposed by Windows.

--
resolution:  - invalid
status: open - closed

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20883
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue20883] Windows 'for current user' installation - 32/64-bit registrations overwrite each other

2014-03-10 Thread Paul Moore

Paul Moore added the comment:

OK, fair enough (I agree that the Windows behaviour here is the root cause of 
the problem). However, it *would* have been possible for the registry keys to 
be HKEY_LOCAL_MACHINE\Software\Python\PythonCore\3.4-32 and 
HKEY_LOCAL_MACHINE\Software\Python\PythonCore\3.4-64 (with whatever Wow64 
nonsense MS chose to add). If that had been in place, we would not have this 
bug.

The change is backward incompatible, though (in an annoyingly obscure way as 
well), and I'm comfortable with a resolution that this is not a sufficiently 
common scenario to warrant that sort of change.

--
nosy: +pmoore

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20883
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue20883] Windows 'for current user' installation - 32/64-bit registrations overwrite each other

2014-03-10 Thread Jurko Gospodnetić

Jurko Gospodnetić added the comment:

I'm against removing local user installation support because that is the only 
way Python can be installed without write access to shared system locations 
like the Windows system folder or the HKEY_LOCAL_MACHINE registry hive.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20883
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue20883] Windows 'for current user' installation - 32/64-bit registrations overwrite each other

2014-03-10 Thread Paul Moore

Paul Moore added the comment:

Agreed, that is not necessary. Nor was Martin suggesting it as far as I can 
tell, he was simply saying that it would be less disruptive in the broader 
scheme of things than messing with the Python registry scheme to work around 
the limitation that 32 and 64 bit Pythons can't both be registered as per-user 
installations.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20883
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue20883] Windows 'for current user' installation - 32/64-bit registrations overwrite each other

2014-03-10 Thread Jurko Gospodnetić

Jurko Gospodnetić added the comment:

And as for simultaneous 64/32-bit Python installations on a single 64-bit 
machine - as Paul said, whichever way Microsoft implemented its automatic 
registry key redirection, it is up to Python to decide how its installer should 
behave.

So the question is - should it be possible to run 32-bit  64-bit Python 
installations on the same machine using the standard py.exe wrapper when those 
installations are done for the current user only?

I know I found that useful in a scenario (done using installations 'for all 
users' though) where I had some scripts using 64-bit Python and needed to run 
several scripts automating a 32-bit Python extension module. I believe the 
problem was in the pstools module that at the time was not available as a 
64-bit build (don't know if that situation has been resolved since).

Personally, I just noticed the undocumented inconsistency and decided to report 
it. I don't really care all that much about whether it is resolved cleanly, as 
in my development setup I have other problems preventing me from using the 
py.exe wrapper all together - I need multiple parallel patch releases in the 
same system and the best way I found to achieve that is to:
  - do a 'local user installation' - version A,
  - rename the target folder for version A
  - do a 'local user installation' - version B,
  - ...
and have my own version specific startup scripts like py243.cmd, py244.cmd, 
py276_x86.cmd, py276.cmd, py340.cmd, ...

I really don't like it that different Python X.Y patch releases overwrite each 
other's installation registrations or uninstall each other automatically. :-( 
Or that you can not specify more detailed Python interpreter version 
information like 2.4.3 to the py.exe wrapper. :-(

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20883
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue20883] Windows 'for current user' installation - 32/64-bit registrations overwrite each other

2014-03-10 Thread Jurko Gospodnetić

Jurko Gospodnetić added the comment:

 Nor was Martin suggesting it as far as I can tell

I'm sorry if I came across too strongly. I can assure you I meant no disrespect 
nor have I at any point felt affronted by anything anyone else said in this 
thread/issue. :-)

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20883
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue20883] Windows 'for current user' installation - 32/64-bit registrations overwrite each other

2014-03-10 Thread Steve Dower

Steve Dower added the comment:

I would be in favour of having separate keys for 32-bit and 64-bit installs (in 
addition to the current one, if dropping it completely is not an option). We 
use the registry keys in PTVS (http://pytools.codeplex.com/) to detect 
installed interpreters, so the collision here means we can only detect one 
per-user interpreter per-version.

We haven't received many complaints about this, so we assume that not many 
people install both the 32-bit and 64-bit versions of Python. However, we do it 
all the time, so we'd be happy with a fix just for us :)

As far as the redirection goes, that is largely a compatibility 'feature' for 
running 32-bit programs on 64-bit Windows. 
HKEY_CURRENT_USER\Software\Wow6432Node is not official (even though there's 
some buggy software that thinks it is...) and doesn't mean anything (while the 
one in HKEY_LOCAL_MACHINE does).

The intent is that software uses differently named keys when storing different 
settings. Having Python\PythonCore\3.4, 3.4-32 and/or 3.4-64 seems 
appropriate to me (where the 3.4 value keeps the current last-one-wins 
behaviour).

Out of interest, what other issues exist for the per-user installation? I 
normally prefer it because I like keeping the DLLs out of System32, and I 
practically never hit any issues (Python 2.5 has one with virtualenv, but 
that's about it).

--
nosy: +steve.dower

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20883
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com