From 605919d1c89ff0e5d39f8f703afdf48aa56be8e9 Mon Sep 17 00:00:00 2001 From: SantaSpeen Date: Mon, 24 Mar 2025 17:24:10 +0300 Subject: [PATCH] [!!] fix build --- dist_scripts/build_packet.py | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/dist_scripts/build_packet.py b/dist_scripts/build_packet.py index 45a173d..9533b8a 100644 --- a/dist_scripts/build_packet.py +++ b/dist_scripts/build_packet.py @@ -14,19 +14,27 @@ splash = "" # Читается из metadata def get_pyinstaller_cmd(): splash_str = "" + uac_admin = "" + dwt = "" + add_data = [f'--add-data {path_fix + d}' for d in data] if splash: - splash_str = f'--splash {path_fix + splash} ' + splash_str = f' --splash {path_fix + splash} ' + if add_data: + add_data = f"{' '.join(add_data)} " + if disable_windowed_traceback: + dwt = " --disable-windowed-traceback " + if admin: + uac_admin = " --uac-admin " pyinstaller_cmd = \ - (f'pyinstaller --noconfirm --onedir --console --clean {splash_str}' - f'--icon {path_fix + icon} --version-file {path_fix + metadata_path_txt} --name {product_name}' - f'{"".join([f' --add-data {path_fix + d}' for d in data])} ' + (f'pyinstaller --noconfirm --onedir --console --clean ' + f'--icon {path_fix + icon} --version-file {path_fix + metadata_path_txt}' + f'{splash_str}{add_data}{dwt}{uac_admin}' f'--workpath {workpath} --distpath {distpath} --specpath {specpath} ' f'--contents-directory {contents_directory} --optimize {optimize} ' - f'{"--disable-windowed-traceback " if disable_windowed_traceback else ""}' - f'{"--uac-admin " if admin else ""} ' - f'{main}') + f'--name {product_name} {main}').split(" ") + pyinstaller_cmd = [x for x in pyinstaller_cmd if x] logger.info(f"execute: {pyinstaller_cmd}") - return pyinstaller_cmd.split(" ") + return pyinstaller_cmd def calculate_sha256(file_path): sha256_hash = hashlib.sha256()