From 1701f369429c579b12bd07c32b0804a51bc8093f Mon Sep 17 00:00:00 2001 From: luochen570 <1160510664@qq.com> Date: Sat, 30 May 2026 22:03:08 +0800 Subject: [PATCH] ci: wait for Python installer on Windows --- .gitea/workflows/build-windows-release.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.gitea/workflows/build-windows-release.yml b/.gitea/workflows/build-windows-release.yml index 8bf225b..52bc268 100644 --- a/.gitea/workflows/build-windows-release.yml +++ b/.gitea/workflows/build-windows-release.yml @@ -78,8 +78,9 @@ jobs: $pythonUrl = 'https://www.python.org/ftp/python/3.12.10/python-3.12.10-amd64.exe' Write-Host "Downloading Python from $pythonUrl" Invoke-WebRequest -Uri $pythonUrl -OutFile $installer - & $installer /quiet InstallAllUsers=0 TargetDir=$pythonRoot Include_pip=1 Include_test=0 PrependPath=0 - if ($LASTEXITCODE -ne 0) { throw "Python installer failed, exit code: $LASTEXITCODE" } + $installArgs = @('/quiet', 'InstallAllUsers=0', "TargetDir=$pythonRoot", 'Include_pip=1', 'Include_test=0', 'PrependPath=0') + $proc = Start-Process -FilePath $installer -ArgumentList $installArgs -Wait -PassThru + if ($proc.ExitCode -ne 0) { throw "Python installer failed, exit code: $($proc.ExitCode)" } } if (-not (Test-Path $pythonExe)) { throw "Python installation finished but python.exe was not found: $pythonExe" } $pythonArgs = @()