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

时间:2018-12-19 05:31:45

标签: python cx-freeze

我需要将 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)])

1 个答案:

答案 0 :(得分:0)

您应该尝试以下操作:

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