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

StackOverflow https://stackoverflow.com/questions/5321435

  •  24-10-2019
  •  | 
  •  

문제

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.

도움이 되었습니까?

해결책

Try using the targetName option:

executables = [Executable(targetName="myexecutable.exe")]
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top