我正在尝试使用cx_Freeze在同一个msi安装程序中创建多个可执行文件:
import sys, os.path
from cx_Freeze import setup, Executable
import cx_Freeze.hooks
PYTHON_INSTALL_DIR = os.path.dirname(os.path.dirname(os.__file__))
os.environ['TCL_LIBRARY'] = os.path.join(PYTHON_INSTALL_DIR, 'tcl', 'tcl8.6')
os.environ['TK_LIBRARY'] = os.path.join(PYTHON_INSTALL_DIR, 'tcl', 'tk8.6')
base = None
if sys.platform == 'win32':
base = 'Win32GUI'
executables = [
Executable('config_monkey.py', base=base), Executable('se8650_monkey.py', base=base)
]
options = {
'build_exe': {
'include_files':[
os.path.join(PYTHON_INSTALL_DIR, 'DLLs', 'tk86t.dll'),
os.path.join(PYTHON_INSTALL_DIR, 'DLLs', 'tcl86t.dll'),
],
'packages':['numpy', 'pandas', 'numpy.lib.format', 'atexit', 'numpy.core._methods', 'tkinter'],
'includes':['numpy', 'pandas', 'numpy.lib.format', 'atexit', 'numpy.core._methods', 'tkinter'],
'excludes':['scipy','matplotlib']
},
}
setup(name='simian',
version='0.1',
description='SE Apps Config Tool',
executables=executables,
options=options
)
它仅创建第一个可执行文件config_monkey.exe
。
如果我只用
运行它executables = [
Executable('se8650_monkey.py', base=base)
]
或
executables = [
Executable('config_monkey.py', base=base)
]
,创建单个可执行文件就可以了。
为什么不创建两个可执行文件?