Compare commits

...
Author SHA1 Message Date
poli0981andClaude Opus 5.5 c78de3e466 feat: games from the Xbox app and the Microsoft Store - the GDK library, a package root as an install-root boundary for the guard and detection, the xbox platform rule (root_file, rules 2026.11.1), the game's own art; Privacy 2.13 (D77-D81) (beta.33 PR-1)
The import gains a fifth store, `xbox`: each ready drive's .GamingRoot names the games folders, each
<Game>\Content\ holding MicrosoftGame.config beside appxmanifest.xml is a GDK package (read with DTDs prohibited),
and Windows' appmodel calls (PackageFamilyNameFromId, GetPackagesByPackageFamily) say whether it is installed for
this user. The record: the family name as the store id, Content as the install folder (the spelling the game's own
process reports, spike-notes section 25), the AUMID as the launch key; ExecutableLocator picks the process that
draws, never gamelaunchhelper.exe.

Safety: no install-root boundary matched the Xbox layout, so check 4 walked only an Unreal title's
Binaries\WinGDK. A GDK package root is now a boundary for InstallRoot and the native ResolveInstallRoot alike, asked
only where no store boundary matched (it can only widen the walk); GamesInstalled joins the native list; one case
list, tests/fixtures/install-roots/cases.txt, is read by Catch2 and xUnit both.

