win XP + wxPython + py2exe

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Olivier Thiery

    win XP + wxPython + py2exe

    Hello,

    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 ?

    Thanks a lot,

    Olivier
  • Peter Hansen

    #2
    Re: win XP + wxPython + py2exe

    Olivier Thiery wrote:
    [color=blue]
    > 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 ?[/color]

    This has been discussed in the group and groups.google.c om can
    certainly dig up the reference for you, if Jaco's advice doesn't
    get you all the way there.

    -Peter

    Comment

    • Steve Zatz

      #3
      Re: win XP + wxPython + py2exe

      "If you are using py2exe to build a standalone Python executable, say
      FOO.EXE, you need to copy pythonw.exe.man ifest into the directory
      where FOO.EXE is and name it FOO.EXE.manifes t."


      Comment

      • simo

        #4
        Re: win XP + wxPython + py2exe

        Olivier Thiery <olivierthiery@ free.fr> wrote:
        [color=blue]
        > 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 ?[/color]

        You need to include and XP manifest file. You can either just copy
        (and rename to match your .exe) the python.exe.mani fest 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:sche mas-microsoft-com:asm.v1"
        manifestVersion ="1.0">
        <assemblyIdenti ty
        version="0.64.1 .0"
        processorArchit ecture="x86"
        name="Controls"
        type="win32"
        />
        <description>my Program</description>
        <dependency>
        <dependentAssem bly>
        <assemblyIdenti ty
        type="win32"
        name="Microsoft .Windows.Common-Controls"
        version="6.0.0. 0"
        processorArchit ecture="X86"
        publicKeyToken= "6595b64144ccf1 df"
        language="*"
        />
        </dependentAssemb ly>
        </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_resource s": [(24,1,manifest)]
        }
        ],
        data_files=["logo.gif",
        "myprogram.ico" ,
        "ChangeLog. txt"],
        )

        Comment

        Working...