Olivier Thiery said:
I've ported a software I've developped from win 2k to win xp and something I
wouldn't have expected happened.
If I simply run the py files, the software uses the current xp skin
looknfeel, but if I compile it using py2exe it looks like any ugly standard
grey win2k app.
Does anybody know why and how it can be fixed ?
You need to include and XP manifest file. You can either just copy
(and rename to match your .exe) the python.exe.manifest file from
c:\python23 or I prefer to embed it into my setup.py for py2exe (just
change "myprogram" to your program name) I think this is in the py2exe
Wiki:
from distutils.core import setup
import py2exe
manifest = """
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1"
manifestVersion="1.0">
<assemblyIdentity
version="0.64.1.0"
processorArchitecture="x86"
name="Controls"
type="win32"
/>
<description>myProgram</description>
<dependency>
<dependentAssembly>
<assemblyIdentity
type="win32"
name="Microsoft.Windows.Common-Controls"
version="6.0.0.0"
processorArchitecture="X86"
publicKeyToken="6595b64144ccf1df"
language="*"
/>
</dependentAssembly>
</dependency>
</assembly>
"""
"""
installs manifest and icon into the .exe
but icon is still needed as we open it
for the window icon (not just the .exe)
changelog and logo are included in dist
"""
setup(
windows = [
{
"script": "myprogram.py",
"icon_resources": [(1, "myprogram.ico")],
"other_resources": [(24,1,manifest)]
}
],
data_files=["logo.gif",
"myprogram.ico",
"ChangeLog.txt"],
)