Skip to content

Reuse the official Gameforge installation id instead of minting one - #29

Merged
erwan-joly merged 1 commit into
masterfrom
fix/gfstub-reuse-installation-id
Nov 29, 2026
Merged

erwan-joly merged 1 commit into
masterfrom
fix/gfstub-reuse-installation-id

Conversation

@erwan-joly

@erwan-joly erwan-joly commented Nov 22, 2026 •

Copy link
Copy Markdown
Contributor

Problem

GfStub seeds InstallationId under HKLM\SOFTWARE\WOW6432Node\Gameforge4d\GameforgeClient\MainApp with a fresh GUID when the value is missing. The stub runs unelevated inside the 32-bit client, so Windows virtualizes that write into HKCU\Software\Classes\VirtualStore\.... The official Gameforge client is also 32-bit and reads the machine key (through the same VirtualStore) before its own per-user HKCU\Software\Gameforge4d\GameforgeClient\MainApp id. After running a stubbed client once, the official client quietly switched to the stub's GUID and Gameforge registered it as a new installation; tools still sending the original id then got Not allowed to create code from auth/thin/codes.

Fix

When the machine key has no id, copy the official client's per-user id into it and only mint a new GUID when no Gameforge client id exists.

Checks

  • Builds with the .NET 11 SDK.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Bug Fixes
    • The app now uses the existing Gameforge client installation ID when available, rather than generating a new one. This helps keep the installation identifier consistent.

GfStub seeded a random InstallationId under the 32-bit machine key when it
was missing. Unelevated, that write lands in the user's VirtualStore, and the
official Gameforge client (also 32-bit) reads it ahead of its own per-user id,
so it silently switched to the stub's id and re-registered the installation.
Seed the machine key with the official client's id when one exists and only
mint a new id on machines without the Gameforge client.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Nov 22, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

EnsureInstallationId now copies the per-user Gameforge client installation ID to the machine registry when the machine registry has no ID. If the per-user ID is absent, it generates an uppercase GUID.

Changes: Installation ID reuse

Layer / File(s) Summary
Installation ID lookup and fallback
src/NosCore.DeveloperTools.GfStub/GfStub.cs
The documentation describes reuse of the official client ID. EnsureInstallationId copies the per-user ID to the machine key, or generates an uppercase GUID if no per-user ID exists.

Estimated code review effort: 2 (Simple) | ~8 minutes

Change: Bug fix

Merge Risk: Minimal · up to fa68b

The stub now reuses the official Gameforge client's per-user installation ID instead of generating a new one. No concrete defect was found, and the remaining uncertainty is whether the official client's registry layout matches the one the stub reads. A quick check on a machine with the client installed would confirm it, but it should not block merge.

Pre-merge checks: Passed 4

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title "Reuse the official Gameforge installation id instead of minting one" matches the main change. The summary says EnsureInstallationId now copies the official Gameforge client's per-user insta…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title "Reuse the official Gameforge installation id instead of minting one" matches the main change. The summary says EnsureInstallationId now copies the official Gameforge client's per-user installation ID into the machine key when present, and generates a new GUID only when no per-user ID exists. The title names the core behavior, so it is a clear, specific fit for the changeset.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 4311b595-8ce7-4f67-b68a-49084ab07737
Commits

Reviewing files that changed from the base of the PR and between 0170d4e and fa68b7e.

Files selected for processing: 1

  • src/NosCore.DeveloperTools.GfStub/GfStub.cs

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

@erwan-joly
erwan-joly merged commit 210c5cc into master Nov 29, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant