[wxPython-users] new style scrollbars on XP?
Chris Reuter
cgreuter at archelon.com
Fri Jun 2 15:42:53 PDT 2006
John Jackson wrote:
> Here's an example of a manifest file that I use on windows xp:
>
> MANIFEST_TEMPLATE = '''
[snip]
> '''
>
> And then I use it when I build an executable using cx_Freeze:
>
> data = MANIFEST_TEMPLATE % dict(prog=constants.PROGRAM_NAME,
> file_description=constants.PROGRAM_TITLE)
> manifest = file(executableDistPath + ".manifest", 'w')
> manifest.write(data)
> manifest.close()
It turns out that you can also embed the manifest into the resources of
a Windows executable. Since I needed to use a custom base executable
anyway, I did it this way.
I'm using MinGW and MSYS.
First, I made a dead simple .rc file:
1 24 "myapp.exe.manifest"
101 ICON myapp.ico
The second line adds an application icon, which I also needed.
I compiled it with windres, the resource compiler that comes with MinGW:
windres Win32Resources.rc Win32Resources.o
Note, though, that windres isn't completely compatible with the
Microsoft resource compiler. This only worked because it was stupidly
simple.
After that, I compiled my modified base executable, Win32GUI_quiet.exe:
gcc -Wall -I. -I/c/Python24/include \
-s /c/WINDOWS/system32/python24.dll -mwindows \
-o Win32GUI_quiet.exe Win32GUI_quiet.c Win32Resources.o
Finally, I ran cx_Freeze with (among other things) the option
"--base-binary `pwd`/Win32GUI_quiet.exe".
Ta-da! One less file to distribute.
(As an aside, cx_Freeze is the greatest thing ever! I mention this here
because the last time I mentioned it, I wasn't particularly positive.
Since then, I've evaluated it better and I'm really impressed with it.)
--Chris
More information about the wxpython-users
mailing list