fix(ci): add native NSIS installer compilation and libpython3 dev dependencies for Linux runner
CI Test Suite / Run Component Tests & Pipeline Verification (push) Successful in 1m45s
Release Binaries & Packages / Build & Release Standalone Binaries (Linux & Windows Cross-Compilation) (push) Successful in 1m10s

This commit is contained in:
2026-09-26 13:33:19 +02:00
parent 911014fae7
commit 17c1791b7d
4 changed files with 120 additions and 20 deletions
+42
View File
@@ -0,0 +1,42 @@
!include "MUI2.nsh"
Name "LOGAR Client"
OutFile "..\dist\LOGAR-Client-Setup.exe"
InstallDir "$PROGRAMFILES64\LOGAR"
RequestExecutionLevel admin
!insertmacro MUI_PAGE_WELCOME
!insertmacro MUI_PAGE_DIRECTORY
!insertmacro MUI_PAGE_INSTFILES
!insertmacro MUI_PAGE_FINISH
!insertmacro MUI_UNPAGE_CONFIRM
!insertmacro MUI_UNPAGE_INSTFILES
!insertmacro MUI_LANGUAGE "English"
Section "Install"
SetOutPath "$INSTDIR"
File "..\dist\Win_Client.exe"
File "..\compilation\nssm.exe"
CreateDirectory "$COMMONAPPDATA\LOGAR"
# Install and configure service via NSSM
ExecWait '"$INSTDIR\nssm.exe" install LOGAR_Client "$INSTDIR\Win_Client.exe"'
ExecWait '"$INSTDIR\nssm.exe" set LOGAR_Client AppDirectory "$INSTDIR"'
ExecWait '"$INSTDIR\nssm.exe" set LOGAR_Client AppStdout "$COMMONAPPDATA\LOGAR\client.log"'
ExecWait '"$INSTDIR\nssm.exe" set LOGAR_Client AppStderr "$COMMONAPPDATA\LOGAR\client_err.log"'
ExecWait '"$INSTDIR\nssm.exe" start LOGAR_Client'
WriteUninstaller "$INSTDIR\uninstall.exe"
SectionEnd
Section "Uninstall"
ExecWait '"$INSTDIR\nssm.exe" stop LOGAR_Client'
ExecWait '"$INSTDIR\nssm.exe" remove LOGAR_Client confirm'
Delete "$INSTDIR\Win_Client.exe"
Delete "$INSTDIR\nssm.exe"
Delete "$INSTDIR\uninstall.exe"
RMDir "$INSTDIR"
SectionEnd
+42
View File
@@ -0,0 +1,42 @@
!include "MUI2.nsh"
Name "LOGAR Server"
OutFile "..\dist\LOGAR-Server-Setup.exe"
InstallDir "$PROGRAMFILES64\LOGAR-Server"
RequestExecutionLevel admin
!insertmacro MUI_PAGE_WELCOME
!insertmacro MUI_PAGE_DIRECTORY
!insertmacro MUI_PAGE_INSTFILES
!insertmacro MUI_PAGE_FINISH
!insertmacro MUI_UNPAGE_CONFIRM
!insertmacro MUI_UNPAGE_INSTFILES
!insertmacro MUI_LANGUAGE "English"
Section "Install"
SetOutPath "$INSTDIR"
File "..\dist\Server.exe"
File "..\compilation\nssm.exe"
CreateDirectory "$COMMONAPPDATA\LOGAR-Server"
# Install and configure service via NSSM
ExecWait '"$INSTDIR\nssm.exe" install LOGAR_Server "$INSTDIR\Server.exe"'
ExecWait '"$INSTDIR\nssm.exe" set LOGAR_Server AppDirectory "$INSTDIR"'
ExecWait '"$INSTDIR\nssm.exe" set LOGAR_Server AppStdout "$COMMONAPPDATA\LOGAR-Server\server.log"'
ExecWait '"$INSTDIR\nssm.exe" set LOGAR_Server AppStderr "$COMMONAPPDATA\LOGAR-Server\server_err.log"'
ExecWait '"$INSTDIR\nssm.exe" start LOGAR_Server'
WriteUninstaller "$INSTDIR\uninstall.exe"
SectionEnd
Section "Uninstall"
ExecWait '"$INSTDIR\nssm.exe" stop LOGAR_Server'
ExecWait '"$INSTDIR\nssm.exe" remove LOGAR_Server confirm'
Delete "$INSTDIR\Server.exe"
Delete "$INSTDIR\nssm.exe"
Delete "$INSTDIR\uninstall.exe"
RMDir "$INSTDIR"
SectionEnd
+33 -1
View File
@@ -136,6 +136,33 @@ def create_windows_exe_zipapp(script_name, exe_name):
print(f"[+] Successfully cross-compiled Windows PE executable: {exe_name}.exe (PE Stub attached: {bool(stub_bytes)})")
def compile_nsis_installers():
"""Compiles NSIS installers if makensis is available (native Linux/Windows)."""
makensis_cmd = None
if shutil.which("makensis"):
makensis_cmd = ["makensis"]
elif os.path.exists(r"C:\Program Files (x86)\NSIS\makensis.exe"):
makensis_cmd = [r"C:\Program Files (x86)\NSIS\makensis.exe"]
elif os.path.exists(r"C:\Program Files\NSIS\makensis.exe"):
makensis_cmd = [r"C:\Program Files\NSIS\makensis.exe"]
if not makensis_cmd:
return False
success = True
for nsi in ["installer_client.nsi", "installer_server.nsi"]:
nsi_path = os.path.join(ROOT_DIR, "compilation", nsi)
if os.path.exists(nsi_path):
print(f"[*] Compiling NSIS script: {nsi} via {makensis_cmd[0]}...")
try:
subprocess.run(makensis_cmd + [nsi_path], check=True)
print(f"[+] Successfully compiled {nsi}")
except Exception as e:
print(f"[!] Warning: Failed to compile {nsi} with {makensis_cmd}: {e}")
success = False
return success
def compile_inno_setup_installers():
"""Compiles Inno Setup installers if iscc or innosetup wrapper is available."""
iscc_cmd = None
@@ -173,6 +200,11 @@ def compile_inno_setup_installers():
return True
def compile_windows_installers():
if not compile_nsis_installers():
compile_inno_setup_installers()
def build_windows():
print("[*] Compiling Windows standalone executables...")
is_windows_host = platform.system() == "Windows"
@@ -192,7 +224,7 @@ def build_windows():
create_windows_exe_zipapp("Win_Client.py", "Win_Client")
create_windows_exe_zipapp("Server.py", "Server")
compile_inno_setup_installers()
compile_windows_installers()
client_bin = os.path.join(DIST_DIR, "Win_Client.exe")
server_bin = os.path.join(DIST_DIR, "Server.exe")