Skip to content

Feature request: %installer_id% template for --subdir-installers to separate builds into subdirectories #310

Description

@rixxxxx

Summary

When downloading games with --platform all --language all, GOG embeds the version string and a build ID in the filename (e.g. setup_game_1.20_gog_v3_(86337).exe).
When a new build is released (setup_game_1.20_gog_v4_(90542).exe), both files accumulate in the game directory.

For archival use cases this is intentional, but the directory becomes cluttered as builds accumulate across many games and languages.

Proposed solution

Add a new template %installer_version% to --subdir-installers (and the other --subdir-* options) that resolves to the version field already present in gameFile.version, with spaces replaced by underscores for filesystem compatibility.

Desired usage:

lgogdownloader --download --subdir-installers %installer_version%

Resulting structure:

rollercoaster_tycoon_deluxe/
├── 1.20_GOG_v3/
│   ├── setup_..._v3_(86337).exe
│   ├── setup_..._v3_(french)_(86337)-1.bin
│   └── ...
├── 1.20_GOG_v4/
│   ├── setup_..._v4_(90542).exe
│   └── ...
├── extras/
└── patches/

Investigation

Before proposing this, the API output was verified with --list details:

id: en1installer0
version: 1.20 GOG v4

id: de1installer0
version: 1.20 GOG v4

Key findings:

  • gameFile.id contains a language/index string like de1installer0, so not the numeric build ID visible in filenames. It is not suitable as a grouping key.
  • gameFile.version contains the human-readable version string (e.g. "1.20 GOG v4") and is identical across all language variants of the same build and making it the correct field for grouping.
  • --check-orphans already uses recursive_directory_iterator internally, so no changes required there.

Compatibility requirements

  • --repair must resolve the same subdir path --> should work automatically via shared path construction
  • --check-orphans: files from older builds that are no longer available on GOG servers will be reported as orphans, so this is expected and correct behavior, not a regression.
  • Default behavior (no %installer_version% in template) must remain unchanged.
  • If gameFile.version is empty (not all games provide a version string), the template should either fall back gracefully or be documented as producing an empty path segment.

Questions for the maintainer (@Sude- )

  1. Is gameFile.version the intended field for this use case, or is there a more stable/canonical identifier for grouping installer variants of the same build?
  2. What is the preferred handling when gameFile.version is empty, sosilent fallback to root, a warning, or a configurable fallback string?
  3. Would a PR be welcome, or is there a different preferred approach?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions