Opened 9 years ago

Closed 8 years ago

#3556 defect closed fixed (fixed)

win32 installer does not dected Python installation directory correctly

Reported by: osuchw Owned by:
Priority: highest Milestone: Twisted-9.0
Component: release management Keywords:
Cc: Jean-Paul Calderone, radix, Cory Dodt, PenguinOfDoom Branch:
Author:

Description

Both Twisted 8.1 and upcoming 8.2RC Windows installers copy files into C:\Python25 regardless where the real Python installation resides. Python is on the PATH Tested on WindowsXP SP3

C:\>python -c "import sys;print sys.platform;print sys.getwindowsversion();print sys.version"
win32
(5, 1, 2600, 2, 'Service Pack 3')
2.5.2 (r252:60911, Feb 21 2008, 13:11:45) [MSC v.1310 32 bit (Intel)]

Following piece of .iss script used to get it correctly for me. (long time ago)

function GetPythonInstallPath(Ver: String) : String;
begin
 	RegQueryStringValue(HKEY_LOCAL_MACHINE, 'SOFTWARE\Python\PythonCore\' + Ver + '\InstallPath', '', Result);
end;

Change History (8)

comment:1 Changed 9 years ago by Jean-Paul Calderone

Type: regressiondefect

If this didn't work in the past, then it's not a regression. A regression is when something which used to work breaks.

comment:2 Changed 9 years ago by osuchw

Let's not split the hairs but it used to work in previous, previous version when installer was built with "setup.py bdist_wininst"

comment:3 Changed 8 years ago by Jean-Paul Calderone

Cc: Jean-Paul Calderone radix Cory Dodt PenguinOfDoom added
Priority: normalhighest

osuchw, thanks for reporting this issue. I didn't intend any offense by my previous comment, I just wanted to explain why I was changing the ticket type.

I'm not sure what we should do with the .iss script included in the ticket description. Maybe one of our developers more familiar with the Windows installer does, but it would be great if you could provide a little more information here.

Meanwhile, I'll add some CCs to this ticket and hope that someone pays it some attention.

I think this would be a nice-to-have for 9.0, but if it doesn't get attention soon I'm not sure it should actually block the release.

comment:4 Changed 8 years ago by therve

I've checked myself with the latest release some time ago, and it worked fine on my machine. Here is the subset of code which is doing the detection, which looks correct to me:

def getPythonHomeForVersion(ver):
    """Return the home directory for a Python version specified as 'M.m'"""
    res = getValueFromReg(r'Software\Python\PythonCore\%s\InstallPath' %
                          ver, None, r'C:\pythonxx')
    if res == r'C:\pythonxx':
        res = getValueFromReg(r'Software\Python\PythonCore\%s\InstallPath' %
                              ver, None, r'C:\pythonxx', hive=winreg.HKCU)
    return res

comment:5 Changed 8 years ago by Jean-Paul Calderone

osuchw, can you still reproduce this problem with the 8.2 windows installer?

comment:6 in reply to:  5 Changed 8 years ago by osuchw

Replying to exarkun:

osuchw, can you still reproduce this problem with the 8.2 windows installer?

I have confirmed the latest installer behaves correctly for Python 2.5 and 2.6. I had my machine rebuilt since I have raised the original ticket, so it could be that my registry was wanky (technical term) at the time.

The getPythonHomeForVersion looks into the same location as the piece of iss script I have listed in the original ticket. I say close the ticket.

comment:7 Changed 8 years ago by Jean-Paul Calderone

Resolution: fixed
Status: newclosed

Thanks!

comment:8 Changed 7 years ago by <automation>

Owner: therve deleted
Note: See TracTickets for help on using tickets.