[python-win32] WinSxS, manifests and binary distribution ?
Robert
kxroberto at googlemail.com
Mon Nov 7 15:28:45 CET 2011
Hello,
I want to see clearly which MFC DLLs (and VCR DLLs) pythonwin.exe
or python(w).exe +win32ui.dll are actually using in Python2.6 or
2.7. And how to manage the actuall bindings/dependencies. And how
to put together binary distribution files.
I want to find a way to first move away the MFC DLLs, to have a
situation here like on a computer without Python installed. And
then put (& test) precisely the required DLLs/manifests next to a
myapp.exe (win32ui based), so that I find which and how how
files can be distributed.
But the situation seems weired so far:
Python2.7.2 / pywin 216:
Verzeichnis von C:\Python27\Lib\site-packages\pythonwin
07.11.2011 14:44 <DIR> .
07.11.2011 14:44 <DIR> ..
26.02.2011 19:10 48.640 dde.pyd
11.06.2008 13:02 1.550 license.txt
07.11.2007 03:19 1.156.600 mfc90.dll
07.11.2007 03:19 1.162.744 mfc90u.dll
07.11.2007 00:51 59.904 mfcm90.dll
07.11.2007 00:51 59.904 mfcm90u.dll
07.11.2007 00:51 548 Microsoft.VC90.MFC.manifest
26.02.2011 19:10 19.968 Pythonwin.exe
04.11.2011 19:07 <DIR> pywin
26.02.2011 19:11 416.256 scintilla.dll
06.11.2011 23:12 1.446 startframework.pyw
26.02.2011 19:09 778.240 win32ui.pyd
26.02.2011 19:10 37.888 win32uiole.pyd
07.11.2011 14:44 <DIR> _mv
12 Datei(en) 3.743.688 Bytes
4 Verzeichnis(se), 43.545.804.800 Bytes frei
Now when I move away the 5 MFC files (4 dlls + manifest) to _mv,
then Pythonwin.exe still runs properly!
And it does so until I move the folder
C:\WINDOWS\WinSxS\x86_Microsoft.VC90.MFC_1fc8b3b9a1e18e3b_9.0.30729.6161_x-ww_028bc148
away to C:\WINDOWS\WinSxS\_mv
(There are 2 more 9.0 MFC folders in WinSxS, but they have no
effect regarding Pythonwin.exe - on or off)
Well, but Pythonwin.exe has a builtin manifest
(win32api.LoadResource(None, 24, 1)) which draws
version="9.0.21022.8" - and not 9.0.30729.* !? how come? :
<assembly xmlns="urn:schemas-microsoft-com:asm.v1"
manifestVersion="1.0">
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
<security>
<requestedPrivileges>
<requestedExecutionLevel level="asInvoker"
uiAccess="false"></requestedExecutionLevel>
</requestedPrivileges>
</security>
</trustInfo>
<dependency>
<dependentAssembly>
<assemblyIdentity type="win32" name="Microsoft.VC90.CRT"
version="9.0.21022.8" processorArchitecture="x86"
publicKeyToken="1fc8b3b9a1e18e3b"></assemblyIdentity>
</dependentAssembly>
</dependency>
<dependency>
<dependentAssembly>
<assemblyIdentity type="win32" name="Microsoft.VC90.MFC"
version="9.0.21022.8" processorArchitecture="x86"
publicKeyToken="1fc8b3b9a1e18e3b"></assemblyIdentity>
</dependentAssembly>
</dependency>
</assembly>
Moreover, the files in ..
Verzeichnis von
C:\WINDOWS\WinSxS\x86_Microsoft.VC90.MFC_1fc8b3b9a1e18e3b_9.0.30729.6161_x-ww_028bc
148
10.10.2011 11:04 <DIR> .
10.10.2011 11:04 <DIR> ..
18.04.2011 21:51 3.766.600 mfc90.dll
18.04.2011 21:51 3.781.960 mfc90u.dll
18.04.2011 21:51 59.904 mfcm90.dll
18.04.2011 21:51 59.904 mfcm90u.dll
4 Datei(en) 7.668.368 Bytes
2 Verzeichnis(se), 43.545.792.512 Bytes frei
.. are younger than Pythonwin.exe itself !??
Well, now with MFC90 folders of WinSxS moved away, and
Pythonwin.exe finally not booting as wanted, I move then back the
5 MFC files from C:\Python27\Lib\site-packages\pythonwin\_mv to
C:\Python27\Lib\site-packages\pythonwin . But Pythowin.exe now
doesn't start with that files right next to it (where precisely
the same version is in Pythonwin.exe manifest and in that
Microsoft.VC90.MFC.manifest file), nor does import win32ui in
python(w).exe work.
(ImportError: DLL load failed: The referenced assembly is not
installed on the computer)
Pythonwin.exe or win32ui won't load until
C:\WINDOWS\WinSxS\x86_Microsoft.VC90.MFC_1fc8b3b9a1e18e3b_9.0.30729.6161_x-ww_028bc
148 is in Place.
I absolutely don't understand this. How can Pythonwin.exe draw a
MFC90 DLL set with future date and future version, and reject the
DLL set coming with pywin32 installer right next to with right
version ... ?
What has to be done to distribute the right binary files for a
win32ui app?
Where do the "active" rather new files in
C:\WINDOWS\WinSxS\x86_Microsoft.VC90.MFC_1fc8b3b9a1e18e3b_9.0.30729.6161_x-ww_028bc
148 come from at all?
Robert
PS: By experience the method with placing MSVCRT 90 files +
manifest next to a Python2.6 wxPython app (no MFC/win32ui) worked
on fresh computers (which I don't have easily at hand).
But here c:\python27\python.exe requires
C:\WINDOWS\WinSxS\x86_Microsoft.VC90.CRT_1fc8b3b9a1e18e3b_9.0.30729.6161_x-ww_31a54e43
.. while 'name="Microsoft.VC90.CRT" version="9.0.21022.8"' is in
its built-in manifest
More information about the python-win32
mailing list