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- )
- 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?
- What is the preferred handling when
gameFile.version is empty, sosilent fallback to root, a warning, or a configurable fallback string?
- Would a PR be welcome, or is there a different preferred approach?
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 theversionfield already present ingameFile.version, with spaces replaced by underscores for filesystem compatibility.Desired usage:
Resulting structure:
Investigation
Before proposing this, the API output was verified with
--list details:Key findings:
gameFile.idcontains a language/index string likede1installer0, so not the numeric build ID visible in filenames. It is not suitable as a grouping key.gameFile.versioncontains 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-orphansalready usesrecursive_directory_iteratorinternally, so no changes required there.Compatibility requirements
--repairmust 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.%installer_version%in template) must remain unchanged.gameFile.versionis 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- )
gameFile.versionthe intended field for this use case, or is there a more stable/canonical identifier for grouping installer variants of the same build?gameFile.versionis empty, sosilent fallback to root, a warning, or a configurable fallback string?