Skip to main content

Module analyze

Module analyze 

Source
Expand description

Archive structure detection.

Given an extracted archive and a game-specific InstallProbe, decide which InstallMethod describes this mod. The pipeline is intentionally ordered so game plugins can claim layouts authoritatively before the generic probes kick in.

Detection order:

  1. Normalize: if the extracted dir contains exactly one wrapper directory and no files, recurse into that subdir and record the strip_prefix on the resulting plan.
  2. Game plugin: probe.analyze(dir) — plugin-specific rules (e.g. REDmod for Cyberpunk).
  3. FOMOD: presence of fomod/ModuleConfig.xml.
  4. BAIN: numbered option subdirs (00 Core, 01 Option, …).
  5. DLL overlay: top-level .dll with no nested asset dirs.
  6. Bare extract: probe.recognizes_bare(dir).
  7. Unknown: fall through.

On Unknown, the caller is expected to dump a dossier (see super::dossier) and let the skill path extend this enum.

Functions§

analyze
Classify extracted_dir and return an InstallPlan with the detected method and source_archive_hash pre-populated.