Detection: an `xbox` platform first in the array (a GDK FINAL FANTASY ships steam_api64.dll), decided by a new
root_file signal from the install root's own listing, so a deep walk that ran short cannot make it Unknown. Art: the
square logo and the splash image the package names, from inside the package root only. games.platform's vocabulary
gains xbox; the importer's fake repository now validates as the real one does. Privacy Policy 2.13 with the wording
approved with the plan; TRADEMARKS, 02_SPEC, 15_ROADMAP, 05/06/08/19/20, README, LIMITATIONS and the guide follow.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-03 11:57:10 +07:00
poli0981andClaude Opus 5.5 2672caa2ff docs(spike-notes): §25's run - six GDK titles activated through their packages; the image paths, the chains, the tokens, the mitigations, and what a start by path really does (D77, D80) (beta.33 PR-1)
The image path and the loader's main-module path are both the Content spelling on every process of every chain; no
chain member the guard's rights cannot open; no fuzzy-fragment module; full trust, not an AppContainer, medium
integrity; none of the four mitigations. And CreateProcess by path is not error 5, as assumed: the package's launch
executable is replaced by an unpackaged gamelaunchhelper.exe that activates the package (the game is never the
caller's process nor its descendant), and an Unreal shipping executable runs outside its package. D80 stands on those
two measured grounds; the read-only claim is struck and dated in place.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-03 11:10:59 +07:00
poli0981andClaude Opus 5.5 16be2b98e4 docs(spike-notes): §25 - the Xbox/GDK titles' layout, read-only, and the launch probe's decision table, written before the run (D77) (beta.33 PR-1)
The owner's 11 GDK packages under C:\XboxGames and D:\xbox, read without launching anything: the .GamingRoot files,
MicrosoftGame.config / appxmanifest.xml, the WindowsApps junction chain, and the executables refusing FILE_READ_DATA
and FILE_EXECUTE to every process outside their package. Then the probe's method and the table that decides what each
outcome changes - committed before the probe runs, as the house rule asks.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-03 10:54:54 +07:00
78 changed files with 1799 additions and 101 deletions

No files matched your search

+32
View File
@@ -35,8 +35,40 @@ numeric core and does not move; the heading is the full version — corrected 20
## [Unreleased]
### Added
- **Games from the Xbox app and the Microsoft Store** (the owner's request of 2026-11-03, owner decisions D77–D81; PC Game
Pass games included): **Import library** finds the games those apps installed into a games folder — each drive's
`.GamingRoot` names the folders, each game's own `MicrosoftGame.config` and `appxmanifest.xml` say what it is, and
Windows says whether its package is installed for you — and lists them as **Xbox**, with the process that actually
draws (an Unreal title's shipping executable, not the stub its package launches; never the GDK's `gamelaunchhelper.exe`).
A game's page shows its own square logo and splash image, read from its folder, and its package version (*Xbox version
1.3.5124.0*). Only games built on Microsoft's GDK are listed; an older Store app (UWP) is not (`docs/05_DETECTION.md`
§Platform signatures & metadata, `LIMITATIONS.md`, the user guide). Everything was measured first, on the owner's eleven
titles: the layout, and what Windows lets another program read there — every game executable refuses to be read, so no
Unreal Engine version is shown for these games (`docs/spike-notes/25-xbox-gdk.md`).
- **The detection rules know Xbox games** (rules `2026.11.1`, so every game in the library is read again once): an `xbox`
platform, first in the list — a GDK FINAL FANTASY ships Steam's DLL and read *Steam* — decided by a new signal,
`root_file`, from the install folder's own listing, so a very large install whose deep walk ran short still reads as
its store (`docs/05_DETECTION.md`).
### Changed
- **The Privacy Policy is 2.13**, shown once at the next start: it names what the Xbox library reads — the games folders
`.GamingRoot` names, each game's package files, Windows' answer whether its package is installed for you, and the
pictures a game ships in its own folder — that Play asks Windows to start such a game, and that before any injection
FrameLedger reads whether a game runs in an app container and which of Windows' code protections it runs under. The
EULA and the Disclaimer do not change.
### Fixed
- **The anti-cheat check saw only part of an Xbox game's folder** (safety): no install-root boundary matched the
`<games folder>\<Game>\Content\` layout, so for an Unreal title's executable, three levels down, check 4 walked only its
`Binaries\WinGDK` folder, and anti-cheat at the root of `Content` would have read clean. A GDK package root — the folder
holding `MicrosoftGame.config` beside `appxmanifest.xml` — is now a boundary for the guard and for detection alike, used
only where no store boundary matched, so it can only widen what is walked. The guard also gained `GamesInstalled\<X>`,
which detection had had alone since #17; one case list read by both test suites now holds the two resolvers together
(`docs/19_SAFETY_AND_ANTICHEAT.md`, `tests/fixtures/install-roots/cases.txt`).
- **The second alpha's release would have stopped at its delta check** (for developers): Velopack names a non-default
channel's packages with the channel (`FrameLedger.App-<version>-alpha-delta.nupkg`), and `release.yml` looked for the
default channel's name. It now takes the delta the pack listed in `assets.<channel>.json`; the betas' packages are named
+19 -5
View File
@@ -212,13 +212,27 @@ you accept the prompt. Turn it on only if you trust everything that runs under y
its store (Settings ▸ Games ▸ *Play button*); the notice after Play says when a Steam game may hand itself to Steam.
([details](docs/spike-notes/23-owner-runs-2026-10-20.md))
## Xbox app and Microsoft Store games
- **Only games built on Microsoft's GDK** (since 0.1.0-beta.33) — what the Xbox app and the Microsoft Store install into
a games folder you chose, PC Game Pass games included — are found by **Import library**. An older Store app (UWP) is
not listed, and a game Windows has not installed for you, such as one left behind on a drive, is not offered.
([details](docs/spike-notes/25-xbox-gdk.md))
- **Their executables cannot be read by other programs** — Windows refuses it to anything outside the game's own
package — so FrameLedger shows no Unreal Engine version and no *Runs as* for them, and says what it could not read
rather than guessing. A Unity game's version still reads, from its player library.
- **The anti-cheat list's per-game entries know Steam ids only.** An Xbox copy of a game listed there by its Steam id is
checked like any other game — its files, its executables, the anti-cheat drivers and services on your PC — but not
by that entry. ([Safety](docs/19_SAFETY_AND_ANTICHEAT.md), [open question](docs/20_OPEN_QUESTIONS.md))
## Game artwork
- **Only the Steam and GOG GALAXY apps keep pictures FrameLedger can show** (since 0.1.0-beta.23). A game's page shows
the cover and banner those apps keep on your PC for a game they installed, read where they keep them — nothing is
downloaded or copied. A game from itch, the Epic Games Launcher or another store, or one whose `.exe` is outside a
store's own folder, shows a picture only once you choose one (**Edit… ▸ Choose image…**). A GOG picture needs Windows'
WebP support, which Windows 11 and most Windows 10 installs have. ([Game page](docs/08_UI.md))
- **Only the Steam and GOG GALAXY apps keep pictures FrameLedger can show** (since 0.1.0-beta.23) — **and, since
0.1.0-beta.33, an Xbox game ships its own**: its square logo and its splash image, shown from its own folder. A game's
page shows the cover and banner those apps keep on your PC for a game they installed, read where they keep them —
nothing is downloaded or copied. A game from itch, the Epic Games Launcher or another store, or one whose `.exe` is
outside a store's own folder, shows a picture only once you choose one (**Edit… ▸ Choose image…**). A GOG picture needs
Windows' WebP support, which Windows 11 and most Windows 10 installs have. ([Game page](docs/08_UI.md))
- The pictures belong to the games' owners; FrameLedger ships none ([names and trademarks](legal/TRADEMARKS.md)).
## Your data
+1 -1
View File
@@ -133,7 +133,7 @@ Most tools tell you your frame rate. FrameLedger tells you **what produced that
- **Shader-compilation stutter attribution** — which frame spikes were pipeline compiles.
- **PC latency** when the game uses Reflex.
Plus the usual: Avg / Min / Max / Median FPS, 1% Low, 0.1% Low, frametime distributions, stutter metrics, CPU/GPU temperatures, session history, cross-session comparison, and Steam/GOG/Epic/itch.io library import. UI in **English / Tiếng Việt / 日本語**.
Plus the usual: Avg / Min / Max / Median FPS, 1% Low, 0.1% Low, frametime distributions, stutter metrics, CPU/GPU temperatures, session history, cross-session comparison, and Steam/GOG/Epic/itch.io/Xbox library import. UI in **English / Tiếng Việt / 日本語**.
## How it works — and the trade-off, stated plainly
+3 -3
View File
@@ -6,8 +6,8 @@ Requirement IDs (`FR-x`, `NFR-x`) are referenced by other docs, commits, and tes
### FR-1 Game library
- FR-1.1 Add game by picking an `.exe`, or drag-dropping an exe/shortcut.
- FR-1.2 Auto-import from Steam, GOG Galaxy, Epic, itch.io with a review checklist. **Import never enables hooking for anything.**
- FR-1.3 Editable metadata (name, cover, publisher, version, notes); auto-detected fields badged and overridable. *(The cover is built since beta.23, D60: the user's own image, else the Steam or GOG GALAXY app's artwork on this PC — `08_UI` §Games.)*
- FR-1.2 Auto-import from Steam, GOG Galaxy, Epic, itch.io with a review checklist — and, since beta.33 (D79), the Xbox app and the Microsoft Store (GDK titles: each drive's `.GamingRoot` folders and each game's package files, `05_DETECTION` §Platform signatures & metadata). **Import never enables hooking for anything.**
- FR-1.3 Editable metadata (name, cover, publisher, version, notes); auto-detected fields badged and overridable. *(The cover is built since beta.23, D60: the user's own image, else the Steam or GOG GALAXY app's artwork on this PC — `08_UI` §Games; since beta.33 also the square logo and splash image an Xbox game ships in its own package folder.)*
- FR-1.4 Remove game (asks whether to keep or delete its sessions).
- FR-1.5 "Supports" row shows shipped-capability hints (DLSS/FSR/XeSS/FG) — visually distinct from measured per-session values (`05_DETECTION` §Capability hints).
- FR-1.7 Delete all sessions (beta.11, owner decision D40): of one game from its page, or of every game from Settings ▸ Data, after a confirmation that says how many — with their frame and sensor series and notes; the library, the settings and every consent stay. The Agent deletes them (the rows are its, `06_DATA_MODEL` §Writer ownership) and refuses while a session it would delete under is being recorded.
@@ -121,4 +121,4 @@ Draw live FPS/frametime/upscaler info inside the game. Only for games already ho
**Permanently:** any evasion technique (`19_SAFETY`); reading/writing game memory; kernel drivers; hardware control (overclocking, fan curves, power limits — `18_GPU_VENDOR_APIS` is read-only); online/competitive titles.
**v1:** Microsoft Store/UWP/Game Pass titles (packaged-app injection constraints); macOS/Linux; cloud sync; benchmark automation; ARM64. **Tier-1 capture of 32-bit games, including most Direct3D 9 titles** — the Overlay is x64-only and an x64 DLL cannot be loaded into a 32-bit process; those titles are Tier 2, which since 2026-08-28 means **not measured at all** — duration, sensors and the reason (`17_HOOK_ENGINE` §Build profile, `20_OPEN_QUESTIONS` §Scope).
**v1:** ~~Microsoft Store/UWP/Game Pass titles (packaged-app injection constraints)~~ *(narrowed 2026-11-03, beta.33, owner decisions D78–D80: Microsoft Store, Xbox app and PC Game Pass titles built on the GDK — full-trust packages — are in scope; what "the constraints" are was measured in `spike-notes` §25. UWP apps, which run in an app container, stay out: refused with a reason of their own)*; macOS/Linux; cloud sync; benchmark automation; ARM64. **Tier-1 capture of 32-bit games, including most Direct3D 9 titles** — the Overlay is x64-only and an x64 DLL cannot be loaded into a 32-bit process; those titles are Tier 2, which since 2026-08-28 means **not measured at all** — duration, sensors and the reason (`17_HOOK_ENGINE` §Build profile, `20_OPEN_QUESTIONS` §Scope).
+23 -3
View File
@@ -70,7 +70,7 @@ Rules are **data, not code**: `rules/detection-rules.json`, bundled ~~and updata
The `anticheat` block is the same file that feeds the hard guard in `19_SAFETY` — shipping it as updatable data is what lets a newly-protected game be blocked without waiting for an app release. ~~**Rules updates that touch the `anticheat` block are treated as security updates:** applied on next check regardless of the user's auto-update preference for other rules.~~ *(Corrected 2026-10-04: there is no feed and no auto-update preference, so today a newly-protected game waits for a release; the sentence is what a feed must do once built, §S20.)*
Signal types evaluated by `RuleEvaluator` (Domain): `file_exists`, `dir_exists`, `sibling_glob`, **`path_contains`**, `pe_company_contains`, `pe_product_contains`, `strings_contains` (bounded 8 MB scan), `manifest_field`. Combine with `all` / `any` — **not nested**, which schemaVersion 2 forbids. Version extractors: `pe_file_version` (of the sibling its `from` names, not of the executable), `pe_product_version_regex`, **`strings_regex`**, `manifest_field`, and since 2026-09-27 **`unreal_build`** (no parameter; decided in code, §Engine version). A regex extractor must capture exactly **one** group — the evaluator returns the first — and `rules-validate.ps1` refuses any other count and any pattern that does not compile (both promised by the rules file's `$comment` and enforced by nothing until beta.10).
Signal types evaluated by `RuleEvaluator` (Domain): `file_exists`, `dir_exists`, `sibling_glob`, **`path_contains`**, `pe_company_contains`, `pe_product_contains`, `strings_contains` (bounded 8 MB scan), `manifest_field`, and since beta.33 **`root_file`** — an exact file name directly in the install root, answered from that one folder's own listing (`GameFileSnapshot.RootFiles`), so a deep walk that ran short makes its miss no less certain; a root that could not be listed makes it `Unknown`. Combine with `all` / `any` — **not nested**, which schemaVersion 2 forbids. Version extractors: `pe_file_version` (of the sibling its `from` names, not of the executable), `pe_product_version_regex`, **`strings_regex`**, `manifest_field`, and since 2026-09-27 **`unreal_build`** (no parameter; decided in code, §Engine version). A regex extractor must capture exactly **one** group — the evaluator returns the first — and `rules-validate.ps1` refuses any other count and any pattern that does not compile (both promised by the rules file's `$comment` and enforced by nothing until beta.10).
> `path_contains` and `strings_regex` were in the shipped data and the schema
> and missing from this list; the schema's own `$comment` said so and nobody had
@@ -312,6 +312,7 @@ engine compiled only, reads as not found. One Ren'Py install was measured.
| Platform | Signals | Metadata |
|---|---|---|
| Xbox *(beta.33, D79; first in the array)* | **both** `MicrosoftGame.config` and `appxmanifest.xml` directly in the install root (`root_file`, `all`): a GDK package root. First because a GDK build can ship Steam's DLL — every FINAL FANTASY Pixel Remaster from the Xbox app carries `Plugins\x86_64\steam_api64.dll` (`spike-notes` §25) — and a `root_file` miss is never `Unknown` for want of a deep walk, so a large Steam install behind it still reads *steam* | each drive's `.GamingRoot` → `<games folder>\<Game>\Content\`: `MicrosoftGame.config` (Identity, ShellVisuals, ExecutableList, StoreId) and `appxmanifest.xml` (the Application id); the package family name and its registration from Windows (`PackageFamilyNameFromId`, `GetPackagesByPackageFamily`) |
| Steam | `steam_api64.dll`/`steam_api.dll` sibling, or path contains `steamapps\common` | nearest `steamapps/appmanifest_<id>.acf` (walk up): `appid`, `name`, `buildid` → version |
| GOG | `goggame-<id>.info` sibling, or `Galaxy64.dll` | `.info` JSON: `gameId`, `name`, `version` |
| Epic | `EOSSDK-Win64-Shipping.dll`~~, or path under an Epic install~~ *(corrected 2026-10-04: the rule has no path signal)* | `%ProgramData%\Epic\EpicGamesLauncher\Data\Manifests\*.item` matched by `InstallLocation` |
@@ -324,9 +325,12 @@ engine compiled only, reads as not found. One Ren'Py install was measured.
> (`StoreRecords.Owning`, as Play finds it). `Infrastructure.Art.SteamArtCache` and `GogArtCache` read them; nothing is
> downloaded, so the *(opt-in)* online lookup in the publisher/version order below still does not exist. Epic, itch and
> other stores keep no image files: their games show the image the user chooses, or none. The detail: `08_UI` §Games ›
> Game detail, *The header's cover*.
> Game detail, *The header's cover*. *(beta.33: an Xbox game ships its own — `Infrastructure.Art.XboxArtCache` reads the
> `Square480x480Logo` (else `Square150x150Logo`) and the `SplashScreenImage` its `MicrosoftGame.config` names, inside
> the package root only, as a square cover and the banner; `IStoreArtCache.Find` takes the owning record rather than the
> id, because those pictures live in the install folder.)*
**Auto-import (FR-1.2):** Steam via `libraryfolders.vdf` → all `appmanifest_*.acf` except `SteamLibrarySource.KnownTools` (2026-09-22: Steamworks Common Redistributables, Borderless Gaming, Wallpaper Engine, SteamVR, the Proton and Steam Linux Runtime entries, Blender — tools Steam's manifests do not distinguish from games, and which became library rows the watcher recorded); GOG via `HKLM\SOFTWARE\WOW6432Node\GOG.com\Games\*`; Epic via `Manifests\*.item`; itch by receipt scan. Import presents a review checklist; nothing is launched, nothing is hooked on import.
**Auto-import (FR-1.2):** Steam via `libraryfolders.vdf` → all `appmanifest_*.acf` except `SteamLibrarySource.KnownTools` (2026-09-22: Steamworks Common Redistributables, Borderless Gaming, Wallpaper Engine, SteamVR, the Proton and Steam Linux Runtime entries, Blender — tools Steam's manifests do not distinguish from games, and which became library rows the watcher recorded); GOG via `HKLM\SOFTWARE\WOW6432Node\GOG.com\Games\*`; Epic via `Manifests\*.item`; itch by receipt scan; *(beta.33)* Xbox by each drive's `.GamingRoot` and each game's package files. Import presents a review checklist; nothing is launched, nothing is hooked on import.
> **Built 2026-09-14 (P4 PR-4).** `Application.Import.LibraryImporter` over four `IStoreLibrarySource` adapters in
> `Infrastructure.Import` — `SteamLibrarySource` (`libraryfolders.vdf` + `appmanifest_*.acf` through
@@ -363,6 +367,22 @@ engine compiled only, reads as not found. One Ren'Py install was measured.
> is fetched (CLAUDE.md rule 8's "opt-in store metadata" is the online lookup, which does not exist). First-run
> step 4 now points at File ▸ Import library… rather than saying "later build".
> **beta.33 (owner decisions D78/D79, `spike-notes` §25): the Xbox app's and the Microsoft Store's games.**
> `XboxLibrarySource` reads each ready fixed or removable drive's `.GamingRoot` (`GamingRoots`: `RGBX`, a count, UTF-16
> folder names relative to the drive), lists the `<games folder>\<Game>\Content\` folders that are GDK package roots
> (`GdkPackageFiles`: `MicrosoftGame.config` beside `appxmanifest.xml`, read with DTDs prohibited and a 1 MB cap), and
> keeps those whose package Windows says is installed for this user (`PackageFamilyNameFromId`, then
> `GetPackagesByPackageFamily`). The record: the store id is the package family name, the install directory is `Content`
> (the spelling the game's own process reports — never the `C:\Program Files\WindowsApps` junction, whose name carries
> the version), the launch key is the AUMID `<family name>!<Application Id>` that Play activates, the version is the
> package's. It names no executable, so `ExecutableLocator` ranks: the WinGDK or Win64 shipping binary over the stub the
> package launches, the Unity player over its crash handler, never `gamelaunchhelper.exe` (a runtime helper since
> beta.33), with the folder above `Content` as the install's name. **What cannot be read:** every game `.exe` under
> `Content` refuses `FILE_READ_DATA` to a process outside its package, so its PE header, version resource, imports and
> strings are not read — the architecture reads `unknown` (never "not x64", so nothing is turned off for it), no Unreal
> version is shown, and the Unity version still reads, from `UnityPlayer.dll`. A UWP app has no `MicrosoftGame.config`
> and is not listed (D78).
> **beta.19 (owner report 2026-10-12): a store's own pick can be a helper, and a launcher is not the game.** The owner's
> A Doll's Locket - Remake (itch 5085165, RPG Maker MZ) was imported as `Dolls Locket\notification_helper.exe` — NW.js's
> toast helper. The pick was **butler's verdict**, taken as is: butler stores a *filtered* verdict (the shallowest
+1 -1
View File
@@ -43,7 +43,7 @@ CREATE TABLE games (
exe_path TEXT NOT NULL UNIQUE, -- where the executable lives; rewritten by ExecutableRelocator when the
-- SAME bytes (exe_size_bytes, exe_mtime_ms) turn up under another drive
-- letter (2026-09-22), and by Change executable for a DIFFERENT binary
platform TEXT NOT NULL DEFAULT 'none', -- steam|gog|epic|itch|none
platform TEXT NOT NULL DEFAULT 'none', -- steam|gog|epic|itch|xbox|none (xbox since beta.33, D79; no CHECK constraint, so no migration)
store_id TEXT,
engine TEXT, engine_version TEXT,
-- (schema 0015, ALTERed last) engine_version_source TEXT: where engine_version came from — a
+10 -2
View File
@@ -38,7 +38,7 @@ WPF + **WPF UI (Wpf.Ui, Fluent)**. Shell = `ui:FluentWindow` with custom `ui:Tit
**NavigationView items:** Dashboard · Games · Compare · Logs — `Settings` lives in `FooterMenuItems`. Icons from `SymbolIcon` (Fluent System Icons; pick from the `SymbolRegular` enum — see 16 §Icons).
**Menu bar**
- **File:** Add game… · Import library (Steam / GOG / Epic / itch.io) · Export ▸ (Session CSV / Session JSON / Chart PNG) · Exit
- **File:** Add game… · Import library (Steam / GOG / Epic / itch.io / Xbox *— since beta.33*) · Export ▸ (Session CSV / Session JSON / Chart PNG) · Exit
- **Tools:** Agent status… · Update detection rules · Vulkan layer registration… · Open data folder · Database maintenance…
- **Help:** User guide (beta.12) · Check for updates · Report a bug… · ~~Documentation~~ Online documentation · Limitations · About FrameLedger (~~App / Developer / Third-party licenses tabs~~ — built beta.12 as *This app* / *Third-party licences* / *Legal documents*, below)
@@ -356,6 +356,13 @@ All screens are `Page`s registered with the navigation page provider and navigat
> surfaces' game page has artwork), `…TheArtworkBandFollowsAThemeSwitch` and `…TheGamePagesArtworkIsDrawn` with
> `AccessibilityTests.NoStyleOfAWpfUiControlLeavesOutItsTemplate` (the cover once took its place and drew nothing, a
> `ui:Image` style not based on WPF UI's; caught in a render before it shipped). The library's cards still have no image.
>
> **beta.33 (D79): an Xbox game's own pictures.** A game the Xbox app or the Microsoft Store installed ships its pictures
> in its package folder, and `MicrosoftGame.config` names them: the `Square480x480Logo` (else `Square150x150Logo`) is the
> cover, drawn **square** (150×150, `ArtCoverIsSquare`) so a logo is never cropped to a portrait, and the
> `SplashScreenImage` (1920×1080 on the owner's titles) is the banner. The square logo comes before a landscape header.
> Read from inside the package root only; the tooltip says *Artwork from the game's own files (Xbox app)*
> (`Art_Source_Xbox`). `GameArtTests.AnXboxGamesSquareLogoIsItsCoverDrawnSquareAndItsSplashTheBanner`.
> **Built 2026-09-14 (P3 PR-5): the grid, the detail page's header, the two rows, the hooking control and
> the Sessions tab.** Grid: `ui:CardAction` cards with platform / engine / hooking badges, sessions, playtime,
@@ -441,7 +448,8 @@ All screens are `Page`s registered with the navigation page provider and navigat
> what the game's files and its store say (`05_DETECTION` §What the files say about themselves): *Runs as* (64-bit
> (x64) · 32-bit (x86) · ARM64 · .NET, any CPU (runs as 64-bit) · …), *File version* and *Product version* (the
> executable's PE resource — for an Unreal title often the engine's), *Store* ("Steam build 20374416", "GOG version
> 1.2.3" — or *Version* when the user typed it), *Engine*, and *Ships with*, one line per capability file: "DLSS:
> 1.2.3", since beta.33 "Xbox version 1.3.5124.0" — or *Version* when the user typed it), *Engine*, and *Ships with*,
> one line per capability file: "DLSS:
> nvngx_dlss.dll 3.7.10.0", "XeSS: libxess.dll (no version)". A row the Agent has not read yet says so. The subtitle
> labels the store's version the same way and then drops the bare store name it would repeat. **An executable that
> cannot run as x64** (x86, 32-bit-preferring .NET, ARM) disables the hooking switch with `Hooking_NotX64_Format` under
+1 -1
View File
@@ -344,7 +344,7 @@ CI/CD with the native build (`release.yml` exists since P4 PR-5, 2026-09-14 —
- ~~PresentMon Service + API2 for a richer Tier 2~~ — **struck 2026-08-27**, and the shape hardened 2026-08-28: v1's ladder has two rungs and Tier 2 is not a measurement. What v2 may want is **a no-injection measurement at all** — which would restore two things at once: the FG oracle §S31 spent four attempts looking for, and `14_TESTING`'s Tier-1 accuracy cross-check, which is struck for the same reason (§G)
- **YouTube overlay export**: frametime/FPS graph as transparent PNG sequence for DaVinci Resolve benchmark videos (SkullMute workflow)
- CapFrameX-compatible CSV import/export
- Microsoft Store / Game Pass titles (packaged-app injection constraints)
- ~~Microsoft Store / Game Pass titles (packaged-app injection constraints)~~ *(struck 2026-11-03: GDK titles from the Xbox app and the Microsoft Store are imported, played and measured since beta.33, D77–D82, `spike-notes` §25; UWP apps stay out, refused with a reason of their own)*
- AFK segmentation via `GetLastInputInfo`
- GPU frame time via timestamp queries (needs care: injecting queries into the game's command lists is more invasive than anything in v1 — needs its own risk review)
- ~~Beta update channel;~~ ARM64 *(struck 2026-10-04: the beta channel shipped with P4 PR-5 — `update.channel`, Settings ▸ Updates; `13_CI_CD` §Branch & release policy)*
+14
View File
@@ -387,6 +387,20 @@ Implemented in `FrameLedger.Injector` and reached from managed code through a th
> appeal. A nested executable outside a recognised store layout is therefore
> still scanned narrowly; that residual is stated, not closed.
>
> **Amended 2026-11-03 (beta.33, `spike-notes` §25): a GDK package root is a boundary too, and `GamesInstalled`
> is one natively.** The Xbox app and the Microsoft Store install to `<games folder>\<Game>\Content\` under a
> folder the user names, which no string can bound — so for the executable the import picks there (an Unreal
> title's `Content\<Project>\Binaries\WinGDK\…-Shipping.exe`), check 4 walked `Binaries\WinGDK` alone, and an
> `EasyAntiCheat\` at `Content`'s root would have read clean: the residual above, on a whole store. The package
> marks its own root — `MicrosoftGame.config` beside `appxmanifest.xml`, both files — so **only when no string
> boundary matched**, the nearest folder at or above the executable's that holds both is the root (at most eight
> levels up, never a drive's root; `ResolveInstallRoot` and the managed `InstallRoot`). Not a blind walk up: a
> marker the package writes, measured as exactly one per package at `Content`'s root on the owner's 11 titles; and
> only ever a widening relative to the executable's folder — a Steam build carrying GDK files keeps its Steam root.
> The native list also gains `GamesInstalled\<X>`, which the managed one had since #17 and the native one never
> did; one case list (`tests/fixtures/install-roots/cases.txt`), read by both suites, holds the two resolvers
> together from now on.
>
> **Amended 2026-10-13: the root AND the executable's folder.** The root replaced the executable's folder, and
> that was half the answer. The walk reaches three levels below where it starts, and an Unreal executable is
> already three below its root, so a folder **beside** the executable is four: MEASURED on Wuthering Waves, whose
+1
View File
@@ -1917,6 +1917,7 @@ Each of these is referenced by an existing doc but specified nowhere.
| **Uninstall / data deletion** | One Velopack clause. No in-app "delete all my data", despite the privacy position | `12_BUILD`, `legal/PRIVACY_POLICY.md` |
| ~~**Cover art**~~ | ~~Appears in the schema, the data directory and the UI; nothing says where it comes from or the licence position on downloaded store art~~ **Answered 2026-10-14 (beta.23, owner decisions D60/D61):** from the user's own image (a copy in `covers\`) or what the Steam and GOG GALAXY apps already keep on this PC — nothing is downloaded, so no store art is redistributed or fetched; the art stays its owners' (`legal/TRADEMARKS.md`), the Privacy Policy 2.11 names the files read. `08_UI` §Games › Game detail. **Row closed** | `06_DATA_MODEL`, `05_DETECTION` |
| **The main line's .NET** *(added 2026-10-31, D73–D76)* | **When does the main line — the betas and the first release — leave .NET 10 LTS, and for what?** The alpha line (`12_BUILD` §The alpha line) builds the same source on .NET 11 to gather the evidence; it decides nothing by existing. What is known: .NET 11 is STS, supported 24 months to about 2028-11, no later than .NET 10 LTS (2028-11-14), so moving buys no support time; Microsoft's supported-OS list for .NET 11 has Windows 10 only in its LTSC and IoT editions, against NFR-8's Windows 10 22H2 floor; C# 15's unions and closed hierarchies would suit the tri-states and refusal reasons, but only once the main line compiles C# 15. **Decision table, written before the evidence:** move to .NET 11 only if (a) at least two alphas on the GA runtime pass the gate and an owner's run of a hooked title with no runtime-specific defect, (b) the owner accepts dropping NFR-8's floor to Windows 11 or ships knowingly unsupported on Windows 10, and (c) something .NET 11 brings is wanted — a measured gain or a language feature; otherwise stay on .NET 10 and take .NET 12 LTS (expected 2027-11) the same way, through the alpha line first | `12_BUILD`, `13_CI_CD`, `02_SPEC` NFR-8, CLAUDE.md pinned stack |
| **Xbox app / Microsoft Store titles** *(added 2026-11-03, beta.33, D77–D82)* | GDK titles are imported, played and measured since beta.33 (`spike-notes` §25: full trust, the user's token, the session's object namespace, the image path the `Content` folder's); what is NOT answered: **(1) title lists know Steam ids only (D81).** `blockedStoreIds` has no `store` value for a Microsoft Store product id or a package family name, and the guard has no reader for one, so an Xbox copy of a game listed there by its Steam id is matched by its executables, modules, files, drivers and services but not by that entry. Keying one would take a schema value (`additionalProperties: false` there is a safety control) and a reader under D31's rule — listed refuses, none is not applicable, unreadable refuses — fed by `MicrosoftGame.config`'s `StoreId`, which the import already reads. The owner chose not to, for now. **(2) A Vulkan GDK title is not measured:** the layer is enabled by `FRAMELEDGER_ENABLE_VK_LAYER=1`, which only a launch FrameLedger makes can set, and a package is started by Windows. **(3) A package that keeps write virtualization on** (all 11 measured turn it off) would put the Overlay's log in its `LocalCache`, out of the bug report's reach; capture itself never reads the log. **(4) Unmeasured:** a start from inside the Xbox app (GameLaunchHelper's parent there — the scan set's next process), any GDK title with anti-cheat, the ring from a packaged process (the owner's first hooked session) | `02_SPEC` §Out of scope, `05_DETECTION`, `19_SAFETY` check 3, `LIMITATIONS.md` |
| **Tier-2 mechanism** *(was: PresentMon distribution)* | **By what mechanism does a shipped build reach a no-injection MEASUREMENT?** Nothing names one. Since 2026-08-28 the ladder is two rungs and Tier 2 is explicitly not a measurement — duration, sensors and the reason — so this row is no longer about degraded fidelity but about whether that capability returns at all. **It now owns TWO casualties, not one:** the frame-generation oracle §S31 spent four attempts looking for, and `14_TESTING`'s Tier-1 accuracy cross-check, struck the same day because it required a second instrument measuring the same frames. **One mechanism would restore both**, which is the strongest argument for costing it. Constraints on any answer: `README`'s capture-tier table and its **safety** row *"always a way out"*, `legal/DISCLAIMER.md` §73 and `legal/EULA.md` §33; ETW needs elevation whatever the tool; and `15_ROADMAP` has no v2 fallback either | `README`, `legal/DISCLAIMER.md`, `legal/EULA.md`, `04_CAPTURE`, `14_TESTING`, `15_ROADMAP` |
---
+1
View File
@@ -48,3 +48,4 @@ Each section below lives in its own file under `docs/spike-notes/`, moved verbat
| §22 | The owner's runs of beta.24 and beta.25 on real hardware (2026-10-19) | [`spike-notes/22-owner-runs-2026-10-19.md`](spike-notes/22-owner-runs-2026-10-19.md) |
| §23 | The owner's runs of beta.26 on real hardware (2026-10-20) | [`spike-notes/23-owner-runs-2026-10-20.md`](spike-notes/23-owner-runs-2026-10-20.md) |
| §24 | The whole gate on .NET 11 RC3 — what the alpha line's SDK asks of the source (2026-10-31, beta.32, D73–D76) | [`spike-notes/24-dotnet11-probe.md`](spike-notes/24-dotnet11-probe.md) |
| §25 | Xbox app / Microsoft Store (GDK) titles — the layout, the launch chain, the image paths (2026-11-03, beta.33, D77–D82) | [`spike-notes/25-xbox-gdk.md`](spike-notes/25-xbox-gdk.md) |
+151
View File
@@ -0,0 +1,151 @@
## 25 · Xbox app / Microsoft Store (GDK) titles — the layout, the launch chain, the image paths *(2026-11-03, beta.33, owner decisions D77–D82)*
**Why this was measured.** The owner asked for the games the Xbox app and the Microsoft Store install (PC Game Pass
included) to be handled, evaluated and analysed. FrameLedger had no source for them — the import read Steam, GOG, Epic
and itch, and the owner's log of 2026-11-01 lists exactly those four — and `02_SPEC` put "Microsoft Store/UWP/Game Pass
titles (packaged-app injection constraints)" out of scope for v1 without any document saying what the constraints were.
What follows is read from the owner's own installs: first read-only (the layout), then a launch probe the owner allowed
(D77): each game started through its package with nothing of FrameLedger in it, its processes recorded, and closed by
its window.
**Where.** The dev box of §Environment (Windows 11 Pro build 29648, i7-14700KF, RTX 5080), the Agent there running
elevated (D34). Gaming Services and GamingServicesNet running; its drivers `gameflt.sys` and `xvdd.sys` running.
| Title | Package family name | Version | Engine | Executables in `Content` |
|---|---|---|---|---|
| A Game About Digging A Hole (on C:) | `rokapublish.AGameAboutDiggingAHole_6q4vfhsywtz4j` | 1.2.1.0 | Unreal, `Binaries\WinGDK` | `DiggingGame.exe` (233,984 bytes), `DiggingGame\Binaries\WinGDK\DiggingGame-WinGDK-Shipping.exe` (126.1 MB) |
| Ascend to ZERO | `FlywayGames.AscendtoZERO_sey8peye7nc36` | 1.2.1.0 | Unreal, `Binaries\WinGDK` | `AscendtoZERO.exe` (339,968), `MementoMori\Binaries\WinGDK\AscendtoZERO-WinGDK-Shipping.exe` (160.7 MB) |
| Valor Mortis | `LyricalGamesLLC.ValorMortis_72fag5ekhk96y` | 1.3.5124.0 | Unreal, `Binaries\Win64` | `ValorMortisMSG.exe` (297,984), `ValorMortis\Binaries\Win64\ValorMortisMSG-Win64-Shipping.exe` (184.1 MB) |
| FINAL FANTASY I–VI (Pixel Remaster) | `39EA002F.FF1DF_n746a19ndrrjg` … `FF6DF` | 1.2.1.0–1.2.3.0 | Unity IL2CPP | `FINAL FANTASY*.exe` (664,336 each), `UnityCrashHandler64.exe` |
| inKONBINI | `BeepJapan.inKONBINI_h2va14as5wpxj` | 1.0.209.0 | Unity, D3D12 Agility SDK | `inKONBINI.exe` (672,256), `UnityCrashHandler64.exe` |
| Microsoft Jewel | `Microsoft.MicrosoftJewel_8wekyb3d8bbwe` | 1.1.8131.0 | Unity, D3D12 Agility SDK | `Microsoft Jewel.exe` (239,936) |
Every one also has `gamelaunchhelper.exe` (100,808–113,096 bytes) at the root of `Content`.
### Read-only, before any launch
- **The layout.** Each drive the Xbox app installs to holds `.GamingRoot` at its root: the bytes `RGBX`, a 32-bit count,
then that many NUL-terminated UTF-16 folder names relative to the drive (C: `XboxGames`, 28 bytes; D: `xbox`, 18
bytes). Under each folder, one folder per game: `Content\` (the game's files), a `Shaders\` folder and GUID-named
package files beside it; `C:\XboxGames\GameSave` is not a game and has no `Content`.
- **The package's own description**, in `Content`: `MicrosoftGame.config` (the FINAL FANTASY titles spell it
`MicrosoftGame.Config`) — `Identity` Name/Publisher/Version, `ShellVisuals` (DefaultDisplayName,
Square480x480Logo 480×480, Square150x150Logo, StoreLogo, SplashScreenImage 1920×1080, BackgroundColor),
`ExecutableList` (the launch executable: the Unreal root stub, the Unity player), TitleId, StoreId,
`DesktopRegistration/ProcessorArchitecture` x64 — and `appxmanifest.xml`: one `Application` whose Executable is
`GameLaunchHelper.exe` with `EntryPoint="Windows.FullTrustApplication"`, `runFullTrust`, `appLicensing`,
`unvirtualizedResources`, and on all 11 `desktop6:FileSystemWriteVirtualization` and
`desktop6:RegistryWriteVirtualization` set to `disabled`. Exactly one `MicrosoftGame.config` per game, at the root of
`Content`; no reparse point anywhere inside `Content`; no `.sys` file and no anti-cheat folder in any tree; no
`Content` tree holds more than 2,633 entries in all (check 4's budget is 4,096 per walk). Each FINAL FANTASY title
ships `FINAL FANTASY*_Data\Plugins\x86_64\steam_api64.dll`.
- **Three spellings of one file.** Windows registers each package's InstallLocation as
`C:\Program Files\WindowsApps\<PackageFullName>` — a junction to `D:\WindowsApps\<PackageFullName>` (the D: games),
itself a junction to `D:\xbox\<Game>\Content\`; for the C: game, straight to `C:\XboxGames\<Game>\Content\`.
`D:\WindowsApps` cannot be listed by the user; a path through it can still be opened. .NET's
`Directory.ResolveLinkTarget` on the WindowsApps junction: access denied. A `FILE_READ_ATTRIBUTES` handle and
`GetFinalPathNameByHandleW` resolve the whole chain, unelevated:
`C:\Program Files\WindowsApps\LyricalGamesLLC.ValorMortis_1.3.5124.0_x64__72fag5ekhk96y\ValorMortis\Binaries\Win64\ValorMortisMSG-Win64-Shipping.exe`
→ `\\?\D:\xbox\Valor Mortis\Content\ValorMortis\Binaries\Win64\ValorMortisMSG-Win64-Shipping.exe`.
- **The executables refuse to be read or run by anything outside their package.** Every game `.exe` under `Content`
(the stubs, the shipping executables, the Unity players, `UnityCrashHandler64.exe`) answers `CreateFileW` with error 5
for `FILE_READ_DATA` and for `FILE_EXECUTE`, from a standard user's process, although its DACL grants Users read: its
first ACE is `(XA;;0x1200a9;;;BU;(WIN://SYSAPPID Contains "<family name>"))`, then `(A;;FR;;;BU)`, and
`READ_ATTRIBUTES` and `READ_CONTROL` work (size, times and security descriptor read). `gamelaunchhelper.exe` (which
carries an extra explicit Users ACE), every `.dll`, the images and the XML files read. What refuses — most likely the
Gaming Services file-system filter — is not established. Consequences: ~~no `CreateProcess` of a GDK game from outside
its package~~ *(corrected the same day by the run below: `CreateProcess` of one does start a process — never the game
in its package, so it is still not how FrameLedger starts one)*, and nothing of FrameLedger may need an executable's
bytes (its PE header, version resource, imports or strings) — `PeImports` already answers `unknown` for a file it
cannot open, without throwing.
- **Windows' own names for them.** `PackageFamilyNameFromId(Name, Publisher)` computes the family name;
`GetPackagesByPackageFamily` lists the installed full name; `GetPackagePathByFullName` answers the WindowsApps path —
all unelevated, documented `appmodel.h` calls. `<family name>!<the appxmanifest Application Id>` is exactly the
AppUserModelID Windows' Start menu lists for each of the 11 (`Get-StartApps`), e.g.
`LyricalGamesLLC.ValorMortis_72fag5ekhk96y!AppValorMortisShipping` and `39EA002F.FF1DF_n746a19ndrrjg!Game`.
### The probe (D77)
PowerShell with inline C#, from the scratchpad, as the standard user, with no FrameLedger hook enabled for any of these
titles (none is in the library). Six titles, one of each kind: A Game About Digging A Hole, Ascend to ZERO, Valor
Mortis, FINAL FANTASY, inKONBINI, Microsoft Jewel. For each:
1. `IApplicationActivationManager::ActivateApplication(<AUMID>, null, AO_NONE)` — the pid it returns, its HRESULT.
2. Every 100 ms for 30 s, each process that was not there before: pid, parent pid, image name, creation time,
`QueryFullProcessImageNameW` (what the watcher and the guard's `ImageDirectory` read) **and**
`GetModuleFileNameExW(handle, NULL)` (the loader's main-module path — what `TargetResolver` compares through
`MainModule.FileName`), `GetPackageFullName`, `TokenIsAppContainer`, the integrity level, elevation,
`GetProcessMitigationPolicy` (signature, dynamic code, user shadow stack, control flow guard, image load), whether
`OpenProcess(PROCESS_QUERY_LIMITED_INFORMATION | PROCESS_VM_READ)` — the guard's module-scan rights — opens it, and
the first poll at which `dxgi.dll`, `d3d11.dll`, `d3d12.dll`, `D3D12Core.dll` and `vulkan-1.dll` are in its module
list.
3. The ancestors of the game's process up to the first name on the guard's launcher list, each with the same
openability test, and every chain member's module names checked against the rules' fuzzy name fragments.
4. `CloseMainWindow` on the game's window, then up to 20 s for it to exit. A game that stays open is left open and
named to the owner, never killed.
Plus, once each: `explorer.exe shell:AppsFolder\<AUMID>` for FINAL FANTASY (the command Play will use), and one
`CreateProcess` of `FINAL FANTASY.exe` by its path (expected: error 5 — if it starts, it is closed the same way).
### The decision table, written before the run
| Measured | Outcome | Then |
|---|---|---|
| The game process's image path (`QueryFullProcessImageNameW`) | `<root>\<Game>\Content\…`, the final path | the library entry is that path, and the watcher matches it as today |
| | `C:\Program Files\WindowsApps\<Full>\…` | a path under a `WindowsApps` segment is resolved with a read-attributes handle and `GetFinalPathNameByHandleW`, in the watcher's key and in the guard's `ImageDirectory` — only such paths, so no existing entry's key moves |
| The loader's main-module path against the image path | the same | `TargetResolver` moves to `QueryFullProcessImageNameW` all the same: one source of the image path for the watcher, the resolver and the guard |
| | different | that move is what makes a hooked session of a packaged game possible at all |
| The chain | GameLaunchHelper → the game (→ the shipping executable), parents alive | nothing to add: the entry is the process that presents, and the watcher sees it |
| | GameLaunchHelper exits first | the same — the watcher matches by path; no election is needed |
| GameLaunchHelper's parent | `svchost.exe` or `explorer.exe` | the guard's scan set stops there; the launcher list is unchanged |
| | `GamingServices.exe` or another SYSTEM process | it joins the hardcoded launcher list, with this row as the reason — else an unelevated Agent's scan cannot open it and refuses every session |
| A chain member the guard's rights cannot open | none | nothing to add |
| | one | named here; a platform process → the launcher list, anything else → the owner, mid-train |
| A chain member's module with a fuzzy fragment in its name | none | nothing to add |
| | one | recorded with its signature kind; the guard refuses (fail closed) and the owner decides — never relaxed here |
| The token | full trust, the user, medium integrity | the Tier-1 path; a token that is not an AppContainer uses the session's object namespace, so the ring and `Local\FrameLedger.Tolerate.<pid>` work unchanged (the ring itself is first seen in the owner's hooked session) |
| | an AppContainer | refused with a reason of its own (D78) |
| Mitigations | none of: signed-only images, prohibited dynamic code, strict shadow stack, strict CFG | inject |
| | any of them | refused before injecting, the policy named (the refusal is built either way: today each ends as a failed injection, no hooks, or a crash risk) |
| The graphics runtime mapped before a 1 Hz watcher can see the process | yes | the session is `late_attach`, as for a game Steam starts; `dxgiPresentsBeforeHook` says how much |
| `CreateProcess` of a game executable by path | error 5 | D80 stands: Play activates the package in both modes |
### What the run found *(2026-11-03, 03:57–04:09 UTC)*
Every activation answered `S_OK` with the pid of `gamelaunchhelper.exe`. The chain, each time: `gamelaunchhelper.exe`
(in the package; its parent the activating process) → `gamingservicesui.exe` (Gaming Services' own UI, no package,
appearing 0.1–0.8 s after the press and gone again) → `XboxPcTray.exe` (the Xbox app's tray, when not already running)
→ the package's launch executable 6.2–14.4 s after the press → for Unreal, the shipping executable 0.25–0.37 s later as
its child.
`gamelaunchhelper.exe` had exited before the 30 s were up in every run, while the game ran on.
| Title | Launch executable at | Process that presents | Graphics runtime mapped |
|---|---|---|---|
| A Game About Digging A Hole | `DiggingGame.exe` +14.4 s | `DiggingGame-WinGDK-Shipping.exe` +14.7 s | `dxgi` + `opengl32` at its first poll, `d3d11` 2.4 s later |
| Ascend to ZERO | `AscendtoZERO.exe` +8.7 s | `AscendtoZERO-WinGDK-Shipping.exe` +8.9 s | `dxgi` + `opengl32` at once, `d3d12` + `D3D12Core` 2.7 s later |
| Valor Mortis | `ValorMortisMSG.exe` +6.8 s | `ValorMortisMSG-Win64-Shipping.exe` +7.2 s | `dxgi` + `opengl32` at once, `d3d12` + `D3D12Core` 3.1 s later, `d3d11` 3.7 s |
| FINAL FANTASY | `FINAL FANTASY.exe` +8.8 s | the same (+ `UnityCrashHandler64.exe`) | `opengl32` 0.4 s, `d3d11` + `dxgi` 1.2 s |
| inKONBINI | `inKONBINI.exe` +6.8 s | the same (+ `UnityCrashHandler64.exe`) | `dxgi` + `d3d11` + `opengl32` at its first poll |
| Microsoft Jewel | `Microsoft Jewel.exe` +6.6 s | the same (+ six `msedgewebview2.exe` children in its package) | `dxgi` + `d3d11` at once, `d3d12` + `D3D12Core` 0.6 s later |
Against the table above:
| Measured | Outcome | So |
|---|---|---|
| The game process's image path | **`<root>\<Game>\Content\…`** for all six, the C: game included (`C:\XboxGames\…\Content\…`) | the entry is that path; the watcher matches as today |
| The loader's main-module path | **the same string** as the image path, for every process of every chain | no mismatch on these titles; `TargetResolver` still moves to `QueryFullProcessImageNameW` (one source) |
| The chain | GameLaunchHelper → the game (→ the shipping executable); GameLaunchHelper gone before the game is | nothing to add: the watcher matches the entry by path |
| GameLaunchHelper's parent | the activating process: `pwsh.exe` (the probe's `ActivateApplication`), `explorer.exe` (`explorer.exe shell:AppsFolder\<AUMID>`), `dllhost.exe` (below). From the Xbox app itself: not measured | started as Play starts it, the scan set stops at `explorer.exe`; the launcher list is unchanged |
| Chain members the guard's rights cannot open | **none**: every process of every chain — GameLaunchHelper while it lived, the stubs, the shipping executables, the Unity players and crash handlers, Jewel's WebView2 children (two of them at low and untrusted integrity) — opened with `QUERY_LIMITED_INFORMATION \| VM_READ` as the standard user | nothing to add |
| Fuzzy-fragment module names in a chain member | **none** (the Unreal games load `xgameruntime.dll`, `XCurl.dll`, `libHttpClient.GDK.dll`, `GameChat2.dll`, `gameplatformservices.dll`, `gamingservicesproxy_17.dll`, `XblAuthManagerProxy.dll`) | nothing to add |
| The token | every game process: in its package, **not an AppContainer**, medium integrity | the Tier-1 path; the session's object namespace |
| Mitigations | none of the four on any game process: signature `0x0`, dynamic code `0x0`, user shadow stack `0x100` (only `CetDynamicApisOutOfProcOnly`), CFG `0x0`/`0x1` (no strict mode), image load `0x0`. Jewel's WebView2 sandboxes carry signed-only `0x5` and dynamic code `0x1` — children, never a target | inject; the `TargetMitigation` refusal is built for the titles that do |
| The graphics runtime before a 1 Hz watcher sees the process | the Unreal shipping executables import `dxgi.dll` statically and create their D3D device 2.4–3.7 s later; the Unity players have it within 0.1–1.2 s | an attach within the watcher's second is before the Unreal device and around the Unity one: `late_attach`, as for a game Steam starts |
| `CreateProcess` by path | **not error 5.** `FINAL FANTASY.exe` (the package's launch executable): Windows started **`gamelaunchhelper.exe`, outside the package, in its place** (that process's image path and main module both `gamelaunchhelper.exe`), which activated the package — a second, packaged `gamelaunchhelper.exe` (its parent `dllhost.exe`) started `FINAL FANTASY.exe` 6.2 s after the press; the process the caller holds is never the game, and the game is not its descendant. `DiggingGame-WinGDK-Shipping.exe` (not a launch executable): ran **as itself, outside its package** (`GetPackageFullName`: no package), its window up, until closed | D80 stands on two measured grounds instead of the one assumed: a start by path either hands itself to the package within seconds (an early exit the crash safety counts, and a launch whose game it never sees) or runs the game outside its package — which FrameLedger must never cause. The Agent refuses to start an executable under a GDK package root |
**Closing.** Five of the six closed on `CloseMainWindow`; Valor Mortis' window went at once and its two processes
about 40 s later, by themselves. Microsoft Jewel ignored it and was left open for the owner, as agreed.
**Not measured:** a start from inside the Xbox app (GameLaunchHelper's parent there); a package that keeps write
virtualization on (all 11 turn it off), so where the Overlay's log would land in one; any GDK title with anti-cheat;
any Vulkan GDK title; the ring from a packaged process (first seen in the owner's hooked session).
+2 -2
View File
@@ -3,8 +3,8 @@
## 1. Add the game
- **File ▸ Add game…** — pick the game's `.exe` file.
- **File ▸ Import library…** — FrameLedger lists the games installed through Steam, GOG, Epic and itch.io, and you
tick the ones to add.
- **File ▸ Import library…** — FrameLedger lists the games installed through Steam, GOG, Epic, itch.io and the Xbox app
(or the Microsoft Store — PC Game Pass games included), and you tick the ones to add.
Every game is added with **hooking off**.
+2 -1
View File
@@ -12,7 +12,8 @@ nothing is uploaded. The only network requests are the update check and the upda
Your game library; your sessions — frame times when a game was measured, the statistics, your PC's sensors, the game's
own memory use, how the game's window was shown; a short description of your hardware for each session; your tags and
notes; your settings; and, in the `covers` folder, a copy of each picture you chose for a game. The pictures the Steam and
GOG GALAXY apps keep for your games are shown from where those apps keep them, never copied. The
GOG GALAXY apps keep for your games, and those an Xbox game ships in its own folder, are shown from where they are, never
copied. The
[Privacy Policy](../legal/PRIVACY_POLICY.md) lists all of it.
## How much is kept
+3 -3
View File
@@ -27,7 +27,7 @@ stopped, hooking turned off — each with one button that only says you have rea
| Menu | Item | What it does |
|---|---|---|
| **File** | **Add game…** | Pick a game's `.exe` file. It is added with hooking off, and its page opens. |
| | **Import library…** | A checklist of the games installed through Steam, GOG Galaxy, Epic and itch.io. |
| | **Import library…** | A checklist of the games installed through Steam, GOG Galaxy, Epic, itch.io and the Xbox app (or the Microsoft Store). |
| | **Export** ▸ **Session CSV** · **Session JSON** · **Chart PNG** | Saves the session you last selected or opened. Read [Your data](05-your-data.md) before you share a file. |
| | **Exit** | Quits FrameLedger, even when *Minimize to tray on close* is on. |
| **Tools** | **Agent status…** | Opens the Dashboard, where the agent's card is. |
@@ -71,8 +71,8 @@ stopped, hooking turned off — each with one button that only says you have rea
## A game's page
- **At the top:** the game's picture — a banner and its cover, from the Steam or GOG GALAXY app on your PC or the image
you chose — in a band that takes the picture's colour; then the name, publisher, version, store and engine, the `.exe`
- **At the top:** the game's picture — a banner and its cover, from the Steam or GOG GALAXY app on your PC, the logo and
splash image an Xbox game ships in its own folder, or the image you chose — in a band that takes the picture's colour; then the name, publisher, version, store and engine, the `.exe`
path, the last session, the last measured session's frame rate and its ray-tracing chips. A game with no picture shows
none (**Settings ▸ Games** turns the picture and its colour off). **Play** starts the game: through the store that
installed it, or directly — **Settings ▸ Games ▸ Play button** chooses. **Edit…** changes the name, publisher, version
+1 -1
View File
@@ -48,7 +48,7 @@ The link under them, *Read what the hook does and does not do*, opens the safety
| Setting | What it does | Default |
|---|---|---|
| **Show game artwork** | A game's page shows a picture of the game: the image you chose for it (**Edit…**), or else the cover and banner the Steam or GOG GALAXY app already keeps on your PC. Nothing is downloaded; a game from another store shows a picture only once you choose one. | On |
| **Show game artwork** | A game's page shows a picture of the game: the image you chose for it (**Edit…**), or else the cover and banner the Steam or GOG GALAXY app already keeps on your PC, or the logo and splash image an Xbox game ships in its own folder. Nothing is downloaded; a game from another store shows a picture only once you choose one. | On |
| **Colour the game page from its artwork** | The band at the top of a game's page takes the picture's main colour — never so strongly that a text on it gets hard to read. Off, the band keeps the plain card colour. | On |
| **Play button** | What **Play** does, on a game's page and on each game in the library. *Through the store*: Steam or the Epic Games Launcher starts the game, GOG GALAXY runs it, and the itch app asks which copy to launch — each store's app does what it does when you start a game from it. A game no store installed, and a GOG game without GOG GALAXY, is started by FrameLedger instead; so is every game while FrameLedger itself runs as administrator, so that the game does not. *Start directly*: FrameLedger's agent starts the game, recorded from its first frame, with your standard rights; it does not start a game whose recording is off, or one that asks to run as administrator. Some Steam games hand themselves to Steam when started directly — the game Steam then starts is recorded — and a few will not start outside Steam at all: start those through the store. | Through the store |
+4 -4
View File
@@ -1,6 +1,6 @@
# FrameLedger — Privacy Policy
**Version:** 2.12 · **Effective:** {{RELEASE_DATE}}
**Version:** 2.13 · **Effective:** {{RELEASE_DATE}}
**Short version: everything stays on your PC. FrameLedger has no accounts, no telemetry, no analytics, and never uploads your data anywhere.**
@@ -9,7 +9,7 @@
Stored in `%LOCALAPPDATA%\FrameLedger` on your device:
- Your game library entries (names, executable paths, metadata you or the app filled in, and whether each one is recorded).
- Images you choose for a game (Edit…), copied into the `covers` folder; choosing the store's image again, or removing the game together with its sessions, deletes the copy. Artwork a store's app keeps on your PC is shown from where it is and not copied.
- Images you choose for a game (Edit…), copied into the `covers` folder; choosing the store's image again, or removing the game together with its sessions, deletes the copy. Artwork a store's app keeps on your PC, or a game ships in its own folder, is shown from where it is and not copied.
- Performance sessions: frame timing series, computed statistics, hardware sensor series (temperatures, load, power, memory usage, and the graphics card's clock speeds, fan speed, memory temperature and whether its power limit or heat held it back), the game's own memory use (its dedicated and shared video memory, private working set, working set and commit, once a second), session duration, crash flags, the graphics driver's settings the game ran under (NVIDIA only), how the game's window was shown (full-screen, borderless or windowed, for how long, its size and the monitor's), tags and notes you write.
- A hardware snapshot per session (CPU/GPU model, driver version, RAM size, OS build, display mode) used for the "what changed between sessions" feature.
- App settings, logs (rotated daily — the app keeps 7 days, the capture agent 14 — including the logs written by the component loaded into games), and, after a crash of the app itself, crash dump files.
@@ -30,7 +30,7 @@ There is no other request. In particular, the anti-cheat safety list and the det
GitHub's own privacy practices apply to requests it receives: <https://docs.github.com/privacy>.
Pressing Play hands the game to its store's app on your PC, which may connect to its store as it does whenever you start a game from it; FrameLedger itself connects to nothing.
Pressing Play hands the game to its store's app on your PC — or, for a game the Xbox app or the Microsoft Store installed, asks Windows to start it as its Start-menu tile does — which may connect to its store as it does whenever you start a game from it; FrameLedger itself connects to nothing.
## 3. Bug reports — always manual
@@ -42,7 +42,7 @@ An exported session (CSV or JSON) and a bug report can contain your games' names
## 4. What the app can technically observe
To do its job, FrameLedger observes: which of *your tracked* executables — the entries in your library whose recording is on — are running, and their process trees; the parameters your games pass to the graphics APIs it intercepts (presentation, upscaling, ray tracing, pipeline creation); the memory use of a tracked game's process — its dedicated and shared video memory, from Windows' GPU performance counters, and its working sets and commit, from Windows' process-memory information, for which a game it does not inject into is opened with the least access Windows offers and closed again (never its memory's content); loaded module names of a game being captured, the version information of its upscaling and frame-generation libraries, and whether each was loaded from the game's folder or from the graphics driver's own copy (for detection and for the anti-cheat safety check); the names of the files in each library game's install folder, the version information of its executable and of the upscaling libraries it ships, the content of its executable file (the markers of the engine and of the graphics libraries it carries, the libraries it imports, and the engine build name an Unreal Engine game carries), the version marks an engine keeps in its own files (Unity's player library and the header of its data file, the header of a Godot data pack, an RPG Maker game's title, core script and Game.ini, the library Game.ini names, and the version file of a Ren'Py game's engine), and the store files that name it (Steam's and GOG's, on your disk) — to detect its engine, its engine version and its features and to check it for anti-cheat before any injection is possible; the lists of installed games that the Steam, GOG GALAXY, Epic Games and itch apps keep on your disk, and where GOG GALAXY is installed — read when you import your library and when you press Play, to find the store that installed a game and hand the game to that store's app — Steam's and GOG GALAXY's also when you open a game's page, to find the artwork their apps keep for it; the cover and banner images that the Steam and GOG GALAXY apps keep on your disk for a game in your library — read to show them on its page, never copied or sent anywhere; the size, position and state of a tracked game's window and the monitor it is on, read from Windows and not from the game, and — for a game FrameLedger injects into — whether the game asked for exclusive full-screen; the NVIDIA driver's settings for your tracked executables (read only: the DLSS and frame-generation overrides the NVIDIA App set); hardware sensor values from your graphics driver's own libraries; how busy the processor is and how much memory is in use, from Windows' own counters; the crash reports Windows keeps in its Application log about a tracked game's executable while it ran (to tell a crash from an ordinary exit — the reports are read, never sent anywhere); and the names of the programs a tracked game starts, so that a game's own crash reporter is recognised.
To do its job, FrameLedger observes: which of *your tracked* executables — the entries in your library whose recording is on — are running, and their process trees; whether a game you enabled hooking for runs in an app container, and which of Windows' code-protection settings it runs under (for example, accepting only Microsoft-signed code), read from Windows before any injection; the parameters your games pass to the graphics APIs it intercepts (presentation, upscaling, ray tracing, pipeline creation); the memory use of a tracked game's process — its dedicated and shared video memory, from Windows' GPU performance counters, and its working sets and commit, from Windows' process-memory information, for which a game it does not inject into is opened with the least access Windows offers and closed again (never its memory's content); loaded module names of a game being captured, the version information of its upscaling and frame-generation libraries, and whether each was loaded from the game's folder or from the graphics driver's own copy (for detection and for the anti-cheat safety check); the names of the files in each library game's install folder, the version information of its executable and of the upscaling libraries it ships, the content of its executable file (the markers of the engine and of the graphics libraries it carries, the libraries it imports, and the engine build name an Unreal Engine game carries), the version marks an engine keeps in its own files (Unity's player library and the header of its data file, the header of a Godot data pack, an RPG Maker game's title, core script and Game.ini, the library Game.ini names, and the version file of a Ren'Py game's engine), and the store files that name it (Steam's and GOG's, on your disk) and, for a game the Xbox app or the Microsoft Store installed, the package files in its install folder that describe it (`MicrosoftGame.config` and `appxmanifest.xml`) — to detect its engine, its engine version and its features and to check it for anti-cheat before any injection is possible; the lists of installed games that the Steam, GOG GALAXY, Epic Games and itch apps keep on your disk, and where GOG GALAXY is installed, the folders the Xbox app installs games into on each drive (named by the `.GamingRoot` file at the drive's root) with each game's package files, and Windows' answer to whether that game's package is installed for you — read when you import your library and when you press Play, to find the store that installed a game and hand the game to that store's app — Steam's and GOG GALAXY's also when you open a game's page, to find the artwork their apps keep for it; the cover and banner images that the Steam and GOG GALAXY apps keep on your disk for a game in your library and the logo and splash-screen images a game from the Xbox app ships in its own folder — read to show them on its page, never copied or sent anywhere; the size, position and state of a tracked game's window and the monitor it is on, read from Windows and not from the game, and — for a game FrameLedger injects into — whether the game asked for exclusive full-screen; the NVIDIA driver's settings for your tracked executables (read only: the DLSS and frame-generation overrides the NVIDIA App set); hardware sensor values from your graphics driver's own libraries; how busy the processor is and how much memory is in use, from Windows' own counters; the crash reports Windows keeps in its Application log about a tracked game's executable while it ran (to tell a crash from an ordinary exit — the reports are read, never sent anywhere); and the names of the programs a tracked game starts, so that a game's own crash reporter is recognised.
It does **not** read game memory outside those API parameters, and does not read game saves, chat, input content, network traffic, or anything unrelated to performance measurement. It records only for programs you added to your library and did not switch recording off for — a program whose recording is off is not watched at all — and injects only into games you individually enabled.
+4 -2
View File
@@ -7,7 +7,8 @@ documents the app asks you to accept.
## Other companies' names
Microsoft, Windows, DirectX, Direct3D and DXGI are trademarks of Microsoft Corporation. NVIDIA, GeForce, RTX, DLSS,
Microsoft, Windows, DirectX, Direct3D, DXGI, Xbox, Xbox Game Pass, PC Game Pass and Microsoft Store are trademarks of
Microsoft Corporation. NVIDIA, GeForce, RTX, DLSS,
Reflex, NVAPI and Streamline are trademarks of NVIDIA Corporation. AMD, Radeon, FSR and FidelityFX are trademarks of
Advanced Micro Devices, Inc. Intel, Arc and XeSS are trademarks of Intel Corporation. Vulkan is a registered trademark
of the Khronos Group Inc.; OpenGL is a registered trademark of Hewlett Packard Enterprise, used under licence by the
@@ -29,7 +30,8 @@ companies, by any game's developer or publisher, or by any anti-cheat vendor, an
not a benchmark claim and not a recommendation.
- **A game's artwork belongs to its owners.** FrameLedger ships none and downloads none: a game's page shows the image you
chose for it, or the cover and banner the Steam or GOG GALAXY app already keeps on your PC, read from where that app
keeps it and never copied (since 0.1.0-beta.23).
keeps it and never copied (since 0.1.0-beta.23) — or, for a game the Xbox app installed, the logo and splash image the
game ships in its own folder, read from there in the same way (since 0.1.0-beta.33).
## The name FrameLedger
+9 -1
View File
@@ -42,7 +42,7 @@
"level, which made it a check that could not fire."
],
"schemaVersion": 2,
"rulesVersion": "2026.10.4",
"rulesVersion": "2026.11.1",
"engines": [
{
@@ -146,6 +146,14 @@
],
"platforms": [
{
"id": "xbox",
"name": "Xbox",
"signals": { "all": [
{ "type": "root_file", "value": "MicrosoftGame.config" },
{ "type": "root_file", "value": "appxmanifest.xml" }
] }
},
{
"id": "steam",
"name": "Steam",
+3 -2
View File
@@ -120,7 +120,7 @@
},
"signalType": {
"$comment": "Closed enum. `path_contains` is used by the seed (platforms/steam) but is ABSENT from the 05_DETECTION signal-type list, and `strings_regex` is used as a version extractor but is likewise absent - 05_DETECTION needs the same edit as this schema.",
"$comment": "Closed enum. `path_contains` is used by the seed (platforms/steam) but is ABSENT from the 05_DETECTION signal-type list, and `strings_regex` is used as a version extractor but is likewise absent - 05_DETECTION needs the same edit as this schema. `root_file` (beta.33, platforms/xbox): an exact file name directly in the install root, answered from that one folder's listing, so a deep walk that ran short cannot make its miss Unknown.",
"enum": [
"file_exists",
"dir_exists",
@@ -129,7 +129,8 @@
"pe_company_contains",
"pe_product_contains",
"strings_contains",
"manifest_field"
"manifest_field",
"root_file"
]
},
+7 -3
View File
@@ -463,12 +463,14 @@ public partial class App : System.Windows.Application
/// <summary>FR-1.2's library import (P4 PR-4): the stores, the executable guess, the importer over the games port, the review checklist behind a port.</summary>
private static void AddImport(IServiceCollection services)
{
// FR-1.2's library import (P4 PR-4): the four stores read from their own local files and keys, the executable
// guess for the two that name none, the importer over the games port, the review checklist behind a port.
// FR-1.2's library import (P4 PR-4): the stores read from their own local files and keys (five since beta.33), the
// executable guess for those that name none, the importer over the games port, the review checklist behind a port.
services.AddSingleton<IStoreLibrarySource>(static _ => new SteamLibrarySource());
services.AddSingleton<IStoreLibrarySource>(static _ => new GogLibrarySource());
services.AddSingleton<IStoreLibrarySource>(static _ => new EpicLibrarySource());
services.AddSingleton<IStoreLibrarySource>(static _ => new ItchLibrarySource(log: static line => Serilog.Log.Information("{Line}", line)));
// beta.33 (D79): the Xbox app's and the Microsoft Store's games, from the drives' .GamingRoot folders and each package's own files.
services.AddSingleton<IStoreLibrarySource>(static _ => new XboxLibrarySource());
services.AddSingleton<IExecutableLocator, ExecutableLocator>();
// beta.21 (D59): Play reads the same records to find the store that installed a game, and GOG GALAXY's program.
services.AddSingleton<Application.Play.IGogGalaxyLocator>(static _ => new GogGalaxyLocator());
@@ -491,9 +493,11 @@ public partial class App : System.Windows.Application
services.AddSingleton<ImportLibraryFlow>();
// beta.23 (owner decisions D60/D61): a game's artwork — the image the user chose (kept in the data folder's covers),
// else what the Steam and GOG GALAXY apps keep on this PC, found through the same store records Play reads.
// else what the Steam and GOG GALAXY apps keep on this PC (and, since beta.33, what an Xbox game ships in its own
// package folder), found through the same store records Play reads.
services.AddSingleton<Application.Art.IStoreArtCache>(static _ => new SteamArtCache());
services.AddSingleton<Application.Art.IStoreArtCache>(static _ => new GogArtCache());
services.AddSingleton<Application.Art.IStoreArtCache>(static _ => new XboxArtCache());
services.AddSingleton(static sp => new StoreRecordsReader(sp.GetServices<IStoreLibrarySource>()));
services.AddSingleton(static sp => new GameArt(
sp.GetRequiredService<Application.Settings.RegisteredSettings>(),
@@ -81,6 +81,11 @@
<Setter Property="Width" Value="230" />
<Setter Property="Height" Value="107" />
</DataTrigger>
<!-- An Xbox game's square logo (beta.33): whole, never cropped to a portrait. -->
<DataTrigger Binding="{Binding ViewModel.ArtCoverIsSquare}" Value="True">
<Setter Property="Width" Value="150" />
<Setter Property="Height" Value="150" />
</DataTrigger>
</Style.Triggers>
</Style>
</ui:Image.Style>
+6 -3
View File
@@ -313,9 +313,10 @@ public static class Formats
};
/// <summary>
/// <c>games.game_version</c> said as what it is (beta.8): a store import writes a Steam build id or a GOG / Epic
/// version string, and a bare "20374416" in the subtitle said nothing. Labelled with the store when a store wrote it
/// (<paramref name="detected"/>); a version the user typed is shown as typed. Null when there is none.
/// <c>games.game_version</c> said as what it is (beta.8): a store import writes a Steam build id, a GOG / Epic
/// version string or an Xbox package's version (beta.33), and a bare "20374416" in the subtitle said nothing.
/// Labelled with the store when a store wrote it (<paramref name="detected"/>); a version the user typed is shown as
/// typed. Null when there is none.
/// </summary>
public static string? StoreVersion(string? platform, string? version, bool detected)
{
@@ -329,6 +330,7 @@ public static class Formats
"steam" => Strings.Store_Steam_Format,
"gog" => Strings.Store_Gog_Format,
"epic" => Strings.Store_Epic_Format,
"xbox" => Strings.Store_Xbox_Format,
_ => null,
};
return format is null ? version : string.Format(CultureInfo.CurrentCulture, format, version);
@@ -393,6 +395,7 @@ public static class Formats
"gog" => "GOG",
"epic" => "Epic Games",
"itch" => "itch.io",
"xbox" => "Xbox",
_ => string.Empty,
};
+17 -6
View File
@@ -80,13 +80,21 @@ public sealed class GameArt
string? platform = null;
if (StoreRecords.Owning(game.Fingerprint.ExePath, game.StoreId, records) is { } record && _caches.TryGetValue(record.Platform, out IStoreArtCache? cache))
{
files = cache.Find(record.StoreId);
files = cache.Find(record);
platform = record.Platform;
}
// The cover slot: the user's image, else the store's portrait cover, else its landscape header.
// The cover slot: the user's image, else the store's portrait cover, else its square logo (an Xbox game's, beta.33),
// else its landscape header.
BitmapSource? storeCover = Decode(files.Cover, 0, 450);
bool landscape = false;
bool square = false;
if (storeCover is null && Decode(files.Square, 0, 300) is { } logo)
{
storeCover = logo;
square = true;
}
if (storeCover is null && Decode(files.Header, 460, 0) is { } header)
{
storeCover = header;
@@ -102,10 +110,13 @@ public sealed class GameArt
}
Color? colour = tint ? DominantOf(cover ?? hero!) : null;
string source = own is not null ? Strings.Art_Source_Yours
: string.Equals(platform, "gog", StringComparison.Ordinal) ? Strings.Art_Source_Gog
: Strings.Art_Source_Steam;
return new GameArtView(cover, own is not null, own is null && landscape, storeCover, hero, colour, source);
string source = own is not null ? Strings.Art_Source_Yours : platform switch
{
"gog" => Strings.Art_Source_Gog,
"xbox" => Strings.Art_Source_Xbox,
_ => Strings.Art_Source_Steam,
};
return new GameArtView(cover, own is not null, own is null && landscape, storeCover, hero, colour, source, own is null && square);
}
private async Task<IReadOnlyList<StoreGame>> RecordsAsync()
+4 -3
View File
@@ -7,7 +7,8 @@ namespace FrameLedger.App.Services;
/// <summary>
/// A game's artwork as its page shows it (beta.23, D60): the cover slot's image (the user's own, or the store's portrait
/// cover, or its landscape header), the store's own cover for the edit dialog's "use the store's image", the banner, the
/// band's colour (null: untinted), and where the images came from, for the tooltip.
/// cover, or — beta.33 — an Xbox game's square logo, or its landscape header), the store's own cover for the edit dialog's
/// "use the store's image", the banner, the band's colour (null: untinted), and where the images came from, for the tooltip.
/// </summary>
public sealed record GameArtView(ImageSource? Cover, bool CoverIsOwn, bool CoverIsLandscape, ImageSource? StoreCover, ImageSource? Hero, Color? Tint, string Source);
public sealed record GameArtView(ImageSource? Cover, bool CoverIsOwn, bool CoverIsLandscape, ImageSource? StoreCover, ImageSource? Hero, Color? Tint, string Source,
bool CoverIsSquare = false);
+6
View File
@@ -93,6 +93,7 @@ public static class Strings
nameof(Art_ImportFailed),
nameof(Art_Source_Gog),
nameof(Art_Source_Steam),
nameof(Art_Source_Xbox),
nameof(Art_Source_Yours),
nameof(Blocked_Directory_Format),
nameof(Blocked_Executable_Format),
@@ -983,6 +984,7 @@ public static class Strings
nameof(Store_Epic_Format),
nameof(Store_Gog_Format),
nameof(Store_Steam_Format),
nameof(Store_Xbox_Format),
nameof(Summary_Annotations_Header),
nameof(Summary_Crash_Body),
nameof(Summary_Crash_Title),
@@ -1314,6 +1316,8 @@ public static class Strings
public static string Art_Source_Steam => ResourceManager.GetString(nameof(Art_Source_Steam), Culture) ?? nameof(Art_Source_Steam);
public static string Art_Source_Xbox => ResourceManager.GetString(nameof(Art_Source_Xbox), Culture) ?? nameof(Art_Source_Xbox);
public static string Art_Source_Yours => ResourceManager.GetString(nameof(Art_Source_Yours), Culture) ?? nameof(Art_Source_Yours);
public static string Blocked_Directory_Format => ResourceManager.GetString(nameof(Blocked_Directory_Format), Culture) ?? nameof(Blocked_Directory_Format);
@@ -3094,6 +3098,8 @@ public static class Strings
public static string Store_Steam_Format => ResourceManager.GetString(nameof(Store_Steam_Format), Culture) ?? nameof(Store_Steam_Format);
public static string Store_Xbox_Format => ResourceManager.GetString(nameof(Store_Xbox_Format), Culture) ?? nameof(Store_Xbox_Format);
public static string Summary_Annotations_Header => ResourceManager.GetString(nameof(Summary_Annotations_Header), Culture) ?? nameof(Summary_Annotations_Header);
public static string Summary_Crash_Body => ResourceManager.GetString(nameof(Summary_Crash_Body), Culture) ?? nameof(Summary_Crash_Body);
+11 -3
View File
@@ -294,7 +294,7 @@
<comment>review</comment>
</data>
<data name="Import_NothingFound" xml:space="preserve">
<value>このマシンの Steam、GOG Galaxy、Epic、itch.io にインストール済みのゲームは見つかりませんでした。</value>
<value>このマシンの Steam、GOG Galaxy、Epic、itch.io、Xbox アプリにインストール済みのゲームは見つかりませんでした。</value>
<comment>review</comment>
</data>
<data name="Import_NothingNew" xml:space="preserve">
@@ -2310,7 +2310,7 @@
<comment>review</comment>
</data>
<data name="FirstRun_Import_Body" xml:space="preserve">
<value>FrameLedger は Steam、GOG Galaxy、Epic、itch.io のインストール済みゲームを読み取り、チェックリストから追加できます — 入った後、「ファイル ▸ ライブラリをインポート…」から。取り込んだゲームはどれも、手動で追加したものと同じくフック無効で始まります。</value>
<value>FrameLedger は Steam、GOG Galaxy、Epic、itch.io、Xbox アプリのインストール済みゲームを読み取り、チェックリストから追加できます — 入った後、「ファイル ▸ ライブラリをインポート…」から。取り込んだゲームはどれも、手動で追加したものと同じくフック無効で始まります。</value>
<comment>review</comment>
</data>
<data name="FirstRun_Import_Header" xml:space="preserve">
@@ -2913,6 +2913,10 @@
<value>Epic バージョン {0}</value>
<comment>review</comment>
</data>
<data name="Store_Xbox_Format" xml:space="preserve">
<value>Xbox バージョン {0}</value>
<comment>review</comment>
</data>
<data name="GameDetail_Details_Header" xml:space="preserve">
<value>詳細</value>
<comment>review</comment>
@@ -4346,7 +4350,7 @@
<comment>review</comment>
</data>
<data name="Settings_GameArt_Body" xml:space="preserve">
<value>ゲームのページに、そのゲームに選んだ画像、なければ Steam または GOG GALAXY のアプリがこの PC に保存しているカバーとバナーを表示します。何もダウンロードしません。</value>
<value>ゲームのページに、そのゲームに選んだ画像、なければ Steam または GOG GALAXY のアプリがこの PC に保存しているカバーとバナー、または Xbox のゲームが自分のフォルダーに同梱しているロゴとスプラッシュ画像を表示します。何もダウンロードしません。</value>
<comment>review</comment>
</data>
<data name="Settings_GameArtTint_Label" xml:space="preserve">
@@ -4365,6 +4369,10 @@
<value>この PC の GOG GALAXY アプリのアートワーク</value>
<comment>review</comment>
</data>
<data name="Art_Source_Xbox" xml:space="preserve">
<value>ゲーム自身のファイルのアートワーク (Xbox アプリ)</value>
<comment>review</comment>
</data>
<data name="Art_Source_Yours" xml:space="preserve">
<value>このゲームに選んだ画像</value>
<comment>review</comment>
+9 -3
View File
@@ -226,7 +226,7 @@
<value>Add selected</value>
</data>
<data name="Import_NothingFound" xml:space="preserve">
<value>No installed games were found in Steam, GOG Galaxy, Epic or itch.io on this machine.</value>
<value>No installed games were found in Steam, GOG Galaxy, Epic, itch.io or the Xbox app on this machine.</value>
</data>
<data name="Import_NothingNew" xml:space="preserve">
<value>No new games: every game your stores have installed is already in the library.</value>
@@ -1738,7 +1738,7 @@
<value>Finish</value>
</data>
<data name="FirstRun_Import_Body" xml:space="preserve">
<value>FrameLedger can read what Steam, GOG Galaxy, Epic and itch.io have installed and add them from a checklist — File ▸ Import library…, once you are in. Every imported game starts with hooking off, exactly like one you add by hand.</value>
<value>FrameLedger can read what Steam, GOG Galaxy, Epic, itch.io and the Xbox app have installed and add them from a checklist — File ▸ Import library…, once you are in. Every imported game starts with hooking off, exactly like one you add by hand.</value>
</data>
<data name="FirstRun_Import_Header" xml:space="preserve">
<value>Your library</value>
@@ -2195,6 +2195,9 @@ The documents below are the full terms; this summary does not replace them.</val
<data name="Store_Epic_Format" xml:space="preserve">
<value>Epic version {0}</value>
</data>
<data name="Store_Xbox_Format" xml:space="preserve">
<value>Xbox version {0}</value>
</data>
<data name="GameDetail_Details_Header" xml:space="preserve">
<value>Details</value>
</data>
@@ -3270,7 +3273,7 @@ The documents below are the full terms; this summary does not replace them.</val
<value>Show game artwork</value>
</data>
<data name="Settings_GameArt_Body" xml:space="preserve">
<value>A game's page shows the image you chose for it, or else the cover and banner the Steam or GOG GALAXY app keeps on this PC. Nothing is downloaded.</value>
<value>A game's page shows the image you chose for it, or else the cover and banner the Steam or GOG GALAXY app keeps on this PC, or the logo and splash image an Xbox game ships in its own folder. Nothing is downloaded.</value>
</data>
<data name="Settings_GameArtTint_Label" xml:space="preserve">
<value>Colour the game page from its artwork</value>
@@ -3284,6 +3287,9 @@ The documents below are the full terms; this summary does not replace them.</val
<data name="Art_Source_Gog" xml:space="preserve">
<value>Artwork from the GOG GALAXY app on this PC</value>
</data>
<data name="Art_Source_Xbox" xml:space="preserve">
<value>Artwork from the game's own files (Xbox app)</value>
</data>
<data name="Art_Source_Yours" xml:space="preserve">
<value>The image you chose for this game</value>
</data>
+9 -3
View File
@@ -221,7 +221,7 @@
<value>Thêm mục đã chọn</value>
</data>
<data name="Import_NothingFound" xml:space="preserve">
<value>Không tìm thấy game nào đã cài trong Steam, GOG Galaxy, Epic hay itch.io trên máy này.</value>
<value>Không tìm thấy game nào đã cài trong Steam, GOG Galaxy, Epic, itch.io hay Xbox app trên máy này.</value>
</data>
<data name="Import_NothingNew" xml:space="preserve">
<value>Không có game mới: mọi game các store đã cài đều đã có trong thư viện.</value>
@@ -1733,7 +1733,7 @@
<value>Hoàn tất</value>
</data>
<data name="FirstRun_Import_Body" xml:space="preserve">
<value>FrameLedger có thể đọc những gì Steam, GOG Galaxy, Epic và itch.io đã cài và thêm chúng từ một danh sách chọn — Tệp ▸ Nhập thư viện…, khi bạn đã vào trong. Mọi game nhập vào đều bắt đầu với hooking tắt, đúng như game bạn thêm thủ công.</value>
<value>FrameLedger có thể đọc những gì Steam, GOG Galaxy, Epic, itch.io và Xbox app đã cài và thêm chúng từ một danh sách chọn — Tệp ▸ Nhập thư viện…, khi bạn đã vào trong. Mọi game nhập vào đều bắt đầu với hooking tắt, đúng như game bạn thêm thủ công.</value>
</data>
<data name="FirstRun_Import_Header" xml:space="preserve">
<value>Thư viện của bạn</value>
@@ -2190,6 +2190,9 @@ Các văn bản bên dưới là điều khoản đầy đủ; bản tóm tắt
<data name="Store_Epic_Format" xml:space="preserve">
<value>Epic phiên bản {0}</value>
</data>
<data name="Store_Xbox_Format" xml:space="preserve">
<value>Xbox phiên bản {0}</value>
</data>
<data name="GameDetail_Details_Header" xml:space="preserve">
<value>Chi tiết</value>
</data>
@@ -3265,7 +3268,7 @@ Các văn bản bên dưới là điều khoản đầy đủ; bản tóm tắt
<value>Hiện ảnh của game</value>
</data>
<data name="Settings_GameArt_Body" xml:space="preserve">
<value>Trang của game hiện ảnh bạn đã chọn cho nó, nếu không có thì ảnh bìa và banner mà ứng dụng Steam hoặc GOG GALAXY lưu sẵn trên máy này. Không tải gì về.</value>
<value>Trang của game hiện ảnh bạn đã chọn cho nó, nếu không có thì ảnh bìa và banner mà ứng dụng Steam hoặc GOG GALAXY lưu sẵn trên máy này, hoặc logo và ảnh splash mà game Xbox kèm sẵn trong thư mục của nó. Không tải gì về.</value>
</data>
<data name="Settings_GameArtTint_Label" xml:space="preserve">
<value>Tô màu trang game theo ảnh</value>
@@ -3279,6 +3282,9 @@ Các văn bản bên dưới là điều khoản đầy đủ; bản tóm tắt
<data name="Art_Source_Gog" xml:space="preserve">
<value>Ảnh từ ứng dụng GOG GALAXY trên máy này</value>
</data>
<data name="Art_Source_Xbox" xml:space="preserve">
<value>Ảnh từ chính các tệp của game (Xbox app)</value>
</data>
<data name="Art_Source_Yours" xml:space="preserve">
<value>Ảnh bạn đã chọn cho game này</value>
</data>
@@ -103,6 +103,10 @@ public sealed partial class GameDetailViewModel : ObservableObject
[ObservableProperty]
private bool _artCoverIsLandscape;
/// <summary>The cover slot holds an Xbox game's square logo (beta.33): drawn square, never cropped to a portrait.</summary>
[ObservableProperty]
private bool _artCoverIsSquare;
/// <summary>The store's wide banner, above the header band; null without one.</summary>
[ObservableProperty]
private ImageSource? _artHero;
@@ -548,6 +552,7 @@ public sealed partial class GameDetailViewModel : ObservableObject
{
ArtCover = view?.Cover;
ArtCoverIsLandscape = view?.CoverIsLandscape ?? false;
ArtCoverIsSquare = view?.CoverIsSquare ?? false;
ArtHero = view?.Hero;
ArtTint = view?.Tint;
ArtSource = view?.Source;
@@ -1168,7 +1173,7 @@ public sealed partial class GameDetailViewModel : ObservableObject
GameRow row = detail.Row;
Name = row.Name;
// A store's version is said as one ("Steam build 20374416", beta.8), and then names the store itself.
bool storeVersion = EditGameViewModel.IsDetectedField(row.FieldProvenanceJson, "game_version") && row.Platform is "steam" or "gog" or "epic";
bool storeVersion = EditGameViewModel.IsDetectedField(row.FieldProvenanceJson, "game_version") && row.Platform is "steam" or "gog" or "epic" or "xbox";
string?[] subtitle = storeVersion
? [row.Publisher, Formats.StoreVersion(row.Platform, row.GameVersion, detected: true) ?? Formats.Platform(row.Platform), EngineText(row)]
: [row.Publisher, row.GameVersion, Formats.Platform(row.Platform), EngineText(row)];
@@ -5,13 +5,14 @@ namespace FrameLedger.Application.Art;
/// <summary>
/// The artwork a store's own app keeps on this PC for one game (beta.23, owner decision D60): the full paths of its portrait
/// cover, its wide banner and its landscape header, each null when that app keeps none. FrameLedger downloads none of it and
/// copies none of it; it shows these files from where the store's app put them.
/// cover, its wide banner and its landscape header, each null when that app keeps none — and since beta.33 a square logo,
/// what an Xbox game's package ships instead of a portrait cover (its <c>Square480x480Logo</c>). FrameLedger downloads
/// none of it and copies none of it; it shows these files from where the store's app or the game put them.
/// </summary>
public sealed record GameArtFiles(string? Cover, string? Hero, string? Header)
public sealed record GameArtFiles(string? Cover, string? Hero, string? Header, string? Square = null)
{
/// <summary>No artwork: the store keeps none, is not installed, or the id is not one of its own.</summary>
public static GameArtFiles None { get; } = new(null, null, null);
public bool IsEmpty => Cover is null && Hero is null && Header is null;
public bool IsEmpty => Cover is null && Hero is null && Header is null && Square is null;
}
@@ -1,18 +1,25 @@
// SPDX-License-Identifier: GPL-3.0-only
// Copyright (C) 2026 poli0981 - additional terms under GPLv3 section 7: see NOTICE
using FrameLedger.Application.Import;
namespace FrameLedger.Application.Art;
/// <summary>
/// One store app's own artwork folder on this PC (beta.23, owner decision D60): Steam's <c>appcache\librarycache</c>, GOG
/// GALAXY's <c>webcache</c>. Read-only. A store that is not installed, an id that is not of the store's own shape, or a
/// folder with nothing in it answers <see cref="GameArtFiles.None"/>, never an error. Which store installed a game is
/// asked of the stores' own records, as Play asks (<c>Play.StoreRecords.Owning</c>) — never of the row's platform alone.
/// One store's artwork for a game on this PC (beta.23, owner decision D60): Steam's <c>appcache\librarycache</c>, GOG
/// GALAXY's <c>webcache</c>, and since beta.33 the logo and splash image an Xbox game ships in its own package folder.
/// Read-only. A store that is not installed, an id that is not of the store's own shape, or a folder with nothing in it
/// answers <see cref="GameArtFiles.None"/>, never an error. Which store installed a game is asked of the stores' own
/// records, as Play asks (<c>Play.StoreRecords.Owning</c>) — never of the row's platform alone.
/// </summary>
public interface IStoreArtCache
{
/// <summary><c>steam</c> · <c>gog</c> — <c>games.platform</c>'s vocabulary.</summary>
/// <summary><c>steam</c> · <c>gog</c> · <c>xbox</c> — <c>games.platform</c>'s vocabulary.</summary>
string Platform { get; }
GameArtFiles Find(string storeId);
/// <summary>
/// The artwork for <paramref name="record"/>, the owning store's record of the game: the whole record since beta.33,
/// because an Xbox game's pictures are in its install folder, not keyed by its id.
/// </summary>
GameArtFiles Find(StoreGame record);
}
@@ -6,12 +6,13 @@ namespace FrameLedger.Application.Import;
/// <summary>
/// One store's installed library, read from its local files (FR-1.2, <c>05_DETECTION</c> §Platform signatures &amp;
/// metadata: Steam's <c>libraryfolders.vdf</c> + <c>appmanifest_*.acf</c>, GOG's registry keys, Epic's
/// <c>Manifests\*.item</c>, itch's receipts). A store that is not installed answers an empty list, never an error;
/// a file that will not parse costs that one entry.
/// <c>Manifests\*.item</c>, itch's receipts, and since beta.33 the Xbox app's games folders — each drive's
/// <c>.GamingRoot</c>, each game's <c>MicrosoftGame.config</c> and <c>appxmanifest.xml</c>). A store that is not
/// installed answers an empty list, never an error; a file that will not parse costs that one entry.
/// </summary>
public interface IStoreLibrarySource
{
/// <summary><c>steam</c> · <c>gog</c> · <c>epic</c> · <c>itch</c> — <c>games.platform</c>'s vocabulary.</summary>
/// <summary><c>steam</c> · <c>gog</c> · <c>epic</c> · <c>itch</c> · <c>xbox</c> — <c>games.platform</c>'s vocabulary.</summary>
string Platform { get; }
ValueTask<IReadOnlyList<StoreGame>> ListAsync(CancellationToken ct = default);
@@ -11,7 +11,9 @@ namespace FrameLedger.Application.Import;
/// </summary>
/// <remarks>
/// <c>LaunchKey</c> (beta.21, Play, D59): what the store's own launch link names where that is more than the store id —
/// the Epic Games Launcher's <c>CatalogNamespace:CatalogItemId:AppName</c>; null for every other store.
/// the Epic Games Launcher's <c>CatalogNamespace:CatalogItemId:AppName</c>, and since beta.33 an Xbox game's
/// AppUserModelID <c>&lt;package family name&gt;!&lt;application id&gt;</c>, which Windows activates (D80); null for every
/// other store.
/// </remarks>
public sealed record StoreGame(string Platform, string StoreId, string Name, string InstallDirectory, string? ExePath, string? Version,
string? LaunchKey = null);
@@ -13,7 +13,7 @@ public sealed record GameMetadata
{
public required string Name { get; init; }
/// <summary><c>steam|gog|epic|itch|none</c>.</summary>
/// <summary><c>steam|gog|epic|itch|xbox|none</c> (<c>xbox</c> since beta.33: the Xbox app and the Microsoft Store, D79).</summary>
public string Platform { get; init; } = "none";
public string? StoreId { get; init; }
@@ -30,7 +30,7 @@ public sealed record GameMetadata
public string? Notes { get; init; }
public static readonly IReadOnlyList<string> Platforms = ["steam", "gog", "epic", "itch", "none"];
public static readonly IReadOnlyList<string> Platforms = ["steam", "gog", "epic", "itch", "xbox", "none"];
public static GameMetadata Of(GameRow row)
{
@@ -35,4 +35,10 @@ public enum DetectionSignalType
/// <summary>A field in a store manifest. Not collected this phase.</summary>
ManifestField,
/// <summary>
/// A file of exactly this name directly in the install root (beta.33, the <c>xbox</c> platform): answered from the
/// root's own listing, so a deep walk that ran short cannot make its miss Unknown — a root that could not be listed can.
/// </summary>
RootFile,
}
@@ -63,6 +63,13 @@ public sealed record GameFileSnapshot
/// </remarks>
public required bool FileListingComplete { get; init; }
/// <summary>
/// The names of the files directly in <see cref="GameDirectory"/>, from a listing of that one folder (beta.33); null
/// when it could not be listed. What a <see cref="DetectionSignalType.RootFile"/> signal is answered from: a complete
/// listing of the root decides its miss as surely as its hit, whatever the deep walk did.
/// </summary>
public IReadOnlySet<string>? RootFiles { get; init; }
/// <summary>PE <c>CompanyName</c>, or null if it could not be read.</summary>
public string? PeCompanyName { get; init; }
@@ -62,6 +62,11 @@ public sealed class RuleEvaluator
Found(snapshot.RelativeDirectories, needle, snapshot.FileListingComplete),
DetectionSignalType.PathContains => Outcome(
snapshot.GameDirectory.Contains(needle.Replace('\\', '/'), StringComparison.OrdinalIgnoreCase)),
// beta.33: one folder's own listing, so its miss is as certain as its hit — unless the folder was not listed.
DetectionSignalType.RootFile => snapshot.RootFiles is { } root
? Outcome(root.Contains(needle))
: SignalOutcome.Unknown,
DetectionSignalType.PeCompanyContains => Contains(snapshot.PeCompanyName, needle),
DetectionSignalType.PeProductContains => Contains(snapshot.PeProductName, needle),
DetectionSignalType.StringsContains => Outcome(snapshot.MatchedStringNeedles.Contains(signal.Value)),
@@ -2,6 +2,7 @@
// Copyright (C) 2026 poli0981 - additional terms under GPLv3 section 7: see NOTICE
using FrameLedger.Application.Art;
using FrameLedger.Application.Import;
namespace FrameLedger.Infrastructure.Art;
@@ -18,8 +19,10 @@ public sealed class GogArtCache(string? webcacheRoot = null) : IStoreArtCache
public string Platform => "gog";
public GameArtFiles Find(string storeId)
public GameArtFiles Find(StoreGame record)
{
ArgumentNullException.ThrowIfNull(record);
string storeId = record.StoreId;
if (!SteamArtCache.IsNumericId(storeId))
{
return GameArtFiles.None;
@@ -2,6 +2,7 @@
// Copyright (C) 2026 poli0981 - additional terms under GPLv3 section 7: see NOTICE
using FrameLedger.Application.Art;
using FrameLedger.Application.Import;
using FrameLedger.Infrastructure.Import;
namespace FrameLedger.Infrastructure.Art;
@@ -24,8 +25,10 @@ public sealed class SteamArtCache(string? steamRoot = null) : IStoreArtCache
public string Platform => "steam";
public GameArtFiles Find(string storeId)
public GameArtFiles Find(StoreGame record)
{
ArgumentNullException.ThrowIfNull(record);
string storeId = record.StoreId;
if (!IsNumericId(storeId) || (steamRoot ?? SteamLibrarySource.InstalledRoot()) is not { } root)
{
return GameArtFiles.None;
@@ -0,0 +1,83 @@
// SPDX-License-Identifier: GPL-3.0-only
// Copyright (C) 2026 poli0981 - additional terms under GPLv3 section 7: see NOTICE
using FrameLedger.Application.Art;
using FrameLedger.Application.Import;
using FrameLedger.Infrastructure.Import;
namespace FrameLedger.Infrastructure.Art;
/// <summary>
/// The pictures an Xbox game ships in its own package folder (beta.33, D60 "a game's artwork is what is already on the
/// PC"): <c>MicrosoftGame.config</c>'s <c>ShellVisuals</c> names them — <c>Square480x480Logo</c> (480×480 on the owner's 11
/// games, else <c>Square150x150Logo</c>) as a square cover, <c>SplashScreenImage</c> (1920×1080) as the banner and the
/// landscape header (<c>spike-notes</c> §25). Read from the record's install folder, which is the package root.
/// </summary>
/// <remarks>
/// A name that points outside the package root is ignored, whatever the file says. Where the plain file is absent, the
/// MSIX resource variants beside it (<c>Logo.scale-200.png</c>) are tried, the largest first; the 11 measured all ship the
/// plain names.
/// </remarks>
public sealed class XboxArtCache : IStoreArtCache
{
public string Platform => "xbox";
public GameArtFiles Find(StoreGame record)
{
ArgumentNullException.ThrowIfNull(record);
try
{
if (GdkPackageFiles.Read(record.InstallDirectory) is not { } package)
{
return GameArtFiles.None;
}
string? square = Image(record.InstallDirectory, package.Square480Logo) ?? Image(record.InstallDirectory, package.Square150Logo);
string? splash = Image(record.InstallDirectory, package.SplashScreen);
return new GameArtFiles(Cover: null, Hero: splash, Header: splash, Square: square);
}
catch (Exception ex) when (ex is IOException or UnauthorizedAccessException or System.Security.SecurityException)
{
return GameArtFiles.None;
}
}
/// <summary>The image <paramref name="relative"/> names inside <paramref name="root"/>, or null when there is none there.</summary>
public static string? Image(string root, string? relative)
{
if (string.IsNullOrWhiteSpace(relative) || string.IsNullOrWhiteSpace(root))
{
return null;
}
string rootFull;
string full;
try
{
rootFull = Path.TrimEndingDirectorySeparator(Path.GetFullPath(root));
full = Path.GetFullPath(Path.Combine(rootFull, relative));
}
catch (Exception ex) when (ex is ArgumentException or NotSupportedException or PathTooLongException)
{
return null;
}
if (!full.StartsWith(rootFull + Path.DirectorySeparatorChar, StringComparison.OrdinalIgnoreCase))
{
return null; // a name that escapes the package is not the package's picture
}
var plain = new FileInfo(full);
if (plain.Exists && plain.Length > 0)
{
return plain.FullName;
}
return plain.Directory is { Exists: true } folder
? folder.EnumerateFiles(Path.GetFileNameWithoutExtension(full) + ".scale-*" + Path.GetExtension(full))
.Where(static f => f.Length > 0)
.OrderByDescending(static f => f.Length)
.FirstOrDefault()?.FullName
: null;
}
}
@@ -191,6 +191,7 @@ public sealed class DetectionRulesFile : IDetectionRulesSource
"pe_product_contains" => DetectionSignalType.PeProductContains,
"strings_contains" => DetectionSignalType.StringsContains,
"manifest_field" => DetectionSignalType.ManifestField,
"root_file" => DetectionSignalType.RootFile,
_ => throw new InvalidOperationException($"'{owner}' has unknown signal type '{d.Type}'"),
};
@@ -101,6 +101,7 @@ public sealed class GameFileProbe : IGameFileProbe
RelativeFiles = files,
RelativeDirectories = dirs,
FileListingComplete = listingComplete,
RootFiles = ListRootFiles(dir),
PeCompanyName = pe.Company,
PeProductName = pe.Product,
PeFileVersion = pe.FileVersion,
@@ -333,6 +334,38 @@ public sealed class GameFileProbe : IGameFileProbe
return found;
}
/// <summary>
/// The names of the files directly in <paramref name="root"/> — what a <c>root_file</c> signal is answered from (beta.33)
/// — or null when that one folder could not be listed or holds more than <see cref="MaxEntries"/> files.
/// </summary>
private static HashSet<string>? ListRootFiles(string root)
{
if (string.IsNullOrEmpty(root))
{
return null;
}
try
{
var names = new HashSet<string>(StringComparer.OrdinalIgnoreCase);
foreach (string file in Directory.EnumerateFiles(root))
{
if (names.Count >= MaxEntries)
{
return null;
}
names.Add(Path.GetFileName(file));
}
return names;
}
catch (Exception ex) when (ex is IOException or UnauthorizedAccessException)
{
return null;
}
}
/// <summary>Breadth-first, bounded. Returns false if the walk did not complete.</summary>
private static bool TryWalk(string root, List<string> files, List<string> dirs)
{
@@ -1,6 +1,8 @@
// SPDX-License-Identifier: GPL-3.0-only
// Copyright (C) 2026 poli0981 - additional terms under GPLv3 section 7: see NOTICE
using FrameLedger.Infrastructure.Import;
namespace FrameLedger.Infrastructure.Detection;
/// <summary>
@@ -27,6 +29,19 @@ namespace FrameLedger.Infrastructure.Detection;
/// <c>D:\another\epic\AlanWake2</c> is a folder of unrelated games, and scanning
/// a sibling title's anti-cheat would be a false refusal with no appeal.
/// </para>
/// <para>
/// <strong>Except at a GDK package root (beta.33).</strong> The Xbox app installs to
/// <c>&lt;games folder&gt;\&lt;Game&gt;\Content\</c> under a folder the user names, so no
/// string can bound it; the package marks its own root instead, with
/// <c>MicrosoftGame.config</c> beside <c>appxmanifest.xml</c>. Only when no string
/// boundary matched, the nearest folder at or above the executable's that holds
/// both is the root (<see cref="GdkPackageFiles.NearestPackageRoot"/>) — which can
/// only widen the walk relative to the exe's own directory, never narrow it. Without
/// it, an Unreal title's <c>Content\…\Binaries\WinGDK</c> was all check 4 saw
/// (<c>spike-notes</c> §25). The native <c>ResolveInstallRoot</c> answers the same,
/// and a shared case list (<c>tests/fixtures/install-roots/cases.txt</c>) holds the
/// two to it.
/// </para>
/// </remarks>
public static class InstallRoot
{
@@ -81,6 +96,6 @@ public static class InstallRoot
}
}
return exeDir;
return GdkPackageFiles.NearestPackageRoot(exeDir) ?? exeDir;
}
}
@@ -71,6 +71,9 @@ public sealed class ExecutableLocator : IExecutableLocator
public static readonly IReadOnlySet<string> RuntimeHelperNames = new HashSet<string>(StringComparer.OrdinalIgnoreCase)
{
"notification_helper", "crashpad_handler", "UnityCrashHandler64", "UnityCrashHandler32", "CrashReportClient", "nwjc", "chromedriver",
// beta.33: the GDK's launcher at every Xbox game's package root (spike-notes §25) — it activates the package and
// exits; the game is what it starts.
"gamelaunchhelper",
};
/// <summary>True for a name in <see cref="RuntimeHelperNames"/>.</summary>
@@ -145,14 +148,14 @@ public sealed class ExecutableLocator : IExecutableLocator
return null;
}
string installName = Squash(Path.GetFileName(Path.TrimEndingDirectorySeparator(installDirectory)));
string installName = Squash(InstallName(installDirectory));
string? best = null;
int bestRank = -1;
long bestSize = -1;
foreach (string exe in Walk(installDirectory, 0))
{
string name = Path.GetFileNameWithoutExtension(exe);
if (IsHelper(name) || IsUnderPluginFolder(installDirectory, exe))
if (IsHelper(name) || IsRuntimeHelper(name) || IsUnderPluginFolder(installDirectory, exe))
{
continue;
}
@@ -203,6 +206,19 @@ public sealed class ExecutableLocator : IExecutableLocator
return named ? _rankNamedAfterTheInstall : 0;
}
/// <summary>
/// The install's own name: its folder's, except for a GDK package root (beta.33), whose folder is always
/// <c>Content</c> and whose game's name is the folder above it (<c>D:\xbox\Valor Mortis\Content</c>).
/// </summary>
private static string InstallName(string installDirectory)
{
string folder = Path.TrimEndingDirectorySeparator(installDirectory);
return string.Equals(Path.GetFileName(folder), XboxLibrarySource.ContentFolder, StringComparison.OrdinalIgnoreCase)
&& GdkPackageFiles.IsPackageRoot(folder) && Path.GetDirectoryName(folder) is { } parent
? Path.GetFileName(parent)
: Path.GetFileName(folder);
}
/// <summary>Letters and digits, lower-cased: "Cyberpunk 2077" and "Cyberpunk2077" are the same name.</summary>
private static string Squash(string value) =>
string.Concat(value.Where(char.IsLetterOrDigit).Select(char.ToLowerInvariant));
@@ -0,0 +1,131 @@
// SPDX-License-Identifier: GPL-3.0-only
// Copyright (C) 2026 poli0981 - additional terms under GPLv3 section 7: see NOTICE
using System.Buffers.Binary;
using System.Text;
namespace FrameLedger.Infrastructure.Import;
/// <summary>
/// The folders the Xbox app installs games into, as each drive's own <c>.GamingRoot</c> file names them (beta.33,
/// <c>spike-notes</c> §25): the bytes <c>RGBX</c>, a little-endian 32-bit count, then that many NUL-terminated UTF-16
/// folder names relative to the drive — measured <c>XboxGames</c> on C: (28 bytes) and <c>xbox</c> on D: (18 bytes).
/// </summary>
/// <remarks>
/// The file is the Xbox app's, undocumented in the way Steam's <c>libraryfolders.vdf</c> is; it is read defensively: a
/// file that does not start with the magic, claims more names than <see cref="MaxCount"/>, runs past its end, or names
/// anything but a plain relative folder costs that drive (or that name), never the import.
/// </remarks>
public static class GamingRoots
{
/// <summary>The file at a drive's root.</summary>
public const string FileName = ".GamingRoot";
/// <summary>More names than any install would have; a count above it is a file that is not one.</summary>
public const int MaxCount = 64;
/// <summary>The largest file read.</summary>
public const int MaxBytes = 64 * 1024;
private const int _headerBytes = 8;
private static ReadOnlySpan<byte> Magic => "RGBX"u8;
/// <summary>The folders <paramref name="bytes"/> names, each joined to <paramref name="driveRoot"/>; empty for a file that is not a <c>.GamingRoot</c>.</summary>
public static IReadOnlyList<string> Parse(ReadOnlySpan<byte> bytes, string driveRoot)
{
ArgumentException.ThrowIfNullOrWhiteSpace(driveRoot);
if (bytes.Length < _headerBytes || !bytes[..4].SequenceEqual(Magic))
{
return [];
}
uint count = BinaryPrimitives.ReadUInt32LittleEndian(bytes[4..8]);
if (count == 0 || count > MaxCount)
{
return [];
}
List<string> roots = [];
int at = _headerBytes;
for (uint i = 0; i < count; i++)
{
int end = at;
while (end + 1 < bytes.Length && (bytes[end] != 0 || bytes[end + 1] != 0))
{
end += 2;
}
if (end + 1 >= bytes.Length)
{
break; // ran past the end: the names read so far stand, the rest is not there
}
string name = Encoding.Unicode.GetString(bytes[at..end]);
if (Resolve(driveRoot, name) is { } root)
{
roots.Add(root);
}
at = end + 2;
}
return roots;
}
/// <summary>Every games folder the ready fixed and removable drives' <c>.GamingRoot</c> files name.</summary>
public static IReadOnlyList<string> OnThisPc()
{
List<string> roots = [];
DriveInfo[] drives;
try
{
drives = DriveInfo.GetDrives();
}
catch (IOException)
{
return roots;
}
foreach (DriveInfo drive in drives)
{
try
{
if (drive.DriveType is not (DriveType.Fixed or DriveType.Removable) || !drive.IsReady)
{
continue;
}
string file = Path.Combine(drive.RootDirectory.FullName, FileName);
var info = new FileInfo(file);
if (!info.Exists || info.Length > MaxBytes)
{
continue;
}
roots.AddRange(Parse(File.ReadAllBytes(file), drive.RootDirectory.FullName));
}
catch (Exception ex) when (ex is IOException or UnauthorizedAccessException)
{
// A drive that will not answer is a drive with no games folder this time.
}
}
return roots;
}
/// <summary><paramref name="name"/> joined to the drive, or null for a name that is not a plain relative folder on it.</summary>
private static string? Resolve(string driveRoot, string name)
{
if (string.IsNullOrWhiteSpace(name) || Path.IsPathRooted(name) || name.Contains(':', StringComparison.Ordinal)
|| name.IndexOfAny(Path.GetInvalidPathChars()) >= 0
|| name.Split('\\', '/').Any(static segment => segment is "." or ".."))
{
return null;
}
string drive = Path.GetFullPath(driveRoot);
string full = Path.GetFullPath(Path.Combine(drive, name));
return full.StartsWith(drive, StringComparison.OrdinalIgnoreCase) && full.Length > drive.Length ? full : null;
}
}
@@ -0,0 +1,38 @@
// SPDX-License-Identifier: GPL-3.0-only
// Copyright (C) 2026 poli0981 - additional terms under GPLv3 section 7: see NOTICE
namespace FrameLedger.Infrastructure.Import;
/// <summary>What <see cref="GdkPackageFiles.Read"/> found in a GDK package root; every member but the identity may be null.</summary>
public sealed record GdkPackage
{
/// <summary><c>Identity/@Name</c>, e.g. <c>LyricalGamesLLC.ValorMortis</c>.</summary>
public required string Name { get; init; }
/// <summary><c>Identity/@Publisher</c>, the certificate subject the family name is computed from.</summary>
public required string Publisher { get; init; }
/// <summary><c>Identity/@Version</c>, e.g. <c>1.3.5124.0</c>.</summary>
public string? Version { get; init; }
/// <summary><c>ShellVisuals/@DefaultDisplayName</c>, else the manifest's <c>DisplayName</c> — never an <c>ms-resource:</c> reference.</summary>
public string? DisplayName { get; init; }
/// <summary>The first <c>ExecutableList/Executable/@Name</c>: the executable the package launches (the Unreal stub, the Unity player).</summary>
public string? LaunchExecutable { get; init; }
/// <summary>The manifest <c>Application/@Id</c> whose executable is <c>GameLaunchHelper.exe</c>, else the first.</summary>
public string? ApplicationId { get; init; }
/// <summary><c>StoreId</c>, the Microsoft Store's product id (<c>9P861V1542BL</c>).</summary>
public string? StoreId { get; init; }
/// <summary><c>ShellVisuals/@Square480x480Logo</c>, relative to the package root.</summary>
public string? Square480Logo { get; init; }
/// <summary><c>ShellVisuals/@Square150x150Logo</c>, relative to the package root.</summary>
public string? Square150Logo { get; init; }
/// <summary><c>ShellVisuals/@SplashScreenImage</c> (1920×1080 on the 11 measured), relative to the package root.</summary>
public string? SplashScreen { get; init; }
}
@@ -0,0 +1,172 @@
// SPDX-License-Identifier: GPL-3.0-only
// Copyright (C) 2026 poli0981 - additional terms under GPLv3 section 7: see NOTICE
using System.Xml;
using System.Xml.Linq;
namespace FrameLedger.Infrastructure.Import;
/// <summary>
/// The two files a Microsoft GDK game's package root carries (beta.33, <c>spike-notes</c> §25): <c>MicrosoftGame.config</c>
/// — the game's identity, its shell visuals and the executable its package launches — and <c>appxmanifest.xml</c>, whose
/// <c>Application</c> names the id Windows activates. The Xbox app and the Microsoft Store install every such game into
/// <c>&lt;drive&gt;\&lt;games folder&gt;\&lt;Game&gt;\Content\</c>, with both files at the root of <c>Content</c>.
/// </summary>
/// <remarks>
/// <para>
/// <b>Read with a hardened reader</b>: no DTD, no resolver, a size cap — the files are the publisher's, and an
/// unexpected shape costs that one game, never the import. Nothing here opens the game's executable: every game
/// <c>.exe</c> under <c>Content</c> refuses <c>FILE_READ_DATA</c> to a process outside its package (§25), while these XML
/// files, the images and the DLLs read.
/// </para>
/// <para>
/// <b>A package root is the folder holding both files</b> (<see cref="IsPackageRoot"/>). The install-root resolvers use
/// that test only where no store boundary is recognised (<c>InstallRoot</c>, native <c>ResolveInstallRoot</c>), so it
/// can widen what detection and the guard's check 4 walk, never narrow it.
/// </para>
/// </remarks>
public static class GdkPackageFiles
{
/// <summary>The GDK's own description of the game; the FINAL FANTASY titles spell it <c>MicrosoftGame.Config</c> (NTFS does not mind).</summary>
public const string ConfigFileName = "MicrosoftGame.config";
/// <summary>The package manifest Windows registers.</summary>
public const string ManifestFileName = "appxmanifest.xml";
/// <summary>How far above an executable's folder <see cref="NearestPackageRoot"/> looks: §25 measured three levels (Unreal's <c>&lt;Project&gt;\Binaries\WinGDK</c>).</summary>
public const int MaxLevelsUp = 8;
/// <summary>The largest description file read; the 11 measured on the owner's PC are 1.5–30 KB.</summary>
public const long MaxFileBytes = 1024 * 1024;
private const string _manifestNamespace = "http://schemas.microsoft.com/appx/manifest/foundation/windows10";
private const string _launchHelper = "GameLaunchHelper.exe";
private const string _resourcePrefix = "ms-resource:";
private static readonly XmlReaderSettings _xml = new()
{
DtdProcessing = DtdProcessing.Prohibit,
XmlResolver = null,
MaxCharactersInDocument = MaxFileBytes,
IgnoreComments = true,
IgnoreProcessingInstructions = true,
};
/// <summary>True when <paramref name="folder"/> holds both a <c>MicrosoftGame.config</c> and an <c>appxmanifest.xml</c> file.</summary>
public static bool IsPackageRoot(string folder)
{
if (string.IsNullOrWhiteSpace(folder))
{
return false;
}
try
{
return File.Exists(Path.Combine(folder, ConfigFileName)) && File.Exists(Path.Combine(folder, ManifestFileName));
}
catch (ArgumentException)
{
return false;
}
}
/// <summary>
/// <paramref name="folder"/> itself or the nearest of its parents, at most <see cref="MaxLevelsUp"/> levels up and never a
/// drive's root, that <see cref="IsPackageRoot"/>; null when there is none.
/// </summary>
public static string? NearestPackageRoot(string folder)
{
if (string.IsNullOrWhiteSpace(folder))
{
return null;
}
DirectoryInfo? current = new(folder);
for (int level = 0; level <= MaxLevelsUp && current is { Parent: not null }; level++)
{
if (IsPackageRoot(current.FullName))
{
return current.FullName;
}
current = current.Parent;
}
return null;
}
/// <summary>The package <paramref name="contentFolder"/> is the root of, or null when it is not one or its files will not parse.</summary>
public static GdkPackage? Read(string contentFolder)
{
ArgumentException.ThrowIfNullOrWhiteSpace(contentFolder);
if (!IsPackageRoot(contentFolder))
{
return null;
}
XDocument? config = Load(Path.Combine(contentFolder, ConfigFileName));
XDocument? manifest = Load(Path.Combine(contentFolder, ManifestFileName));
if (config?.Root is not { } game || manifest?.Root is not { } package)
{
return null;
}
XElement? identity = Child(game, "Identity");
string? name = Attribute(identity, "Name");
string? publisher = Attribute(identity, "Publisher");
if (name is null || publisher is null)
{
return null;
}
XElement? visuals = Child(game, "ShellVisuals");
XNamespace ns = _manifestNamespace;
List<XElement> applications = [.. package.Elements(ns + "Applications").Elements(ns + "Application")];
XElement? application = applications.Find(static a => string.Equals(Attribute(a, "Executable"), _launchHelper, StringComparison.OrdinalIgnoreCase))
?? applications.FirstOrDefault();
return new GdkPackage
{
Name = name,
Publisher = publisher,
Version = Attribute(identity, "Version"),
DisplayName = Plain(Attribute(visuals, "DefaultDisplayName")) ?? Plain(package.Element(ns + "Properties")?.Element(ns + "DisplayName")?.Value),
LaunchExecutable = Attribute(Child(Child(game, "ExecutableList"), "Executable"), "Name"),
ApplicationId = Attribute(application, "Id"),
StoreId = Plain(Child(game, "StoreId")?.Value),
Square480Logo = Attribute(visuals, "Square480x480Logo"),
Square150Logo = Attribute(visuals, "Square150x150Logo"),
SplashScreen = Attribute(visuals, "SplashScreenImage"),
};
}
private static XDocument? Load(string path)
{
try
{
var info = new FileInfo(path);
if (!info.Exists || info.Length > MaxFileBytes)
{
return null;
}
using XmlReader reader = XmlReader.Create(path, _xml);
return XDocument.Load(reader);
}
catch (Exception ex) when (ex is IOException or UnauthorizedAccessException or XmlException)
{
return null;
}
}
/// <summary>The first child element named <paramref name="localName"/> in any namespace — <c>MicrosoftGame.config</c> declares none.</summary>
private static XElement? Child(XElement? parent, string localName) =>
parent?.Elements().FirstOrDefault(e => string.Equals(e.Name.LocalName, localName, StringComparison.Ordinal));
private static string? Attribute(XElement? element, string name) =>
element?.Attribute(name)?.Value is { } value && !string.IsNullOrWhiteSpace(value) ? value.Trim() : null;
/// <summary>A name as text, or null for an empty one or an <c>ms-resource:</c> reference this reader does not resolve.</summary>
private static string? Plain(string? value) =>
string.IsNullOrWhiteSpace(value) || value.TrimStart().StartsWith(_resourcePrefix, StringComparison.OrdinalIgnoreCase) ? null : value.Trim();
}
@@ -0,0 +1,18 @@
// SPDX-License-Identifier: GPL-3.0-only
// Copyright (C) 2026 poli0981 - additional terms under GPLv3 section 7: see NOTICE
namespace FrameLedger.Infrastructure.Import;
/// <summary>
/// Windows' own answers about an app package (beta.33): the family name a package identity has, and whether a package of
/// that family is installed for the current user. The Xbox library asks both of every game folder it finds, so a folder
/// the Xbox app left behind, or one installed for another user, is not offered.
/// </summary>
public interface IInstalledPackages
{
/// <summary>The package family name Windows computes for <paramref name="name"/> and <paramref name="publisher"/>, or null when it does not.</summary>
string? FamilyName(string name, string publisher);
/// <summary>True when a package of the family <paramref name="familyName"/> is installed for the current user.</summary>
bool IsInstalled(string familyName);
}
@@ -0,0 +1,67 @@
// SPDX-License-Identifier: GPL-3.0-only
// Copyright (C) 2026 poli0981 - additional terms under GPLv3 section 7: see NOTICE
using System.Runtime.InteropServices;
namespace FrameLedger.Infrastructure.Import;
/// <summary>
/// <see cref="IInstalledPackages"/> over <c>appmodel.h</c>'s documented calls — <c>PackageFamilyNameFromId</c> and
/// <c>GetPackagesByPackageFamily</c> — which answer for the user without elevation (measured on the owner's 11 games,
/// <c>spike-notes</c> §25). Hand-written <c>DllImport</c>s beside <c>ToolhelpProcessSnapshotSource</c>'s, for its reason:
/// the marshaling-off CsWin32 profile would hand back raw <c>PWSTR</c>s for the strings this class exists to read.
/// </summary>
public sealed class WindowsInstalledPackages : IInstalledPackages
{
private const int _errorSuccess = 0;
private const int _errorInsufficientBuffer = 122;
private const int _familyNameCapacity = 128; // PACKAGE_FAMILY_NAME_MAX_LENGTH is 64 + the terminator
/// <summary>The one instance; it holds nothing.</summary>
public static WindowsInstalledPackages Instance { get; } = new();
/// <inheritdoc />
public string? FamilyName(string name, string publisher)
{
ArgumentException.ThrowIfNullOrWhiteSpace(name);
ArgumentException.ThrowIfNullOrWhiteSpace(publisher);
var id = new PackageId { Name = name, Publisher = publisher };
uint length = _familyNameCapacity;
char[] buffer = new char[_familyNameCapacity];
int result = PackageFamilyNameFromId(ref id, ref length, buffer);
return result == _errorSuccess && length > 1 && length <= buffer.Length ? new string(buffer, 0, checked((int)length - 1)) : null;
}
/// <inheritdoc />
public bool IsInstalled(string familyName)
{
ArgumentException.ThrowIfNullOrWhiteSpace(familyName);
uint count = 0;
uint bufferLength = 0;
int result = GetPackagesByPackageFamily(familyName, ref count, IntPtr.Zero, ref bufferLength, IntPtr.Zero);
// Asked with no buffers, an installed family answers "insufficient buffer" with its count; none answers success and 0.
return result == _errorInsufficientBuffer || (result == _errorSuccess && count > 0);
}
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
private struct PackageId
{
public uint Reserved;
public uint ProcessorArchitecture;
public ulong Version;
public string Name;
public string Publisher;
public string? ResourceId;
public string? PublisherId;
}
[DefaultDllImportSearchPaths(DllImportSearchPath.System32)]
[DllImport("kernel32.dll", CharSet = CharSet.Unicode)]
private static extern int PackageFamilyNameFromId(ref PackageId packageId, ref uint packageFamilyNameLength, [Out] char[] packageFamilyName);
[DefaultDllImportSearchPaths(DllImportSearchPath.System32)]
[DllImport("kernel32.dll", CharSet = CharSet.Unicode)]
private static extern int GetPackagesByPackageFamily(string packageFamilyName, ref uint count, IntPtr packageFullNames, ref uint bufferLength,
IntPtr buffer);
}
@@ -0,0 +1,85 @@
// SPDX-License-Identifier: GPL-3.0-only
// Copyright (C) 2026 poli0981 - additional terms under GPLv3 section 7: see NOTICE
using FrameLedger.Application.Import;
namespace FrameLedger.Infrastructure.Import;
/// <summary>
/// The games the Xbox app and the Microsoft Store installed — PC Game Pass included (beta.33, owner decisions D78/D79,
/// <c>spike-notes</c> §25): every <c>&lt;games folder&gt;\&lt;Game&gt;\Content\</c> that is a GDK package root, under the
/// folders the drives' <c>.GamingRoot</c> files name (<see cref="GamingRoots"/>), whose package Windows says is installed
/// for this user (<see cref="IInstalledPackages"/>).
/// </summary>
/// <remarks>
/// <para>
/// <b>The record:</b> the store id is the package family name (stable across the game's updates, unlike the WindowsApps
/// folder whose name carries the version); the install directory is <c>Content</c>, the spelling the game's process
/// reports for its own image (§25 — never the <c>C:\Program Files\WindowsApps</c> junction); the launch key is the
/// AppUserModelID <c>&lt;family name&gt;!&lt;Application Id&gt;</c>, exactly what Windows' Start menu lists, which Play
/// activates (D80). The executable is left to <c>ExecutableLocator</c>, because the one the package launches is the
/// Unreal stub, not the shipping executable that presents.
/// </para>
/// <para>
/// GDK titles only (D78): a UWP app has no <c>MicrosoftGame.config</c> and lives in no games folder, so it is not listed.
/// </para>
/// </remarks>
public sealed class XboxLibrarySource(IReadOnlyList<string>? gamingRoots = null, IInstalledPackages? packages = null) : IStoreLibrarySource
{
/// <summary>The package root's folder name under each game's folder.</summary>
public const string ContentFolder = "Content";
public string Platform => "xbox";
public ValueTask<IReadOnlyList<StoreGame>> ListAsync(CancellationToken ct = default)
{
IReadOnlyList<string> roots = gamingRoots ?? GamingRoots.OnThisPc();
IInstalledPackages registry = packages ?? WindowsInstalledPackages.Instance;
List<StoreGame> games = [];
foreach (string root in roots)
{
string[] folders;
try
{
folders = Directory.GetDirectories(root);
}
catch (Exception ex) when (ex is IOException or UnauthorizedAccessException)
{
continue;
}
foreach (string folder in folders)
{
ct.ThrowIfCancellationRequested();
if (Read(folder, registry) is { } game)
{
games.Add(game);
}
}
}
return ValueTask.FromResult<IReadOnlyList<StoreGame>>(games);
}
/// <summary>The game in <paramref name="gameFolder"/>, or null when it holds no installed GDK package.</summary>
public static StoreGame? Read(string gameFolder, IInstalledPackages registry)
{
ArgumentException.ThrowIfNullOrWhiteSpace(gameFolder);
ArgumentNullException.ThrowIfNull(registry);
string content = Path.Combine(gameFolder, ContentFolder);
if (GdkPackageFiles.Read(content) is not { } package)
{
return null;
}
string? family = registry.FamilyName(package.Name, package.Publisher);
if (family is null || !registry.IsInstalled(family))
{
return null;
}
string name = package.DisplayName ?? Path.GetFileName(Path.TrimEndingDirectorySeparator(gameFolder));
string? launchKey = package.ApplicationId is { } appId ? family + "!" + appId : null;
return new StoreGame("xbox", family, name, content, ExePath: null, package.Version, launchKey);
}
}
@@ -184,7 +184,7 @@ public sealed class SqliteGameRepository : IGameRepository
ArgumentException.ThrowIfNullOrWhiteSpace(metadata.Name, nameof(metadata));
if (!GameMetadata.Platforms.Contains(metadata.Platform, StringComparer.Ordinal))
{
throw new ArgumentException($"'{metadata.Platform}' is not a platform (steam|gog|epic|itch|none)", nameof(metadata));
throw new ArgumentException($"'{metadata.Platform}' is not a platform ({string.Join('|', GameMetadata.Platforms)})", nameof(metadata));
}
return _db.WriteAsync(async (c, tx, token) =>
@@ -295,7 +295,7 @@ public sealed class SqliteGameRepository : IGameRepository
ArgumentNullException.ThrowIfNull(store);
if (!GameMetadata.Platforms.Contains(store.Platform, StringComparer.Ordinal) || string.Equals(store.Platform, "none", StringComparison.Ordinal))
{
throw new ArgumentException($"'{store.Platform}' is not a store (steam|gog|epic|itch)", nameof(store));
throw new ArgumentException($"'{store.Platform}' is not a store ({string.Join('|', GameMetadata.Platforms.Where(static p => !string.Equals(p, "none", StringComparison.Ordinal)))})", nameof(store));
}
return _db.WriteAsync(async (c, tx, token) =>
@@ -84,8 +84,9 @@ inline constexpr std::size_t kMaxPreScanPathLen = 1024;
// anti-cheat SDK. For exactly the layout most likely to carry EAC, check 4 was
// looking in the wrong place.
//
// Walks up to a hardcoded platform boundary (`steamapps\common\<X>` and
// friends) and returns that game's folder. Boundaries are hardcoded for the same
// Walks up to a hardcoded platform boundary (`steamapps\common\<X>`,
// `GOG Galaxy\Games\<X>`, `Epic Games\<X>`, `GamesInstalled\<X>`) and returns
// that game's folder. Boundaries are hardcoded for the same
// reason IsPlatformLauncher is: a data-driven boundary would let a rules update
// move where the hard gate looks.
//
@@ -94,6 +95,15 @@ inline constexpr std::size_t kMaxPreScanPathLen = 1024;
// `D:\games\Title\` is a folder of other games, and refusing this title because
// a sibling ships anti-cheat is a false refusal with no appeal.
//
// EXCEPT AT A GDK PACKAGE ROOT (beta.33, spike-notes §25). The Xbox app installs
// to `<games folder>\<Game>\Content\` under a folder the user names; the package
// marks its own root with `MicrosoftGame.config` beside `appxmanifest.xml`. Only
// when no string boundary matched, the nearest folder at or above `exeDir` (at
// most 8 levels up, never a drive's root) holding both FILES is the root — not a
// blind walk up, a marker the package itself writes, and only ever a widening of
// the walk relative to `exeDir`. The managed InstallRoot answers the same; the
// case list tests/fixtures/install-roots/cases.txt holds both to it.
//
// The root REPLACED the executable's folder as check 4's one walk on 2026-09-25,
// and that was half right: what sits at the root (Lies of P's EasyAntiCheat/) is
// seen, what sits beside a nested executable is not (kMaxPreScanDepth). Since
@@ -1,8 +1,8 @@
// SPDX-License-Identifier: GPL-3.0-only
// Copyright (C) 2026 poli0981 - additional terms under GPLv3 section 7: see NOTICE
// windows.h stays in its own block above the sorted group, as fl_ac_rules.cpp does: WideCharToMultiByte (the one
// Win32 call here, for the executable's leaf name) needs it.
// windows.h stays in its own block above the sorted group, as fl_ac_rules.cpp does: WideCharToMultiByte (for the
// executable's leaf name) and GetFileAttributesW (a GDK package root's two files, beta.33) need it.
#include <windows.h>
#include <cstring>
@@ -272,6 +272,29 @@ Verdict PreScanGameWith(const wchar_t* exePath, const Sources& s, const char* to
return finding.seen ? ToleratedVerdict(finding) : Passed();
}
// A GDK package root (beta.33, spike-notes §25): the folder holding both `MicrosoftGame.config` and `appxmanifest.xml`
// as files. `folder` is the first `len` characters of a path; the probe path is built on the stack. A probe that fails
// — too long, absent, a directory, unreadable — is not a root.
bool IsGdkPackageRoot(const wchar_t* folder, std::size_t len) noexcept {
static const wchar_t* const kFiles[] = {L"MicrosoftGame.config", L"appxmanifest.xml"};
for (const wchar_t* file : kFiles) {
wchar_t probe[kMaxPreScanPathLen] = {};
const std::size_t fileLen = wcslen(file);
if (len + 1 + fileLen + 1 > kMaxPreScanPathLen) {
return false;
}
std::wmemcpy(probe, folder, len);
probe[len] = L'\\';
std::wmemcpy(probe + len + 1, file, fileLen);
probe[len + 1 + fileLen] = L'\0';
const DWORD attrs = GetFileAttributesW(probe);
if (attrs == INVALID_FILE_ATTRIBUTES || (attrs & FILE_ATTRIBUTE_DIRECTORY) != 0) {
return false;
}
}
return true;
}
} // namespace
bool ResolveInstallRoot(const wchar_t* exeDir, wchar_t* out, std::size_t cap) noexcept {
@@ -306,10 +329,13 @@ bool ResolveInstallRoot(const wchar_t* exeDir, wchar_t* out, std::size_t cap) no
const wchar_t* seg[2];
std::size_t len;
};
// `GamesInstalled` joined on 2026-11-03 (beta.33): the managed resolver had it since #17 and this one never did, so
// detection and check 4 walked different folders for a game under one. More is walked here now, never less.
static const Boundary kBoundaries[] = {
{{L"steamapps", L"common"}, 2},
{{L"GOG Galaxy", L"Games"}, 2},
{{L"Epic Games", nullptr}, 1},
{{L"GamesInstalled", nullptr}, 1},
};
for (const Boundary& b : kBoundaries) {
@@ -333,7 +359,26 @@ bool ResolveInstallRoot(const wchar_t* exeDir, wchar_t* out, std::size_t cap) no
}
}
// No boundary recognised: the executable's own directory, unchanged.
// No string boundary: a GDK package root at or above the executable's folder (beta.33, spike-notes §25). The Xbox
// app installs to <games folder>\<Game>\Content\ under a folder the user names, so no string bounds it; the package
// marks its own root. Asked only here — after every string boundary missed — so it widens the walk relative to the
// exe's own folder, never narrows it; the nearest one wins, at most kMaxGdkLevelsUp levels up, and never a drive's
// root (two segments at least). Without it an Unreal title's Content\<Project>\Binaries\WinGDK was all check 4 saw.
constexpr std::size_t kMaxGdkLevelsUp = 8;
for (std::size_t up = 0; up <= kMaxGdkLevelsUp && up + 2 <= count; ++up) {
const auto n = static_cast<std::size_t>(ends[count - 1 - up] - exeDir);
if (!IsGdkPackageRoot(exeDir, n)) {
continue;
}
if (n + 1 > cap) {
return false; // a truncated path is a path to somewhere else
}
std::wmemcpy(out, exeDir, n);
out[n] = L'\0';
return true;
}
// Nothing recognised: the executable's own directory, unchanged.
if (wcslen(exeDir) + 1 > cap) {
return false;
}
+3
View File
@@ -120,6 +120,9 @@ add_custom_target(fl_stage_overlay_payload DEPENDS "${FL_STAGED_OVERLAY}")
target_compile_definitions(fl_guard_test PRIVATE
FL_HARNESS_EXE=L"$<TARGET_FILE:hook-harness>"
# The install-root cases the managed InstallRootCasesTests read too (beta.33): one list, so the two resolvers
# cannot answer a layout differently without one of the two suites going red.
FL_INSTALL_ROOT_CASES=L"${CMAKE_SOURCE_DIR}/../../tests/fixtures/install-roots/cases.txt"
# The extent hook-harness tags, from src/native/CMakeLists.txt. Shared rather
# than retyped: a fixture and its assertion holding separate copies of the
# number under test is how a test starts proving something else.
+139
View File
@@ -3961,6 +3961,145 @@ TEST_CASE("an unrecognised layout keeps the exe's own directory", "[guard][presc
CHECK_FALSE(ResolveInstallRoot(nullptr, out, kMaxPreScanPathLen));
}
// ===========================================================================
// The shared install-root cases (beta.33): tests/fixtures/install-roots/cases.txt, read here and by the managed
// InstallRootCasesTests, so ResolveInstallRoot and InstallRoot.Resolve cannot drift apart again — they had, over
// `GamesInstalled`, since #17. A GDK package root is marked by FILES, so each case builds its tree in a temp folder.
// ===========================================================================
namespace {
struct InstallRootCase {
std::wstring files;
std::wstring exe;
std::wstring root;
};
// The case file is ASCII (its own header says so); Narrow, its inverse, is the log tests' above.
std::wstring Widen(const std::string& ascii) {
std::wstring w;
for (char ch : ascii) {
w.push_back(static_cast<wchar_t>(static_cast<unsigned char>(ch)));
}
return w;
}
std::vector<InstallRootCase> ReadInstallRootCases() {
FILE* f = nullptr;
REQUIRE(_wfopen_s(&f, FL_INSTALL_ROOT_CASES, L"rb") == 0);
REQUIRE(f != nullptr);
std::string text;
char chunk[4096];
std::size_t got = 0;
while ((got = std::fread(chunk, 1, sizeof(chunk), f)) > 0) {
text.append(chunk, got);
}
std::fclose(f);
std::vector<InstallRootCase> cases;
std::size_t start = 0;
while (start < text.size()) {
std::size_t end = text.find('\n', start);
if (end == std::string::npos) {
end = text.size();
}
std::string line = text.substr(start, end - start);
start = end + 1;
if (!line.empty() && line.back() == '\r') {
line.pop_back();
}
if (line.empty() || line[0] == '#') {
continue;
}
const std::size_t a = line.find('|');
const std::size_t b = (a == std::string::npos) ? std::string::npos : line.find('|', a + 1);
INFO("case line: " << line);
REQUIRE(b != std::string::npos);
cases.push_back({Widen(line.substr(0, a)), Widen(line.substr(a + 1, b - a - 1)), Widen(line.substr(b + 1))});
}
return cases;
}
void MakeFolders(const std::wstring& dir) {
for (std::size_t i = 3; i <= dir.size(); ++i) { // past "C:\"
if (i == dir.size() || dir[i] == L'\\') {
static_cast<void>(CreateDirectoryW(dir.substr(0, i).c_str(), nullptr));
}
}
}
void RemoveFolderTree(const std::wstring& dir) {
WIN32_FIND_DATAW fd{};
HANDLE h = FindFirstFileW((dir + L"\\*").c_str(), &fd);
if (h != INVALID_HANDLE_VALUE) {
do {
const std::wstring name = fd.cFileName;
if (name == L"." || name == L"..") {
continue;
}
const std::wstring path = dir + L"\\" + name;
if ((fd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) != 0) {
RemoveFolderTree(path);
} else {
static_cast<void>(DeleteFileW(path.c_str()));
}
} while (FindNextFileW(h, &fd) != 0);
FindClose(h);
}
static_cast<void>(RemoveDirectoryW(dir.c_str()));
}
void WriteEmptyFile(const std::wstring& path) {
HANDLE h = CreateFileW(path.c_str(), GENERIC_WRITE, 0, nullptr, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, nullptr);
REQUIRE(h != INVALID_HANDLE_VALUE);
CloseHandle(h);
}
} // namespace
TEST_CASE("the shared install-root cases resolve as the managed resolver resolves them", "[guard][prescan]") {
const std::vector<InstallRootCase> cases = ReadInstallRootCases();
REQUIRE(cases.size() >= 10); // an empty list is a green test that compared nothing
wchar_t base[MAX_PATH] = {};
REQUIRE(GetTempPathW(MAX_PATH, base) > 0);
int index = 0;
for (const InstallRootCase& c : cases) {
const std::wstring temp = std::wstring(base) + L"fl_roots_" + std::to_wstring(GetCurrentProcessId()) + L"_" +
std::to_wstring(index++);
RemoveFolderTree(temp);
MakeFolders(temp);
std::size_t start = 0;
while (start < c.files.size()) {
std::size_t end = c.files.find(L';', start);
if (end == std::wstring::npos) {
end = c.files.size();
}
const std::wstring item = c.files.substr(start, end - start);
start = end + 1;
if (item.empty()) {
continue;
}
const std::wstring path = temp + L"\\" + item;
if (path.back() == L'\\') {
MakeFolders(path.substr(0, path.size() - 1));
} else {
MakeFolders(path.substr(0, path.rfind(L'\\')));
WriteEmptyFile(path);
}
}
const std::wstring exe = temp + L"\\" + c.exe;
const std::wstring exeDir = exe.substr(0, exe.rfind(L'\\'));
wchar_t out[kMaxPreScanPathLen] = {};
INFO("case " << index << ": " << Narrow(c.exe));
const bool resolved = ResolveInstallRoot(exeDir.c_str(), out, kMaxPreScanPathLen);
RemoveFolderTree(temp);
REQUIRE(resolved);
CHECK(Narrow(out) == Narrow(temp + L"\\" + c.root));
}
}
TEST_CASE("the advisory pre-scan reaches the same verdict as the one inside the guard", "[guard][prescan]") {
// FR-2.2's UI question. Same matcher, same polarity — the only difference is
// that it takes the executable's path instead of a pid.
@@ -157,6 +157,7 @@ public sealed class FormatsTests
InEnglish(() => Formats.ExitStatusText(ExitStatus.Crashed)).Should().Be("crashed");
InEnglish(() => Formats.ExitStatusText(ExitStatus.UnhookedSafety)).Should().Be("unhooked (safety)");
Formats.Platform("steam").Should().Be("Steam");
Formats.Platform("xbox").Should().Be("Xbox", "beta.33, D79: the Xbox app and the Microsoft Store");
Formats.Platform("none").Should().BeEmpty();
}
@@ -183,6 +184,7 @@ public sealed class FormatsTests
Formats.StoreVersion("steam", "20374416", detected: true).Should().Be("Steam build 20374416");
Formats.StoreVersion("gog", "1.2.3", detected: true).Should().Be("GOG version 1.2.3");
Formats.StoreVersion("epic", "++Fortnite+Release-31.10", detected: true).Should().Be("Epic version ++Fortnite+Release-31.10");
Formats.StoreVersion("xbox", "1.3.5124.0", detected: true).Should().Be("Xbox version 1.3.5124.0", "the package version an import read");
Formats.StoreVersion("itch", "0.9", detected: true).Should().Be("0.9", "itch has no store version to label");
Formats.StoreVersion("steam", "1.04 (my patch)", detected: false).Should().Be("1.04 (my patch)", "the user's words are theirs");
Formats.StoreVersion("steam", " ", detected: true).Should().BeNull();
@@ -80,6 +80,28 @@ public sealed class GameArtTests : IDisposable
gone.Source.Should().Be(Strings.Art_Source_Steam);
}
[Fact]
public async Task AnXboxGamesSquareLogoIsItsCoverDrawnSquareAndItsSplashTheBanner()
{
// beta.33: what an Xbox game ships in its own package folder (spike-notes §25) — a 480x480 logo, a 1920x1080 splash.
await using ScratchLedger s = await ScratchLedger.OpenAsync();
string content = Path.Combine(_dir, "xbox", "Valor Mortis", "Content");
GameRow game = await s.GameAsync("Valor Mortis", Path.Combine(content, "ValorMortis", "Binaries", "Win64", "ValorMortisMSG-Win64-Shipping.exe"));
string logo = TestImages.Write(Path.Combine(content, "Resources", "Square480x480Logo.png"), TestImages.Png(48, 48, Color.FromRgb(30, 30, 160)));
string splash = TestImages.Write(Path.Combine(content, "Resources", "SplashScreen.png"), TestImages.Png(96, 54, Color.FromRgb(160, 30, 30)));
var store = new TestImages.Store("xbox", new StoreGame("xbox", "LyricalGamesLLC.ValorMortis_72fag5ekhk96y", "Valor Mortis", content, null, null));
var cache = new TestImages.ArtCache("xbox", "LyricalGamesLLC.ValorMortis_72fag5ekhk96y", new GameArtFiles(null, splash, splash, logo));
GameArtView view = (await Art(new MemorySettings(), store, cache).ForAsync(game, Ct))!;
view.Cover.Should().NotBeNull();
view.CoverIsSquare.Should().BeTrue("the logo is drawn whole in a square slot, never cropped to a portrait");
view.CoverIsLandscape.Should().BeFalse("the splash is the banner; the square logo comes before the landscape header");
view.Hero.Should().NotBeNull();
view.Source.Should().Be(Strings.Art_Source_Xbox);
view.Tint!.Value.B.Should().BeGreaterThan(view.Tint.Value.R, "the band takes the logo's colour, the cover slot's image");
}
[Theory]
[InlineData("C:\\Windows\\Web\\Wallpaper\\img0.jpg")]
[InlineData("\\\\server\\share\\x.png")]
+4 -3
View File
@@ -67,10 +67,11 @@ internal static class TestImages
public List<string> Asked { get; } = [];
public GameArtFiles Find(string id)
public GameArtFiles Find(StoreGame record)
{
Asked.Add(id);
return string.Equals(id, storeId, StringComparison.Ordinal) ? files : GameArtFiles.None;
ArgumentNullException.ThrowIfNull(record);
Asked.Add(record.StoreId);
return string.Equals(record.StoreId, storeId, StringComparison.Ordinal) ? files : GameArtFiles.None;
}
}
}
@@ -146,6 +146,14 @@ internal sealed class FakeGameRepository : IGameRepository
public ValueTask<bool> ApplyStoreMetadataAsync(long gameId, StoreMetadata store, CancellationToken ct = default)
{
// The real repository's contract (beta.33): a store id that is not in games.platform's vocabulary throws there, so it
// throws here too — an importer test must not pass with a platform the ledger would refuse.
ArgumentNullException.ThrowIfNull(store);
if (!GameMetadata.Platforms.Contains(store.Platform, StringComparer.Ordinal) || string.Equals(store.Platform, "none", StringComparison.Ordinal))
{
throw new ArgumentException($"'{store.Platform}' is not a store", nameof(store));
}
Stores.Add((gameId, store));
foreach ((string key, GameRow row) in Rows)
{
@@ -59,6 +59,32 @@ public sealed class RuleEvaluatorTests
.Should().Be(SignalOutcome.NoMatch);
}
[Fact]
public void RootFile_IsDecidedByTheRootsOwnListing_EvenWhenTheDeepWalkRanShort()
{
// beta.33, the xbox platform: a GDK package root's two files. The deep walk stopped on a bound
// (FileListingComplete false), which would make a sibling_glob miss Unknown; the root's own listing decides.
GameFileSnapshot gdk = Snapshot(files: [], listingComplete: false) with
{
RootFiles = new HashSet<string>(["MicrosoftGame.Config", "appxmanifest.xml"], StringComparer.OrdinalIgnoreCase),
};
GameFileSnapshot steam = Snapshot(files: ["steam_api64.dll"], listingComplete: false) with
{
RootFiles = new HashSet<string>(["Game.exe", "steam_api64.dll"], StringComparer.OrdinalIgnoreCase),
};
RuleEvaluator.Evaluate(Signal(DetectionSignalType.RootFile, "MicrosoftGame.config"), gdk).Should().Be(SignalOutcome.Match);
RuleEvaluator.Evaluate(Signal(DetectionSignalType.RootFile, "MicrosoftGame.config"), steam).Should().Be(SignalOutcome.NoMatch,
"a complete listing of the root is evidence of absence there, whatever the deep walk did");
RuleEvaluator.Evaluate(Signal(DetectionSignalType.SiblingGlob, "MicrosoftGame.config"), steam).Should().Be(SignalOutcome.Unknown,
"the contrast: a walk-based miss on an incomplete walk is Unknown");
}
[Fact]
public void RootFile_IsUnknownWhenTheRootWasNotListed() =>
RuleEvaluator.Evaluate(Signal(DetectionSignalType.RootFile, "MicrosoftGame.config"), Snapshot(files: ["MicrosoftGame.config"]))
.Should().Be(SignalOutcome.Unknown, "no listing of the root (RootFiles null) is not a miss");
[Fact]
public void PathContains_IsCaseInsensitiveAndSeparatorAgnostic()
{
@@ -0,0 +1,93 @@
// SPDX-License-Identifier: GPL-3.0-only
// Copyright (C) 2026 poli0981 - additional terms under GPLv3 section 7: see NOTICE
using FluentAssertions;
using FrameLedger.Infrastructure.Detection;
namespace FrameLedger.Infrastructure.Tests.Detection;
/// <summary>
/// The install-root cases both resolvers read (beta.33): <c>tests/fixtures/install-roots/cases.txt</c>, answered here by
/// <see cref="InstallRoot.Resolve"/> and in <c>fl_guard_test</c> by the native <c>ResolveInstallRoot</c>. They had drifted:
/// the managed list carried <c>GamesInstalled</c> from #17 and the native one never did. A GDK package root is marked by
/// FILES (<c>MicrosoftGame.config</c> beside <c>appxmanifest.xml</c>, <c>spike-notes</c> §25), so each case builds its tree
/// in a folder of its own under the temp directory.
/// </summary>
public sealed class InstallRootCasesTests : IDisposable
{
private readonly string _temp = Path.Combine(Path.GetTempPath(), "fl-install-roots-" + Guid.NewGuid().ToString("N"));
private static string RepoRoot()
{
var dir = new DirectoryInfo(AppContext.BaseDirectory);
while (dir is not null && !File.Exists(Path.Combine(dir.FullName, "FrameLedger.slnx")))
{
dir = dir.Parent;
}
dir.Should().NotBeNull("the cases live in the repository");
return dir!.FullName;
}
public static TheoryData<string, string, string> Cases()
{
var data = new TheoryData<string, string, string>();
foreach (string line in File.ReadAllLines(Path.Combine(RepoRoot(), "tests", "fixtures", "install-roots", "cases.txt")))
{
if (line.Length == 0 || line[0] == '#')
{
continue;
}
string[] fields = line.Split('|');
fields.Should().HaveCount(3, $"'{line}' must be <files>|<exe>|<root>");
data.Add(fields[0], fields[1], fields[2]);
}
return data;
}
[Fact]
public void TheListIsNotEmpty() =>
Cases().Should().HaveCountGreaterThanOrEqualTo(10, "an empty list is a green theory that compared nothing");
[Theory]
[MemberData(nameof(Cases))]
public void EachSharedCaseResolvesToItsRoot(string files, string exe, string root)
{
ArgumentNullException.ThrowIfNull(files);
ArgumentNullException.ThrowIfNull(exe);
ArgumentNullException.ThrowIfNull(root);
Directory.CreateDirectory(_temp);
foreach (string item in files.Split(';', StringSplitOptions.RemoveEmptyEntries))
{
string path = Path.Combine(_temp, item);
if (item.EndsWith('\\'))
{
Directory.CreateDirectory(path);
}
else
{
Directory.CreateDirectory(Path.GetDirectoryName(path)!);
File.WriteAllBytes(path, []);
}
}
InstallRoot.Resolve(Path.Combine(_temp, exe)).Should().Be(Path.Combine(_temp, root), $"the case for {exe}");
}
public void Dispose()
{
try
{
if (Directory.Exists(_temp))
{
Directory.Delete(_temp, recursive: true);
}
}
catch (IOException)
{
// A folder still in use is the OS's to clean; the case already answered.
}
}
}
@@ -68,6 +68,39 @@ public sealed class ExecutableLocatorTests : IDisposable
"the root executable of an Unreal package starts the shipping binary and exits; the shipping binary is the process that presents");
}
[Fact]
public async Task AGdkUnrealPackagePicksTheWinGdkShippingBinaryOverTheStubAndTheLaunchHelper()
{
// A Game About Digging A Hole from the Xbox app (spike-notes §25), its real sizes: the package launches the 233,984-byte
// stub, the stub starts the shipping binary, and gamelaunchhelper.exe is the GDK's own launcher.
string content = Sub("A Game About Digging A Hole", "Content");
string bin = Sub("A Game About Digging A Hole", "Content", "DiggingGame", "Binaries", "WinGDK");
await File.WriteAllBytesAsync(Path.Combine(content, "MicrosoftGame.config"), [], Ct);
await File.WriteAllBytesAsync(Path.Combine(content, "appxmanifest.xml"), [], Ct);
await File.WriteAllBytesAsync(Path.Combine(content, "DiggingGame.exe"), new byte[233_984], Ct);
await File.WriteAllBytesAsync(Path.Combine(content, "gamelaunchhelper.exe"), new byte[113_096], Ct);
await File.WriteAllBytesAsync(Path.Combine(bin, "DiggingGame-WinGDK-Shipping.exe"), new byte[2_000], Ct);
new ExecutableLocator().PickPrimary(content).Should().Be(Path.Combine(bin, "DiggingGame-WinGDK-Shipping.exe"),
"the WinGDK shipping binary is the process that presents; the stub and the GDK's launcher are not the game");
}
[Fact]
public async Task TheGdkLaunchHelperIsNeverTheGameEvenWhenItIsTheLargest()
{
// A GDK title of no engine the locator knows: only the name of the package's parent folder and the sizes say anything.
string content = Sub("Microsoft Jewel", "Content");
await File.WriteAllBytesAsync(Path.Combine(content, "MicrosoftGame.config"), [], Ct);
await File.WriteAllBytesAsync(Path.Combine(content, "appxmanifest.xml"), [], Ct);
await File.WriteAllBytesAsync(Path.Combine(content, "gamelaunchhelper.exe"), new byte[900_000], Ct);
await File.WriteAllBytesAsync(Path.Combine(content, "ToolKit.exe"), new byte[800_000], Ct);
await File.WriteAllBytesAsync(Path.Combine(content, "MicrosoftJewel.exe"), new byte[239_936], Ct);
new ExecutableLocator().PickPrimary(content).Should().Be(Path.Combine(content, "MicrosoftJewel.exe"),
"a package root's name is the folder above Content, so the executable named after the game outranks a larger stranger; " +
"the launcher is never the game");
}
[Fact]
public async Task AnExecutableNamedAfterTheInstallBeatsALargerStranger()
{
@@ -0,0 +1,69 @@
// SPDX-License-Identifier: GPL-3.0-only
// Copyright (C) 2026 poli0981 - additional terms under GPLv3 section 7: see NOTICE
using System.Text;
using FluentAssertions;
using FrameLedger.Infrastructure.Import;
namespace FrameLedger.Infrastructure.Tests.Import;
/// <summary>
/// beta.33: the drives' <c>.GamingRoot</c> files as the owner's are (<c>spike-notes</c> §25) — C: 28 bytes naming
/// <c>XboxGames</c>, D: 18 bytes naming <c>xbox</c> — and every way one can fail to be one, costing that drive or that name
/// only; and Windows' own package answers, which are the same on every PC for a given identity.
/// </summary>
public sealed class GamingRootsTests
{
private static byte[] Bytes(uint count, params string[] names)
{
List<byte> bytes = [.. "RGBX"u8.ToArray(), .. BitConverter.GetBytes(count)];
foreach (string name in names)
{
bytes.AddRange(Encoding.Unicode.GetBytes(name + "\0"));
}
return [.. bytes];
}
[Fact]
public void TheOwnersTwoFilesNameTheirGamesFolders()
{
byte[] c = Bytes(1, "XboxGames");
byte[] d = Bytes(1, "xbox");
c.Should().HaveCount(28, "the C: file measured on the owner's PC");
d.Should().HaveCount(18, "the D: file measured on the owner's PC");
GamingRoots.Parse(c, @"C:\").Should().Equal(@"C:\XboxGames");
GamingRoots.Parse(d, @"D:\").Should().Equal(@"D:\xbox");
GamingRoots.Parse(Bytes(2, "XboxGames", @"More\Games"), @"E:\").Should().Equal(@"E:\XboxGames", @"E:\More\Games");
}
[Fact]
public void AFileThatIsNotOneNamesNothing()
{
GamingRoots.Parse([], @"C:\").Should().BeEmpty();
GamingRoots.Parse("XGBR\u0001\0\0\0x\0\0\0"u8.ToArray(), @"C:\").Should().BeEmpty("the magic is RGBX");
GamingRoots.Parse(Bytes(0), @"C:\").Should().BeEmpty();
GamingRoots.Parse(Bytes((uint)GamingRoots.MaxCount + 1, "x"), @"C:\").Should().BeEmpty("a count no install has is a file that is not one");
}
[Fact]
public void ATruncatedFileKeepsTheNamesItHoldsAndAStrangeNameCostsItself()
{
byte[] truncated = [.. Bytes(2, "XboxGames"), .. Encoding.Unicode.GetBytes("Cut")];
GamingRoots.Parse(truncated, @"C:\").Should().Equal(@"C:\XboxGames");
GamingRoots.Parse(Bytes(5, @"..\Windows", @"C:\Elsewhere", "Fine", "a:b", "."), @"D:\").Should().ContainSingle().Which.Should().Be(@"D:\Fine",
"only a plain folder on the file's own drive is a games folder");
}
[Fact]
public void WindowsComputesTheFamilyNameTheStartMenuLists()
{
// The identity Valor Mortis' MicrosoftGame.config states, and the family name Get-AppxPackage and Get-StartApps list
// for it on the owner's PC; PackageFamilyNameFromId computes it the same way on any Windows.
WindowsInstalledPackages.Instance.FamilyName("LyricalGamesLLC.ValorMortis", "CN=C32D4B9A-1AEC-416A-8124-789B35AD6753")
.Should().Be("LyricalGamesLLC.ValorMortis_72fag5ekhk96y");
WindowsInstalledPackages.Instance.IsInstalled("FrameLedger.NotAPackage_0000000000000").Should().BeFalse();
}
}
@@ -3,6 +3,7 @@
using FluentAssertions;
using FrameLedger.Application.Art;
using FrameLedger.Application.Import;
using FrameLedger.Infrastructure.Art;
namespace FrameLedger.Infrastructure.Tests.Import;
@@ -20,6 +21,9 @@ public sealed class StoreArtCachesTests : IDisposable
public void Dispose() => Directory.Delete(_dir, recursive: true);
/// <summary>A store's record of a game with <paramref name="id"/> (beta.33: the caches take the whole record).</summary>
private static StoreGame Record(string id) => new("steam", id, "Game", @"C:\Games\Game", ExePath: null, Version: null);
private string Touch(DateTime writtenUtc, params string[] parts)
{
string path = Path.Combine([_dir, .. parts]);
@@ -40,7 +44,7 @@ public sealed class StoreArtCachesTests : IDisposable
_ = Steam("374320", "library_hero_blur.jpg");
_ = Steam("374320", "logo.png");
GameArtFiles files = new SteamArtCache(Path.Combine(_dir, "Steam")).Find("374320");
GameArtFiles files = new SteamArtCache(Path.Combine(_dir, "Steam")).Find(Record("374320"));
files.Should().Be(new GameArtFiles(cover, hero, header));
}
@@ -54,14 +58,14 @@ public sealed class StoreArtCachesTests : IDisposable
string capsule = Steam("1091500", "cccc", "library_capsule.jpg");
string header = Steam("1091500", "dddd", "library_header.jpg");
GameArtFiles files = new SteamArtCache(Path.Combine(_dir, "Steam")).Find("1091500");
GameArtFiles files = new SteamArtCache(Path.Combine(_dir, "Steam")).Find(Record("1091500"));
files.Cover.Should().Be(capsule);
files.Hero.Should().Be(newerHero, "an asset Steam replaced has a newer copy in a new folder");
files.Header.Should().Be(header);
string portrait = Steam("1091500", "library_600x900.jpg");
new SteamArtCache(Path.Combine(_dir, "Steam")).Find("1091500").Cover.Should().Be(portrait, "the 600x900 portrait is preferred over the capsule");
new SteamArtCache(Path.Combine(_dir, "Steam")).Find(Record("1091500")).Cover.Should().Be(portrait, "the 600x900 portrait is preferred over the capsule");
}
[Theory]
@@ -73,17 +77,17 @@ public sealed class StoreArtCachesTests : IDisposable
public void AnIdThatIsNotTheStoresOwnShapeNamesNoFolder(string id)
{
_ = Steam("374320", "library_600x900.jpg");
new SteamArtCache(Path.Combine(_dir, "Steam")).Find(id).Should().Be(GameArtFiles.None);
new GogArtCache(Path.Combine(_dir, "webcache")).Find(id).Should().Be(GameArtFiles.None);
new SteamArtCache(Path.Combine(_dir, "Steam")).Find(Record(id)).Should().Be(GameArtFiles.None);
new GogArtCache(Path.Combine(_dir, "webcache")).Find(Record(id)).Should().Be(GameArtFiles.None);
}
[Fact]
public void NothingThereIsNoneNeverAnError()
{
new SteamArtCache(Path.Combine(_dir, "no-steam")).Find("374320").Should().Be(GameArtFiles.None);
new GogArtCache(Path.Combine(_dir, "no-galaxy")).Find("1125815775").Should().Be(GameArtFiles.None);
new SteamArtCache(Path.Combine(_dir, "no-steam")).Find(Record("374320")).Should().Be(GameArtFiles.None);
new GogArtCache(Path.Combine(_dir, "no-galaxy")).Find(Record("1125815775")).Should().Be(GameArtFiles.None);
_ = Directory.CreateDirectory(Path.Combine(_dir, "Steam", "appcache", "librarycache", "220"));
new SteamArtCache(Path.Combine(_dir, "Steam")).Find("220").IsEmpty.Should().BeTrue("Steam keeps a folder with no artwork in it for some apps");
new SteamArtCache(Path.Combine(_dir, "Steam")).Find(Record("220")).IsEmpty.Should().BeTrue("Steam keeps a folder with no artwork in it for some apps");
}
[Fact]
@@ -95,7 +99,7 @@ public sealed class StoreArtCachesTests : IDisposable
_ = Touch(DateTime.UtcNow, "webcache", "222", "gog", "1125815775", "33dd_glx_square_icon_v2.webp");
_ = Directory.CreateDirectory(Path.Combine(_dir, "webcache", "common"));
GameArtFiles files = new GogArtCache(Path.Combine(_dir, "webcache")).Find("1125815775");
GameArtFiles files = new GogArtCache(Path.Combine(_dir, "webcache")).Find(Record("1125815775"));
files.Should().Be(new GameArtFiles(cover, banner, null), "the newest copy wins across users, and GOG keeps no header");
}
@@ -0,0 +1,177 @@
// SPDX-License-Identifier: GPL-3.0-only
// Copyright (C) 2026 poli0981 - additional terms under GPLv3 section 7: see NOTICE
using FluentAssertions;
using FrameLedger.Application.Import;
using FrameLedger.Infrastructure.Art;
using FrameLedger.Infrastructure.Import;
namespace FrameLedger.Infrastructure.Tests.Import;
/// <summary>
/// beta.33 (owner decisions D78/D79, <c>spike-notes</c> §25): the Xbox app's games, read from a games folder laid out as the
/// owner's are — <c>&lt;Game&gt;\Content\</c> with <c>MicrosoftGame.config</c> and <c>appxmanifest.xml</c> in the shapes Valor
/// Mortis and FINAL FANTASY ship — and Windows' package answers stubbed, so the source's own decisions are what is tested.
/// </summary>
public sealed class XboxLibrarySourceTests : IDisposable
{
private const string _valorConfig = """
<?xml version="1.0" encoding="utf-8"?>
<Game configVersion="1">
<Identity Name="LyricalGamesLLC.ValorMortis" Publisher="CN=C32D4B9A-1AEC-416A-8124-789B35AD6753" Version="1.3.5124.0" />
<ShellVisuals DefaultDisplayName="Valor Mortis" PublisherDisplayName="Lyrical Games LLC" StoreLogo="Resources\StoreLogo.png" Square150x150Logo="Resources\Logo.png" Square44x44Logo="Resources\SmallLogo.png" Square480x480Logo="Resources\Square480x480Logo.png" Description="ms-resource:AppDescription" ForegroundText="dark" BackgroundColor="#000040" SplashScreenImage="Resources\SplashScreen.png" />
<ExecutableList>
<Executable Name="ValorMortisMSG.exe" Id="AppValorMortisShipping" OverrideDisplayName="ms-resource:AppDisplayName" TargetDeviceFamily="PC" />
</ExecutableList>
<TitleId>76300F35</TitleId>
<StoreId>9P861V1542BL</StoreId>
</Game>
""";
private const string _valorManifest = """
<?xml version="1.0" encoding="UTF-8"?>
<Package xmlns="http://schemas.microsoft.com/appx/manifest/foundation/windows10" xmlns:uap="http://schemas.microsoft.com/appx/manifest/uap/windows10">
<Identity Name="LyricalGamesLLC.ValorMortis" Publisher="CN=C32D4B9A-1AEC-416A-8124-789B35AD6753" Version="1.3.5124.0" ProcessorArchitecture="x64" />
<Properties>
<DisplayName>Valor Mortis</DisplayName>
</Properties>
<Applications>
<Application Id="AppValorMortisShipping" Executable="GameLaunchHelper.exe" EntryPoint="Windows.FullTrustApplication" />
</Applications>
</Package>
""";
private readonly string _root = Path.Combine(Path.GetTempPath(), "fl-xbox-" + Guid.NewGuid().ToString("N"));
public XboxLibrarySourceTests() => Directory.CreateDirectory(_root);
public void Dispose() => Directory.Delete(_root, recursive: true);
private static CancellationToken Ct => TestContext.Current.CancellationToken;
private string Game(string folder, string config, string manifest, string configName = GdkPackageFiles.ConfigFileName)
{
string content = Path.Combine(_root, folder, XboxLibrarySource.ContentFolder);
Directory.CreateDirectory(content);
File.WriteAllText(Path.Combine(content, configName), config);
File.WriteAllText(Path.Combine(content, GdkPackageFiles.ManifestFileName), manifest);
return content;
}
[Fact]
public async Task AnInstalledGdkPackageIsListedWithItsFamilyNameItsAumidAndItsContentFolder()
{
string content = Game("Valor Mortis", _valorConfig, _valorManifest);
var packages = new Packages("LyricalGamesLLC.ValorMortis_72fag5ekhk96y");
IReadOnlyList<StoreGame> games = await new XboxLibrarySource([_root], packages).ListAsync(Ct);
games.Should().ContainSingle();
StoreGame game = games[0];
game.Platform.Should().Be("xbox");
game.StoreId.Should().Be("LyricalGamesLLC.ValorMortis_72fag5ekhk96y", "the family name is stable across updates; the WindowsApps folder's name is not");
game.Name.Should().Be("Valor Mortis");
game.InstallDirectory.Should().Be(content, "the spelling the game's own process reports (§25), never the WindowsApps junction");
game.ExePath.Should().BeNull("the package launches the stub; the locator picks the shipping executable that presents");
game.Version.Should().Be("1.3.5124.0");
game.LaunchKey.Should().Be("LyricalGamesLLC.ValorMortis_72fag5ekhk96y!AppValorMortisShipping", "the AUMID Windows' Start menu lists, which Play activates");
packages.Asked.Should().Equal(("LyricalGamesLLC.ValorMortis", "CN=C32D4B9A-1AEC-416A-8124-789B35AD6753"));
}
[Fact]
public async Task APackageWindowsDoesNotHaveInstalledForThisUserIsNotOffered()
{
Game("Left Behind", _valorConfig, _valorManifest);
(await new XboxLibrarySource([_root], new Packages()).ListAsync(Ct)).Should().BeEmpty(
"a folder the Xbox app left behind, or one installed for another user, is not a game this user can start");
}
[Fact]
public async Task FoldersThatAreNotPackagesCostOnlyThemselves()
{
Game("Valor Mortis", _valorConfig, _valorManifest);
Directory.CreateDirectory(Path.Combine(_root, "GameSave")); // the Xbox app's own folder, no Content
Directory.CreateDirectory(Path.Combine(_root, "Half", "Content"));
await File.WriteAllTextAsync(Path.Combine(_root, "Half", "Content", GdkPackageFiles.ConfigFileName), _valorConfig, Ct); // no manifest
Game("Broken", "<Game><Identity", _valorManifest); // will not parse
Game("Nameless", "<Game configVersion=\"1\"><Identity Version=\"1.0.0.0\" /></Game>", _valorManifest);
IReadOnlyList<StoreGame> games = await new XboxLibrarySource([_root, Path.Combine(_root, "no-such-folder")],
new Packages("LyricalGamesLLC.ValorMortis_72fag5ekhk96y")).ListAsync(Ct);
games.Select(static g => g.Name).Should().Equal("Valor Mortis");
}
[Fact]
public async Task AResourceNameFallsBackToTheManifestsThenToTheFolders()
{
string config = _valorConfig.Replace("DefaultDisplayName=\"Valor Mortis\"", "DefaultDisplayName=\"ms-resource:AppDisplayName\"", StringComparison.Ordinal);
Game("Valor Mortis", config, _valorManifest);
Game("FINAL FANTASY", config.Replace("LyricalGamesLLC.ValorMortis", "39EA002F.FF1DF", StringComparison.Ordinal),
_valorManifest.Replace("<DisplayName>Valor Mortis</DisplayName>", "<DisplayName>ms-resource:AppDisplayName</DisplayName>", StringComparison.Ordinal),
configName: "MicrosoftGame.Config");
IReadOnlyList<StoreGame> games = await new XboxLibrarySource([_root], new Packages("LyricalGamesLLC.ValorMortis_72fag5ekhk96y", "39EA002F.FF1DF_n746a19ndrrjg")).ListAsync(Ct);
games.Select(static g => g.Name).Should().BeEquivalentTo(["Valor Mortis", "FINAL FANTASY"],
"an ms-resource reference is not a name: the manifest's own DisplayName, else the game's folder (the FINAL FANTASY titles spell the config MicrosoftGame.Config)");
}
[Fact]
public async Task TheApplicationThatRunsTheLaunchHelperIsTheOneActivated()
{
string manifest = _valorManifest.Replace(
"<Application Id=\"AppValorMortisShipping\" Executable=\"GameLaunchHelper.exe\"",
"<Application Id=\"Editor\" Executable=\"Editor.exe\" EntryPoint=\"Windows.FullTrustApplication\" /><Application Id=\"Game\" Executable=\"gamelaunchhelper.exe\"",
StringComparison.Ordinal);
Game("Valor Mortis", _valorConfig, manifest);
(await new XboxLibrarySource([_root], new Packages("LyricalGamesLLC.ValorMortis_72fag5ekhk96y")).ListAsync(Ct))
.Single().LaunchKey.Should().Be("LyricalGamesLLC.ValorMortis_72fag5ekhk96y!Game");
}
[Fact]
public async Task AConfigWithADocumentTypeIsRefusedNotExpanded()
{
string withDtd = "<?xml version=\"1.0\"?><!DOCTYPE Game [<!ENTITY x \"Valor Mortis\">]>" + _valorConfig[(_valorConfig.IndexOf("<Game", StringComparison.Ordinal))..];
Game("Valor Mortis", withDtd, _valorManifest);
(await new XboxLibrarySource([_root], new Packages("LyricalGamesLLC.ValorMortis_72fag5ekhk96y")).ListAsync(Ct)).Should().BeEmpty(
"the reader prohibits DTDs: a publisher's file is data, never something to expand");
}
[Fact]
public void TheArtCacheReadsTheSquareLogoAndTheSplashFromThePackageAndNothingOutsideIt()
{
string content = Game("Valor Mortis", _valorConfig, _valorManifest);
Directory.CreateDirectory(Path.Combine(content, "Resources"));
File.WriteAllBytes(Path.Combine(content, "Resources", "Square480x480Logo.png"), [1, 2, 3]);
File.WriteAllBytes(Path.Combine(content, "Resources", "SplashScreen.scale-200.png"), [1, 2, 3, 4]);
File.WriteAllBytes(Path.Combine(content, "Resources", "SplashScreen.scale-100.png"), [1, 2]);
var record = new StoreGame("xbox", "LyricalGamesLLC.ValorMortis_72fag5ekhk96y", "Valor Mortis", content, ExePath: null, Version: null);
Application.Art.GameArtFiles files = new XboxArtCache().Find(record);
files.Square.Should().Be(Path.Combine(content, "Resources", "Square480x480Logo.png"));
files.Hero.Should().Be(Path.Combine(content, "Resources", "SplashScreen.scale-200.png"), "the plain name is absent, so the largest scale variant beside it");
files.Header.Should().Be(files.Hero);
files.Cover.Should().BeNull("a GDK package ships no portrait cover");
XboxArtCache.Image(content, @"..\..\outside.png").Should().BeNull("a name that escapes the package is not the package's picture");
XboxArtCache.Image(content, @"C:\Windows\System32\shell32.dll").Should().BeNull();
}
/// <summary>Windows' package answers, stubbed: the family name is the one listed whose name part matches; installed = listed.</summary>
private sealed class Packages(params string[] installed) : IInstalledPackages
{
public List<(string Name, string Publisher)> Asked { get; } = [];
public string? FamilyName(string name, string publisher)
{
Asked.Add((name, publisher));
return installed.FirstOrDefault(f => f.StartsWith(name + "_", StringComparison.Ordinal)) ?? name + "_0000000000000";
}
public bool IsInstalled(string familyName) => installed.Contains(familyName, StringComparer.Ordinal);
}
}
@@ -226,6 +226,27 @@ public sealed class SqliteGameRepositoryTests
(await repo.ApplyStoreMetadataAsync(row.Id + 99, new StoreMetadata { Platform = "steam" }, Ct)).Should().BeFalse();
}
/// <summary>
/// beta.33 (D79): an Xbox game's import is a store write the REAL repository takes, and the user's Edit… keeps it — the
/// fake used by the importer's tests validated nothing, so an "xbox" those tests accepted would have thrown here.
/// </summary>
[Fact]
public async Task AnXboxImportIsAStoreTheLedgerTakesAndEditKeeps()
{
await using LedgerFixture f = await LedgerFixture.OpenAsync();
var repo = new SqliteGameRepository(f.Db);
GameRow row = await repo.EnsureAsync(_exe, "Valor Mortis", Ct);
(await repo.ApplyStoreMetadataAsync(row.Id, new StoreMetadata { Platform = "xbox", StoreId = "LyricalGamesLLC.ValorMortis_72fag5ekhk96y", GameVersion = "1.3.5124.0" }, Ct))
.Should().BeTrue();
GameRow imported = (await repo.FindByIdAsync(row.Id, Ct))!;
imported.Platform.Should().Be("xbox");
imported.StoreId.Should().Be("LyricalGamesLLC.ValorMortis_72fag5ekhk96y");
(await repo.UpdateMetadataAsync(row.Id, GameMetadata.Of(imported) with { Notes = "a note" }, Ct)).Should().BeTrue("Edit… passes the row's platform through");
(await repo.FindByIdAsync(row.Id, Ct))!.Platform.Should().Be("xbox");
}
private static async Task<long> AddSessionAsync(LedgerFixture f, long gameId)
{
long snapshotId = await new SqliteHardwareSnapshotRepository(f.Db).EnsureAsync(new HardwareSnapshot { GpuName = "G" }, DateTimeOffset.UnixEpoch, Ct).ConfigureAwait(false);
+39
View File
@@ -0,0 +1,39 @@
# The install-root cases BOTH resolvers must answer the same way (beta.33): InstallRoot.Resolve in C#
# (FrameLedger.Infrastructure.Tests, InstallRootCasesTests) and ResolveInstallRoot in C++ (fl_guard_test, "the shared
# install-root cases ..."). They had drifted once already: the managed list carried `GamesInstalled` from #17 and the
# native one never did, so detection and the guard's check 4 walked different folders for a game under one.
#
# Each test makes the listed files under a fresh temporary folder T, resolves the executable T\<exe>, and requires
# T\<root>. One case per line, three fields split by '|':
# <files to create, ';'-separated, may be empty; a trailing '\' makes a folder> | <the executable> | <the root>
# Every path is relative to T. Lines starting with '#' and blank lines are ignored. ASCII only.
# Store boundaries (the layouts measured 2026-08-03; `GamesInstalled` native since beta.33).
|SteamLibrary\steamapps\common\Lies of P\LiesofP\Binaries\Win64\LOP-Win64-Shipping.exe|SteamLibrary\steamapps\common\Lies of P
|SteamLibrary\steamapps\common\Lies of P\LOP.exe|SteamLibrary\steamapps\common\Lies of P
|SteamLibrary\steamapps\common\Deadly Heart Gambit\DeadlyHeartGambit.exe|SteamLibrary\steamapps\common\Deadly Heart Gambit
|Epic Games\SomeTitle\Sub\game.exe|Epic Games\SomeTitle
|GOG Galaxy\Games\SomeTitle\bin\game.exe|GOG Galaxy\Games\SomeTitle
|GamesInstalled\SomeTitle\bin\game.exe|GamesInstalled\SomeTitle
# No boundary and no package root: the executable's own folder (Alan Wake 2 as installed).
|another\epic\AlanWake2\AlanWake2.exe|another\epic\AlanWake2
# A GDK package root (spike-notes section 25): MicrosoftGame.config beside appxmanifest.xml marks it. The Unreal shipping
# executable three levels below, its stub at the root, and the FINAL FANTASY spelling of the config's name.
xbox\Digging\Content\MicrosoftGame.config;xbox\Digging\Content\appxmanifest.xml|xbox\Digging\Content\DiggingGame\Binaries\WinGDK\DiggingGame-WinGDK-Shipping.exe|xbox\Digging\Content
xbox\Digging\Content\MicrosoftGame.config;xbox\Digging\Content\appxmanifest.xml|xbox\Digging\Content\DiggingGame.exe|xbox\Digging\Content
xbox\Valor\Content\MicrosoftGame.config;xbox\Valor\Content\appxmanifest.xml|xbox\Valor\Content\ValorMortis\Binaries\Win64\ValorMortisMSG-Win64-Shipping.exe|xbox\Valor\Content
xbox\FF\Content\MicrosoftGame.Config;xbox\FF\Content\appxmanifest.xml|xbox\FF\Content\FINAL FANTASY.exe|xbox\FF\Content
# Not a package root: one of the two files only, or a folder that carries the config's name.
xbox\Half\Content\MicrosoftGame.config|xbox\Half\Content\Bin\x.exe|xbox\Half\Content\Bin
xbox\Odd\Content\MicrosoftGame.config\;xbox\Odd\Content\appxmanifest.xml|xbox\Odd\Content\Bin\x.exe|xbox\Odd\Content\Bin
# A store boundary wins over package files below it: the rule only ever widens what is walked.
SteamLibrary\steamapps\common\Both\Game\Binaries\WinGDK\MicrosoftGame.config;SteamLibrary\steamapps\common\Both\Game\Binaries\WinGDK\appxmanifest.xml|SteamLibrary\steamapps\common\Both\Game\Binaries\WinGDK\Both-WinGDK-Shipping.exe|SteamLibrary\steamapps\common\Both
# The nearest package root wins; eight levels up is the reach, nine is out of it.
outer\MicrosoftGame.config;outer\appxmanifest.xml;outer\inner\Content\MicrosoftGame.config;outer\inner\Content\appxmanifest.xml|outer\inner\Content\bin\x.exe|outer\inner\Content
deep8\Content\MicrosoftGame.config;deep8\Content\appxmanifest.xml|deep8\Content\a\b\c\d\e\f\g\h\x.exe|deep8\Content
deep9\Content\MicrosoftGame.config;deep9\Content\appxmanifest.xml|deep9\Content\a\b\c\d\e\f\g\h\i\x.exe|deep9\Content\a\b\c\d\e\f\g\h\i
Whitespace-only changes.
Whitespace-only changes.
Whitespace-only changes.
Whitespace-only changes.
@@ -0,0 +1 @@
{ "engine": null, "platform": "xbox", "capabilities": [], "$why": "The FINAL FANTASY Pixel Remaster layout from the Xbox app: a GDK package root that also ships steam_api64.dll in a plugin folder. xbox is first in the platforms array, so it wins over steam." }
View File
Whitespace-only changes.
Whitespace-only changes.
Whitespace-only changes.
+1
View File
@@ -0,0 +1 @@
{ "engine": null, "platform": "xbox", "capabilities": [], "$why": "MicrosoftGame.config and appxmanifest.xml both directly in the install root (root_file): a GDK package root, spike-notes section 25." }
+6 -4
View File
@@ -595,11 +595,13 @@ $liveIds = @()
foreach ($section in 'engines', 'platforms', 'capabilities') {
if (Test-Member $rules $section) { $liveIds += @($rules.$section | ForEach-Object { $_.id }) }
}
# Directories that are deliberately not rule ids: the ordering case and the two
# canaries are named for what they PROVE, not for a rule — and since rules
# 2026.09.5 the globs FSR 3 and XeSS DX11 added to two existing ids.
# Directories that are deliberately not rule ids: the ordering cases and the two
# canaries are named for what they PROVE, not for a rule — since rules 2026.09.5
# the globs FSR 3 and XeSS DX11 added to two existing ids, and since 2026.11.1
# (beta.33) the xbox platform's precedence over the steam_api64.dll a GDK
# FINAL FANTASY ships.
$nonRuleFixtures = @('unity_markers_with_ue_structure', 'no_engine', 'every_engine_marker',
'dlss_stack', 'fsr_globs', 'fsr3_xess_dx11')
'dlss_stack', 'fsr_globs', 'fsr3_xess_dx11', 'xbox_beats_steam_api')
foreach ($name in $fixtureNames) {
if ($name -notin $liveIds -and $name -notin $nonRuleFixtures) {
$errors.Add("fixture '$name' matches no live rule id and is not a named special case — stale fixtures report green forever")