[python-win32] win32all and non-standard Python distribution

Pavlos Christoforou pavlos at gaaros.com
Fri May 16 20:02:34 EDT 2003


This is the procedure we follow to keep the python distro we ship with
our application completely independent from any installed python on the
target machine.

1. make a copy of the python22.dll and open it as a resource in MSVC.
One of the resource strings is "2.2" which defines the subpath in the
registry where this specific python dll will look for various settings.
Modify this string to some other value, say "2.2_IST".

2. Lets suppose that your applications root directory is {app} and that
you have unzipped the python distro in {app}\Python22\. The following
registry entries will do the trick. 

Root: HKLM; Subkey: "SOFTWARE\Python\PythonCore\2.2_IST\PythonPath";
ValueType: string; ValueName: ""; ValueData:
"{app}\ExternalModules\Python22\Lib;{app}\ExternalModules\Python22\Lib\s
ite-packages;{app}\ExternalModules\Python22\DLLs" 

Root: HKLM; Subkey:
"SOFTWARE\Python\PythonCore\2.2_IST\PythonPath\win32com"; ValueType:
string; ValueName: ""; ValueData:
"{app}\ExternalModules\Python22\Lib\site-packages\win32com"


Root: HKLM; Subkey:
"SOFTWARE\Python\PythonCore\2.2_IST\PythonPath\win32"; ValueType:
string; ValueName: ""; ValueData:
"{app}\ExternalModules\Python22\Lib\site-packages\win32;{app}\ExternalMo
dules\Python22\Lib\site-packages\win32\lib"

Root: HKLM; Subkey: "SOFTWARE\Python\PythonCore\2.2_IST\InstallPath";
ValueType: string; ValueName: ""; ValueData: "{app}\Python22" ; Flags:
uninsdeletekey


Pavlos Christoforou
> Anyone solved this issue before? Obvious solutions
> would be sys.path fixups in all applications I run,
> messing with directory structure before ZIPing, adding
> some sort of site.py post-install, and getting Mark
> Hammond to change how win32all installs itself (can we
> get .h and .lib files installed too?) :)
>




More information about the Python-win32 mailing list