WebPanel fix round 1: close reply by code, loader PE check, no-open scan, drop Core.xml

- RynthCoreChatCommands: each method keeps its own summary; /rc webpanel close answers by the Close code (closing / already closed / could not close); verb added to the class header list.
- Build-Installer.ps1: Assert-PeMachine throws unless Runtime\WebView2Loader.dll is x86 (0x14C).
- ChatCommandReplyTests: HandleWebPanelCommand has no Open(, Navigate( or ShellExecute.
- Engine csproj: Microsoft.Web.WebView2.Core.xml is not copied (with the other dropped WebView2 copies).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Daniel Wallace 2026-11-07 15:47:57 -08:00
commit 4e30b16bf5
4 changed files with 42 additions and 9 deletions

View file

@ -339,6 +339,17 @@ if ($SkipDecalBridge) {
# release.txt — which core release this install is ($release, from -Version at the top).
Set-Content -Path "$StagingDir\release.txt" -Value @($release, $Version) -Encoding ASCII
# The PE machine field of a DLL (e_lfanew at 0x3C, then the COFF Machine at PE offset + 4). The game is
# 32-bit, so the web panel's native loader must be the x86 one (0x14C): the NuGet package also carries
# win-x64 and win-arm64 copies that would load nowhere.
function Assert-PeMachine([string]$Path, [int]$Expected) {
$bytes = [System.IO.File]::ReadAllBytes($Path)
if ($bytes.Length -lt 0x40) { throw "$Path is not a PE file (too short)" }
$pe = [System.BitConverter]::ToInt32($bytes, 0x3C)
if ($pe -lt 0 -or $pe + 6 -gt $bytes.Length) { throw "$Path is not a PE file (bad e_lfanew)" }
$machine = [System.BitConverter]::ToUInt16($bytes, $pe + 4)
if ($machine -ne $Expected) { throw ("{0}: PE machine 0x{1:X}, expected 0x{2:X}" -f $Path, $machine, $Expected) }
}
# Everything a working install needs. The 2026-09-25 public installer went out
# without the Loader and the SEH trampoline because nothing checked.
$required = @(
@ -369,7 +380,9 @@ if (-not $SkipDecalBridge) {
}
$missing = @($required | Where-Object { -not (Test-Path $_) })
if ($missing.Count -gt 0) { throw "Staging is missing required files:`n $($missing -join "`n ")" }
if (-not $NativeAot) {
Assert-PeMachine "$StagingDir\Runtime\WebView2Loader.dll" 0x14C
}
# Report staged sizes
$engineDll = "$StagingDir\Runtime\RynthCore.Engine.dll"
if (Test-Path $engineDll) {