2011-03-16 2 views
2

다음 설치 파일을 사용하여 cx_freeze를 사용하여 실행 파일을 만듭니다. 실행 가능한 스크립트의 이름이 아닌 다른 이름으로 exe 파일을 생성 할 수 있습니까?실행 파일의 이름이 아닌 실행 파일에 다른 이름을 지정하십시오.

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

는 이제 생성 된 exe는 이름 runner.exe를이 있고 난 스크립트 IR 더 패키지에서 참조하는 스크립트 원인 작동하지 않습니다, 그것은 실행 파일의 이름을 변경 myexecutable.exe 같은 다른 무언가가되고 싶어요 모듈.

답변

6

시도 targetName 옵션을 사용하여 :

executables = [Executable(targetName="myexecutable.exe")] 
+0

안녕하세요, 당신의 도움을 주셔서 감사 ... 일했다! – snehal

관련 문제