[python-win32] FW: Problem with winxpgui

Christian Sørensen cso at giritech.com
Tue Jun 23 11:56:07 CEST 2009



-----Original Message-----
From: Christian Sørensen 
Sent: 23. juni 2009 10:18
To: 'Mark Hammond'
Subject: RE: [python-win32] Problem with winxpgui

Yep! Worked out nicely. So for the record here is what we did:

1) Go the folder with the python executable.

2) Create a file called python.exe.manifest with this content:

<?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.Windows.Common-Controls" version="6.0.0.0"  processorArchitecture="X86" publicKeyToken="6595b64144ccf1df" language="*"></assemblyIdentity>
    </dependentAssembly>
  </dependency>
  <dependency>
    <dependentAssembly>
      <assemblyIdentity type="win32" name="Microsoft.VC90.CRT" version="9.0.21022.8" processorArchitecture="x86" publicKeyToken="1fc8b3b9a1e18e3b"></assemblyIdentity>
    </dependentAssembly>
  </dependency>
</assembly>

3) Use the mt.exe tool like this:
Note: This rewrites the python.exe manifest - so be careful.

mt.exe -outputresource:python.exe -manifest python.exe.manifest

Thank you for your time, it is very much appreciated.

Christian


-----Original Message-----
From: Mark Hammond [mailto:mhammond at skippinet.com.au] 
Sent: 20. juni 2009 00:50
To: Christian Sørensen
Subject: RE: [python-win32] Problem with winxpgui

The simplest solution is probably to simply use something like the MS
"manifest tool" (mt.exe) to hack the manifest in your copy of python.exe (or
whatever exe it is you intend using - eg, a py2exe based one...)

Cheers,

Mark


> -----Original Message-----
> From: Christian Sørensen [mailto:cso at giritech.com]
> Sent: Friday, 19 June 2009 6:05 PM
> To: mhammond at skippinet.com.au
> Subject: RE: [python-win32] Problem with winxpgui
> 
> 
> Hi again and thank you for answering
> 
> I am getting some help from my colleague in trying to figure this out.
> So here is what we have come up with so far. We are using py2exe to
> pack the python code and have tried adding a manifest info to the
> setup.py file used for that. This is the info we added:
> 
> manifest_template = """
> <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.Windows.Common-
> Controls" version="6.0.0.0"  processorArchitecture="X86"
> publicKeyToken="6595b64144ccf1df" language="*"></assemblyIdentity>
>     </dependentAssembly>
>   </dependency>
>   <dependency>
>     <dependentAssembly>
>       <assemblyIdentity type="win32" name="Microsoft.VC90.CRT"
> version="9.0.21022.8" processorArchitecture="x86"
> publicKeyToken="1fc8b3b9a1e18e3b"></assemblyIdentity>
>     </dependentAssembly>
>   </dependency>
> </assembly>
> """
> 
> The important part here as I am sure you already know, is the
> dependency including Microsoft.Window.Common-Controls. This works for
> the executable that is coming out of running py2exe on our code.
> However it does not help us much when running the code directly using
> python and we have some tests that we would like to run that way.
> 
> So any help in getting a change into the python executable would be
> great. We are absolutely willing to try whatever you point us to. I am
> sure we have enough programming skills to give it a go.
> 
> Greetings,
> 
> Christian




More information about the python-win32 mailing list