Dar un nombre diferente al ejecutable que no sea el nombre del script ejecutable

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

  •  24-10-2019
  •  | 
  •  

Pregunta

Estoy usando el siguiente archivo de configuración para crear ejecutable usando cx_freeze. ¿Es posible generar el EXE con un nombre diferente que no sea el nombre del script ejecutable?

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

Entonces, ahora el exe que se crea tiene nombre runner.exe y quiero que sea algo diferente como myExecutable.exe renombra el ejecutable, el script no funciona porque el script se hace referencia a los módulos del paquete.

¿Fue útil?

Solución

Intenta usar el targetName opción:

executables = [Executable(targetName="myexecutable.exe")]
Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top