From 30e747bb4cb2aafd56858bc210d4729a86e854de Mon Sep 17 00:00:00 2001 From: Fabian Dill Date: Tue, 29 Aug 2023 20:59:39 +0200 Subject: [PATCH] Windows: create terminal capable Launcher (#2111) --- inno_setup.iss | 1 + setup.py | 11 ++++++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/inno_setup.iss b/inno_setup.iss index d87ae857eae9..147cd74dca07 100644 --- a/inno_setup.iss +++ b/inno_setup.iss @@ -116,6 +116,7 @@ Source: "{#source_path}\SNI\*"; Excludes: "*.sfc, *.log"; DestDir: "{app}\SNI"; Source: "{#source_path}\EnemizerCLI\*"; Excludes: "*.sfc, *.log"; DestDir: "{app}\EnemizerCLI"; Flags: ignoreversion recursesubdirs createallsubdirs; Components: generator/lttp Source: "{#source_path}\ArchipelagoLauncher.exe"; DestDir: "{app}"; Flags: ignoreversion; +Source: "{#source_path}\ArchipelagoLauncher(DEBUG).exe"; DestDir: "{app}"; Flags: ignoreversion; Source: "{#source_path}\ArchipelagoGenerate.exe"; DestDir: "{app}"; Flags: ignoreversion; Components: generator Source: "{#source_path}\ArchipelagoServer.exe"; DestDir: "{app}"; Flags: ignoreversion; Components: server Source: "{#source_path}\ArchipelagoFactorioClient.exe"; DestDir: "{app}"; Flags: ignoreversion; Components: client/factorio diff --git a/setup.py b/setup.py index b5b1af3a327a..212bcc5d0954 100644 --- a/setup.py +++ b/setup.py @@ -185,13 +185,22 @@ def resolve_icon(icon_name: str): exes = [ cx_Freeze.Executable( - script=f'{c.script_name}.py', + script=f"{c.script_name}.py", target_name=c.frozen_name + (".exe" if is_windows else ""), icon=resolve_icon(c.icon), base="Win32GUI" if is_windows and not c.cli else None ) for c in components if c.script_name and c.frozen_name ] +if is_windows: + # create a duplicate Launcher for Windows, which has a working stdout/stderr, for debugging and --help + c = next(component for component in components if component.script_name == "Launcher") + exes.append(cx_Freeze.Executable( + script=f"{c.script_name}.py", + target_name=f"{c.frozen_name}(DEBUG).exe", + icon=resolve_icon(c.icon), + )) + extra_data = ["LICENSE", "data", "EnemizerCLI", "SNI"] extra_libs = ["libssl.so", "libcrypto.so"] if is_linux else []