# buildid

> **Tool `tools/triage/buildid.py`** (program, Triage). Pin down which build of a game this is: everything a copy says about its own version.

Run it with `./gameframe run buildid ARGS` or `python3 tools/triage/buildid.py`. [Source on GitHub](https://github.com/tanepiper/game-frame/blob/main/tools/triage/buildid.py).

## Its own help

This is the help text in the tool itself, as `./gameframe tool buildid` prints it.

```text
Pin down which build of a game this is: everything a copy says about its own version.

Usage: buildid.py SOURCE [--name LABEL] [--write docs/versions.md] [--json]

  SOURCE   a folder (an install, an extracted disc), a disc image (.cue, .bin, .iso) read in
           place, or one executable
  --name   what to call this copy in the table (default: the folder or file name)
  --write  put the result into that file, between `<!-- buildid LABEL -->` and
           `<!-- /buildid LABEL -->`, replacing an earlier result for the same label, or under a
           "## Build identity" heading at the end when there is none yet
  --json   everything as JSON

What it reads:

- the disc's volume descriptor, for a disc image: label, the date it was mastered (created) and
  last modified, publisher, data preparer and mastering application;
- each executable and DLL: the PE link date, and the VERSIONINFO resource (product name,
  product and file version, company, description);
- version strings inside each executable ("Version 2.8", "v1.0", "Ver 1.02"), from its ASCII and
  UTF-16 text;
- version lines in the copy's own text files, such as readme files, `setup.ini`, `autorun.inf`,
  `*.nfo` and `*.txt` near the top: lines that name a version, a patch or an update, or give a
  date.

It prints Markdown for the "Build identity" section of the project's `docs/versions.md`. Then
compare it with the official releases you find (re-inventory, "Every edition, and the
reference"): is this the latest official build, and if not, which is?

It reads only the copy, and prints short identifying lines from it, not its content. Version
lines from a readme are quoted, at most a line each, so the table stays publishable. Needs
pefile (.venv) for VERSIONINFO; the rest uses the standard library.
```

## Named by

Skills: [re-inventory](/skills/re-inventory), [re-start](/skills/re-start).
