MCPcopy Create free account
hub / github.com/conda/constructor / calculate_msi_install_path

Function calculate_msi_install_path

tests/test_examples.py:345–358  ·  view source on GitHub ↗

Calculate the MSI install path from the construct.yaml config. MSI installers use ' ' as the install directory name, matching the formal_name set in briefcase.py.

(config_path: Path)

Source from the content-addressed store, hash-verified

343
344
345def calculate_msi_install_path(config_path: Path) -> Path:
346 """Calculate the MSI install path from the construct.yaml config.
347
348 MSI installers use '<name> <version>' as the install directory name,
349 matching the formal_name set in briefcase.py.
350 """
351 config = parse_construct(str(config_path), platform="win-64")
352 dir_name = f"{config['name']} {config['version']}"
353 local_dir = os.environ.get("LOCALAPPDATA", str(Path.home() / r"AppData\Local"))
354 root_dir = Path(local_dir) / "Programs"
355 root_dir.mkdir(parents=True, exist_ok=True)
356
357 assert root_dir.is_dir() # Consistency check to avoid strange unexpected errors
358 return Path(root_dir) / dir_name
359
360
361def handle_exception_and_error_out(

Callers 1

create_installerFunction · 0.85

Calls 1

getMethod · 0.80

Tested by

no test coverage detected