12

I was just wondering if it's possible to change the program icon for a cx_Freeze script, I've looked around but I couldn't find anything.

jpeg
  • 2,372
  • 4
  • 18
  • 31
Joseph Smith
  • 3,243
  • 5
  • 20
  • 18
  • 2
    The `icon` option is listed in the docs: http://cx_freeze.readthedocs.org/en/latest/distutils.html#build-exe IIRC, you need to have a .ico file for it to work on Windows, so if it's in another format, you'll have to convert it manually. – Thomas K May 10 '12 at 11:47
  • Thomas You've been very helpful lately ;) – Joseph Smith May 15 '12 at 02:06

1 Answers1

25

Just add icon="icon.ico" in Executable() like this:

from cx_Freeze import setup, Executable

target = Executable(
    script="your_program.py",
    base="Win32GUI",
    compress=False,
    copyDependentFiles=True,
    appendScriptToExe=True,
    appendScriptToLibrary=False,
    icon="icon.ico"
    )

setup(
    name="name",
    version="1.0",
    description="the description",
    author="the author",
    options={"build_exe": options},
    executables=[target]
    )
jpeg
  • 2,372
  • 4
  • 18
  • 31
Texom512
  • 4,785
  • 3
  • 16
  • 16