fix(scripts): bypass PowerShell execution policy in PLAY_FRAMEGEN.cmd and fix Windows 11 HAGS check

- Pass -ExecutionPolicy Bypass when PLAY_FRAMEGEN.cmd invokes scripts/play-gta6-framegen.ps1 so double-clicking works on default Windows PowerShell settings (Restricted).
- Treat an absent HwSchMode registry value on Windows 11 (build >= 22000) as default-enabled instead of printing a false 'HAGS: off' warning; HwSchMode=1 is still reported as off.
This commit is contained in:
wike1701 committed 2026-11-27 11:46:45 +01:00
1 parent 9341f4316f
commit 0a542c06ff
2 files changed
+13 -4

No files matched your search

+2 -2
View File
@@ -13,7 +13,7 @@ if not exist "%PS1%" (
exit /b 1
)
if /i "%~1"=="check" (
%PSH% -NoProfile -File "%PS1%" -Check
%PSH% -NoProfile -ExecutionPolicy Bypass -File "%PS1%" -Check
pause
exit /b 0
)
@@ -38,7 +38,7 @@ if errorlevel 6 (set "PICK=6") else if errorlevel 5 (set "PICK=5") else if error
:run
echo.
%PSH% -NoProfile -File "%PS1%" -Mode %PICK%
%PSH% -NoProfile -ExecutionPolicy Bypass -File "%PS1%" -Mode %PICK%
:end
echo.
+11 -2
View File
@@ -54,6 +54,15 @@ switch ($Mode) {
$sl = Join-Path $repo 'nvidia-sdk\Streamline\bin\x64'
$victory = Join-Path $repo 'target\release\victory.exe'
$hags = (Get-ItemProperty 'HKLM:\SYSTEM\CurrentControlSet\Control\GraphicsDrivers' -Name HwSchMode -ErrorAction SilentlyContinue).HwSchMode
$isWin11 = [Environment]::OSVersion.Version.Build -ge 22000
$hagsOff = ($hags -eq 1) -or ($null -eq $hags -and -not $isWin11)
$hagsText = if ($hags -eq 2) {
'on'
} elseif ($null -eq $hags -and $isWin11) {
'default (on in Windows 11)'
} else {
'off: frame generation needs it (Settings > Display > Graphics)'
}
if ($Check) {
Write-Host "repo: $repo"
@@ -61,7 +70,7 @@ if ($Check) {
Write-Host "mode: $Mode ($what)"
Write-Host "DLSS: $(if (Test-Path (Join-Path $sl 'sl.interposer.dll')) { 'present' } else { 'not yet (downloaded at first start)' })"
Write-Host "built: $(if (Test-Path $victory) { 'yes' } else { 'no (built at first start)' })"
Write-Host "HAGS: $(if ($hags -eq 2) { 'on' } else { 'off: frame generation needs it (Settings > Display > Graphics)' })"
Write-Host "HAGS: $hagsText"
exit 0
}
if (Get-Process victory -ErrorAction SilentlyContinue) { Write-Host 'The game is already running. Close it first.'; exit 1 }
@@ -93,7 +102,7 @@ if (-not (Test-Path (Join-Path $sl 'sl.interposer.dll'))) {
try { & (Join-Path $PSScriptRoot 'get-nvidia-sdks.ps1') }
catch { Write-Host "Could not get them ($($_.Exception.Message)): the game runs without DLSS and frame generation." }
}
if ($hags -ne 2) { Write-Host 'Hardware-accelerated GPU scheduling is off: frame generation will not work until it is on.' }
if ($hagsOff) { Write-Host 'Hardware-accelerated GPU scheduling is off: frame generation will not work until it is on.' }
# 4. Start (play-foxhound.ps1 builds target\release\victory.exe the first time).
if (-not (Test-Path $victory)) { Write-Host 'First start: building the layer, a few minutes ...' }