是否可以将exe文件添加到cx_freeze python bdist_msi中?

Is it possible to add exe file into cx_freeze python bdist_msi?

我需要将 RemoveDrive.exe 添加到 cx-freeze msi 包中 并尝试过

includefiles=['RemoveDrive.exe']

setup.py 但是,它没有被添加到包中

代码:

from cx_Freeze import setup, Executable

build_exe_options = {"packages": ["os","shutil","datetime","subprocess"]}

includefiles = ['RemoveDrive.exe', 'whitelist.txt']
base = None

setup(  name = "whitelist",
        version = "0.1",
        description = "My application!",
        options = {"build_exe": build_exe_options},
        executables = [Executable("whitelisting.py", base=base)])

你应该试试这个:

from cx_Freeze import setup, Executable

build_exe_options = {"packages": ["os","shutil","datetime","subprocess"]}

includefiles = ['RemoveDrive.exe', 'whitelist.txt']
base = None

exe = Executable(script='whitelisting.py', base = base)

setup(  name = "whitelist",
        version = "0.1",
        description = "My application!",
        options = {"build_exe": {'include_files':includefiles}},
        executables = [exe])