[Python-Dev] DLL in the system directory on Windows.

Mark Hammond mhammond@skippinet.com.au
Tue, 4 Apr 2000 09:11:13 +1000


The 1.6a1 installer on Windows copies Python16.dll into the Python
directory, rather than the system32 directory like 1.5.x.  We
discussed too long ago on this list not why this was probably not
going to work.  I guess Guido decided to "suck it and see" - which
is fine.

But guess what - it doesnt work :-(

I couldnt get past the installer!  The win32all installer executes
some Python code at the end of the install (to generate the .pyc
files and install the COM objects).  This Python code is executed
directly to the installation .EXE, by loading and executing a "shim"
DLL I wrote for the purpose.

Problem is, try as I might, my shim DLL could not load Python16.dll.
The shim DLL _was_ in the same directory as Python16.dll.  The only
way I could have solved it was to insist the WISE installation .EXE
be run from the main Python directory - obviously not an option.

And the problem is quite obviously going to exist with COM objects.

The problem would appear to go away if the universe switched over
the LoadLibraryEx() - but we dont have that control in most cases
(eg, COM, WISE etc dictate this to us).

So, my solution was to copy Python16.dll to the system directory
during win32all installation.  This results in duplicate copies of
this DLL, so to my mind, it is preferable that Python itself go back
to using the System32 directory.

The problem this will lead to is that Python 1.6.0 and 1.6.1 will
not be able to be installed concurrently.  Putting entries on the
PATH doesnt solve the underlying problem - you will only be able to
have one Python 1.6 directory on your path, else you end up with the
same coflicts for the DLL.

I dont see any better answer than System32 :-(  Thoughts?

Mark.