Skip to content
Open
8 changes: 4 additions & 4 deletions installers/win-setup-template.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,10 @@ function Get-ExecParams {
)

if ($IsMSI) {
"TARGETDIR=$PythonArchPath ALLUSERS=1"
"TARGETDIR=`"$PythonArchPath`" ALLUSERS=1"
} else {
$Include_freethreaded = if ($IsFreeThreaded) { "Include_freethreaded=1" } else { "" }
"DefaultAllUsersTargetDir=$PythonArchPath InstallAllUsers=1 $Include_freethreaded"
"DefaultAllUsersTargetDir=`"$PythonArchPath`" InstallAllUsers=1 $Include_freethreaded"
}
}

Expand Down Expand Up @@ -121,7 +121,7 @@ Copy-Item -Path ./$PythonExecName -Destination $PythonArchPath | Out-Null
Write-Host "Install Python $Version in $PythonToolcachePath..."
$ExecParams = Get-ExecParams -IsMSI $IsMSI -IsFreeThreaded $IsFreeThreaded -PythonArchPath $PythonArchPath

cmd.exe /c "cd $PythonArchPath && call $PythonExecName $ExecParams /quiet"
cmd.exe /c "cd `"$PythonArchPath`" && call `"$PythonExecName`" $ExecParams /quiet"
Comment thread
franciscogarcia-payroc marked this conversation as resolved.
if ($LASTEXITCODE -ne 0) {
Throw "Error happened during Python installation"
}
Expand All @@ -138,7 +138,7 @@ New-Item -Path "$PythonArchPath\python3.exe" -ItemType SymbolicLink -Value "$Pyt
Write-Host "Install and upgrade Pip"
$Env:PIP_ROOT_USER_ACTION = "ignore"
$PythonExePath = Join-Path -Path $PythonArchPath -ChildPath "python.exe"
cmd.exe /c "$PythonExePath -m ensurepip && $PythonExePath -m pip install --upgrade --force-reinstall pip --no-warn-script-location"
cmd.exe /c "`"$PythonExePath`" -m ensurepip && `"$PythonExePath`" -m pip install --upgrade --force-reinstall pip --no-warn-script-location"
Comment thread
franciscogarcia-payroc marked this conversation as resolved.
if ($LASTEXITCODE -ne 0) {
Throw "Error happened during pip installation / upgrade"
}
Expand Down
Loading