From 0a542c06ff94a9e0631cee382a39d940f12258ab Mon Sep 17 00:00:00 2001 From: wike1701 Date: Fri, 27 Nov 2026 11:46:45 +0100 Subject: [PATCH] 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. --- PLAY_FRAMEGEN.cmd | 4 ++-- scripts/play-gta6-framegen.ps1 | 13 +++++++++++-- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/PLAY_FRAMEGEN.cmd b/PLAY_FRAMEGEN.cmd index a88e15f..2598f9e 100644 --- a/PLAY_FRAMEGEN.cmd +++ b/PLAY_FRAMEGEN.cmd @@ -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. diff --git a/scripts/play-gta6-framegen.ps1 b/scripts/play-gta6-framegen.ps1 index b451cdc..a799ce5 100644 --- a/scripts/play-gta6-framegen.ps1 +++ b/scripts/play-gta6-framegen.ps1 @@ -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 ...' }