Opened 15 years ago

Last modified 13 years ago

#114 assigned enhancement

optional package to register python in Windows registry — at Version 9

Reported by: maphew Owned by: maphew
Priority: major Component: Installer
Version: Keywords: python
Cc:

Description (last modified by maphew)

It can be helpful sometimes to register the gdal version of python with Windows. This way a) .py files can be run from outside the o4w shell, and b) 3rd party python programs which aren't part of the o4w package system can be installed using traditional python installers and eggs.

working prototype: http://code.google.com/p/maphew/source/browse/register-python/register-python.py

Adapted from how to for (de)registering a given python install: http://effbot.org/zone/python-register.htm

There can only be a single major version registered at a time, e.g. only one python 2.5

Change History (9)

comment:1 by warmerdam, 15 years ago

I would encourage some caution in registering OSGeo4W's Python as the system python. As noted, we should not replace the system python if there is one registered. We might also consider making registering as the system python something that is trigger by an extra by-request package rather than part of the normal python install.

That said, if we can do this well it could be quite valuable.

Were you interested in taking the lead on this Matt?

comment:2 by maphew, 15 years ago

Owner: changed from osgeo4w-dev@… to maphew
Status: newassigned

Sure, I'll give it a try. It looks tight enough in scope that I won't have to stretch too far to learn how. :)

comment:3 by maphew, 15 years ago

I have a version ready for testing: http://code.google.com/p/maphew/source/browse/trunk/gis/o4w_extras/register-python.py.

Successfully doesn't register o4w python on WinXP Home with Py2.5 pre-installed outside of o4w. Don't know if it will work on x64.

comment:4 by maphew, 15 years ago

It, currently, doesn't detect existing installs on x64 due to something called "registry reflection" and "registry redirection" - http://www.mail-archive.com/python-list@python.org/msg266397.html

However on x64 it can't register itself either, so this is an annoyance and a failure, but not damaging.

comment:5 by maphew, 14 years ago

Python 2.7+ has a _winreg module which reads like it would fix the 64bit issue. Patch files here, found by way of Stack Overflow.

comment:6 by maphew, 14 years ago

Keywords: python added

comment:8 by maphew, 13 years ago

New release of register-python.py (reg-py_0.1) is ready for testing. It's been tested on 32bit Win7. Most notable improvement is that this version removes as well as installs (but only if the InstallPath matches)

b:\>register-python.bat install

Putting python from environment into registry...

--- Python 2.7 is now registered to C:\o4w\apps\Python27!

b:>register-python.bat remove

Found in All Users:

        2.7 - C:\o4w\apps\Python27

existing python matches ours, removing...

--- Python 2.7, C:\o4w\apps\Python27 is now removed!

b:\code\maphew\gis\o4w_extras>

comment:9 by maphew, 13 years ago

Description: modified (diff)

revised url: http://code.google.com/p/maphew/source/browse/register-python/register-python.py (sorry for the jumping about! When reorganizing for my personal efficiency I forgot there are links to it.)

Note: See TracTickets for help on using tickets.