From fc0c98ee4931a357f76311d178da678372fa739a Mon Sep 17 00:00:00 2001 From: benya Date: Sun, 15 Feb 2026 22:16:13 +0300 Subject: [PATCH] fix(installer): stabilize ISCC script and output decoding - remove fragile preprocessor icon block in .iss - decode ISCC stdout/stderr with cp1251/cp866 fallbacks for readable diagnostics --- build.py | 26 +++++++++++++++++++------- installer/AnabasisManager.iss | 2 -- 2 files changed, 19 insertions(+), 9 deletions(-) diff --git a/build.py b/build.py index 6d9ebde..548d903 100644 --- a/build.py +++ b/build.py @@ -170,6 +170,19 @@ def _find_iscc(): return "" +def _decode_process_output(raw_bytes): + if raw_bytes is None: + return "" + if isinstance(raw_bytes, str): + return raw_bytes + for enc in ("utf-8", "cp1251", "cp866"): + try: + return raw_bytes.decode(enc) + except Exception: + continue + return raw_bytes.decode("utf-8", errors="replace") + + def build_installer(): print(f"\n--- 4. Создание установщика {INSTALLER_NAME} ---") if os.name != "nt": @@ -200,15 +213,14 @@ def build_installer(): completed = subprocess.run( command, capture_output=True, - text=True, - encoding="utf-8", - errors="replace", check=False, ) - if completed.stdout: - print(completed.stdout.rstrip()) - if completed.stderr: - print(completed.stderr.rstrip()) + stdout_text = _decode_process_output(completed.stdout) + stderr_text = _decode_process_output(completed.stderr) + if stdout_text: + print(stdout_text.rstrip()) + if stderr_text: + print(stderr_text.rstrip()) if completed.returncode != 0: raise RuntimeError(f"ISCC exited with code {completed.returncode}") installer_path = os.path.join("dist", INSTALLER_NAME) diff --git a/installer/AnabasisManager.iss b/installer/AnabasisManager.iss index 91aee26..f86fbc4 100644 --- a/installer/AnabasisManager.iss +++ b/installer/AnabasisManager.iss @@ -28,9 +28,7 @@ SolidCompression=yes WizardStyle=modern ArchitecturesInstallIn64BitMode=x64compatible UninstallDisplayIcon={app}\AnabasisManager.exe -#ifexist MyIconFile SetupIconFile={#MyIconFile} -#endif [Languages] Name: "russian"; MessagesFile: "compiler:Languages\Russian.isl"