Merge pull request #31 from wike1701/fix/play-framegen-policy-and-hags
fix(scripts): bypass PowerShell execution policy in PLAY_FRAMEGEN.cmd and fix Windows 11 HAGS check
This commit is contained in:
2 files changed
+13
-4
No files matched your search
+2
-2
@@ -13,7 +13,7 @@ if not exist "%PS1%" (
|
|||||||
exit /b 1
|
exit /b 1
|
||||||
)
|
)
|
||||||
if /i "%~1"=="check" (
|
if /i "%~1"=="check" (
|
||||||
%PSH% -NoProfile -File "%PS1%" -Check
|
%PSH% -NoProfile -ExecutionPolicy Bypass -File "%PS1%" -Check
|
||||||
pause
|
pause
|
||||||
exit /b 0
|
exit /b 0
|
||||||
)
|
)
|
||||||
@@ -38,7 +38,7 @@ if errorlevel 6 (set "PICK=6") else if errorlevel 5 (set "PICK=5") else if error
|
|||||||
|
|
||||||
:run
|
:run
|
||||||
echo.
|
echo.
|
||||||
%PSH% -NoProfile -File "%PS1%" -Mode %PICK%
|
%PSH% -NoProfile -ExecutionPolicy Bypass -File "%PS1%" -Mode %PICK%
|
||||||
|
|
||||||
:end
|
:end
|
||||||
echo.
|
echo.
|
||||||
|
|||||||
@@ -54,6 +54,15 @@ switch ($Mode) {
|
|||||||
$sl = Join-Path $repo 'nvidia-sdk\Streamline\bin\x64'
|
$sl = Join-Path $repo 'nvidia-sdk\Streamline\bin\x64'
|
||||||
$victory = Join-Path $repo 'target\release\victory.exe'
|
$victory = Join-Path $repo 'target\release\victory.exe'
|
||||||
$hags = (Get-ItemProperty 'HKLM:\SYSTEM\CurrentControlSet\Control\GraphicsDrivers' -Name HwSchMode -ErrorAction SilentlyContinue).HwSchMode
|
$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) {
|
if ($Check) {
|
||||||
Write-Host "repo: $repo"
|
Write-Host "repo: $repo"
|
||||||
@@ -61,7 +70,7 @@ if ($Check) {
|
|||||||
Write-Host "mode: $Mode ($what)"
|
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 "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 "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
|
exit 0
|
||||||
}
|
}
|
||||||
if (Get-Process victory -ErrorAction SilentlyContinue) { Write-Host 'The game is already running. Close it first.'; exit 1 }
|
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') }
|
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." }
|
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).
|
# 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 ...' }
|
if (-not (Test-Path $victory)) { Write-Host 'First start: building the layer, a few minutes ...' }
|
||||||
|
|||||||
Reference in new issue
Block a user