diff options
| author | Oskari Timperi <oskari.timperi@iki.fi> | 2019-06-21 11:53:19 +0300 |
|---|---|---|
| committer | Oskari Timperi <oskari.timperi@iki.fi> | 2019-06-21 11:53:19 +0300 |
| commit | 37902c1aca190c96615d61d39f1b2b1ee9fa1f9b (patch) | |
| tree | c5bdddc6a32a262e20f91e90e46f6359b4f6190a | |
| parent | a447739463ef7c0d6e34d4a85c66555e77c08193 (diff) | |
| download | portablepython-37902c1aca190c96615d61d39f1b2b1ee9fa1f9b.tar.gz portablepython-37902c1aca190c96615d61d39f1b2b1ee9fa1f9b.zip | |
First try downloading Python 2.X.Y
| -rw-r--r-- | azure-pipelines.yml | 7 | ||||
| -rw-r--r-- | download.ps1 | 29 |
2 files changed, 28 insertions, 8 deletions
diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 3ac0bc1..cd6a59f 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -132,6 +132,13 @@ jobs: PYVERSION: 3.7.3 PYARCH: 64 + PY2716_32: + PYVERSION: 2.7.16 + PYARCH: 32 + PY2716_64: + PYVERSION: 2.7.16 + PYARCH: 64 + pool: vmImage: 'vs2017-win2016' diff --git a/download.ps1 b/download.ps1 index ed23363..d90252b 100644 --- a/download.ps1 +++ b/download.ps1 @@ -1,7 +1,15 @@ -if ($env:PYARCH -eq "64") { - $filename = "python-${env:PYVERSION}-amd64.exe" +if ($env:PYVERSION -like "3.*") { + if ($env:PYARCH -eq "64") { + $filename = "python-${env:PYVERSION}-amd64.exe" + } else { + $filename = "python-${env:PYVERSION}.exe" + } } else { - $filename = "python-${env:PYVERSION}.exe" + if ($env:PYARCH -eq "64") { + $filename = "python-${env:PYVERSION}.amd64.msi" + } else { + $filename = "python-${env:PYVERSION}.msi" + } } $url = "https://www.python.org/ftp/python/${env:PYVERSION}/${filename}" @@ -17,10 +25,15 @@ Write-Output "Log file: $logfile" $client = New-Object System.Net.WebClient $client.DownloadFile($url, $target) -# Replace TARGET_DIR in unattend.xml.in with our target directory -((Get-Content -path unattend.xml.in -raw) -replace 'TARGET_DIR',$targetdir) | Set-Content -path unattend.xml +if ($env:PYVERSION -like "3.*") { + # Replace TARGET_DIR in unattend.xml.in with our target directory + ((Get-Content -path unattend.xml.in -raw) -replace 'TARGET_DIR',$targetdir) | Set-Content -path unattend.xml -Start-Process -FilePath "$target" -ArgumentList "/quiet","/log","$logfile" -Wait + Start-Process -FilePath "$target" -ArgumentList "/quiet","/log","$logfile" -Wait -# Remove all __pycache__ directories -Get-ChildItem -Include __pycache__ -Recurse -Force | Remove-Item -Force -Recurse + # Remove all __pycache__ directories + Get-ChildItem -Include __pycache__ -Recurse -Force | Remove-Item -Force -Recurse +} else { + msiexec /qn /i $target TARGETDIR=$targetdir ADDLOCAL=DefaultFeature,TclTk,Documentation,Tools REMOVE=Extensions,Testsuite ALLUSERS=1 + Get-ChildItem -Include "*.pyc" -Recurse -Force | Remove-Item -Force +} |
