Coverage for src/ezcompiler/services/installer_service.py: 100.00%
9 statements
« prev ^ index » next coverage.py v7.14.3, created at 2026-07-04 11:22 +0000
« prev ^ index » next coverage.py v7.14.3, created at 2026-07-04 11:22 +0000
1# ///////////////////////////////////////////////////////////////
2# INSTALLER_SERVICE - Installer build orchestration service
3# Project: ezcompiler
4# ///////////////////////////////////////////////////////////////
6"""
7Installer service - Orchestrates first-deployment installer packaging.
9Builds a setup.exe from a compiled bundle via an installer adapter
10(InstallerFactory). Mirrors ReleaseService's structure.
11"""
13from __future__ import annotations
15# ///////////////////////////////////////////////////////////////
16# IMPORTS
17# ///////////////////////////////////////////////////////////////
18from pathlib import Path
19from typing import Any
21from ..adapters import InstallerFactory
23# ///////////////////////////////////////////////////////////////
24# CLASSES
25# ///////////////////////////////////////////////////////////////
28class InstallerService:
29 """Service orchestrating first-deployment installer packaging."""
31 # ------------------------------------------------
32 # BUILD METHODS
33 # ------------------------------------------------
35 @staticmethod
36 def build_installer(
37 bundle_dir: Path,
38 app_name: str,
39 version: str,
40 output_dir: Path,
41 *,
42 installer_type: str = "innosetup",
43 installer_config: dict[str, Any] | None = None,
44 ) -> Path:
45 """Build the installer executable for a compiled bundle.
47 Args:
48 bundle_dir: Directory containing the compiled application.
49 app_name: Application name.
50 version: Application version string.
51 output_dir: Directory where the setup.exe is produced.
52 installer_type: Installer backend to use (default: "innosetup").
53 installer_config: Extra config forwarded to the installer adapter
54 (e.g. "icon", "company_name", "iss_path", "iscc_path").
56 Returns:
57 Path: The produced setup.exe path.
59 Raises:
60 InstallerError: When installer packaging fails.
61 """
62 installer = InstallerFactory.create_installer(installer_type, installer_config)
63 return installer.build(
64 bundle_dir=bundle_dir,
65 app_name=app_name,
66 version=version,
67 output_dir=output_dir,
68 )