diff --git a/.gitea/workflows/release.yml b/.gitea/workflows/release.yml index b5144a4..ce9420d 100644 --- a/.gitea/workflows/release.yml +++ b/.gitea/workflows/release.yml @@ -18,17 +18,17 @@ jobs: run: | $ErrorActionPreference = "Stop" if (-not (Get-Command python -ErrorAction SilentlyContinue)) { - Write-Host "Python not found; installing 3.12 (per-user, no admin needed)..." + Write-Host "Python not found; installing 3.12 to a fixed dir (no admin needed)..." $url = "https://www.python.org/ftp/python/3.12.7/python-3.12.7-amd64.exe" Invoke-WebRequest -Uri $url -OutFile "$env:TEMP\py.exe" - Start-Process -Wait -FilePath "$env:TEMP\py.exe" -ArgumentList "/quiet","PrependPath=1","Include_test=0" - $base = @( - "$env:LOCALAPPDATA\Programs\Python\Python312", - "C:\Program Files\Python312", - "C:\Python312" - ) | Where-Object { Test-Path "$_\python.exe" } | Select-Object -First 1 - if (-not $base) { throw "Python install did not produce python.exe in a known location" } - $env:Path = "$base;$base\Scripts;$env:Path" + $dir = "$env:LOCALAPPDATA\Python312" + $p = Start-Process -Wait -PassThru -FilePath "$env:TEMP\py.exe" ` + -ArgumentList "/quiet","TargetDir=$dir","PrependPath=1","Include_test=0" + Write-Host "installer exit code: $($p.ExitCode)" + if (-not (Test-Path "$dir\python.exe")) { + throw "python.exe not found at $dir after install (exit $($p.ExitCode))" + } + $env:Path = "$dir;$dir\Scripts;$env:Path" } python --version python -m pip install --upgrade pip