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
This commit is contained in:
26
build.py
26
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)
|
||||
|
||||
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user