Skip to content

Commit 2a3e717

Browse files
committed
chore(rc2): sync verified package files and installer state
1 parent 07a080b commit 2a3e717

10 files changed

Lines changed: 239 additions & 359 deletions

‎.github/workflows/aurora-tools-test.yml‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,3 @@ jobs:
2121
shell: powershell
2222
run: |
2323
& .\tests\Aurora_Diagnostics_Tests.ps1
24-
- name: Test RC3 redundant installer and precise recovery
25-
shell: powershell
26-
run: |
27-
& .\tests\Aurora_Installer_Tests.ps1

‎.github/workflows/just_build_no_signature.yml‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -116,15 +116,14 @@ jobs:
116116
- name: Add Runtime Sync / 添加运行库同步工具
117117
shell: powershell
118118
run: |
119-
& .\scripts\stage_aurora_package.ps1 -Destination (Join-Path $env:GITHUB_WORKSPACE 'x64\Release\a')
119+
Copy-Item "${{ github.workspace }}\dist\runtime_sync\*.ps1" "${{ github.workspace }}\x64\Release\a\"
120+
Copy-Item "${{ github.workspace }}\dist\runtime_sync\*.bat" "${{ github.workspace }}\x64\Release\a\"
120121
121122
- name: Package Aurora / 打包 Aurora
122123
shell: powershell
123124
run: |
124125
$zipName = "${{ steps.get_version.outputs.filename }}.7z"
125-
& .\scripts\stage_aurora_package.ps1 -Destination (Join-Path $env:GITHUB_WORKSPACE 'x64\Release\a') -VerifyOnly
126126
7z a -r ${{ github.workspace }}\$zipName ${{ github.workspace }}\x64\Release\a\*.*
127-
if ($LASTEXITCODE -ne 0) { throw 'Aurora archive failed.' }
128127
129128
continue-on-error: false
130129

‎dist/runtime_sync/Aurora_Common.ps1‎

Lines changed: 19 additions & 168 deletions
Large diffs are not rendered by default.

‎dist/runtime_sync/Aurora_Setup.bat‎

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
@echo off
22
setlocal DisableDelayedExpansion
33
chcp 65001 >nul
4-
REM The menu can uninstall this BAT; leave its context before launching.
5-
REM PowerShell owns the interactive completion prompt and returns its exit code.
6-
(goto) 2>nul & powershell.exe -NoProfile -ExecutionPolicy Bypass -File "%~dp0Aurora_Setup.ps1"
4+
powershell.exe -NoProfile -ExecutionPolicy Bypass -File "%~dp0Aurora_Setup.ps1"
5+
set "AURORA_EXIT=%ERRORLEVEL%"
6+
echo.
7+
echo 操作已结束,请查看上方结果。按任意键关闭窗口。
8+
pause >nul
9+
exit /b %AURORA_EXIT%

‎dist/runtime_sync/Aurora_Setup.ps1‎

Lines changed: 174 additions & 95 deletions
Large diffs are not rendered by default.
Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
@echo off
22
setlocal DisableDelayedExpansion
33
chcp 65001 >nul
4-
REM Leave the BAT context before removal; no attempt to reread a deleted BAT.
5-
REM PowerShell owns the interactive completion prompt and returns its exit code.
6-
(goto) 2>nul & powershell.exe -NoProfile -ExecutionPolicy Bypass -File "%~dp0Aurora_Setup.ps1" -Action Remove -InstallDir "%~dp0."
4+
powershell.exe -NoProfile -ExecutionPolicy Bypass -File "%~dp0Aurora_Setup.ps1" -Action Remove -InstallDir "%~dp0."
5+
set "AURORA_EXIT=%ERRORLEVEL%"
6+
echo.
7+
echo 操作已结束,请查看上方结果。按任意键关闭窗口。
8+
pause >nul
9+
exit /b %AURORA_EXIT%

