def freeze(ctx, install: bool, force: bool):
"""
Creates a Win32 executable file from EMFT's source
"""
if install:
_install_pyinstaller(ctx, force)
pyinstaller_version, _, _ = do_ex(ctx, [sys.executable, '-m', 'PyInstaller', '--version'])
pyinstaller_version = pyinstaller_version.strip()
click.secho(f'current version of pyinstaller: {pyinstaller_version}', fg='green')
# noinspection SpellCheckingInspection
if not pyinstaller_version.strip() in (PYINSTALLER_NEEDED_VERSION, f'{PYINSTALLER_NEEDED_VERSION}0'):
click.secho('EMFT needs a very specific version of PyInstaller to compile successfully.\n'
'You can force the installation of that version using the command:\n\n'
'\temft-build freeze --force', err=True, fg='red')
exit(-1)
do(ctx, [
sys.executable,
'-m', 'PyInstaller',
'--log-level=WARN',
'--noconfirm', '--onefile', '--clean', '--windowed',
'--icon', './emft/resources/app.ico',
'--workpath', './build',
'--distpath', './dist',
'--paths', f'{os.path.join(sys.exec_prefix, "Lib/site-packages/PyQt5/Qt/bin")}',
'--add-data', f'{certifi.where()};.',
'--name', 'EMFT',
'./emft/main.py'
])
评论列表
文章目录