Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Give a different name to the executable other than the name of the executable script

I am using the following setup file to create executable using cx_freeze. Is it possible to generate the exe with a different name other than the name of the executable script?

from cx_Freeze import setup, Executable 
import xlrd  
buildOptions = dict(                 
                 compressed = True,
                 optimize=2,                 
                 path=sys.path+[".\\uitls", “.\\supported”], 
                 include_files=[“Doc"],                 
                 includes=[“xlrd”, "win32com"],
                 packages=["utils", ”supported"],
                 append_script_to_exe=True,
                 copy_dependent_files=True,
                  ) 
setup(
                 name = "TestExecutable",
                 version = "0.1",
                 options = dict(build_exe = buildOptions),
                           executables = [Executable(script=r".\\codebase\\runner.py",
                           icon=".\\icon.ico",
                           base="Win32GUI")]                
     )  

So now the exe which is created has name runner.exe and i want it to be something different like myexecutable.exe Renaming the executable, ir the script is not working cause the script is further referenced by the package modules.

like image 891
snehal Avatar asked Feb 25 '23 19:02

snehal


1 Answers

Try using the targetName option:

executables = [Executable(targetName="myexecutable.exe")]
like image 136
samplebias Avatar answered Feb 27 '23 15:02

samplebias