我有一个exe文件,需要先执行该文件,然后才能在cx_freeze setup.py文件中安装主应用程序
我在test.py中包含了exe安装,下面的initScript选项中提到了该
test.pt
________________________________
import os
os.system('test.exe')
_________________________________
setup.py
_______________________________________________
exe = Executable(
script='main.py',
initScript= 'test.py',
base=base,
targetName="main.exe",
copyDependentFiles=True,
compress=False,
appendScriptToExe=False,
appendScriptToLibrary=False,
shortcutDir="MyProgramMenu",
shortcutName=APP_NAME,
icon="main.ico",
)
bdist_msi_options = {
"upgrade_code": UPGRADE_CODE,
"add_to_path" : False,
"data" : msi_data
}
setup(
name=APP_NAME, # program name
version=VERSION,
description='test Generation Tool',
options={"build_exe": {"excludes":excludes,
"include_files":includefiles},
"bdist_msi" : bdist_msi_options,
},
executables=[exe]
)
_____________________________________________________________
该exe文件包含在Executable的initScript中,我希望只要安装了我的主应用程序但该exe文件不起作用,该exe文件就会首先执行。 任何建议都会有很大帮助。谢谢