Am 01.02.2016 um 10:26 schrieb eryk sun:
> On Sun, Jan 31, 2016 at 10:42 PM, Mark Hammond <skippy.hamm...@gmail.com> 
> wrote:
>> On 17/01/2016 6:51 AM, Malte Forkel wrote:
>>> I'm trying the register a COM server using the install script of a built
>>> distribution, created with the  bdist_wininst format of distutils. But
>>> the script fails with a message that MSVCR90.dll can't be found.
>>> Registering the server after the installer is done works fine. I'm using
>>> Python 2.7.11 and pywin32-220 on Windows 7.1 64 bit.
>> That sounds a little strange - the script should only be executed after
>> python27.dll is loaded, which itself relies on msvcr90.dll.
>>
>> Does it happen to work if you put the installer executable in the same
>> directory as python27.dll?
> Loading msvcr90.dll requires a SxS activation context. Neither
> pythoncom27.dll nor pywintypes27.dll have this assembly embedded as
> resource #2. I assume that's because they're normally loaded as
> extension modules. In this case Python uses the activation context
> that gets saved in its DllMain, which includes the VC90 assembly from
> the #2 manifest that's embedded in python27.dll. Are these two DLLs
> getting loaded in some other way here? If so you can create a context
> at runtime from the manifest that's embedded in python27.dll.
>
> pythoncomloader27.dll can load msvcr90.dll because it has the
> following manifest embedded as resource #2:
>
> <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
> <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="amd64" publi
> cKeyToken="1fc8b3b9a1e18e3b"></assemblyIdentity>
>     </dependentAssembly>
>   </dependency>
> </assembly>
>

To me, that sounds similar to bug report #705, Missing MSVCR90.DLL under
'boost::python' application [1]. Its authors writes

  By the way, I added the same manifest that it is in
"pythoncomloader27.dll" in to
  "pywintypes27.dll" and "pythoncom27.dll" and the error message does
not appear
  any more."

Unfortunately, I don't have the Windows skills to follow his advice or
yours. How do I "create a context at runtime from the manifest that's
embedded in python27.dll"?

Malte

[1] http://sourceforge.net/p/pywin32/bugs/705/
_______________________________________________
python-win32 mailing list
python-win32@python.org
https://mail.python.org/mailman/listinfo/python-win32

Reply via email to