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 ""
|
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():
|
def build_installer():
|
||||||
print(f"\n--- 4. Создание установщика {INSTALLER_NAME} ---")
|
print(f"\n--- 4. Создание установщика {INSTALLER_NAME} ---")
|
||||||
if os.name != "nt":
|
if os.name != "nt":
|
||||||
@@ -200,15 +213,14 @@ def build_installer():
|
|||||||
completed = subprocess.run(
|
completed = subprocess.run(
|
||||||
command,
|
command,
|
||||||
capture_output=True,
|
capture_output=True,
|
||||||
text=True,
|
|
||||||
encoding="utf-8",
|
|
||||||
errors="replace",
|
|
||||||
check=False,
|
check=False,
|
||||||
)
|
)
|
||||||
if completed.stdout:
|
stdout_text = _decode_process_output(completed.stdout)
|
||||||
print(completed.stdout.rstrip())
|
stderr_text = _decode_process_output(completed.stderr)
|
||||||
if completed.stderr:
|
if stdout_text:
|
||||||
print(completed.stderr.rstrip())
|
print(stdout_text.rstrip())
|
||||||
|
if stderr_text:
|
||||||
|
print(stderr_text.rstrip())
|
||||||
if completed.returncode != 0:
|
if completed.returncode != 0:
|
||||||
raise RuntimeError(f"ISCC exited with code {completed.returncode}")
|
raise RuntimeError(f"ISCC exited with code {completed.returncode}")
|
||||||
installer_path = os.path.join("dist", INSTALLER_NAME)
|
installer_path = os.path.join("dist", INSTALLER_NAME)
|
||||||
|
|||||||
@@ -28,9 +28,7 @@ SolidCompression=yes
|
|||||||
WizardStyle=modern
|
WizardStyle=modern
|
||||||
ArchitecturesInstallIn64BitMode=x64compatible
|
ArchitecturesInstallIn64BitMode=x64compatible
|
||||||
UninstallDisplayIcon={app}\AnabasisManager.exe
|
UninstallDisplayIcon={app}\AnabasisManager.exe
|
||||||
#ifexist MyIconFile
|
|
||||||
SetupIconFile={#MyIconFile}
|
SetupIconFile={#MyIconFile}
|
||||||
#endif
|
|
||||||
|
|
||||||
[Languages]
|
[Languages]
|
||||||
Name: "russian"; MessagesFile: "compiler:Languages\Russian.isl"
|
Name: "russian"; MessagesFile: "compiler:Languages\Russian.isl"
|
||||||
|
|||||||
Reference in New Issue
Block a user