merge: bring feat/full-installer into SK-local

Integrates the aelrynth snapshot port (main), the full installer, the
tmds.dbus advisory fix and all launcher/engine work into SK-local.

Conflict resolutions:
- Logging: keep SK-local's level-based logging (EngineLogLevel, ShouldLog,
  engine.json LoggingLevel) and adopt full-installer's tagged WRN/ERR,
  LastIssue and per-PID logs; the Desktop rolling log is superseded.
- Launcher: keep the inject-all-sessions toggle and Logging level combo
  alongside the new stagger/crash-relaunch/stuck-client options; the
  LoggingLevel is now written through EngineJsonStore.SetString.
- PluginManager: keep SK-local's basename/canonical-path de-duplication,
  drop the default-directory scan (opt-in via PluginPaths).
- Injector, installer, CI workflow, BUILD.md: take full-installer.
- Solution: add DesktopLog + Loader, drop the stale Plugins/RynthAi stub.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
BlankenshipG 2026-10-04 16:16:24 -04:00
commit 36ffa94252
256 changed files with 62130 additions and 3382 deletions

View file

@ -1,75 +1,140 @@
#Requires -Version 5.1
<#
.SYNOPSIS
Builds RynthCore + RynthSuite release outputs and produces RynthBundle-Setup.exe via Inno Setup.
Builds RynthCore + RynthSuite from source and produces the full installer
(RynthCore-Setup-<version>.exe) via Inno Setup.
.DESCRIPTION
1. Publishes the Avalonia launcher (self-contained, x86 — bundles .NET; no global runtime for RynthCore.exe)
0. Makes sure a .NET 10 SDK is available; installs one per-user when missing (see -NoDotNetInstall)
1. Publishes the Avalonia launcher (self-contained, x86)
2. Publishes RynthCore.Engine (NativeAOT, x86 -- ~2 min)
3. Publishes RynthCore.Injector (self-contained, x86)
4. Publishes every RynthCore.Plugin.* project under RynthSuite (NativeAOT, x86), plus
ub-Rythai (RynthCore.Plugin.UbRythai) when ../ub-Rythai/... exists or -UbRythaiPluginProject is set
5. Optionally publishes LootEditor and MonsterEditor (framework-dependent, x64)
6. Stages all output under installer\staging\app\ (recursive trees for tools and launcher)
7. Invokes ISCC.exe to produce installer\Output\RynthBundle-Setup.exe
3. Publishes RynthCore.Loader (NativeAOT, x86) -- the DLL the launcher injects
4. Publishes RynthCore.Plugin.RynthAi (NativeAOT, x86) from RynthSuite
5. Publishes the Loot Editor (self-contained, x86)
6. Publishes the Monster Editor (self-contained, x86) from RynthSuite
7. Publishes the experimental plugins (RynthChat, RynthJuice, RynthNav, RynthTracker,
RynthVision; NativeAOT, x86) -- optional components in the installer
8. Stages RynthCore under installer\staging\core\ and RynthSuite under
installer\staging\suite\, plus the hand-built RynthCore.SehTrampoline.dll,
and checks every required runtime file is there
9. Archives the previous installer (installer\previous-release\) when -Version changes
10. Invokes ISCC.exe to produce installer\Output\RynthCore-Setup-<version>.exe
(and a RynthCore-Setup.exe copy)
The installer lets the user choose both the RynthCore and the RynthSuite folders; the
code resolves them at runtime from HKA\Software\Rynth (see src\RynthCore.App\RynthInstallPaths.cs).
.PARAMETER Configuration
Build configuration. Default: Release
.PARAMETER IsccPath
Path to ISCC.exe (Inno Setup compiler). Default looks in the standard Inno Setup 6 location.
Path to ISCC.exe (Inno Setup compiler). Default looks in the standard Inno Setup 6 locations.
Install Inno Setup from: https://jrsoftware.org/isdl.php
.PARAMETER RynthSuiteRoot
RynthSuite repo root. Default: the sibling ..\RynthSuite next to this RynthCore repo.
.PARAMETER Version
Release version yyyy.m.d.n (e.g. 2026.10.4.2). Stamped into the launcher/engine/tools,
release.txt and the installer. Omit for a dev build.
.PARAMETER SkipBuild
Skip dotnet publish steps and just re-run ISCC against the existing staging directory.
Skip dotnet publish steps and just re-stage + re-run ISCC against existing publish output.
.PARAMETER NoDotNetInstall
Fail instead of auto-installing when no .NET 10 SDK is found. By default a missing SDK is
installed per-user (no admin) to %LOCALAPPDATA%\Microsoft\dotnet via Microsoft's signed
dotnet-install.ps1, and used for this build.
#>
param(
[string]$Configuration = "Release",
[string]$IsccPath = "C:\Program Files (x86)\Inno Setup 6\ISCC.exe",
[string]$IsccPath = "",
# Explicit path to the RynthSuite repo root. When omitted, defaults to the
# sibling directory of RynthCore (i.e. ..\RynthSuite relative to this repo).
[string]$RynthSuiteRoot = "",
# Version string injected into the installer (e.g. "0.3"). When omitted,
# Version string injected into the installer (yyyy.m.d.n). When omitted,
# the version defined in RynthCore.iss is used as-is.
[string]$Version = "",
# Include RynthSuite desktop tools (LootEditor + MonsterEditor) in setup.
[switch]$IncludeSuiteTools = $true,
# Full path to RynthCore.Plugin.UbRythai.csproj. Empty = default sibling ..\ub-Rythai\...
[string]$UbRythaiPluginProject = "",
# Omit ub-Rythai from the bundle (e.g. CI without that checkout).
[switch]$SkipUbRythai,
[switch]$SkipBuild
[switch]$SkipBuild,
[switch]$NoDotNetInstall
)
$ErrorActionPreference = "Stop"
Set-StrictMode -Off
function Copy-PublishTree {
param(
[string]$SourceRoot,
[string]$DestRoot,
[switch]$ExcludePdb
)
if (-not (Test-Path $SourceRoot)) {
throw "Publish output not found: $SourceRoot"
}
$srcFull = (Resolve-Path $SourceRoot).Path
# Normalize trailing separator so substring math is safe on Windows
if (-not $srcFull.EndsWith([IO.Path]::DirectorySeparatorChar)) {
$srcFull += [IO.Path]::DirectorySeparatorChar
}
Get-ChildItem $SourceRoot -Recurse -File | ForEach-Object {
if ($ExcludePdb -and $_.Extension -eq '.pdb') { return }
$rel = $_.FullName.Substring($srcFull.Length)
$target = Join-Path $DestRoot $rel
$parent = Split-Path $target -Parent
if ($parent -and -not (Test-Path $parent)) {
New-Item -ItemType Directory -Path $parent -Force | Out-Null
}
Copy-Item -LiteralPath $_.FullName -Destination $target -Force
# Release number for release.txt, which the launcher's updater reads
# (RynthUpdater.InstalledCoreRelease). -Version yyyy.m.d.n → yyyymmddnn; a dev build
# without -Version records 0 ("unknown", so any published release reads as newer).
# Checked here, before the builds, so a typo fails in a second rather than at the end.
$release = 0
if ($Version) {
$p = $Version.Split('.')
if ($p.Count -ne 4 -or ($p | Where-Object { $_ -notmatch '^\d+$' }) -or [int]$p[1] -gt 12 -or [int]$p[2] -gt 31 -or [int]$p[3] -gt 99) {
throw "-Version must be yyyy.m.d.n (e.g. 2026.9.26.3), got '$Version'"
}
$release = [int]$p[0] * 1000000 + [int]$p[1] * 10000 + [int]$p[2] * 100 + [int]$p[3]
}
# Stamp the core builds and tools with the release, so the launcher, the engine log and the
# in-game Status panel show it (RynthCore.App.BuildVersion); the SDK appends the git commit.
# The RynthAi plugin keeps its own semantic version (RynthCore.Plugin.RynthAi.csproj), so it
# is published WITHOUT these args.
$VersionArgs = @()
if ($Version) { $VersionArgs = @("-p:Version=$Version") }
# ── .NET 10 SDK check (auto-install when missing) ───────────────────────────
# Every project targets net10.0, so publishing needs a .NET 10 SDK. Returns $true when the
# 'dotnet' on PATH lists a 10.x SDK.
function Test-DotNet10Sdk {
$cmd = Get-Command dotnet -ErrorAction SilentlyContinue
if (-not $cmd) { return $false }
$sdks = & $cmd.Source --list-sdks 2>$null
return [bool]($sdks | Where-Object { $_ -match '^10\.' })
}
# Makes a .NET 10 SDK available for this build: uses the one on PATH, else a previous per-user
# auto-install, else installs one per-user (no admin) with Microsoft's dotnet-install.ps1, whose
# Authenticode signature must verify as Microsoft before it is run.
function Initialize-DotNet10Sdk {
if (Test-DotNet10Sdk) { Write-Host ".NET 10 SDK: found ($((Get-Command dotnet).Source))"; return }
$userDotNet = Join-Path $env:LOCALAPPDATA "Microsoft\dotnet"
if (Test-Path (Join-Path $userDotNet "dotnet.exe")) {
$env:DOTNET_ROOT = $userDotNet
$env:PATH = "$userDotNet;$env:PATH"
if (Test-DotNet10Sdk) { Write-Host ".NET 10 SDK: found per-user install ($userDotNet)"; return }
}
if ($NoDotNetInstall) {
throw "No .NET 10 SDK found. Install it from https://dotnet.microsoft.com/download/dotnet/10.0 or re-run without -NoDotNetInstall."
}
Write-Host ""
Write-Host ".NET 10 SDK not found -- installing it per-user to $userDotNet ..." -ForegroundColor Yellow
$installScript = Join-Path $env:TEMP "dotnet-install.ps1"
[Net.ServicePointManager]::SecurityProtocol = [Net.ServicePointManager]::SecurityProtocol -bor [Net.SecurityProtocolType]::Tls12
Invoke-WebRequest -Uri "https://dot.net/v1/dotnet-install.ps1" -OutFile $installScript -UseBasicParsing
$sig = Get-AuthenticodeSignature $installScript
if ($sig.Status -ne 'Valid' -or $sig.SignerCertificate.Subject -notmatch 'O=Microsoft Corporation') {
Remove-Item $installScript -Force -ErrorAction SilentlyContinue
throw "dotnet-install.ps1 signature check failed ($($sig.Status)); not running it."
}
# Separate process so the script runs under Bypass regardless of this session's execution policy.
& powershell -NoProfile -ExecutionPolicy Bypass -File $installScript -Channel 10.0 -InstallDir $userDotNet
$installExit = $LASTEXITCODE
Remove-Item $installScript -Force -ErrorAction SilentlyContinue
if ($installExit -ne 0) { throw "dotnet-install.ps1 failed (exit $installExit)" }
$env:DOTNET_ROOT = $userDotNet
$env:PATH = "$userDotNet;$env:PATH"
if (-not (Test-DotNet10Sdk)) { throw ".NET 10 SDK install finished but 'dotnet --list-sdks' still shows no 10.x SDK." }
Write-Host ".NET 10 SDK: installed ($userDotNet)" -ForegroundColor Green
}
# Only the publish steps need the SDK; -SkipBuild just re-stages and re-runs ISCC.
if (-not $SkipBuild) { Initialize-DotNet10Sdk }
$ScriptDir = $PSScriptRoot
$RepoRoot = Split-Path $ScriptDir -Parent # e.g. C:\Projects\RynthCore
$ProjectsRoot = Split-Path $RepoRoot -Parent # e.g. C:\Projects
@ -79,58 +144,38 @@ if (-not $RynthSuiteRoot) {
$RynthSuiteRoot = "$ProjectsRoot\RynthSuite"
}
$LauncherProject = "$RepoRoot\src\RynthCore.App.Avalonia\RynthCore.App.Avalonia.csproj"
$EngineProject = "$RepoRoot\src\RynthCore.Engine\RynthCore.Engine.csproj"
$InjectorProject = "$RepoRoot\src\RynthCore.Injector\RynthCore.Injector.csproj"
$LauncherProject = "$RepoRoot\src\RynthCore.App.Avalonia\RynthCore.App.Avalonia.csproj"
$EngineProject = "$RepoRoot\src\RynthCore.Engine\RynthCore.Engine.csproj"
$LoaderProject = "$RepoRoot\src\RynthCore.Loader\RynthCore.Loader.csproj"
$PluginProject = "$RynthSuiteRoot\Plugins\RynthCore.Plugin.RynthAi\RynthCore.Plugin.RynthAi.csproj"
$LootEditorProject = "$RynthSuiteRoot\Tools\RynthCore.LootEditor\RynthCore.LootEditor.csproj"
$MonsterEditorProject = "$RynthSuiteRoot\Tools\RynthCore.MonsterEditor\RynthCore.MonsterEditor.csproj"
$LauncherPublish = "$RepoRoot\src\RynthCore.App.Avalonia\bin\$Configuration\net10.0-windows7.0\win-x86\publish"
$EnginePublish = "$RepoRoot\src\RynthCore.Engine\bin\$Configuration\net10.0-windows\win-x86\publish"
$InjectorPublish = "$RepoRoot\src\RynthCore.Injector\bin\$Configuration\net10.0-windows\win-x86\publish"
$LauncherPublish = "$RepoRoot\src\RynthCore.App.Avalonia\bin\$Configuration\net10.0-windows7.0\win-x86\publish"
$EnginePublish = "$RepoRoot\src\RynthCore.Engine\bin\$Configuration\net10.0-windows\win-x86\publish"
$LoaderPublish = "$RepoRoot\src\RynthCore.Loader\bin\$Configuration\net10.0-windows\win-x86\publish"
$PluginPublish = "$RynthSuiteRoot\Plugins\RynthCore.Plugin.RynthAi\bin\$Configuration\net10.0-windows\win-x86\publish"
$LootEditorPublish = "$RynthSuiteRoot\Tools\RynthCore.LootEditor\bin\$Configuration\net10.0\win-x86\publish"
$MonsterEditorPublish = "$RynthSuiteRoot\Tools\RynthCore.MonsterEditor\bin\$Configuration\net10.0\win-x86\publish"
$PluginProjects = @()
$pluginProjectFiles = Get-ChildItem -Path "$RynthSuiteRoot\Plugins" -Filter "RynthCore.Plugin.*.csproj" -File -Recurse -ErrorAction SilentlyContinue
foreach ($pluginProject in $pluginProjectFiles) {
$pluginName = [IO.Path]::GetFileNameWithoutExtension($pluginProject.Name)
$PluginProjects += [pscustomobject]@{
Name = $pluginName
ProjectPath = $pluginProject.FullName
PublishPath = Join-Path $pluginProject.DirectoryName "bin\$Configuration\net10.0-windows\win-x86\publish"
DllPath = Join-Path (Join-Path $pluginProject.DirectoryName "bin\$Configuration\net10.0-windows\win-x86\publish") "$pluginName.dll"
}
}
# Experimental RynthSuite plugins (optional installer components). Each installs to
# <RynthSuite>\<Name>\RynthCore.Plugin.<Name>.dll and keeps its own semantic version.
$ExperimentalPlugins = @('RynthChat', 'RynthJuice', 'RynthNav', 'RynthTracker', 'RynthVision')
function Get-ExperimentalProject([string]$Name) { "$RynthSuiteRoot\Plugins\RynthCore.Plugin.$Name\RynthCore.Plugin.$Name.csproj" }
function Get-ExperimentalPublish([string]$Name) { "$RynthSuiteRoot\Plugins\RynthCore.Plugin.$Name\bin\$Configuration\net10.0-windows\win-x86\publish" }
# RynthNav's starter portal list (shipped into <RynthCore>\NavData, never overwritten).
$NavPortalsTsv = "$RynthSuiteRoot\Tools\RynthNav.PortalGraph\Data\portals.tsv"
# ub-Rythai ships from a sibling repo (same layout as RynthSuite/README.md); publish + stage into Runtime\Plugins.
if (-not $SkipUbRythai) {
if ($UbRythaiPluginProject) {
$ubRythaiProj = $UbRythaiPluginProject
}
else {
$ubRythaiProj = "$ProjectsRoot\ub-Rythai\RynthCore.Plugin.UbRythai\RynthCore.Plugin.UbRythai.csproj"
}
if (Test-Path -LiteralPath $ubRythaiProj) {
$ubDir = Split-Path $ubRythaiProj -Parent
$ubName = "RynthCore.Plugin.UbRythai"
$PluginProjects += [pscustomobject]@{
Name = $ubName
ProjectPath = $ubRythaiProj
PublishPath = Join-Path $ubDir "bin\$Configuration\net10.0-windows\win-x86\publish"
DllPath = Join-Path (Join-Path $ubDir "bin\$Configuration\net10.0-windows\win-x86\publish") "$ubName.dll"
}
Write-Host "ub-Rythai plugin included: $ubRythaiProj" -ForegroundColor DarkCyan
}
else {
$warn = "ub-Rythai project not found (optional): $ubRythaiProj - RynthCore.Plugin.UbRythai.dll will be omitted. Clone next to RynthCore or pass -UbRythaiPluginProject."
Write-Warning $warn
}
}
$StagingDir = "$ScriptDir\staging\app"
# staging\core → {app} (user-chosen RynthCore folder)
# staging\suite → {code:GetSuiteDir} (user-chosen RynthSuite folder)
$StagingRoot = "$ScriptDir\staging"
$CoreStaging = "$StagingRoot\core"
$SuiteStaging = "$StagingRoot\suite"
# ── Validate projects ───────────────────────────────────────────────────────
foreach ($p in @($LauncherProject, $EngineProject, $InjectorProject)) {
$allProjects = @($LauncherProject, $EngineProject, $LoaderProject, $PluginProject, $LootEditorProject, $MonsterEditorProject) +
@($ExperimentalPlugins | ForEach-Object { Get-ExperimentalProject $_ })
foreach ($p in $allProjects) {
if (-not (Test-Path $p)) {
throw "Project not found: $p`nUpdate paths in Build-Installer.ps1 if your repo layout differs."
}
@ -154,50 +199,51 @@ if (-not $SkipBuild) {
$step++
Write-Host ""
# Self-contained: ship .NET 10 with the apphost so RynthCore.exe does not require a machine-wide
# Desktop Runtime (avoids the official apphost "You must install .NET" dialog on clean PCs).
Write-Host "[$step/$totalSteps] Publishing Launcher (self-contained, x86)..." -ForegroundColor Cyan
# RollForward=Disable: host must use bundled runtimes only (avoids probing %ProgramFiles%\dotnet\shared\...).
dotnet publish $LauncherProject -c $Configuration -r win-x86 --self-contained true `
-p:SelfContained=true -p:PublishSelfContained=true -p:RollForward=Disable
Write-Host "[1/7] Publishing Launcher (self-contained, x86)..." -ForegroundColor Cyan
dotnet publish $LauncherProject -c $Configuration -r win-x86 --self-contained true @VersionArgs
if ($LASTEXITCODE -ne 0) { throw "Launcher publish failed (exit $LASTEXITCODE)" }
$step++
Write-Host ""
Write-Host "[$step/$totalSteps] Publishing Engine (NativeAOT, ~2 min)..." -ForegroundColor Cyan
dotnet publish $EngineProject -c $Configuration
Write-Host "[2/7] Publishing Engine (NativeAOT, ~2 min)..." -ForegroundColor Cyan
dotnet publish $EngineProject -c $Configuration @VersionArgs
if ($LASTEXITCODE -ne 0) { throw "Engine publish failed (exit $LASTEXITCODE)" }
$step++
# ── 3. Loader (NativeAOT, small) ──────────────────────────────────────────
Write-Host ""
Write-Host "[$step/$totalSteps] Publishing Injector (self-contained, x86)..." -ForegroundColor Cyan
dotnet publish $InjectorProject -c $Configuration -r win-x86 --self-contained true `
-p:SelfContained=true -p:PublishSelfContained=true -p:RollForward=Disable
if ($LASTEXITCODE -ne 0) { throw "Injector publish failed (exit $LASTEXITCODE)" }
Write-Host "[3/7] Publishing Loader (NativeAOT)..." -ForegroundColor Cyan
dotnet publish $LoaderProject -c $Configuration @VersionArgs
if ($LASTEXITCODE -ne 0) { throw "Loader publish failed (exit $LASTEXITCODE)" }
foreach ($plugin in $PluginProjects) {
$step++
Write-Host ""
Write-Host "[$step/$totalSteps] Publishing plugin: $($plugin.Name) (NativeAOT)..." -ForegroundColor Cyan
dotnet publish $plugin.ProjectPath -c $Configuration
if ($LASTEXITCODE -ne 0) { throw "Plugin publish failed for $($plugin.Name) (exit $LASTEXITCODE)" }
}
# ── 4. RynthAi plugin (NativeAOT; keeps its own version) ─────────────────
Write-Host ""
Write-Host "[4/7] Publishing RynthAi plugin (NativeAOT)..." -ForegroundColor Cyan
dotnet publish $PluginProject -c $Configuration
if ($LASTEXITCODE -ne 0) { throw "Plugin publish failed (exit $LASTEXITCODE)" }
if ($IncludeSuiteTools) {
if (-not (Test-Path "$RepoRoot\installer\_toolpublish")) {
New-Item -ItemType Directory -Path "$RepoRoot\installer\_toolpublish" -Force | Out-Null
}
$step++
Write-Host ""
Write-Host "[$step/$totalSteps] Publishing LootEditor (framework-dependent x64)..." -ForegroundColor Cyan
dotnet publish $LootEditorProject -c $Configuration -r win-x64 --self-contained false --output "$RepoRoot\installer\_toolpublish\LootEditor"
if ($LASTEXITCODE -ne 0) { throw "LootEditor publish failed (exit $LASTEXITCODE)" }
# ── 5. Loot Editor (self-contained Avalonia tool) ─────────────────────────
Write-Host ""
Write-Host "[5/7] Publishing Loot Editor (self-contained, x86)..." -ForegroundColor Cyan
dotnet publish $LootEditorProject -c $Configuration -r win-x86 --self-contained true @VersionArgs
if ($LASTEXITCODE -ne 0) { throw "Loot Editor publish failed (exit $LASTEXITCODE)" }
$step++
Write-Host ""
Write-Host "[$step/$totalSteps] Publishing MonsterEditor (framework-dependent x64)..." -ForegroundColor Cyan
dotnet publish $MonsterEditorProject -c $Configuration -r win-x64 --self-contained false --output "$RepoRoot\installer\_toolpublish\MonsterEditor"
if ($LASTEXITCODE -ne 0) { throw "MonsterEditor publish failed (exit $LASTEXITCODE)" }
# ── 6. Monster Editor (self-contained Avalonia tool) ──────────────────────
Write-Host ""
Write-Host "[6/7] Publishing Monster Editor (self-contained, x86)..." -ForegroundColor Cyan
dotnet publish $MonsterEditorProject -c $Configuration -r win-x86 --self-contained true @VersionArgs
if ($LASTEXITCODE -ne 0) { throw "Monster Editor publish failed (exit $LASTEXITCODE)" }
# ── 7. Experimental plugins (NativeAOT; optional components) ──────────────
# RynthJuice/RynthNav/RynthVision set <PublishDir> to the live C:\Games\RynthSuite\<Name>\
# folder for dev hot-reload; override it so an installer build never touches a live install.
# A trailing '/' (not '\') keeps the argument intact when the path contains spaces.
Write-Host ""
Write-Host "[7/7] Publishing experimental plugins (NativeAOT)..." -ForegroundColor Cyan
foreach ($name in $ExperimentalPlugins) {
Write-Host " $name"
$publishDir = (Get-ExperimentalPublish $name) + '/'
dotnet publish (Get-ExperimentalProject $name) -c $Configuration "-p:PublishDir=$publishDir"
if ($LASTEXITCODE -ne 0) { throw "$name publish failed (exit $LASTEXITCODE)" }
}
}
@ -205,108 +251,153 @@ if (-not $SkipBuild) {
Write-Host ""
Write-Host "Staging files..." -ForegroundColor Cyan
if (Test-Path "$ScriptDir\staging") {
Remove-Item "$ScriptDir\staging" -Recurse -Force
}
New-Item -ItemType Directory -Path "$StagingDir\Runtime\Native" -Force | Out-Null
New-Item -ItemType Directory -Path "$StagingDir\Runtime\Plugins" -Force | Out-Null
if ($IncludeSuiteTools) {
New-Item -ItemType Directory -Path "$StagingDir\Tools\LootEditor" -Force | Out-Null
New-Item -ItemType Directory -Path "$StagingDir\Tools\MonsterEditor" -Force | Out-Null
if (Test-Path $StagingRoot) {
Remove-Item $StagingRoot -Recurse -Force
}
New-Item -ItemType Directory -Path "$CoreStaging\Runtime\Native" -Force | Out-Null
New-Item -ItemType Directory -Path "$CoreStaging\Tools\LootEditor" -Force | Out-Null
New-Item -ItemType Directory -Path "$SuiteStaging\RynthAi\MonsterEditor" -Force | Out-Null
# Document runtime prerequisites: launcher + injector are self-contained; editor tools are FDD x64.
$prereqPath = Join-Path $StagingDir "RynthCore-Prerequisites.txt"
Set-Content -LiteralPath $prereqPath -Encoding UTF8 -Value @"
RynthCore Runtime Prerequisites
==============================
RynthCore.exe and Runtime\RynthCore.Injector.exe are published self-contained (they bundle .NET 10
x86). You do not need a separate .NET Desktop Runtime install to run the launcher or injector from
this folder.
The optional suite tools (Loot Editor / Monster Editor) are framework-dependent x64. If they show
a missing-runtime dialog, install:
- .NET Desktop Runtime 10 x64:
https://dotnet.microsoft.com/en-us/download/dotnet/10.0/runtime
"@
# Launcher (self-contained — copy full tree, then rename launcher host + host metadata files)
if (-not (Test-Path $LauncherPublish)) {
throw "Launcher publish not found: $LauncherPublish`nRun without -SkipBuild first."
}
Copy-PublishTree -SourceRoot $LauncherPublish -DestRoot $StagingDir -ExcludePdb
$avExe = "$StagingDir\RynthCore.App.Avalonia.exe"
if (Test-Path $avExe) {
Move-Item -LiteralPath $avExe -Destination "$StagingDir\RynthCore.exe" -Force
# Keep host metadata filenames in sync with the renamed apphost.
# If these remain as RynthCore.App.Avalonia.* the apphost can fail runtime resolution
# and show a ".NET install required" prompt even when .NET 10 is already installed.
$avRuntimeConfig = "$StagingDir\RynthCore.App.Avalonia.runtimeconfig.json"
if (Test-Path $avRuntimeConfig) {
Move-Item -LiteralPath $avRuntimeConfig -Destination "$StagingDir\RynthCore.runtimeconfig.json" -Force
# Copies a publish folder (files + subfolders) without .pdb files.
function Copy-PublishTree([string]$Source, [string]$Dest) {
if (-not (Test-Path $Source)) { throw "Publish output not found: $Source" }
foreach ($file in (Get-ChildItem $Source -File)) {
if ($file.Extension -eq '.pdb') { continue }
Copy-Item $file.FullName (Join-Path $Dest $file.Name) -Force
}
$avDeps = "$StagingDir\RynthCore.App.Avalonia.deps.json"
if (Test-Path $avDeps) {
Move-Item -LiteralPath $avDeps -Destination "$StagingDir\RynthCore.deps.json" -Force
foreach ($dir in (Get-ChildItem $Source -Directory)) {
Copy-Item $dir.FullName $Dest -Recurse -Force
Get-ChildItem (Join-Path $Dest $dir.Name) -Recurse -File -Filter '*.pdb' | Remove-Item -Force
}
} else {
throw "Expected launcher executable not found after publish: RynthCore.App.Avalonia.exe under $LauncherPublish"
}
# Launcher root files (rename .exe → RynthCore.exe; drop .pdb)
foreach ($file in (Get-ChildItem "$LauncherPublish" -File)) {
if ($file.Extension -eq '.pdb') { continue }
$destName = if ($file.Name -eq 'RynthCore.App.Avalonia.exe') { 'RynthCore.exe' } else { $file.Name }
Copy-Item $file.FullName "$CoreStaging\$destName" -Force
}
# Engine runtime files (into Runtime\, skip .pdb)
foreach ($file in (Get-ChildItem "$EnginePublish" -File)) {
if ($file.Extension -eq '.pdb') { continue }
Copy-Item $file.FullName "$StagingDir\Runtime\$($file.Name)" -Force
Copy-Item $file.FullName "$CoreStaging\Runtime\$($file.Name)" -Force
}
# Loader — the DLL the launcher injects (EngineInjectionService.EngineDllName); it
# maps RynthCore.Engine.dll and provides hot-reload. Without it a fresh install's
# launcher can't auto-find an engine to inject.
$loaderDll = "$LoaderPublish\RynthCore.Loader.dll"
if (-not (Test-Path $loaderDll)) { throw "Loader DLL not found at: $loaderDll" }
Copy-Item $loaderDll "$CoreStaging\Runtime\" -Force
# SEH trampoline — hand-built native DLL (native\SehTrampoline\Build-SehTrampoline.ps1),
# NOT part of the engine publish output. Without it SehTrampoline.IsAvailable stays
# false and CombatActionHooks.CastSpell fails closed on every targeted cast, which
# includes self-buffs (the plugin passes the player id): the bot says "Casting: X"
# and nothing happens. Same missing/stale checks as scripts\Deploy-RynthCore.ps1.
$sehDll = "$RepoRoot\native\SehTrampoline\bin\RynthCore.SehTrampoline.dll"
$sehSrc = "$RepoRoot\native\SehTrampoline\SehTrampoline.c"
if (-not (Test-Path $sehDll)) { throw "SEH trampoline not found at: $sehDll`nBuild it with native\SehTrampoline\Build-SehTrampoline.ps1" }
if ((Test-Path $sehSrc) -and (Get-Item $sehSrc).LastWriteTime -gt (Get-Item $sehDll).LastWriteTime) {
throw "RynthCore.SehTrampoline.dll is STALE (SehTrampoline.c is newer). Rebuild with native\SehTrampoline\Build-SehTrampoline.ps1"
}
Copy-Item $sehDll "$CoreStaging\Runtime\" -Force
# Engine Native subfolder
if (Test-Path "$EnginePublish\Native") {
foreach ($file in (Get-ChildItem "$EnginePublish\Native" -File)) {
if ($file.Extension -eq '.pdb') { continue }
Copy-Item $file.FullName "$StagingDir\Runtime\Native\$($file.Name)" -Force
Copy-Item $file.FullName "$CoreStaging\Runtime\Native\$($file.Name)" -Force
}
}
# Injector (self-contained x86) — full publish tree into Runtime\ next to the engine
if (-not (Test-Path $InjectorPublish)) {
throw "Injector publish not found: $InjectorPublish`nRun without -SkipBuild, or publish RynthCore.Injector for $Configuration|win-x86."
}
Copy-PublishTree -SourceRoot $InjectorPublish -DestRoot "$StagingDir\Runtime" -ExcludePdb
# Loot Editor → <RynthCore>\Tools\LootEditor (the launcher/engine look for it there)
Copy-PublishTree $LootEditorPublish "$CoreStaging\Tools\LootEditor"
# Plugin DLLs only (cimgui.dll excluded — already in Runtime from Engine)
foreach ($plugin in $PluginProjects) {
if (-not (Test-Path $plugin.DllPath)) {
throw "Plugin DLL not found at: $($plugin.DllPath)"
}
# RynthAi plugin DLL → <RynthSuite>\RynthAi (next to its data dirs; the installer hands the
# path to the launcher via HKA\Software\Rynth\PendingPluginRegistration).
$pluginDll = "$PluginPublish\RynthCore.Plugin.RynthAi.dll"
if (-not (Test-Path $pluginDll)) { throw "Plugin DLL not found at: $pluginDll" }
Copy-Item $pluginDll "$SuiteStaging\RynthAi\" -Force
Copy-Item $plugin.DllPath "$StagingDir\Runtime\Plugins\" -Force
# Monster Editor → <RynthSuite>\RynthAi\MonsterEditor (RynthAi's dashboard launches it from there)
Copy-PublishTree $MonsterEditorPublish "$SuiteStaging\RynthAi\MonsterEditor"
# Experimental plugins → <RynthSuite>\<Name>\RynthCore.Plugin.<Name>.dll (the NativeAOT DLL is self-contained;
# cimgui.dll is provided by the engine's Runtime folder).
foreach ($name in $ExperimentalPlugins) {
$dll = Join-Path (Get-ExperimentalPublish $name) "RynthCore.Plugin.$name.dll"
if (-not (Test-Path $dll)) { throw "$name DLL not found at: $dll" }
New-Item -ItemType Directory -Path "$SuiteStaging\$name" -Force | Out-Null
Copy-Item $dll "$SuiteStaging\$name\" -Force
}
if ($IncludeSuiteTools) {
foreach ($tool in @(
@{ Source = "$RepoRoot\installer\_toolpublish\LootEditor"; Dest = "$StagingDir\Tools\LootEditor" },
@{ Source = "$RepoRoot\installer\_toolpublish\MonsterEditor"; Dest = "$StagingDir\Tools\MonsterEditor" }
)) {
if (-not (Test-Path $tool.Source)) {
throw "Tool publish output not found: $($tool.Source)"
}
# FDD x64 tools — copy the full tree (runtimes\ from NuGet, not a bundled .NET host)
Copy-PublishTree -SourceRoot $tool.Source -DestRoot $tool.Dest -ExcludePdb
}
}
# RynthNav starter data → <RynthCore>\NavData (staged apart from core so it is only installed with RynthNav).
if (-not (Test-Path $NavPortalsTsv)) { throw "RynthNav portals.tsv not found at: $NavPortalsTsv" }
New-Item -ItemType Directory -Path "$StagingRoot\navdata" -Force | Out-Null
Copy-Item $NavPortalsTsv "$StagingRoot\navdata\" -Force
# release.txt — which core release this install is ($release, from -Version at the top).
Set-Content -Path "$CoreStaging\release.txt" -Value @($release, $Version) -Encoding ASCII
# Everything a working install needs. The 2026-09-25 public installer went out
# without the Loader and the SEH trampoline because nothing checked.
$required = @(
"$CoreStaging\RynthCore.exe",
"$CoreStaging\RynthCore.App.Avalonia.dll",
"$CoreStaging\RynthCore.App.Avalonia.deps.json",
"$CoreStaging\RynthCore.App.Avalonia.runtimeconfig.json",
"$CoreStaging\Runtime\RynthCore.Loader.dll",
"$CoreStaging\Runtime\RynthCore.Engine.dll",
"$CoreStaging\Runtime\RynthCore.SehTrampoline.dll",
"$CoreStaging\Runtime\minhook.x86.dll",
"$CoreStaging\Runtime\cimgui.dll",
"$CoreStaging\Tools\LootEditor\RynthCore.LootEditor.exe",
"$SuiteStaging\RynthAi\RynthCore.Plugin.RynthAi.dll",
"$SuiteStaging\RynthAi\MonsterEditor\RynthCore.MonsterEditor.exe",
"$StagingRoot\navdata\portals.tsv"
) + @($ExperimentalPlugins | ForEach-Object { "$SuiteStaging\$_\RynthCore.Plugin.$_.dll" })
$missing = @($required | Where-Object { -not (Test-Path $_) })
if ($missing.Count -gt 0) { throw "Staging is missing required files:`n $($missing -join "`n ")" }
# Every assembly the launcher's deps.json lists must be staged next to it — a launcher DLL whose
# deps.json doesn't match is exactly the "Could not load RynthCore.DesktopLog" failure of 2026-10-04.
$depsJson = Get-Content "$CoreStaging\RynthCore.App.Avalonia.deps.json" -Raw | ConvertFrom-Json
$projectLibs = $depsJson.libraries.PSObject.Properties | Where-Object { $_.Value.type -eq 'project' } | ForEach-Object { ($_.Name -split '/')[0] }
$missingLibs = @($projectLibs | Where-Object { -not (Test-Path "$CoreStaging\$_.dll") })
if ($missingLibs.Count -gt 0) { throw "Launcher deps.json references project assemblies that were not staged:`n $($missingLibs -join "`n ")" }
# Report staged sizes
$engineDll = "$StagingDir\Runtime\RynthCore.Engine.dll"
$engineDll = "$CoreStaging\Runtime\RynthCore.Engine.dll"
if (Test-Path $engineDll) {
$sizeMb = [math]::Round((Get-Item $engineDll).Length / 1MB, 1)
Write-Host " Engine.dll: ${sizeMb} MB"
}
$totalMb = [math]::Round((Get-ChildItem "$StagingDir" -Recurse -File | Measure-Object Length -Sum).Sum / 1MB, 1)
Write-Host " Total staged: ${totalMb} MB"
$coreMb = [math]::Round((Get-ChildItem $CoreStaging -Recurse -File | Measure-Object Length -Sum).Sum / 1MB, 1)
$suiteMb = [math]::Round((Get-ChildItem $SuiteStaging -Recurse -File | Measure-Object Length -Sum).Sum / 1MB, 1)
Write-Host " Staged: RynthCore ${coreMb} MB, RynthSuite ${suiteMb} MB"
Write-Host "Staging complete: $StagingDir" -ForegroundColor Green
Write-Host "Staging complete: $StagingRoot" -ForegroundColor Green
# ── Archive the previous installer when -Version bumps ─────────────────────
# installer\previous-release\last-built-version.txt records the last version built; when a new
# -Version is built, that version's installer is copied to previous-release\ first.
$previousReleaseDir = Join-Path $ScriptDir "previous-release"
$lastVersionFile = Join-Path $previousReleaseDir "last-built-version.txt"
if ($Version) {
New-Item -ItemType Directory -Path $previousReleaseDir -Force | Out-Null
$lastVer = if (Test-Path $lastVersionFile) { (Get-Content $lastVersionFile -Raw).Trim() } else { "" }
if ($lastVer -and $lastVer -ne $Version) {
$prevExe = Join-Path $ScriptDir "Output\RynthCore-Setup-$lastVer.exe"
if (-not (Test-Path $prevExe)) { $prevExe = Join-Path $ScriptDir "Output\RynthCore-Setup.exe" }
if (Test-Path $prevExe) {
$archive = Join-Path $previousReleaseDir "RynthCore-Setup-$lastVer.exe"
Write-Host "Archiving previous installer ($lastVer) -> $archive" -ForegroundColor Cyan
Copy-Item $prevExe $archive -Force
}
}
}
# ── Archive prior bundle when -Version bumps ────────────────────────────────
# Copies installer\Output\RynthBundle-Setup.exe to previous-release\ using the
@ -344,13 +435,18 @@ if ($Version) {
}
# ── Inno Setup ───────────────────────────────────────────────────────────────
if (-not (Test-Path $IsccPath)) {
# Auto-detect ISCC if not specified: try standard install location then user-local.
if (-not $IsccPath) {
$candidates = @(
"C:\Program Files (x86)\Inno Setup 6\ISCC.exe",
"$env:LOCALAPPDATA\Programs\Inno Setup 6\ISCC.exe"
)
foreach ($c in $candidates) { if (Test-Path $c) { $IsccPath = $c; break } }
}
if (-not $IsccPath -or -not (Test-Path $IsccPath)) {
Write-Host ""
Write-Warning "Inno Setup compiler not found at:"
Write-Warning " $IsccPath"
Write-Warning "Install Inno Setup 6 from: https://jrsoftware.org/isdl.php"
Write-Warning "Then re-run this script, or invoke ISCC manually:"
Write-Warning " `"$IsccPath`" `"$ScriptDir\RynthCore.iss`""
Write-Warning "Inno Setup compiler not found. Install Inno Setup 6 from: https://jrsoftware.org/isdl.php"
Write-Warning "Or pass -IsccPath to this script explicitly."
exit 0
}
@ -366,15 +462,14 @@ $issSource = "$ScriptDir\RynthCore.iss"
# Source, staging\) still resolve from the installer\ directory.
$issTmp = "$ScriptDir\RynthCore.tmp.iss"
$issContent = Get-Content $issSource -Raw
$installerExeName = "RynthBundle-Setup"
$outputName = "RynthCore-Setup"
if ($Version) {
$versionTrim = $Version.Trim()
$issContent = $issContent -replace 'AppVersion=0\.0\.0', "AppVersion=$versionTrim"
# Versioned .exe avoids Inno error 32 when Output\RynthBundle-Setup.exe is open in Explorer or AV.
$fnSuffix = Get-SafeVersionFileSuffix -Ver $versionTrim
$installerExeName = "RynthBundle-Setup-$fnSuffix"
$issContent = $issContent -replace 'OutputBaseFilename=RynthBundle-Setup', "OutputBaseFilename=$installerExeName"
Write-Host " Version override: $versionTrim (OutputBaseFilename=$installerExeName)"
# Versioned .exe avoids Inno error 32 when Output\RynthCore-Setup.exe is open in Explorer or AV.
$outputName = "RynthCore-Setup-$Version"
$issContent = $issContent -replace 'AppVersion=0\.0\.0', "AppVersion=$Version"
$issContent = $issContent -replace 'AppVerName=RynthCore \+ RynthSuite 0\.0\.0', "AppVerName=RynthCore + RynthSuite $Version"
$issContent = $issContent -replace 'OutputBaseFilename=RynthCore-Setup', "OutputBaseFilename=$outputName"
Write-Host " Version override: $Version"
}
Set-Content -Path $issTmp -Value $issContent -Encoding UTF8
@ -385,25 +480,14 @@ try {
Remove-Item $issTmp -Force -ErrorAction SilentlyContinue
}
$builtInstaller = Join-Path $ScriptDir "Output\$installerExeName.exe"
# Best-effort copy to the legacy canonical name for scripts that expect RynthBundle-Setup.exe.
if ($Version -and (Test-Path -LiteralPath $builtInstaller)) {
$canonicalInstaller = Join-Path $ScriptDir "Output\RynthBundle-Setup.exe"
try {
Copy-Item -LiteralPath $builtInstaller -Destination $canonicalInstaller -Force
}
catch {
Write-Warning "Could not copy to RynthBundle-Setup.exe (file may be in use). Primary artifact: $builtInstaller"
}
}
# Record the version that produced the bundle (enables archive on next bump).
$builtInstaller = "$ScriptDir\Output\$outputName.exe"
if ($Version) {
New-Item -ItemType Directory -Path $previousReleaseDir -Force | Out-Null
[System.IO.File]::WriteAllText($lastVersionFile, $Version.Trim())
# Canonical name for the launcher updater / docs; best effort if the file is locked.
try { Copy-Item $builtInstaller "$ScriptDir\Output\RynthCore-Setup.exe" -Force }
catch { Write-Warning "Could not refresh Output\RynthCore-Setup.exe (in use?). Primary artifact: $builtInstaller" }
[IO.File]::WriteAllText($lastVersionFile, $Version)
}
Write-Host ""
Write-Host "SUCCESS" -ForegroundColor Green
Write-Host "Installer: $builtInstaller"

View file

@ -0,0 +1,103 @@
#Requires -Version 7
<#
.SYNOPSIS
Creates the RynthCore update-signing keys. Run it once, yourself.
.DESCRIPTION
Launchers install an update only if its feed is signed by a key they trust. This makes
two ECDSA P-256 keys:
primary Signs every release. Saved to <KeyDir>\primary.key, encrypted with Windows
DPAPI for your user account: Publish-Update.ps1 signs without a prompt, and the
file is useless on any other account or PC.
backup Replaces the primary if it is ever lost (new PC, reinstall). Saved to
<KeyDir>\backup.key.p8, encrypted with a password you choose here. Move it
OFFLINE (a USB stick in a drawer) and delete the copy on this PC.
Both public halves are written into src\RynthCore.App.Avalonia\UpdateTrust.cs, so
launchers built afterwards trust either key. Commit that file, then build and release.
The private keys never leave this PC. Never copy them to the server: the point of signing
is that a compromised server still can't push code to players.
.PARAMETER Force
Replace existing keys. Launchers that only trust the old keys will refuse every release
signed with the new ones, so this strands them until they reinstall by hand.
#>
param(
[string]$KeyDir = (Join-Path $env:USERPROFILE ".rynthcore-update-signing"),
[string]$TrustFile = (Join-Path $PSScriptRoot "..\src\RynthCore.App.Avalonia\UpdateTrust.cs"),
# For scripted tests only; normally you are prompted.
[SecureString]$BackupPassword,
[switch]$Force
)
$ErrorActionPreference = "Stop"
Add-Type -AssemblyName System.Security
$crypto = [System.Security.Cryptography.ProtectedData].Assembly # DPAPI present (fails loudly if not)
$primaryPath = Join-Path $KeyDir "primary.key"
$backupPath = Join-Path $KeyDir "backup.key.p8"
if ((Test-Path $primaryPath) -and -not $Force) {
throw "Keys already exist in $KeyDir. Replacing them strands launchers that trust only the old ones; pass -Force only if you mean it."
}
if (-not (Test-Path $TrustFile)) { throw "UpdateTrust.cs not found at $TrustFile" }
if (-not $BackupPassword) {
$BackupPassword = Read-Host "Password for the BACKUP key (needed only if the primary is ever lost)" -AsSecureString
$again = Read-Host "Repeat it" -AsSecureString
if ((ConvertFrom-SecureString $BackupPassword -AsPlainText) -ne (ConvertFrom-SecureString $again -AsPlainText)) {
throw "The passwords don't match."
}
}
$plain = ConvertFrom-SecureString $BackupPassword -AsPlainText
if ($plain.Length -lt 12) { throw "Use at least 12 characters for the backup key password." }
New-Item -ItemType Directory -Force $KeyDir | Out-Null
$curve = [System.Security.Cryptography.ECCurve+NamedCurves]::nistP256
$primary = [System.Security.Cryptography.ECDsa]::Create($curve)
$backup = [System.Security.Cryptography.ECDsa]::Create($curve)
# Primary: DPAPI (CurrentUser), with fixed entropy so a stray DPAPI blob can't pose as it.
$entropy = [Text.Encoding]::UTF8.GetBytes("RynthCore update signing v1")
$pkcs8 = $primary.ExportPkcs8PrivateKey()
try {
$blob = [System.Security.Cryptography.ProtectedData]::Protect($pkcs8, $entropy, 'CurrentUser')
[IO.File]::WriteAllBytes($primaryPath, $blob)
} finally { [Array]::Clear($pkcs8) }
# Backup: password-encrypted PKCS#8 (AES-256, 600k PBKDF2 rounds).
$pbe = [System.Security.Cryptography.PbeParameters]::new(
[System.Security.Cryptography.PbeEncryptionAlgorithm]::Aes256Cbc,
[System.Security.Cryptography.HashAlgorithmName]::SHA256, 600000)
[IO.File]::WriteAllBytes($backupPath, $backup.ExportEncryptedPkcs8PrivateKey($plain, $pbe))
$plain = $null
function KeyId([byte[]]$spki) {
$h = [System.Security.Cryptography.SHA256]::HashData($spki)
return ([Convert]::ToHexString($h, 0, 8)).ToLowerInvariant()
}
$keys = foreach ($k in @(@{ Name = "primary"; Key = $primary }, @{ Name = "backup"; Key = $backup })) {
$spki = $k.Key.ExportSubjectPublicKeyInfo()
[pscustomobject]@{ Name = $k.Name; Id = KeyId $spki; Base64 = [Convert]::ToBase64String($spki) }
}
# Write the public keys between the markers in UpdateTrust.cs.
$src = Get-Content $TrustFile -Raw
$begin = "// BEGIN KEYS (New-UpdateSigningKey.ps1)"
$end = "// END KEYS"
$i = $src.IndexOf($begin); $j = $src.IndexOf($end)
if ($i -lt 0 -or $j -lt $i) { throw "Key markers not found in $TrustFile" }
$indent = " "
$lines = $keys | ForEach-Object { "$indent`"$($_.Base64)`", // $($_.Name) $($_.Id)" }
$new = $src.Substring(0, $i + $begin.Length) + "`r`n" + ($lines -join "`r`n") + "`r`n$indent" + $src.Substring($j)
Set-Content -Path $TrustFile -Value $new -NoNewline -Encoding utf8
Write-Host ""
Write-Host "Keys created in $KeyDir" -ForegroundColor Green
$keys | ForEach-Object { Write-Host (" {0,-8} {1}" -f $_.Name, $_.Id) }
Write-Host ""
Write-Host "Public keys written to $TrustFile" -ForegroundColor Green
Write-Host "Next:"
Write-Host " 1. Move $backupPath OFFLINE (USB stick), then delete it here. Keep its password somewhere safe."
Write-Host " 2. Commit UpdateTrust.cs, then publish with installer\Publish-Update.ps1 -Version <yyyy.m.d.n>."

View file

@ -0,0 +1,256 @@
#Requires -Version 7
<#
.SYNOPSIS
Builds, signs and publishes a RynthCore + RynthSuite release to the launchers' update feed.
.DESCRIPTION
One command per release:
1. Refuses if the signing key isn't set up or isn't trusted by the launcher being shipped,
if either repo has uncommitted changes, or if -Version isn't newer than the live feed.
2. Builds the installer (Build-Installer.ps1 -Version) and the RynthSuite plugins into
installer\Releases\<release>\ — never into the live C:\Games folders.
3. Writes the manifest (sizes + SHA-256 of every file), signs it with the DPAPI key
(Sign-Update.ps1, no prompt) and checks the signature the way the launcher will.
4. Uploads the release files, checks their hashes on the server, replaces the website's
RynthCore-Setup.exe and RynthSuite-Plugins.zip (old ones kept in ~/backups/rynth),
and swaps in update.json last, atomically.
5. Fetches the live feed back and compares it byte for byte.
Launchers pick it up at their next check (start-up, every 6 hours, or the button). Plugins
swap in place without touching running bots; the core installer waits until every
RynthCore client is closed.
.EXAMPLE
.\Publish-Update.ps1 -Version 2026.9.28.1 -Changes "Arrow crafting covers every head type.", "The Tell button works on players too."
#>
param(
[Parameter(Mandatory)][string]$Version,
# Release notes for players, one line per change: they become this release's entry in
# downloads/rynth/releases.json, which the "What's new" list on aelrynth.com/rynth.html shows.
[string[]]$Changes = @(),
# Short text the launcher shows next to an available update; defaults to the changes.
[string]$Notes = "",
[switch]$DryRun, # build + sign + verify, upload nothing
[switch]$AllowDirty, # publish with uncommitted changes (don't)
[string]$SshHost = "aelrynth-vps",
[string]$RemoteDir = "/var/www/site/downloads/rynth",
[string]$BaseUrl = "https://aelrynth.com/downloads/rynth",
[string]$KeyDir = (Join-Path $env:USERPROFILE ".rynthcore-update-signing"),
[string]$RynthSuiteRoot = "",
[string]$TrustFile = "" # defaults to the launcher's UpdateTrust.cs; override for tests
)
$ErrorActionPreference = "Stop"
$ScriptDir = $PSScriptRoot
$RepoRoot = Split-Path $ScriptDir -Parent
if (-not $RynthSuiteRoot) { $RynthSuiteRoot = Join-Path (Split-Path $RepoRoot -Parent) "RynthSuite" }
if (-not $TrustFile) { $TrustFile = Join-Path $RepoRoot "src\RynthCore.App.Avalonia\UpdateTrust.cs" }
function Step($m) { Write-Host ""; Write-Host "== $m" -ForegroundColor Cyan }
function Sha256([string]$path) { (Get-FileHash $path -Algorithm SHA256).Hash.ToLowerInvariant() }
# Same check as RynthUpdater.VerifyEnvelope: any trusted key's signature over the payload bytes.
function Test-Envelope([string]$path, [string[]]$keys) {
$envelope = Get-Content $path -Raw | ConvertFrom-Json
$payload = [Convert]::FromBase64String($envelope.payload)
foreach ($k in $keys) {
$spki = [Convert]::FromBase64String($k)
$id = ([Convert]::ToHexString([System.Security.Cryptography.SHA256]::HashData($spki), 0, 8)).ToLowerInvariant()
$ec = [System.Security.Cryptography.ECDsa]::Create()
$read = 0; $ec.ImportSubjectPublicKeyInfo($spki, [ref]$read)
foreach ($s in $envelope.signatures) {
if ($s.key -ne $id) { continue }
if ($ec.VerifyData($payload, [Convert]::FromBase64String($s.sig),
[System.Security.Cryptography.HashAlgorithmName]::SHA256,
[System.Security.Cryptography.DSASignatureFormat]::IeeeP1363FixedFieldConcatenation)) { return $true }
}
}
return $false
}
# ── 1. Preconditions ─────────────────────────────────────────────────────────
Step "Checking preconditions"
$p = $Version.Split('.')
if ($p.Count -ne 4 -or ($p | Where-Object { $_ -notmatch '^\d+$' })) { throw "-Version must be yyyy.m.d.n, got '$Version'" }
$release = [int]$p[0] * 1000000 + [int]$p[1] * 10000 + [int]$p[2] * 100 + [int]$p[3]
if ($Changes.Count -eq 0 -and $Notes) { $Changes = @($Notes -split ';\s*' | Where-Object { $_ }) }
if ($Changes.Count -eq 0) { throw "Give -Changes: the release notes players see on aelrynth.com/rynth.html (one string per change)." }
if (-not $Notes) { $Notes = $Changes -join " " }
$trusted = [regex]::Matches((Get-Content $TrustFile -Raw), '"([A-Za-z0-9+/=]{80,})"') | ForEach-Object { $_.Groups[1].Value }
if ($trusted.Count -lt 2) {
throw "UpdateTrust.cs has $($trusted.Count) key(s); it needs the primary and the backup. Run New-UpdateSigningKey.ps1 and commit UpdateTrust.cs."
}
$probe = New-TemporaryFile
try {
Set-Content $probe "probe $release" -NoNewline
& (Join-Path $ScriptDir "Sign-Update.ps1") -PayloadPath $probe -OutPath "$probe.sig" -KeyDir $KeyDir | Out-Null
if (-not (Test-Envelope "$probe.sig" $trusted)) {
throw "The signing key in $KeyDir is not one UpdateTrust.cs trusts: launchers would refuse this release."
}
} finally { Remove-Item $probe, "$probe.sig" -ErrorAction SilentlyContinue }
Write-Host " signing key is trusted by the launcher ($($trusted.Count) keys)"
if (-not $AllowDirty) {
foreach ($repo in $RepoRoot, $RynthSuiteRoot) {
$dirty = git -C $repo status --porcelain --untracked-files=no
if ($dirty) { throw "$repo has uncommitted changes — release from committed code (or pass -AllowDirty):`n$dirty" }
}
Write-Host " RynthCore $(git -C $RepoRoot rev-parse --short HEAD), RynthSuite $(git -C $RynthSuiteRoot rev-parse --short HEAD)"
}
try {
$live = Invoke-RestMethod "$BaseUrl/update.json" -TimeoutSec 20
$liveRelease = ([Text.Encoding]::UTF8.GetString([Convert]::FromBase64String($live.payload)) | ConvertFrom-Json).release
if ($release -le $liveRelease) { throw "Release $release is not newer than the live feed's $liveRelease — bump -Version." }
Write-Host " live feed is at $liveRelease; publishing $release"
} catch [Microsoft.PowerShell.Commands.HttpResponseException] {
Write-Host " no live feed yet — this is the first release"
}
# ── 2. Build ─────────────────────────────────────────────────────────────────
$rel = Join-Path $ScriptDir "Releases\$release"
if (Test-Path $rel) { Remove-Item $rel -Recurse -Force }
New-Item -ItemType Directory -Force "$rel\plugins", "$rel\build" | Out-Null
Step "Building the installer ($Version)"
& (Join-Path $ScriptDir "Build-Installer.ps1") -Version $Version -RynthSuiteRoot $RynthSuiteRoot
if (-not $?) { throw "Build-Installer.ps1 failed" }
Copy-Item (Join-Path $ScriptDir "Output\RynthCore-Setup.exe") "$rel\RynthCore-Setup.exe"
Copy-Item (Join-Path $ScriptDir "staging\plugins\RynthAi\RynthCore.Plugin.RynthAi.dll") "$rel\plugins\"
$suitePlugins = "RynthChat", "RynthTracker", "RynthNav", "RynthVision"
foreach ($name in $suitePlugins) {
Step "Building $name"
$proj = Join-Path $RynthSuiteRoot "Plugins\RynthCore.Plugin.$name\RynthCore.Plugin.$name.csproj"
# PublishDir overrides the projects' own (RynthNav/RynthVision publish into the live C:\Games folders).
dotnet publish $proj -c Release "-p:Version=$Version" "-p:PublishDir=$rel\build\$name\" -v q -nologo
if ($LASTEXITCODE -ne 0) { throw "dotnet publish failed for $name" }
Copy-Item "$rel\build\$name\RynthCore.Plugin.$name.dll" "$rel\plugins\"
}
Step "Packing RynthSuite-Plugins.zip"
$zipRoot = "$rel\build\zip"
foreach ($name in $suitePlugins) {
New-Item -ItemType Directory -Force "$zipRoot\RynthSuite\$name" | Out-Null
Copy-Item "$rel\plugins\RynthCore.Plugin.$name.dll" "$zipRoot\RynthSuite\$name\"
}
$navSrc = "C:\Games\RynthCore\NavData"
New-Item -ItemType Directory -Force "$zipRoot\RynthCore\NavData" | Out-Null
Get-ChildItem $navSrc -File | Where-Object { $_.Extension -eq ".tile" -or $_.Name -eq "portals.tsv" } |
Copy-Item -Destination "$zipRoot\RynthCore\NavData\"
@"
RynthSuite plugins for RynthCore (Asheron's Call, retail client) - $Version
Extract this zip into C:\Games - it creates:
C:\Games\RynthSuite\RynthChat\ RynthChat plugin
C:\Games\RynthSuite\RynthNav\ RynthNav plugin
C:\Games\RynthSuite\RynthTracker\ RynthTracker plugin
C:\Games\RynthSuite\RynthVision\ RynthVision plugin
C:\Games\RynthCore\NavData\ RynthNav's baked navmesh tiles
Then, in the RynthCore launcher's Plugins tab, add the full path of each
plugin DLL you want. Install RynthCore first (RynthCore-Setup.exe), which
also installs RynthAi and the Loot Editor. After that the launcher keeps
the plugins up to date by itself.
MIT licensed. https://aelrynth.com/projects.html
"@ -replace "`n", "`r`n" | Set-Content "$zipRoot\README.txt" -NoNewline
Compress-Archive -Path "$zipRoot\*" -DestinationPath "$rel\RynthSuite-Plugins.zip" -CompressionLevel Optimal
# ── 3. Manifest + signature ──────────────────────────────────────────────────
Step "Writing and signing the manifest"
$setup = Get-Item "$rel\RynthCore-Setup.exe"
$plugins = foreach ($dll in Get-ChildItem "$rel\plugins\*.dll" | Sort-Object Name) {
[ordered]@{
name = $dll.BaseName -replace '^RynthCore\.Plugin\.', ''
file = $dll.Name
url = "$BaseUrl/releases/$release/plugins/$($dll.Name)"
size = $dll.Length
sha256 = Sha256 $dll.FullName
}
}
$manifest = [ordered]@{
schema = 1
release = $release
version = $Version
published = (Get-Date).ToUniversalTime().ToString("yyyy-MM-ddTHH:mm:ssZ")
notes = $Notes
core = [ordered]@{
release = $release
version = $Version
url = "$BaseUrl/releases/$release/RynthCore-Setup.exe"
size = $setup.Length
sha256 = Sha256 $setup.FullName
}
plugins = @($plugins)
}
Set-Content "$rel\update.payload.json" ($manifest | ConvertTo-Json -Depth 5) -Encoding utf8NoBOM
& (Join-Path $ScriptDir "Sign-Update.ps1") -PayloadPath "$rel\update.payload.json" -OutPath "$rel\update.json" -KeyDir $KeyDir
if (-not (Test-Envelope "$rel\update.json" $trusted)) { throw "Signed feed does not verify against UpdateTrust.cs" }
Write-Host " verified against the launcher's trusted keys"
# Release notes: this release on top of the live list (a re-run replaces its own entry).
$history = @()
try { $history = @((Invoke-RestMethod "$BaseUrl/releases.json" -TimeoutSec 20).releases) }
catch [Microsoft.PowerShell.Commands.HttpResponseException] { Write-Host " no releases.json yet — starting one" }
$entry = [ordered]@{ version = $Version; date = (Get-Date -Format "yyyy-MM-dd"); changes = @($Changes) }
$releaseNotes = [ordered]@{ releases = @($entry) + @($history | Where-Object { $_ -and $_.version -ne $Version }) }
Set-Content "$rel\releases.json" ($releaseNotes | ConvertTo-Json -Depth 5) -Encoding utf8NoBOM
Write-Host " releases.json: $($releaseNotes.releases.Count) release(s), $($Changes.Count) change(s) in this one"
if ($DryRun) {
Write-Host ""; Write-Host "Dry run: release built and signed in $rel; nothing uploaded." -ForegroundColor Yellow
return
}
# ── 4. Upload ────────────────────────────────────────────────────────────────
Step "Uploading release $release"
$remoteRel = "$RemoteDir/releases/$release"
ssh $SshHost "mkdir -p '$remoteRel/plugins'"
if ($LASTEXITCODE -ne 0) { throw "ssh mkdir failed" }
scp -q "$rel\RynthCore-Setup.exe" "${SshHost}:$remoteRel/RynthCore-Setup.exe"
if ($LASTEXITCODE -ne 0) { throw "scp of the installer failed" }
scp -q (Get-ChildItem "$rel\plugins\*.dll").FullName "${SshHost}:$remoteRel/plugins/"
if ($LASTEXITCODE -ne 0) { throw "scp of the plugins failed" }
$remoteSums = ssh $SshHost "cd '$remoteRel' && sha256sum RynthCore-Setup.exe plugins/*.dll"
$expect = @{ "RynthCore-Setup.exe" = $manifest.core.sha256 }
foreach ($pl in $plugins) { $expect["plugins/$($pl.file)"] = $pl.sha256 }
foreach ($line in $remoteSums) {
$sum, $name = $line -split '\s+', 2
if ($expect[$name.TrimStart('*')] -ne $sum) { throw "Hash mismatch on the server for $name — feed NOT published" }
}
Write-Host " $($expect.Count) files uploaded and hash-checked"
Step "Replacing the website downloads"
scp -q "$rel\RynthCore-Setup.exe" "${SshHost}:$RemoteDir/.RynthCore-Setup.exe.new"
if ($LASTEXITCODE -ne 0) { throw "scp of the website installer failed" }
scp -q "$rel\RynthSuite-Plugins.zip" "${SshHost}:$RemoteDir/.RynthSuite-Plugins.zip.new"
if ($LASTEXITCODE -ne 0) { throw "scp of the plugins zip failed" }
ssh $SshHost "set -e; mkdir -p ~/backups/rynth; cd '$RemoteDir'; for f in RynthCore-Setup.exe RynthSuite-Plugins.zip; do [ -f `$f ] && cp -p `$f ~/backups/rynth/`$f.before-$release || true; mv -f .`$f.new `$f; done"
if ($LASTEXITCODE -ne 0) { throw "Replacing the website downloads failed" }
Step "Publishing the feed"
scp -q "$rel\update.json" "${SshHost}:$RemoteDir/.update.json.new"
if ($LASTEXITCODE -ne 0) { throw "scp of update.json failed" }
ssh $SshHost "mv -f '$RemoteDir/.update.json.new' '$RemoteDir/update.json'"
if ($LASTEXITCODE -ne 0) { throw "Publishing update.json failed" }
# The release notes follow the feed, so the page never lists a release launchers can't get yet.
scp -q "$rel\releases.json" "${SshHost}:$RemoteDir/.releases.json.new"
if ($LASTEXITCODE -ne 0) { throw "scp of releases.json failed" }
ssh $SshHost "mv -f '$RemoteDir/.releases.json.new' '$RemoteDir/releases.json'"
if ($LASTEXITCODE -ne 0) { throw "Publishing releases.json failed" }
# ── 5. Verify ────────────────────────────────────────────────────────────────
Step "Verifying the live feed"
$tmp = New-TemporaryFile
try {
Invoke-WebRequest "$BaseUrl/update.json" -OutFile $tmp -UseBasicParsing -Headers @{ "Cache-Control" = "no-cache" }
if ((Sha256 $tmp) -ne (Sha256 "$rel\update.json")) { throw "The live update.json differs from the one just signed!" }
if (-not (Test-Envelope $tmp $trusted)) { throw "The live update.json does not verify!" }
} finally { Remove-Item $tmp -ErrorAction SilentlyContinue }
Write-Host ""
Write-Host "Published RynthCore $Version (release $release)." -ForegroundColor Green
Write-Host "Launchers pick it up at their next check, and aelrynth.com/rynth.html lists it. Still by hand: the public source snapshots."

View file

@ -1,7 +1,18 @@
; RynthCore + RynthSuite Installer
; Build with: Build-Installer.ps1 (requires Inno Setup 6)
; RynthCore + RynthSuite full installer
; Build with: Build-Installer.ps1 (requires Inno Setup 6) — it builds every component from source
; (launcher, engine, loader, RynthAi plugin, Loot Editor, Monster Editor) and stages them under
; installer\staging\core and installer\staging\suite before invoking ISCC on this file.
; Source: https://jrsoftware.org/isdl.php
;
; Install locations are user-defined:
; * RynthCore folder ({app}) — the standard "Select Destination Location" page
; * RynthSuite folder ({code:GetSuiteDir}) — a second folder page right after it
; Both are recorded under HKA\Software\Rynth (CoreDir / SuiteDir); the engine, launcher and plugins
; resolve every path from there (RynthInstallPaths.cs), so neither folder has to be under C:\Games.
; Silent installs: /DIR="<core folder>" /SUITEDIR="<suite folder>".
; Prerequisite: when the .NET 10 Desktop Runtime (x86) is missing, the "installdotnet" task (on by default)
; downloads it from Microsoft and installs it before the files are copied. A failure is reported, never fatal.
;
; NOTE: No ISPP (#define / {#...}) macros are used in this file.
; Build-Installer.ps1 replaces the AppVersion placeholder via text substitution
; before invoking ISCC, so the preprocessor has nothing to expand.
@ -9,13 +20,17 @@
; APPVERSION_PLACEHOLDER=0.0.0
[Setup]
; Same AppId as every earlier RynthCore / RynthBundle installer, so this upgrades them in place.
AppId={{A8B4C2D1-E3F5-4678-9ABC-DEF012345678}
AppName=RynthCore
AppVerName=RynthCore + RynthSuite 0.0.0
AppVersion=0.0.0
AppPublisher=RynthCore
AppPublisherURL=https://github.com/tombohar/RynthCore
AppPublisherURL=https://aelrynth.com/rynth.html
UninstallDisplayName=RynthCore + RynthSuite
DefaultDirName=C:\Games\RynthCore
DisableDirPage=no
UsePreviousAppDir=yes
DefaultGroupName=RynthCore
DisableProgramGroupPage=yes
OutputDir=Output
@ -28,265 +43,440 @@ WizardStyle=modern
; the chosen install folder requires it (e.g. C:\Games\).
PrivilegesRequired=lowest
PrivilegesRequiredOverridesAllowed=dialog
; 32-bit app; works on 32/64-bit Windows
ArchitecturesAllowed=x86 x64 arm64
; Close a running launcher / editors before replacing their files.
CloseApplications=yes
; 32-bit app; works on 32/64-bit Windows (HKA registry writes land in the 32-bit view,
; which is exactly where RynthInstallPaths reads HKLM from).
ArchitecturesAllowed=x86compatible
ArchitecturesInstallIn64BitMode=
[Languages]
Name: "english"; MessagesFile: "compiler:Default.isl"
[Types]
Name: "full"; Description: "Full install (RynthCore + RynthSuite)"
Name: "core"; Description: "RynthCore only"
Name: "custom"; Description: "Custom"; Flags: iscustom
[Components]
Name: "core"; Description: "RynthCore launcher, engine and Loot Editor"; Types: full core custom; Flags: fixed
Name: "rynthai"; Description: "RynthSuite: RynthAi plugin (installed and registered with the launcher)"; Types: full
Name: "monstereditor"; Description: "RynthSuite: Monster Editor"; Types: full
; Experimental plugins: unchecked by default in every install type (ticking one switches to Custom).
Name: "experimental"; Description: "RynthSuite: Experimental plugins (work in progress)"
Name: "experimental\rynthchat"; Description: "RynthChat - replacement chat window (classifies and owns game chat)"
Name: "experimental\rynthjuice"; Description: "RynthJuice - floating damage/heal numbers and kill bursts"
Name: "experimental\rynthnav"; Description: "RynthNav - navmesh pathing and portal routing (needs baked NavData tiles)"
Name: "experimental\rynthtracker"; Description: "RynthTracker - per-session kill tracker"
Name: "experimental\rynthvision"; Description: "RynthVision - unclimbable slope, water and radar-range overlays"
[Tasks]
Name: desktopicon; Description: "Create a &desktop shortcut"; GroupDescription: "Additional icons:"
; Only offered when the runtime is missing. RynthCore and its tools are self-contained / NativeAOT and run
; without it; it is installed for framework-dependent add-ons and tools. Skip silently with /MERGETASKS="!installdotnet".
Name: installdotnet; Description: "Download and install the Microsoft .NET 10 Desktop Runtime (x86, about 55 MB; may ask for administrator approval)"; GroupDescription: "Prerequisites:"; Check: DotNet10DesktopMissing
; Files left by older layouts (the 0.4.x RynthBundle put a framework-dependent launcher, the engine
; and plugins straight into {app}). Mixing those with a newer launcher is what broke 2026-10-04's
; reinstall (RynthCore.App.Avalonia.dll from 0.4.7 + a newer deps.json → missing DesktopLog).
; Only loose top-level binaries/metadata are removed; every file the new build needs is copied back
; by [Files] right after. User data (Logs, AcClient, NavData, DecalBridge, ...) is never touched.
[InstallDelete]
Type: files; Name: "{app}\*.dll"
Type: files; Name: "{app}\*.json"
Type: files; Name: "{app}\*.pdb"
Type: files; Name: "{app}\*.exp"
Type: files; Name: "{app}\*.lib"
Type: files; Name: "{app}\*.previous"
Type: files; Name: "{app}\RynthCore.App.Avalonia.exe"
Type: files; Name: "{app}\RynthCore-Prerequisites.txt"
Type: files; Name: "{app}\Runtime\*.dll"
Type: files; Name: "{app}\Runtime\*.json"
Type: files; Name: "{app}\Runtime\*.pdb"
Type: files; Name: "{app}\Runtime\RynthCore.Injector.exe"
Type: filesandordirs; Name: "{app}\Runtime\Plugins"
; Program files
[Files]
; Installs the entire staging layout (launcher, Runtime\, Tools\, etc.)
Source: "staging\app\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs
; RynthCore: launcher, Runtime\ (engine, loader, native deps), Tools\LootEditor, release.txt
Source: "staging\core\*"; DestDir: "{app}"; Components: core; Flags: ignoreversion recursesubdirs createallsubdirs
; Data directories (created once; never removed on uninstall)
; RynthSuite: the RynthAi plugin lives next to its data folders in the chosen Suite folder.
Source: "staging\suite\RynthAi\RynthCore.Plugin.RynthAi.dll"; DestDir: "{code:GetSuiteDir}\RynthAi"; Components: rynthai; Flags: ignoreversion
; Monster Editor: RynthAi's dashboard launches it from <RynthAi>\MonsterEditor\.
Source: "staging\suite\RynthAi\MonsterEditor\*"; DestDir: "{code:GetSuiteDir}\RynthAi\MonsterEditor"; Components: monstereditor; Flags: ignoreversion recursesubdirs createallsubdirs
; Experimental plugins: each in its own <RynthSuite>\<Name>\ folder (the layout the launcher already uses).
Source: "staging\suite\RynthChat\RynthCore.Plugin.RynthChat.dll"; DestDir: "{code:GetSuiteDir}\RynthChat"; Components: experimental\rynthchat; Flags: ignoreversion
Source: "staging\suite\RynthJuice\RynthCore.Plugin.RynthJuice.dll"; DestDir: "{code:GetSuiteDir}\RynthJuice"; Components: experimental\rynthjuice; Flags: ignoreversion
Source: "staging\suite\RynthNav\RynthCore.Plugin.RynthNav.dll"; DestDir: "{code:GetSuiteDir}\RynthNav"; Components: experimental\rynthnav; Flags: ignoreversion
Source: "staging\suite\RynthTracker\RynthCore.Plugin.RynthTracker.dll"; DestDir: "{code:GetSuiteDir}\RynthTracker"; Components: experimental\rynthtracker; Flags: ignoreversion
Source: "staging\suite\RynthVision\RynthCore.Plugin.RynthVision.dll"; DestDir: "{code:GetSuiteDir}\RynthVision"; Components: experimental\rynthvision; Flags: ignoreversion
; RynthNav reads <RynthCore>\NavData. Starter portal list only; a newer one from RynthNav.PortalGraph is kept.
Source: "staging\navdata\portals.tsv"; DestDir: "{app}\NavData"; Components: experimental\rynthnav; Flags: onlyifdoesntexist uninsneveruninstall
; RynthAi data directories (created once; never removed on uninstall — they hold user profiles)
[Dirs]
Name: "C:\Games\RynthSuite\RynthAi"; Flags: uninsneveruninstall
Name: "C:\Games\RynthSuite\RynthAi\NavProfiles"; Flags: uninsneveruninstall
Name: "C:\Games\RynthSuite\RynthAi\LootProfiles"; Flags: uninsneveruninstall
Name: "C:\Games\RynthSuite\RynthAi\MetaFiles"; Flags: uninsneveruninstall
Name: "C:\Games\RynthSuite\RynthAi\MetaProfiles"; Flags: uninsneveruninstall
Name: "C:\Games\RynthSuite\RynthAi\SettingsProfiles"; Flags: uninsneveruninstall
Name: "C:\Games\RynthSuite\RynthAi\SettingsProfiles\ACEmulator"; Flags: uninsneveruninstall
Name: "C:\Games\RynthSuite\RynthAi\MonsterProfiles"; Flags: uninsneveruninstall
Name: "C:\Games\RynthSuite\RynthAi\LuaScripts"; Flags: uninsneveruninstall
Name: "C:\Games\RynthSuite\RynthAi\Logs"; Flags: uninsneveruninstall
Name: "C:\Games\RynthSuite\RynthAi\pvars"; Flags: uninsneveruninstall
Name: "C:\Games\RynthSuite\RynthAi\ItemGiver"; Flags: uninsneveruninstall
Name: "{code:GetSuiteDir}\RynthAi"; Components: rynthai; Flags: uninsneveruninstall
Name: "{code:GetSuiteDir}\RynthAi\NavProfiles"; Components: rynthai; Flags: uninsneveruninstall
Name: "{code:GetSuiteDir}\RynthAi\LootProfiles"; Components: rynthai; Flags: uninsneveruninstall
Name: "{code:GetSuiteDir}\RynthAi\MetaFiles"; Components: rynthai; Flags: uninsneveruninstall
Name: "{code:GetSuiteDir}\RynthAi\MetaProfiles"; Components: rynthai; Flags: uninsneveruninstall
Name: "{code:GetSuiteDir}\RynthAi\SettingsProfiles"; Components: rynthai; Flags: uninsneveruninstall
Name: "{code:GetSuiteDir}\RynthAi\SettingsProfiles\ACEmulator"; Components: rynthai; Flags: uninsneveruninstall
Name: "{code:GetSuiteDir}\RynthAi\MonsterProfiles"; Components: rynthai; Flags: uninsneveruninstall
Name: "{code:GetSuiteDir}\RynthAi\LuaScripts"; Components: rynthai; Flags: uninsneveruninstall
Name: "{code:GetSuiteDir}\RynthAi\Logs"; Components: rynthai; Flags: uninsneveruninstall
Name: "{code:GetSuiteDir}\RynthAi\pvars"; Components: rynthai; Flags: uninsneveruninstall
Name: "{code:GetSuiteDir}\RynthAi\ItemGiver"; Components: rynthai; Flags: uninsneveruninstall
Name: "{code:GetSuiteDir}\RynthAi\AutoVendor"; Components: rynthai; Flags: uninsneveruninstall
; RynthNav tiles baked by RynthNav.Baker (default --out) go here; kept on uninstall.
Name: "{app}\NavData"; Components: experimental\rynthnav; Flags: uninsneveruninstall
; Install locations for the engine / launcher / plugins (see RynthInstallPaths.cs), plus a one-shot
; hand-off the launcher consumes on next start to add the plugin to its Plugins list.
; HKA = HKCU for a per-user install, HKLM for an all-users (elevated) install.
[Registry]
Root: HKA; Subkey: "Software\Rynth"; ValueType: string; ValueName: "CoreDir"; ValueData: "{app}"; Flags: uninsdeletevalue uninsdeletekeyifempty
Root: HKA; Subkey: "Software\Rynth"; ValueType: string; ValueName: "SuiteDir"; ValueData: "{code:GetSuiteDir}"; Flags: uninsdeletevalue uninsdeletekeyifempty
Root: HKA; Subkey: "Software\Rynth"; ValueType: string; ValueName: "PendingPluginRegistration"; ValueData: "{code:GetPendingPlugins}"; Check: HasPendingPlugins; Flags: uninsdeletevalue
; Shortcuts
[Icons]
; Start Menu
Name: "{group}\RynthCore"; Filename: "{app}\RynthCore.exe"; WorkingDir: "{app}"; Comment: "Launch RynthCore and inject into Asheron's Call"
Name: "{group}\RynthCore Injector (CLI)"; Filename: "{app}\Runtime\RynthCore.Injector.exe"; WorkingDir: "{app}\Runtime"; Check: FileExists(ExpandConstant('{app}\Runtime\RynthCore.Injector.exe'))
Name: "{group}\RynthCore Loot Editor"; Filename: "{app}\Tools\LootEditor\RynthCore.LootEditor.exe"; WorkingDir: "{app}\Tools\LootEditor"; Check: FileExists(ExpandConstant('{app}\Tools\LootEditor\RynthCore.LootEditor.exe'))
Name: "{group}\RynthCore Monster Editor"; Filename: "{app}\Tools\MonsterEditor\RynthCore.MonsterEditor.exe"; WorkingDir: "{app}\Tools\MonsterEditor"; Check: FileExists(ExpandConstant('{app}\Tools\MonsterEditor\RynthCore.MonsterEditor.exe'))
; RynthCore.exe / Injector bundle .NET 10 (x86) — no Start Menu link nudging users to install a
; global runtime. See RynthCore-Prerequisites.txt for the optional x64 runtime (Loot/Monster tools).
Name: "{group}\Loot Editor"; Filename: "{app}\Tools\LootEditor\RynthCore.LootEditor.exe"; WorkingDir: "{app}\Tools\LootEditor"; Comment: "Edit VTank-style loot profiles"
Name: "{group}\Monster Editor"; Filename: "{code:GetSuiteDir}\RynthAi\MonsterEditor\RynthCore.MonsterEditor.exe"; WorkingDir: "{code:GetSuiteDir}\RynthAi\MonsterEditor"; Components: monstereditor; Comment: "Edit RynthAi monster profiles"
Name: "{group}\RynthSuite Folder"; Filename: "{code:GetSuiteDir}"; Components: rynthai
Name: "{group}\Uninstall RynthCore"; Filename: "{uninstallexe}"
; Optional Desktop shortcut (created only when the desktopicon task is checked)
Name: "{autodesktop}\RynthCore"; Filename: "{app}\RynthCore.exe"; WorkingDir: "{app}"; Tasks: desktopicon
; ── Advisory: .NET 10+ Desktop Runtime (x64) for Suite tools (Loot/Monster) ──────────────
; RynthCore.exe and the injector are self-contained. Loot/Monster are x64 FDD and need a
; machine runtime; this page informs only — Next is never disabled (Rynth client policy; not UB-ILT).
; Registry rules below must match src/RynthCore.DesktopLog/NetDesktopX64Prerequisite.cs (C#) — change both together.
[Run]
; Interactive install: offer to start the launcher on the last page.
Filename: "{app}\RynthCore.exe"; WorkingDir: "{app}"; Description: "Launch RynthCore"; Flags: nowait postinstall skipifsilent
; The launcher's updater runs this installer with /SILENT /RELAUNCH after closing itself;
; bring it back when the upgrade is done.
Filename: "{app}\RynthCore.exe"; WorkingDir: "{app}"; Flags: nowait runasoriginaluser; Check: CmdLineParamExists('/RELAUNCH')
[Code]
const
{ Official landing page: user picks the x64 Desktop Runtime download. }
DotNet10DesktopDownloadUrl = 'https://dotnet.microsoft.com/en-us/download/dotnet/10.0/runtime';
DefaultSuiteDir = 'C:\Games\RynthSuite';
{ Microsoft's permalink to the latest .NET 10 Desktop Runtime (x86 to match RynthCore's x86 binaries). }
DotNetDesktopUrl = 'https://aka.ms/dotnet/10.0/windowsdesktop-runtime-win-x86.exe';
DotNetDesktopFile = 'windowsdesktop-runtime-10-win-x86.exe';
DotNetManualUrl = 'https://dotnet.microsoft.com/download/dotnet/10.0';
var
PrereqPage: TWizardPage;
PrereqStatus: TNewStaticText;
PrereqButtonDownload: TNewButton;
PrereqButtonRecheck: TNewButton;
SuiteDirPage: TInputDirWizardPage;
DotNetDownloadPage: TDownloadWizardPage;
{ Set once the .NET step ran (interactive: on leaving the Ready page; silent: in PrepareToInstall). }
DotNetHandled: Boolean;
{ True once the user (or /SUITEDIR / a previous install) chose the Suite folder explicitly;
until then it follows the RynthCore folder as a sibling "RynthSuite" folder. }
SuiteDirPinned: Boolean;
{ Path A: shared Windows Desktop pack (FDD for WinForms/WPF) — e.g. Microsoft.WindowsDesktop.App\10.0.0 }
function IsWindowsDesktopSharedFramework10Plus: Boolean;
function CmdLineParamExists(const Value: string): Boolean;
var
Names: TArrayOfString;
I, Major, DotPos: Integer;
S: String;
begin
Result := False;
if not RegGetSubkeyNames(HKLM64, 'SOFTWARE\dotnet\shared\Microsoft.WindowsDesktop.App', Names) then
Exit;
for I := 0 to GetArrayLength(Names) - 1 do
begin
S := Names[I];
DotPos := Pos('.', S);
if DotPos > 0 then
begin
Major := StrToIntDef(Copy(S, 1, DotPos - 1), 0);
if Major >= 10 then
begin
Result := True;
Exit;
end;
end;
end;
end;
{ Path B: .NET host registration (see learn.microsoft.com runtime discovery) — sharedhost Version 10+.
Uses HKLM64\SOFTWARE\dotnet\Setup\InstalledVersions\x64\sharedhost\Version
and the parallel Microsoft\dotnet\Setup key when present. }
function IsSharedHostVersion10PlusX64: Boolean;
var
V: String;
DotPos: Integer;
Major: Integer;
begin
Result := False;
if RegQueryStringValue(HKLM64, 'SOFTWARE\dotnet\Setup\InstalledVersions\x64\sharedhost', 'Version', V) then
begin
DotPos := Pos('.', V);
if DotPos > 0 then
begin
Major := StrToIntDef(Copy(V, 1, DotPos - 1), 0);
if Major >= 10 then
begin
Result := True;
Exit;
end;
end;
end;
if RegQueryStringValue(HKLM64, 'SOFTWARE\Microsoft\dotnet\Setup\InstalledVersions\x64\sharedhost', 'Version', V) then
begin
DotPos := Pos('.', V);
if DotPos > 0 then
begin
Major := StrToIntDef(Copy(V, 1, DotPos - 1), 0);
if Major >= 10 then
Result := True;
end;
end;
end;
{ Path C: SDK / workload bands under Microsoft\dotnet\InstalledManifests\x64
(e.g. ...Manifest-10.0.100). }
function IsDotNet10BandInInstalledManifestsX64: Boolean;
var
Names: TArrayOfString;
I: Integer;
S, L: String;
begin
Result := False;
if not RegGetSubkeyNames(HKLM64, 'SOFTWARE\Microsoft\dotnet\InstalledManifests\x64', Names) then
Exit;
for I := 0 to GetArrayLength(Names) - 1 do
begin
S := Names[I];
L := LowerCase(S);
if Pos('manifest-10.', L) > 0 then
for I := 1 to ParamCount do
if CompareText(ParamStr(I), Value) = 0 then
begin
Result := True;
Exit;
end;
end;
{ Returns the value of a /NAME=value command-line switch, or '' when absent. }
function CmdLineParamValue(const Name: string): string;
var
I: Integer;
Prefix: string;
begin
Result := '';
Prefix := '/' + Name + '=';
for I := 1 to ParamCount do
if CompareText(Copy(ParamStr(I), 1, Length(Prefix)), Prefix) = 0 then
begin
Result := RemoveQuotes(Copy(ParamStr(I), Length(Prefix) + 1, MaxInt));
Exit;
end;
end;
{ Suite folder recorded by an earlier install in the SAME install mode (HKA: HKCU per-user, HKLM all-users),
or ''. Never adopt the other mode's folder: two installs sharing a Suite folder would delete each other's
files on uninstall. }
function RegisteredSuiteDir: string;
begin
Result := '';
if not RegQueryStringValue(HKA, 'Software\Rynth', 'SuiteDir', Result) then
Result := '';
end;
{ Default Suite folder for a given RynthCore folder: its sibling "RynthSuite". }
function SiblingSuiteDir(const CoreDir: string): string;
begin
Result := AddBackslash(ExtractFileDir(RemoveBackslashUnlessRoot(CoreDir))) + 'RynthSuite';
end;
// {code:GetSuiteDir}: the chosen RynthSuite folder, without a trailing backslash.
function GetSuiteDir(Param: string): string;
begin
if SuiteDirPage = nil then
Result := DefaultSuiteDir
else if WizardSilent and not SuiteDirPinned then
{ Silent installs never run NextButtonClick: follow /DIR= with a sibling RynthSuite folder. }
Result := SiblingSuiteDir(WizardDirValue)
else
Result := RemoveBackslashUnlessRoot(Trim(SuiteDirPage.Values[0]));
end;
// Experimental plugin names; component "experimental\<lowercase name>" installs <Suite>\<Name>\RynthCore.Plugin.<Name>.dll.
function ExperimentalPluginName(Index: Integer): string;
begin
case Index of
0: Result := 'RynthChat';
1: Result := 'RynthJuice';
2: Result := 'RynthNav';
3: Result := 'RynthTracker';
4: Result := 'RynthVision';
else
Result := '';
end;
end;
{ Satisfied if desktop pack 10+, InstalledManifests 10.x band, or x64 sharedhost Version 10+ (Path B). }
function IsNetDesktop10PlusX64Present: Boolean;
function ExperimentalSelected(Index: Integer): Boolean;
begin
Result := WizardIsComponentSelected('experimental\' + Lowercase(ExperimentalPluginName(Index)));
end;
{ True when anything is going into the RynthSuite folder (controls the Suite folder page / memo line). }
function AnySuiteComponentSelected: Boolean;
var
I: Integer;
begin
Result := WizardIsComponentSelected('rynthai') or WizardIsComponentSelected('monstereditor');
for I := 0 to 4 do
if ExperimentalSelected(I) then
Result := True;
end;
// {code:GetPendingPlugins}: ';'-separated plugin DLLs for the launcher to add to its Plugins list on next start.
function GetPendingPlugins(Param: string): string;
var
I: Integer;
Name: string;
begin
Result := '';
if WizardIsComponentSelected('rynthai') then
Result := GetSuiteDir('') + '\RynthAi\RynthCore.Plugin.RynthAi.dll';
for I := 0 to 4 do
if ExperimentalSelected(I) then
begin
Name := ExperimentalPluginName(I);
if Result <> '' then
Result := Result + ';';
Result := Result + GetSuiteDir('') + '\' + Name + '\RynthCore.Plugin.' + Name + '.dll';
end;
end;
function HasPendingPlugins: Boolean;
begin
Result := GetPendingPlugins('') <> '';
end;
{ ── .NET 10 Desktop Runtime (x86) ─────────────────────────────────────────── }
{ True when Root (a ...\shared\Microsoft.WindowsDesktop.App folder) holds a 10.x version folder. }
function HasVersion10Folder(const Root: string): Boolean;
var
FindRec: TFindRec;
begin
Result := False;
{ 32-bit Windows: no x64 Desktop host; treat as "not applicable" and let setup proceed. }
if (not IsWin64) then
begin
Result := True;
if FindFirst(AddBackslash(Root) + '10.*', FindRec) then
try
repeat
if FindRec.Attributes and FILE_ATTRIBUTE_DIRECTORY <> 0 then
begin
Result := True;
Exit;
end;
until not FindNext(FindRec);
finally
FindClose(FindRec);
end;
end;
{ Detects the x86 Desktop Runtime 10.x the way the .NET host does: the shared framework folder under
Program Files (x86)\dotnet, or the installer's registration in the 32-bit registry view. }
function IsDotNet10DesktopX86Installed: Boolean;
var
Names: TArrayOfString;
I: Integer;
begin
Result := HasVersion10Folder(ExpandConstant('{commonpf32}\dotnet\shared\Microsoft.WindowsDesktop.App'));
if Result then Exit;
if RegGetValueNames(HKLM32, 'SOFTWARE\dotnet\Setup\InstalledVersions\x86\sharedfx\Microsoft.WindowsDesktop.App', Names) then
for I := 0 to GetArrayLength(Names) - 1 do
if Copy(Names[I], 1, 3) = '10.' then
begin
Result := True;
Exit;
end;
end;
// Check function for the installdotnet task: offer it only when the runtime is missing.
function DotNet10DesktopMissing: Boolean;
begin
Result := not IsDotNet10DesktopX86Installed;
end;
function OnDotNetDownloadProgress(const Url, FileName: String; const Progress, ProgressMax: Int64): Boolean;
begin
Result := True; { never cancel from code; the download page has its own Abort button }
end;
{ Downloads and runs the .NET 10 Desktop Runtime installer when the task is selected and the runtime is
still missing. Returns '' on success / nothing to do, else a reason. Never blocks the RynthCore install. }
function InstallDotNetRuntime(UsePage: Boolean): string;
var
SetupPath: string;
ResultCode: Integer;
begin
Result := '';
DotNetHandled := True;
if not WizardIsTaskSelected('installdotnet') or IsDotNet10DesktopX86Installed then
Exit;
Log('.NET 10 Desktop Runtime (x86) missing; downloading ' + DotNetDesktopUrl);
try
if UsePage then
begin
DotNetDownloadPage.Clear;
DotNetDownloadPage.Add(DotNetDesktopUrl, DotNetDesktopFile, '');
DotNetDownloadPage.Show;
try
DotNetDownloadPage.Download;
finally
DotNetDownloadPage.Hide;
end;
end
else
DownloadTemporaryFile(DotNetDesktopUrl, DotNetDesktopFile, '', @OnDotNetDownloadProgress);
except
Result := 'the download failed (' + GetExceptionMessage + ')';
Exit;
end;
if IsWindowsDesktopSharedFramework10Plus or IsDotNet10BandInInstalledManifestsX64 or IsSharedHostVersion10PlusX64 then
Result := True;
end;
procedure PrereqUpdateStatus;
var
Ok: Boolean;
begin
Ok := IsNetDesktop10PlusX64Present;
if Ok then
PrereqStatus.Font.Color := $008000
{ The runtime's own bundle asks for elevation (UAC) itself when this setup is not elevated. }
SetupPath := ExpandConstant('{tmp}\' + DotNetDesktopFile);
Log('Running ' + SetupPath + ' /install /quiet /norestart');
if not ShellExec('', SetupPath, '/install /quiet /norestart', '', SW_SHOW, ewWaitUntilTerminated, ResultCode) then
Result := 'its installer could not be started (' + SysErrorMessage(ResultCode) + ')'
{ 0 = installed, 3010/1641 = installed (restart pending/started), 1638 = a newer version is already installed }
else if (ResultCode <> 0) and (ResultCode <> 3010) and (ResultCode <> 1641) and (ResultCode <> 1638) then
Result := 'its installer exited with code ' + IntToStr(ResultCode) + ' (1602 = cancelled)'
else
PrereqStatus.Font.Color := $0000FF;
if (not IsWin64) then
begin
PrereqStatus.Font.Color := $004040;
PrereqStatus.Caption := '32-bit Windows: the bundled Loot/Monster tools need a 64-bit OS; ' +
'RynthCore.exe will still be installed. You can skip the .NET x64 check.';
end
else if Ok then
PrereqStatus.Caption := 'Microsoft .NET Desktop Runtime 10 or newer (x64) is already installed. You can continue.'
else
PrereqStatus.Caption := 'Not detected: Microsoft .NET 10+ Desktop Runtime (x64) for the Loot/Monster tools. ' +
'You can still continue — RynthCore.exe does not need this. Install the x64 Desktop runtime when you use those tools ' +
'(use "Open download page" / "Check again").' + #13#10#13#10 +
'RynthCore ships with its own .NET for the launcher and injector.';
PrereqButtonRecheck.Enabled := not Ok;
{ Always allow Next: advisory-only page for the Rynth bundle installer. }
WizardForm.NextButton.Enabled := True;
Log('.NET 10 Desktop Runtime installer finished, exit code ' + IntToStr(ResultCode));
end;
procedure PrereqOpenDownloadClick(Sender: TObject);
{ Runs the .NET step and reports (but never fails on) a problem. }
procedure HandleDotNetRuntime(UsePage: Boolean);
var
E: Integer;
Problem: string;
begin
if not ShellExec('open', DotNet10DesktopDownloadUrl, '', '', SW_SHOWNORMAL, ewNoWait, E) then
MsgBox('Could not open the web browser. Copy this address:'#13#10#13#10 + DotNet10DesktopDownloadUrl, mbError, MB_OK);
end;
procedure PrereqRecheckClick(Sender: TObject);
begin
PrereqUpdateStatus;
Problem := InstallDotNetRuntime(UsePage);
if Problem = '' then Exit;
Log('.NET 10 Desktop Runtime was not installed: ' + Problem);
if not WizardSilent then
MsgBox('The Microsoft .NET 10 Desktop Runtime could not be installed: ' + Problem + '.' + #13#10#13#10 +
'RynthCore will still be installed and works without it (it is self-contained). ' +
'You can install the runtime later from:' + #13#10 + DotNetManualUrl, mbInformation, MB_OK);
end;
procedure InitializeWizard;
var
RowTop: Integer;
Initial: string;
begin
PrereqPage := CreateCustomPage(
wpWelcome,
'Optional runtime (Suite tools)',
'The Loot Editor and Monster Editor are x64 apps and need the Microsoft .NET 10+ Desktop Runtime (x64) on the PC to run. ' +
'Setup does not require it to finish — RynthCore.exe and the injector bundle their own .NET.'
);
PrereqStatus := TNewStaticText.Create(PrereqPage);
with PrereqStatus do
begin
Parent := PrereqPage.Surface;
Top := 0;
Left := 0;
WordWrap := True;
AutoSize := False;
Height := 128;
Width := PrereqPage.SurfaceWidth;
end;
RowTop := PrereqStatus.Top + PrereqStatus.Height + 16;
PrereqButtonDownload := TNewButton.Create(PrereqPage);
with PrereqButtonDownload do
begin
Parent := PrereqPage.Surface;
Top := RowTop;
Left := 0;
Width := 200;
Caption := 'Open download page';
OnClick := @PrereqOpenDownloadClick;
end;
PrereqButtonRecheck := TNewButton.Create(PrereqPage);
with PrereqButtonRecheck do
begin
Parent := PrereqPage.Surface;
Top := RowTop;
Left := PrereqButtonDownload.Left + PrereqButtonDownload.Width + 12;
Width := 160;
Caption := 'Check again';
OnClick := @PrereqRecheckClick;
end;
PrereqUpdateStatus;
{ After the Components page, so ShouldSkipPage knows whether any Suite component was picked. }
SuiteDirPage := CreateInputDirPage(wpSelectComponents,
'Select RynthSuite Location',
'Where should the RynthSuite plugins and their data be installed?',
'RynthAi, the Monster Editor and any experimental plugins you picked will be installed into the RynthSuite folder below, and your ' +
'profiles (nav, loot, meta, settings) are kept there. To continue, click Next. ' +
'If you would like to select a different folder, click Browse.',
False, 'RynthSuite');
SuiteDirPage.Add('');
{ Priority: /SUITEDIR= → previous install of this setup → registry → C:\Games\RynthSuite. }
Initial := CmdLineParamValue('SUITEDIR');
if Initial = '' then Initial := GetPreviousData('SuiteDir', '');
if Initial = '' then Initial := RegisteredSuiteDir;
SuiteDirPinned := Initial <> '';
if Initial = '' then Initial := DefaultSuiteDir;
SuiteDirPage.Values[0] := Initial;
{ Progress page for the optional .NET 10 Desktop Runtime download (shown only when that task runs). }
DotNetDownloadPage := CreateDownloadPage('Downloading Prerequisites',
'Downloading the Microsoft .NET 10 Desktop Runtime (x86)...', @OnDotNetDownloadProgress);
end;
procedure CurPageChanged(CurPageID: Integer);
procedure RegisterPreviousData(PreviousDataKey: Integer);
begin
if (PrereqPage <> nil) and (CurPageID = PrereqPage.ID) then
PrereqUpdateStatus;
SetPreviousData(PreviousDataKey, 'SuiteDir', GetSuiteDir(''));
end;
function ShouldSkipPage(PageID: Integer): Boolean;
begin
{ Silent (or very silent) install: no GUI to open the download page. Admin must pre-install the x64 runtime. }
if (PrereqPage <> nil) and (PageID = PrereqPage.ID) and WizardSilent then
Result := True
else
Result := False;
{ No Suite components selected → no Suite folder to choose. }
Result := (SuiteDirPage <> nil) and (PageID = SuiteDirPage.ID) and not AnySuiteComponentSelected;
end;
function NextButtonClick(CurPageID: Integer): Boolean;
var
Dir: string;
begin
{ Prereq page is advisory only — never block Next on .NET detection (Rynth client installer only). }
Result := True;
{ Leaving the RynthCore folder page: keep an un-pinned Suite folder beside the chosen Core folder. }
if (CurPageID = wpSelectDir) and not SuiteDirPinned then
SuiteDirPage.Values[0] := SiblingSuiteDir(WizardDirValue);
if (SuiteDirPage <> nil) and (CurPageID = SuiteDirPage.ID) then
begin
Dir := GetSuiteDir('');
{ Require an absolute local or UNC path (e.g. D:\Games\RynthSuite or \\server\share\RynthSuite). }
if (Length(Dir) < 3) or not ((Copy(Dir, 2, 2) = ':\') or (Copy(Dir, 1, 2) = '\\')) then
begin
MsgBox('Please choose a full folder path for RynthSuite, for example D:\Games\RynthSuite.', mbError, MB_OK);
Result := False;
Exit;
end;
SuiteDirPinned := True;
end;
{ Leaving the Ready page: fetch/install the .NET runtime first (with a progress page) if that task is on. }
if CurPageID = wpReady then
HandleDotNetRuntime(True);
end;
// Silent installs skip the wizard pages, so the .NET step runs here instead (no progress page). Never blocks.
function PrepareToInstall(var NeedsRestart: Boolean): String;
begin
if not DotNetHandled then
HandleDotNetRuntime(False);
Result := '';
end;
function UpdateReadyMemo(Space, NewLine, MemoUserInfoInfo, MemoDirInfo, MemoTypeInfo,
MemoComponentsInfo, MemoGroupInfo, MemoTasksInfo: String): String;
begin
Result := MemoDirInfo + NewLine;
if AnySuiteComponentSelected then
Result := Result + 'RynthSuite location:' + NewLine + Space + GetSuiteDir('') + NewLine;
Result := Result + NewLine + MemoComponentsInfo;
if MemoTasksInfo <> '' then
Result := Result + NewLine + MemoTasksInfo;
end;

58
installer/Sign-Update.ps1 Normal file
View file

@ -0,0 +1,58 @@
#Requires -Version 7
<#
.SYNOPSIS
Signs an update manifest into the envelope the launcher verifies (RynthUpdater.VerifyEnvelope).
.DESCRIPTION
Output: {"payload": base64(manifest bytes), "signatures": [{"key": <id>, "sig": base64}]},
ECDSA P-256 / SHA-256 over the exact payload bytes, IEEE P1363 format. Signs with the DPAPI
primary key from New-UpdateSigningKey.ps1 — no prompt — or, with -UseBackupKey, the offline
backup key (asks for its password).
#>
param(
[Parameter(Mandatory)][string]$PayloadPath,
[Parameter(Mandatory)][string]$OutPath,
[string]$KeyDir = (Join-Path $env:USERPROFILE ".rynthcore-update-signing"),
[switch]$UseBackupKey,
[string]$BackupKeyPath,
# For scripted tests only; normally you are prompted.
[SecureString]$BackupPassword
)
$ErrorActionPreference = "Stop"
Add-Type -AssemblyName System.Security
$ec = [System.Security.Cryptography.ECDsa]::Create()
if ($UseBackupKey) {
if (-not $BackupKeyPath) { $BackupKeyPath = Join-Path $KeyDir "backup.key.p8" }
if (-not (Test-Path $BackupKeyPath)) { throw "Backup key not found at $BackupKeyPath" }
if (-not $BackupPassword) { $BackupPassword = Read-Host "Backup key password" -AsSecureString }
$pw = ConvertFrom-SecureString $BackupPassword -AsPlainText
$read = 0
$ec.ImportEncryptedPkcs8PrivateKey($pw, [IO.File]::ReadAllBytes($BackupKeyPath), [ref]$read)
$pw = $null
} else {
$primaryPath = Join-Path $KeyDir "primary.key"
if (-not (Test-Path $primaryPath)) {
throw "No signing key at $primaryPath. Run installer\New-UpdateSigningKey.ps1 first."
}
$entropy = [Text.Encoding]::UTF8.GetBytes("RynthCore update signing v1")
$pkcs8 = [System.Security.Cryptography.ProtectedData]::Unprotect([IO.File]::ReadAllBytes($primaryPath), $entropy, 'CurrentUser')
try {
$read = 0
$ec.ImportPkcs8PrivateKey($pkcs8, [ref]$read)
} finally { [Array]::Clear($pkcs8) }
}
$payload = [IO.File]::ReadAllBytes($PayloadPath)
$sig = $ec.SignData($payload, [System.Security.Cryptography.HashAlgorithmName]::SHA256,
[System.Security.Cryptography.DSASignatureFormat]::IeeeP1363FixedFieldConcatenation)
$spki = $ec.ExportSubjectPublicKeyInfo()
$id = ([Convert]::ToHexString([System.Security.Cryptography.SHA256]::HashData($spki), 0, 8)).ToLowerInvariant()
$envelope = [ordered]@{
payload = [Convert]::ToBase64String($payload)
signatures = @([ordered]@{ key = $id; sig = [Convert]::ToBase64String($sig) })
}
Set-Content -Path $OutPath -Value ($envelope | ConvertTo-Json -Depth 4) -Encoding utf8NoBOM
Write-Host "Signed $PayloadPath with key $id -> $OutPath"

View file

@ -1 +1 @@
0.4.10
2026.10.4.6