[python-win32] NT Services and upgrading Python

Thomas Heller thomas.heller@ion-tof.com
Wed, 23 Jan 2002 22:04:10 +0100


From: "Jeff Shannon" <jeff@ccvcorp.com>
> 
> I have an NT Service running, using Python 2.0, and I'd like
> to use a package that prefers 2.1.  Installing the new
> version is simple enough, but I wonder if it might cause any
> issues with my service?
> 
> Now, it seems most likely that if I install 2.1 alongside
> 2.0, they'll have separate sections in the registry, and
> things *ought* to work... but I'm worried that anything
> installed in \windows\system (etc.) might be overwritten, or
> that a $PATH search will find 2.1 when I should be using 2.0
> (or vice-versa).  This service is ... not mission-critical,
> but it's a significant part of daily business operation, so
> I really don't want to just try it out and hope it doesn't
> break.
You can run several Python versions at the same time (this applies
at least to the PythonLabs version, I'm not sure about ActiveState's).
> 
> Alternatively, I could re-work the service to use 2.1 -- my
> code probably wouldn't require any change.  Would this be as
> simple as unregistering the service, upgrading Python, and
> then re-registering it?  Are there any other hidden catches
> behind doing this?  (If it *is* this simple, then this is
> probably my best bet...)
Services written in Python are run via PythonService.exe,
whish is included in win32all. They will use the version
which you registered last ;-). I do not known if the win32all
setup program registers this, but you can easily, after installing
all the 2.1 stuff, run the 2.0 PythonService.exe again to register
it, and your service will continue to use the 2.0 files.

Regards,

Thomas