Python version information/RunPythonInstallers.ps1: Difference between revisions
From ihaveahax's Site
Jump to navigationJump to search
No edit summary |
(Include_freethreaded=1) |
||
Line 1: | Line 1: | ||
I made this so I could install multiple versions of Python at once, mainly in virtual machines. It expects each one to be in the same directory as the script. | I made this so I could install multiple versions of Python at once, mainly in virtual machines. It expects each one to be in the same directory as the script. For 3.13 it also installs the free-threaded build. | ||
<syntaxhighlight lang="powershell" copy> | <syntaxhighlight lang="powershell" copy> | ||
$UsedPath = Get-ChildItem -Path . -Name "UsedInstallers" | $UsedPath = Get-ChildItem -Path . -Name "UsedInstallers" | ||
Line 11: | Line 11: | ||
#Write-Host $Command | #Write-Host $Command | ||
#Invoke-Expression "$Command" | #Invoke-Expression "$Command" | ||
Start-Process -FilePath $_ -ArgumentList @('/passive', 'InstallAllUsers=1', 'CompileAll=1', 'Include_doc=0', 'Include_debug=1', 'Include_symbols=1') -Wait | Start-Process -FilePath $_ -ArgumentList @('/passive', 'InstallAllUsers=1', 'CompileAll=1', 'Include_doc=0', 'Include_debug=1', 'Include_symbols=1', 'Include_freethreaded=1') -Wait | ||
Move-Item -Path $_ -Destination $UsedPath | Move-Item -Path $_ -Destination $UsedPath | ||
} | } | ||
</syntaxhighlight> | </syntaxhighlight> |
Latest revision as of 04:17, 27 October 2024
I made this so I could install multiple versions of Python at once, mainly in virtual machines. It expects each one to be in the same directory as the script. For 3.13 it also installs the free-threaded build.
$UsedPath = Get-ChildItem -Path . -Name "UsedInstallers"
if (!$UsedPath) {
$UsedPath = New-Item -ItemType Directory -Name "UsedInstallers"
}
Write-Host $UsedPath
Get-ChildItem -Filter 'python-*.exe' | ForEach {
#$Command = ".\$_ /passive InstallAllUsers=1 CompileAll=1 Include_doc=0 Include_debug=1 Include_symbols=1"
#$Command = ".\$_ /?"
#Write-Host $Command
#Invoke-Expression "$Command"
Start-Process -FilePath $_ -ArgumentList @('/passive', 'InstallAllUsers=1', 'CompileAll=1', 'Include_doc=0', 'Include_debug=1', 'Include_symbols=1', 'Include_freethreaded=1') -Wait
Move-Item -Path $_ -Destination $UsedPath
}