‎dist/runtime_sync/runtime_sync.ps1‎

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
param(
22
[ValidateSet('Install','Check','Restore')][string]$Mode = 'Check',
33
[string]$InstallDir = $PSScriptRoot, [string]$GameRoot, [string]$GameExe,
4-
[string]$ReportPath, [switch]$Rescan, [switch]$CallerHasLock, [switch]$RC3Safety
4+
[string]$ReportPath, [switch]$Rescan, [switch]$CallerHasLock
55
)
66
# Check never repairs. Rescan remains accepted for v1 callers; v2 always inventories.
77
$ErrorActionPreference = 'Stop'
@@ -34,10 +34,6 @@ try {
3434
}
3535
# Recovery must remain available even if the optional diagnostic helper is missing.
3636
. (Join-Path $PSScriptRoot 'Aurora_Diagnostics.ps1')
37-
if ($RC3Safety) {
38-
. (Join-Path $PSScriptRoot 'Aurora_Installer.ps1')
39-
. (Join-Path $PSScriptRoot 'Aurora_RuntimeCatalog.ps1')
40-
}
4137
$scan = Get-AuroraScan $GameRoot
4238
foreach ($w in $scan.Warnings) { Write-Host "[扫描不完整] $w" -ForegroundColor Yellow }
4339
$sources = @{}
@@ -69,12 +65,8 @@ try {
6965
foreach ($name in @($sources.Keys | Where-Object { $_ -like 'sl.*.dll' })) {
7066
$info = Get-AuroraBinary $sources[$name]
7167
if ($info.Major -ne 2 -or $info.Architecture -ne 'x64') { $sourceSlBlocked = $true }
72-
if ($RC3Safety -and (-not $AuroraVerifiedSL2.ContainsKey($name) -or (Get-AuroraHash $sources[$name]) -ne $AuroraVerifiedSL2[$name])) { $sourceSlBlocked = $true }
7368
}
7469
foreach ($item in $inventory) {
75-
if ($RC3Safety -and (Test-AuroraUtilityPath $item.Path.Substring($GameRoot.Length).TrimStart('\') -Runtime)) {
76-
$item.Reason = '启动器 / 工具 / 反作弊目录的 Runtime 仅记录,不替换'; continue
77-
}
7870
if ($item.Name -eq 'nvngx_dlssnr.dll') { $item.Reason = 'DLSSNR 仅记录,不同步、不覆盖'; continue }
7971
if (-not $sources.ContainsKey($item.Name)) { continue }
8072
$source = Get-AuroraBinary $sources[$item.Name]; $item.SourceVersion = $source.Version
@@ -83,14 +75,13 @@ try {
8375
$item.Reason = '版本、架构或哈希无法确认;保留原文件'; continue
8476
}
8577
if ($item.Name -like 'sl.*.dll' -and ($slBlocked -or $sourceSlBlocked)) {
86-
$item.Reason = '游戏或源包存在 SL1 / 未知代际,或 RC3 源哈希未经确认;保护整组 Streamline'; continue
78+
$item.Reason = '游戏或源包存在 SL1 / 未知代际;保护整组 Streamline'; continue
8779
}
8880
$item.SourceHash = Get-AuroraHash $sources[$item.Name]
8981
if ($item.SourceHash -eq $item.SHA256) { $item.Reason = '与包内版本相同'; continue }
9082
$item.Action = '可同步'; $item.Reason = '已识别版本和 x64 架构,执行前备份并校验'
9183
}
9284
$candidates=@(Get-AuroraCandidates $scan)
93-
if ($RC3Safety) { $candidates=@(Get-AuroraDeploymentCandidates $scan) }
9485
$observations=@()
9586
if (-not $GameExe) {
9687
$direct=@($candidates | Where-Object { $_.Directory -ieq $InstallDir })
@@ -115,9 +106,6 @@ try {
115106
'巫师3:保留 SL1.5.6;游戏原生帧生成关闭,使用 OptiFG (Upscaler) → DLSSG → None (Real DLSSG),DualFeature=false。'
116107
)
117108
$report = [pscustomobject]@{ SchemaVersion=2; DiagnosticVersion='2.1'; Timestamp=[DateTime]::UtcNow.ToString('o'); Mode=$Mode; Phase='PreOperation'; GameRoot=$GameRoot; GameExe=$GameExe; InstallDir=$InstallDir; ScanComplete=$scan.Complete; ScanWarnings=$scan.Warnings; Inventory=$inventory; LoadedModules=$loaded; Processes=@($processEvidence.Processes); Findings=$findings; Observations=$observations; Notes=$notes }
118-
if ($RC3Safety) {
119-
$report | Add-Member NoteProperty RuntimeGroups @(Get-AuroraRuntimeGroups $scan @(Get-AuroraDeploymentCandidates $scan) $processEvidence $GameExe)
120-
}
121109
$reportText=Format-AuroraDiagnosticText $report
122110
Write-Host $reportText
123111
if ($ReportPath) {

‎docs/AURORA_SETUP_RUNTIME_V2.md‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
# Aurora Setup / Runtime Sync v2
22

3-
本页保留 RC2 行为与 Runtime Sync v2 安全机制的历史说明。RC3 默认界面与冗余部署行为见 [RC3 安装器说明](AURORA_INSTALLER_RC3.md)。
4-
5-
RC2 修改基于 `aurora` 提交 `e1673a16673070401612db04cc0593ca4dc3a6f6`。这是一组安装工具更新,不包含重新构建的 OptiScaler.dll。
3+
本次修改基于 `aurora` 提交 `e1673a16673070401612db04cc0593ca4dc3a6f6`。这是一组安装工具更新,不包含重新构建的 OptiScaler.dll。
64

75
## 使用方式
86

‎package_release.ps1‎

Lines changed: 28 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Assemble a release zip.
1+
# Assemble a release zip.
22
#
33
# The build output directory is not the release: it also holds import libraries, export files, debug
44
# symbols, and whatever earlier experiments left behind. Shipping that folder wholesale is how a
@@ -9,7 +9,7 @@
99
# and the user supplies their own copy per game folder. Only the ~108 KB forwarder ships.
1010

1111
param(
12-
[ValidatePattern('^[A-Za-z0-9][A-Za-z0-9._-]{0,79}$')][string]$Version = "v0.1.0-dlssnr",
12+
[string]$Version = "v0.1.0-dlssnr",
1313
[switch]$SkipBuild
1414
)
1515

@@ -19,57 +19,20 @@ $ErrorActionPreference = "Stop"
1919
# than one now -- the experiment runs in a git worktree beside the main tree, and a hardcoded root
2020
# silently packages the other one's build output while reporting success.
2121
$root = Split-Path -Parent $PSCommandPath
22-
. (Join-Path $root 'dist\runtime_sync\Aurora_Common.ps1')
23-
function Copy-PackageFile([string]$Source,[string]$Target) {
24-
$current=''; if (Test-Path -LiteralPath $Target) { $current=Get-AuroraHash $Target }
25-
Copy-AuroraAtomic $Source $Target $current (Get-AuroraHash $Source)
26-
}
27-
function Copy-PackageTree([string]$Source,[string]$Target) {
28-
$guard=Enter-AuroraPathGuard $Source -Directory
29-
try {
30-
foreach ($item in @(Get-ChildItem -LiteralPath $Source -Force)) {
31-
Assert-AuroraPlainPath $item.FullName
32-
if ($item.PSIsContainer) {
33-
if ($item.Name -match '^(AuroraSetup|RuntimeSync|_storage.*|\.git)$') { continue }
34-
if ($item.Name -ieq 'plugins') {
35-
$patcher=Join-Path $item.FullName 'OptiPatcher.asi'
36-
if (Test-Path -LiteralPath $patcher) { Copy-PackageFile $patcher (Join-Path $Target 'plugins\OptiPatcher.asi') }
37-
continue
38-
}
39-
Copy-PackageTree $item.FullName (Join-Path $Target $item.Name)
40-
} elseif ($item.Name -notmatch '(?i)\.(exp|lib|pdb|ilk)$|latewarp') {
41-
Copy-PackageFile $item.FullName (Join-Path $Target $item.Name)
42-
}
43-
}
44-
} finally { $guard.Dispose() }
45-
}
4622
$msb = "C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Current\Bin\MSBuild.exe"
47-
$releaseRoot=Join-Path $root 'release'
48-
# Fresh stages avoid recursive deletion entirely; failed stages remain inspectable.
49-
$stage=Join-Path $releaseRoot ($Version+'-'+[Guid]::NewGuid().ToString('N'))
50-
$zip=Join-Path $releaseRoot ("OptiScaler-DLSSNR-$Version.zip")
51-
foreach ($path in @($stage,$zip)) {
52-
if (-not (Test-AuroraWithin $path $releaseRoot)) { throw 'Package output escaped release directory.' }
53-
Assert-AuroraPlainPath $path
54-
}
55-
$releaseGuard=Enter-AuroraPathGuard $releaseRoot -Directory -Create
56-
try {
23+
$stage = "$root\release\$Version"
24+
$zip = "$root\release\OptiScaler-DLSSNR-$Version.zip"
5725

5826
if (-not $SkipBuild) {
5927
foreach ($proj in @("$root\OptiScaler\dlssnr\forwarder\dlssnr_forwarder.vcxproj", "$root\OptiScaler.sln")) {
6028
$out = & $msb $proj /p:Configuration=Release /p:Platform=x64 /v:minimal /m 2>&1
6129
$err = $out | Select-String "error "
62-
if ($LASTEXITCODE -ne 0 -or $err) { throw "Build failed: $proj (exit $LASTEXITCODE): $($out -join [Environment]::NewLine)" }
30+
if ($err) { Write-Host "FAILED: $proj"; $err | Select-Object -First 6; exit 1 }
6331
}
6432
Write-Host "built"
6533
}
6634

6735
$src = "$root\x64\Release\a"
68-
foreach ($name in @('OptiScaler.dll','OptiScaler.ini')) { $null=Get-AuroraHash (Join-Path $src $name) }
69-
foreach ($name in @('Licenses','OptiScaler')) {
70-
$path=Join-Path $src $name; Assert-AuroraPlainPath $path
71-
if (-not (Test-Path -LiteralPath $path -PathType Container)) { throw "Missing package directory: $name" }
72-
}
7336

7437
# The forwarder is taken from its own build output, not from the shared folder. The solution build
7538
# does not reliably rebuild it, and a stale one here would ship silently.
@@ -79,13 +42,12 @@ foreach ($name in @('Licenses','OptiScaler')) {
7942
# guards against a stale one, and it runs either way.
8043
$forwarder = "$root\OptiScaler\dlssnr\forwarder\x64\Release\a\nvngx.dll_dlssnr.dll"
8144

82-
if (-not (Test-Path -LiteralPath $forwarder)) {
45+
if (-not (Test-Path $forwarder)) {
8346
$forwarder = "$root\x64\Release\a\nvngx.dll_dlssnr.dll"
8447
Write-Host "forwarder: using the shared build output ($forwarder)"
8548
}
8649

8750
$exports = @("dlssnr_call_create", "dlssnr_call_evaluate", "dlssnr_call_set_extras")
88-
$null=Get-AuroraHash $forwarder
8951
$bytes = [System.Text.Encoding]::ASCII.GetString([System.IO.File]::ReadAllBytes($forwarder))
9052
$missing = @($exports | Where-Object { $bytes.IndexOf($_) -lt 0 })
9153

@@ -94,7 +56,8 @@ if ($missing.Count -gt 0) {
9456
exit 1
9557
}
9658

97-
[IO.Directory]::CreateDirectory($stage) | Out-Null
59+
if (Test-Path $stage) { Remove-Item $stage -Recurse -Force }
60+
New-Item -ItemType Directory -Force -Path $stage | Out-Null
9861

9962
# Files, then folders. Anything not named here does not ship.
10063
$files = @(
@@ -107,18 +70,23 @@ $files = @(
10770
)
10871

10972
foreach ($f in $files) {
110-
if (Test-Path -LiteralPath "$src\$f") { Copy-PackageFile "$src\$f" "$stage\$f" }
73+
if (Test-Path "$src\$f") { Copy-Item "$src\$f" "$stage\$f" -Force }
11174
else { Write-Host "missing from build output: $f" }
11275
}
11376

114-
foreach ($d in @("Licenses", "OptiScaler")) {
115-
Copy-PackageTree "$src\$d" "$stage\$d"
77+
# Always stage the current setup helpers together; runtime_sync.ps1 now shares Aurora_Common.ps1.
78+
foreach ($name in @('Aurora_Common.ps1', 'Aurora_Diagnostics.ps1', 'Aurora_Setup.ps1', 'runtime_sync.ps1',
79+
'Aurora_Setup.bat', 'Check_DLSS_Runtime.bat', 'Remove_Aurora.bat')) {
80+
$helper = Join-Path $root ("dist\runtime_sync\" + $name)
81+
if (-not (Test-Path -LiteralPath $helper -PathType Leaf)) { throw "Missing Aurora helper: $name" }
82+
Copy-Item -LiteralPath $helper -Destination (Join-Path $stage $name) -Force
11683
}
11784

118-
# Source helpers, wrapper, DLSS and catalog-verified SL2 are refreshed together.
119-
& (Join-Path $root 'scripts\stage_aurora_package.ps1') -RepositoryRoot $root -Destination $stage
85+
foreach ($d in @("Licenses", "OptiScaler")) {
86+
Copy-Item "$src\$d" "$stage\$d" -Recurse -Force
87+
}
12088

121-
Copy-PackageFile $forwarder "$stage\nvngx.dll_dlssnr.dll"
89+
Copy-Item $forwarder "$stage\nvngx.dll_dlssnr.dll" -Force
12290

12391
# Logging on, in the release only.
12492
#
@@ -131,25 +99,25 @@ Copy-PackageFile $forwarder "$stage\nvngx.dll_dlssnr.dll"
13199
# answers the common report at almost no cost. Crash reports need Trace and synchronous writes, and
132100
# the notes say so rather than everyone paying for it.
133101
$iniPath = "$stage\OptiScaler.ini"
134-
$ini = Get-Content -LiteralPath $iniPath -Raw
102+
$ini = Get-Content $iniPath -Raw
135103
$ini = $ini -replace '(?m)^LogToFile=auto', 'LogToFile=true'
136104
$ini = $ini -replace '(?m)^LogLevel=auto', 'LogLevel=2'
137-
Set-Content -LiteralPath $iniPath $ini -Encoding utf8 -NoNewline
105+
Set-Content $iniPath $ini -Encoding utf8 -NoNewline
138106

139-
$check = Select-String -LiteralPath $iniPath -Pattern '^LogToFile=|^LogLevel=' | ForEach-Object { $_.Line }
107+
$check = Select-String -Path $iniPath -Pattern '^LogToFile=|^LogLevel=' | ForEach-Object { $_.Line }
140108
Write-Host "log settings: $($check -join ', ')"
141109

142110
# Belt and braces: nothing that is a build artifact, and nothing from the abandoned warp work, may
143111
# survive into the zip regardless of how it got into the staging folder.
144-
# Build artifacts and installation state were excluded during the guarded copy.
112+
Get-ChildItem $stage -Recurse -Include *.exp, *.lib, *.pdb, *.ilk, *latewarp* | Remove-Item -Force
145113

146114
# No feature may ship switched on by accident.
147115
#
148116
# A global regex on "^Enabled=auto" once turned on five sections at once -- output scaling,
149117
# sharpening, the magnifier and two more -- while trying to enable one, because the ini has six keys
150118
# called Enabled in six different sections. That was in a test install rather than a release, and
151119
# only because nothing was checking. This checks.
152-
$on = Select-String -LiteralPath "$stage\OptiScaler.ini" -Pattern '^Enabled=true'
120+
$on = Select-String -Path "$stage\OptiScaler.ini" -Pattern '^Enabled=true'
153121

154122
if ($on) {
155123
Write-Host "REFUSING: the packaged ini has features switched on:"
@@ -159,16 +127,11 @@ if ($on) {
159127

160128
Write-Host "ini verified: nothing switched on by default"
161129

162-
& (Join-Path $root 'scripts\stage_aurora_package.ps1') -RepositoryRoot $root -Destination $stage -VerifyOnly
163-
Add-Type -AssemblyName System.IO.Compression.FileSystem
164-
$temporaryZip=Join-Path $releaseRoot ([Guid]::NewGuid().ToString('N')+'.zip')
165-
[IO.Compression.ZipFile]::CreateFromDirectory($stage,$temporaryZip,'Optimal',$false)
166-
Copy-PackageFile $temporaryZip $zip
167-
[IO.File]::Delete($temporaryZip)
130+
if (Test-Path $zip) { Remove-Item $zip -Force }
131+
Compress-Archive -Path "$stage\*" -DestinationPath $zip -CompressionLevel Optimal
168132

169133
Write-Host ""
170134
Write-Host "staged at $stage"
171-
Get-ChildItem -LiteralPath $stage | ForEach-Object { Write-Host (' '+$_.Name) }
135+
Get-ChildItem $stage | ForEach-Object { " {0,-42} {1,10:N0}" -f $_.Name, $_.Length }
172136
Write-Host ""
173-
Write-Host ("zip: {0} ({1:N1} MB)" -f $zip, ((Get-Item -LiteralPath $zip).Length / 1MB))
174-
} finally { $releaseGuard.Dispose() }
137+
Write-Host ("zip: {0} ({1:N1} MB)" -f $zip, ((Get-Item $zip).Length / 1MB))

‎setup_windows.bat‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ if not exist "%~dp0Aurora_Setup.ps1" (
99
)
1010
powershell.exe -NoProfile -ExecutionPolicy Bypass -File "%~dp0Aurora_Setup.ps1"
1111
set "AURORA_EXIT=%ERRORLEVEL%"
12-
if not "%AURORA_EXIT%"=="0" pause
12+
pause
1313
exit /b %AURORA_EXIT%
1414
:aurora_legacy
1515
REM Setup OptiScaler for your game

0 commit comments

Comments
 (0)