Logo FSBarV1_Archived

BarInstall Module

Resolves the user's BAR installation — data directory, installed engine versions, the active engine per user override, and the skirmish AIs registered under the active engine. Every path this module returns is verified at resolution time; callers can hand the result to downstream modules (proxy installer, session launcher) without re-checking existence. Wraps `FSBar.Client.EngineDiscovery` — no filesystem logic is duplicated — but adds a data-model vocabulary (`EngineVersionEntry`, `BarInstall`) and structured error reporting tuned for the hub's Settings / First-Run UI.

Types

Type Description

BarInstall

Complete hub view of the install.

BarInstallError

Failure modes surfaced by `detect`.

EngineVersionEntry

Descriptor for one installed engine version under `/engine/recoil_/`.

Functions and values

Function or value Description

detect settings

Full Usage: detect settings

Parameters:
Returns: Result<BarInstall, BarInstallError>

Enumerates installed engines and selects the active one per the settings override. All filesystem checks run here; callers can treat an `Ok` result as fully validated.

settings : HubSettings
Returns: Result<BarInstall, BarInstallError>

formatError arg1

Full Usage: formatError arg1

Parameters:
Returns: string

Human-readable rendering of a `BarInstallError`. Used by the GUI and by diagnostics logs.

arg0 : BarInstallError
Returns: string

listSkirmishAis engine

Full Usage: listSkirmishAis engine

Parameters:
Returns: string list

Lists the skirmish AIs installed under `` by scanning for immediate subdirectories. Returns the AI names (directory basenames) sorted alphabetically. Missing `AI/Skirmish` directory yields an empty list.

engine : EngineVersionEntry
Returns: string list

resolveDataDir settings

Full Usage: resolveDataDir settings

Parameters:
Returns: string

Returns the absolute data directory path the hub should use — `settings.BarDataDirOverride` when `Some`, else the XDG default (`$HOME/.local/state/Beyond All Reason`). No filesystem check.

settings : HubSettings
Returns: string

Type something to start searching.