Initial
EonaCat/ci-workflows: SonarQube / sonar (push) Successful in 49s

This commit is contained in:
EonaCat committed 2026-12-04 19:28:10 +01:00
1 parent 2cff35f215
commit 8dcee1bb46
355 files changed
+253629 -1

No files matched your search

@@ -0,0 +1,57 @@
# Fetches the AMD files FSR 3 frame generation needs (about 30 MB) from AMD's own GitHub (the FidelityFX SDK,
# GPUOpen-LibrariesAndSDKs/FidelityFX-SDK) into a fidelityfx folder: by default amd-sdk\FidelityFX\bin here
# (git-ignored), where the EonaCat XS launcher looks for them; `eonacat-xsbox get-fsr` names one under
# %LOCALAPPDATA%\EonaCat\XS. They are AMD's, under AMD's licence (saved beside them: read it); this repository does
# not carry them, so each person gets them from AMD directly. Each file is checked against the SHA-256 of the
# copy this fork was tested with, and the game loads them only with AMD's valid signature.
param(
[string]$Tag = 'v2.4.0',
[string]$To = ''
)
$ProgressPreference = 'SilentlyContinue'
[Net.ServicePointManager]::SecurityProtocol = [Net.ServicePointManager]::SecurityProtocol -bor [Net.SecurityProtocolType]::Tls12
$bin = if ($To) { $To } else { Join-Path (Resolve-Path (Join-Path $PSScriptRoot '..')).Path 'amd-sdk\FidelityFX\bin' }
$base = "https://raw.githubusercontent.com/GPUOpen-LibrariesAndSDKs/FidelityFX-SDK/$Tag/Kits/FidelityFX"
# What the game loads, and the SHA-256 of the copies tested (FidelityFX SDK v2.4.0).
$files = [ordered]@{
'amd_fidelityfx_loader_dx12.dll' = 'E2191D3C0828BE45EB8AFFD4E3EC0378F2293ADC345B772A7170EDCF3B021ECB'
'amd_fidelityfx_framegeneration_dx12.dll' = 'E6843252F58B0341A0D80F6A20BC0D840643EE95BC48C22CAC08745344577BB6'
}
function Get-File([string]$Url, [string]$To) {
New-Item -ItemType Directory -Force (Split-Path $To) | Out-Null
$part = "$To.part"
if (Get-Command curl.exe -ErrorAction SilentlyContinue) {
& curl.exe --location --fail --silent --show-error --progress-bar --output $part $Url
if ($LASTEXITCODE -ne 0) { Remove-Item $part -ErrorAction SilentlyContinue; throw "could not get $Url" }
} else {
Invoke-WebRequest -Uri $Url -OutFile $part -UseBasicParsing -ErrorAction Stop
}
$part
}
Write-Host "AMD FSR 3 frame generation (FidelityFX SDK $Tag), from github.com/GPUOpen-LibrariesAndSDKs/FidelityFX-SDK (about 30 MB):"
New-Item -ItemType Directory -Force $bin | Out-Null
foreach ($name in $files.Keys) {
$to = Join-Path $bin $name
if ((Test-Path $to) -and (Get-FileHash $to -Algorithm SHA256).Hash -eq $files[$name]) {
Write-Host " $name already there"
continue
}
$part = Get-File "$base/signedbin/$name" $to
$hash = (Get-FileHash $part -Algorithm SHA256).Hash
if ($hash -ne $files[$name]) {
Remove-Item $part -Force
throw "$name is not the file this build was tested with (SHA-256 $hash); not kept"
}
Move-Item $part $to -Force
$len = (Get-Item $to).Length
Write-Host (" {0} {1}" -f $name, $(if ($len -ge 1MB) { '{0:N1} MB' -f ($len / 1MB) } else { '{0:N0} KB' -f ($len / 1KB) }))
}
try {
$lic = Get-File "$base/docs/license.md" (Join-Path $bin 'amd-fidelityfx-license.md')
Move-Item $lic (Join-Path $bin 'amd-fidelityfx-license.md') -Force
Write-Host " licence: $(Join-Path $bin 'amd-fidelityfx-license.md')"
} catch { Write-Host " (AMD's licence text could not be fetched: $($_.Exception.Message))" }
Write-Host ''
Write-Host 'Done. They are used from the next start.'
@@ -0,0 +1,62 @@
# Fetches Microsoft's newer Direct3D 12 runtime (the D3D12 Agility SDK, D3D12Core.dll, from Microsoft's own
# NuGet package Microsoft.Direct3D.D3D12, about 22 MB) into a D3D12 folder: by default the one beside
# target\release\eonacat-xsbox.exe; `eonacat-xsbox play` names the one beside itself. Windows 10's own Direct3D 12 stops at
# shader model 6.5, and every shader the layer translates is 6.6: without this runtime each pipeline is refused
# and the game closes within seconds. eonacat-xsbox.exe asks Windows for this runtime (it exports D3D12SDKVersion = 614
# and D3D12SDKPath = .\D3D12\); Windows uses it only where its own is older. It is Microsoft's, under Microsoft's
# licence (saved beside it: read it); this repository does not carry it. The package and the DLL are checked
# against the SHA-256 of the copies this fork was tested with, and the DLL against Microsoft's signature.
param(
[string]$Version = '1.614.1',
[string]$To = ''
)
$ErrorActionPreference = 'Stop'
$ProgressPreference = 'SilentlyContinue'
[Net.ServicePointManager]::SecurityProtocol = [Net.ServicePointManager]::SecurityProtocol -bor [Net.SecurityProtocolType]::Tls12
$dir = if ($To) { $To } else { Join-Path (Resolve-Path (Join-Path $PSScriptRoot '..')).Path 'target\release\D3D12' }
# The SHA-256 of the copies tested: D3D12Core.dll 1.614.1.0 first, since launchers take the first hash after
# that name as the DLL's (VILauncher's "Fix and verify" took the package's and then refused every package).
$core = '8A23D826B25B4329522FF451CB52B7F2B34D7F2913CFEB878371CE8BD765FE2D'
# The package it comes in, Microsoft.Direct3D.D3D12 1.614.1.
$package = '9880AA91602DD51DD6CF7911A2BCA7A2323513B15338573CDE014B3356EEAFF2'
$url = "https://api.nuget.org/v3-flatcontainer/microsoft.direct3d.d3d12/$Version/microsoft.direct3d.d3d12.$Version.nupkg"
$target = Join-Path $dir 'D3D12Core.dll'
if ((Test-Path $target) -and (Get-FileHash $target -Algorithm SHA256).Hash -eq $core) {
Write-Host "Microsoft's Direct3D 12 runtime $Version is already in $dir"
exit 0
}
Write-Host "Microsoft's Direct3D 12 runtime $Version (the Agility SDK), from nuget.org (about 22 MB):"
New-Item -ItemType Directory -Force $dir | Out-Null
$part = Join-Path $dir "microsoft.direct3d.d3d12.$Version.nupkg.part"
try {
if (Get-Command curl.exe -ErrorAction SilentlyContinue) {
& curl.exe --location --fail --silent --show-error --progress-bar --output $part $url
if ($LASTEXITCODE -ne 0) { throw "could not get $url" }
} else {
Invoke-WebRequest -Uri $url -OutFile $part -UseBasicParsing
}
$hash = (Get-FileHash $part -Algorithm SHA256).Hash
if ($hash -ne $package) { throw "the package is not the one this build was tested with (SHA-256 $hash); not kept" }
Add-Type -AssemblyName System.IO.Compression.FileSystem
$zip = [IO.Compression.ZipFile]::OpenRead($part)
try {
$entry = $zip.Entries | Where-Object FullName -eq 'build/native/bin/x64/D3D12Core.dll'
if (-not $entry) { throw 'the package has no build/native/bin/x64/D3D12Core.dll' }
$dll = "$target.part"
[IO.Compression.ZipFileExtensions]::ExtractToFile($entry, $dll, $true)
$lic = $zip.Entries | Where-Object FullName -eq 'LICENSE.txt'
if ($lic) { [IO.Compression.ZipFileExtensions]::ExtractToFile($lic, (Join-Path $dir 'microsoft-d3d12-license.txt'), $true) }
} finally { $zip.Dispose() }
$hash = (Get-FileHash $dll -Algorithm SHA256).Hash
if ($hash -ne $core) { Remove-Item $dll -Force; throw "D3D12Core.dll is not the file this build was tested with (SHA-256 $hash); not kept" }
$sig = Get-AuthenticodeSignature $dll
if ($sig.Status -ne 'Valid' -or $sig.SignerCertificate.Subject -notlike 'CN=Microsoft Corporation,*') {
Remove-Item $dll -Force; throw "D3D12Core.dll is not validly signed by Microsoft ($($sig.Status)); not kept"
}
Move-Item $dll $target -Force
} finally {
Remove-Item $part -Force -ErrorAction SilentlyContinue
}
Write-Host (' D3D12Core.dll {0:N1} MB, signed by Microsoft' -f ((Get-Item $target).Length / 1MB))
Write-Host " in $dir (licence: microsoft-d3d12-license.txt beside it)"
@@ -0,0 +1,159 @@
# Fetches the NVIDIA files DLSS and DLSS frame generation need (about 70 MB) from NVIDIA's own GitHub into
# nvidia-sdk\Streamline\bin\x64 here (git-ignored), where the EonaCat XS launcher looks for them. They are
# NVIDIA's, under NVIDIA's licences (saved beside them: read them); this repository does not and may not carry
# them, so each person gets them from NVIDIA directly. the launcher invokes this embedded installer through the engine command.
# Nothing of NVIDIA's is needed to build the layer: the files are loaded when the game runs.
param(
[string]$StreamlineTag = 'v2.14.16',
# Another folder for them than nvidia-sdk here (`eonacat-xsbox get-dlss` names one under %LOCALAPPDATA%\EonaCat\XS).
[string]$To = '',
# Skip the signature check below (only if NVIDIA's files fail it for a reason you have looked into).
[switch]$SkipSignatureCheck
)
$ProgressPreference = 'SilentlyContinue' # Invoke-WebRequest's progress bar makes it many times slower
[Net.ServicePointManager]::SecurityProtocol = [Net.ServicePointManager]::SecurityProtocol -bor [Net.SecurityProtocolType]::Tls12
$sdk = if ($To) { $To } else { Join-Path (Resolve-Path (Join-Path $PSScriptRoot '..')).Path 'nvidia-sdk' }
$sl = Join-Path $sdk 'Streamline'
$bin = Join-Path $sl 'bin\x64'
# What is loaded when the game runs: Streamline's interposer and plugins, DLSS and the frame generation model.
$dlls = 'sl.interposer.dll', 'sl.common.dll', 'sl.dlss.dll', 'sl.dlss_g.dll', 'sl.reflex.dll', 'sl.pcl.dll', 'nvngx_dlss.dll', 'nvngx_dlssg.dll'
# One file from a URL, with curl's progress line where Windows has curl (it has since Windows 10 1803).
function Get-File([string]$Url, [string]$To) {
New-Item -ItemType Directory -Force (Split-Path $To) | Out-Null
$part = "$To.part"
if (Get-Command curl.exe -ErrorAction SilentlyContinue) {
& curl.exe --location --fail --silent --show-error --progress-bar --output $part $Url
if ($LASTEXITCODE -ne 0) { Remove-Item $part -ErrorAction SilentlyContinue; throw "could not get $Url" }
} else {
Invoke-WebRequest -Uri $Url -OutFile $part -UseBasicParsing -ErrorAction Stop
}
Move-Item $part $To -Force
}
# Bytes first..last of a URL.
function Get-Range([string]$Url, [long]$First, [long]$Last) {
$q = [Net.HttpWebRequest]::Create($Url)
$q.UserAgent = 'get-nvidia-sdks'
$q.AddRange($First, $Last)
$r = $q.GetResponse()
try {
if ([int]$r.StatusCode -ne 206) { throw 'the server does not give parts of the file' }
$m = New-Object IO.MemoryStream
$r.GetResponseStream().CopyTo($m)
, $m.ToArray()
} finally { $r.Close() }
}
# Takes the named files out of a zip on a server without downloading the whole zip: its directory is at
# its end, and each file in it can be asked for by its place. $Want: a regex on the paths in the zip.
# Each goes into $Into under the part of its path after the SDK's top folder.
function Get-FromZip([string]$Url, [string]$Want, [string]$Into) {
# Where the file really is (the download address redirects), and how long it is.
$h = [Net.HttpWebRequest]::Create($Url); $h.Method = 'HEAD'; $h.UserAgent = 'get-nvidia-sdks'
$r = $h.GetResponse(); $real = $r.ResponseUri.AbsoluteUri; $length = $r.ContentLength; $r.Close()
$tailLen = [Math]::Min($length, 2MB)
$tail = Get-Range $real ($length - $tailLen) ($length - 1)
$end = -1
for ($i = $tail.Length - 22; $i -ge 0; $i--) {
if ($tail[$i] -eq 0x50 -and $tail[$i + 1] -eq 0x4b -and $tail[$i + 2] -eq 5 -and $tail[$i + 3] -eq 6) { $end = $i; break }
}
if ($end -lt 0) { throw 'no zip directory found' }
$dirSize = [BitConverter]::ToUInt32($tail, $end + 12)
$dirAt = [BitConverter]::ToUInt32($tail, $end + 16)
if ($dirAt -eq [uint32]::MaxValue) { throw 'a zip64 archive' }
$dir = if ($dirAt -ge $length - $tailLen) {
$from = [int]($dirAt - ($length - $tailLen)); , $tail[$from..($from + $dirSize - 1)]
} else { Get-Range $real $dirAt ($dirAt + $dirSize - 1) }
$got = 0
$at = 0
while ($at + 46 -le $dir.Length -and [BitConverter]::ToUInt32($dir, $at) -eq 0x02014b50) {
$method = [BitConverter]::ToUInt16($dir, $at + 10)
$packed = [BitConverter]::ToUInt32($dir, $at + 20)
$size = [BitConverter]::ToUInt32($dir, $at + 24)
$nameLen = [BitConverter]::ToUInt16($dir, $at + 28)
$extraLen = [BitConverter]::ToUInt16($dir, $at + 30)
$noteLen = [BitConverter]::ToUInt16($dir, $at + 32)
$headerAt = [BitConverter]::ToUInt32($dir, $at + 42)
$name = [Text.Encoding]::UTF8.GetString($dir, $at + 46, $nameLen)
$at += 46 + $nameLen + $extraLen + $noteLen
if ($name -notmatch $Want) { continue }
# The file's own header (its extra field may be longer than the directory's), then its bytes.
$piece = Get-Range $real $headerAt ($headerAt + 30 + $nameLen + 2048 + $packed - 1)
if ([BitConverter]::ToUInt32($piece, 0) -ne 0x04034b50) { throw "no file header for $name" }
$dataAt = 30 + [BitConverter]::ToUInt16($piece, 26) + [BitConverter]::ToUInt16($piece, 28)
if ($dataAt + $packed -gt $piece.Length) { throw "the header of $name is longer than expected" }
$out = [IO.MemoryStream]::new()
if ($method -eq 0) { $out.Write($piece, $dataAt, [int]$packed) }
elseif ($method -eq 8) {
$in = [IO.MemoryStream]::new($piece, $dataAt, [int]$packed)
$z = [IO.Compression.DeflateStream]::new($in, [IO.Compression.CompressionMode]::Decompress)
$z.CopyTo($out); $z.Close()
} else { throw "$name is packed in a way this script does not know ($method)" }
if ($out.Length -ne $size) { throw "$name came out $($out.Length) bytes long, not $size" }
$rel = ($name -replace '^.*?(?=(bin/x64/|license\.txt$))', '') -replace '/', '\'
$to = Join-Path $Into $rel
New-Item -ItemType Directory -Force (Split-Path $to) | Out-Null
[IO.File]::WriteAllBytes($to, $out.ToArray())
Write-Host (" {0} {1:N1} MB" -f $rel, ($size / 1MB))
$got++
}
$got
}
# These DLLs are loaded into the game's process, so each one must carry a valid Authenticode signature
# from NVIDIA before it is kept. A file that fails is deleted, so a bad download is never used by accident.
function Assert-NvidiaSigned([string[]]$Names) {
if ($SkipSignatureCheck) { Write-Host ' signature check skipped (-SkipSignatureCheck)'; return }
$bad = @()
foreach ($n in $Names) {
$f = Join-Path $bin $n
if (-not (Test-Path $f)) { continue }
$sig = Get-AuthenticodeSignature -FilePath $f
$who = if ($sig.SignerCertificate) { $sig.SignerCertificate.Subject } else { '' }
if ($sig.Status -ne 'Valid' -or $who -notmatch 'NVIDIA') {
$bad += "$n ($($sig.Status)$(if ($who) { ', ' + $who }))"
Remove-Item $f -Force -ErrorAction SilentlyContinue
}
}
if ($bad) { throw "Not signed by NVIDIA, removed: $($bad -join '; '). Run again, or see -SkipSignatureCheck." }
Write-Host ' signatures: all valid, signed by NVIDIA'
}
Write-Host "NVIDIA Streamline $StreamlineTag with DLSS and frame generation, from github.com/NVIDIA-RTX/Streamline (about 70 MB):"
$missing = @($dlls | Where-Object { -not (Test-Path (Join-Path $bin $_)) })
if (-not $missing) {
Write-Host " all there already: $bin"
} else {
$url = "https://github.com/NVIDIA-RTX/Streamline/releases/download/$StreamlineTag/streamline-sdk-$StreamlineTag.zip"
$names = ($dlls | ForEach-Object { [regex]::Escape($_) }) -join '|'
$want = "(^|/)bin/x64/($names|[^/]*license[^/]*\.txt)$|^([^/]+/)?license\.txt$"
try { [void](Get-FromZip $url $want $sl) }
catch { Write-Host " Taking the files out of the archive in place did not work ($($_.Exception.Message))." }
if (@($dlls | Where-Object { -not (Test-Path (Join-Path $bin $_)) })) {
# The whole archive then (263 MB).
Write-Host ' Getting the whole archive instead (263 MB) ...'
$zip = Join-Path $sdk "streamline-sdk-$StreamlineTag.zip"
Get-File $url $zip
$into = Join-Path $sdk 'streamline-unpacked'
Expand-Archive -Path $zip -DestinationPath $into -Force -ErrorAction Stop
$found = Get-ChildItem $into -Recurse -Filter 'sl.interposer.dll' |
Where-Object { $_.FullName -match '\\bin\\x64\\sl\.interposer\.dll$' -and $_.FullName -notmatch '\\development\\' } |
Select-Object -First 1
if (-not $found) { throw 'The Streamline archive has no bin\x64\sl.interposer.dll.' }
$top = Split-Path (Split-Path (Split-Path $found.FullName))
New-Item -ItemType Directory -Force $bin | Out-Null
Get-ChildItem (Join-Path $top 'bin\x64') -File |
Where-Object { $dlls -contains $_.Name -or $_.Name -match 'license.*\.txt$' } |
Copy-Item -Destination $bin -Force
Copy-Item (Join-Path $top 'license.txt') $sl -Force -ErrorAction SilentlyContinue
Remove-Item $into -Recurse -Force -ErrorAction SilentlyContinue
Remove-Item $zip -Force
}
}
Assert-NvidiaSigned $dlls
$still = @($dlls | Where-Object { -not (Test-Path (Join-Path $bin $_)) })
if ($still) { throw "Not there after all: $($still -join ', ')" }
Write-Host " licences: $(Join-Path $sl 'license.txt') (Streamline) and the *.license.txt files in $bin (DLSS, Reflex)"
Write-Host ''
Write-Host 'Done. They are used from the next start.'