Change icon for a cx_Freeze script

Joseph Smith picture Joseph Smith · May 10, 2012 · Viewed 17.2k times · Source

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.

Answer

Texom512 picture Texom512 · Mar 8, 2015

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]
    )