Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
89 lines (63 sloc) 2.26 KB
#
# Python 3 turbo.me file
# https://github.com/turboapps/turbome/tree/master/python
#
# Licensed under the Apache License, Version 2.0
# http://www.apache.org/licenses/LICENSE-2.0
###################################
# Requirements
###################################
requires privilege:admin
###################################
# Meta tags
###################################
meta title="Python"
meta namespace="python"
meta name="python"
###################################
# Pull dependency images
###################################
using gnu/wget,7-zip/7-zip,turbobuild/disable-ie-enhanced-security
###################################
# Download and install
###################################
# Set working directory
cmd mkdir %SYSTEMDRIVE%\Workspace
workdir @SYSDRIVE@\Workspace
# Reset environment variable
env pythonhome=""
# Get download link
batch
echo [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 > GetDownloadLink.ps1
echo $website = Invoke-WebRequest -Uri https://www.python.org/downloads/ >> GetDownloadLink.ps1
echo $item = $website.links ^| where {$_.innerText -like "*Download Python 3*" -and $_.href -like "*python-3*.exe"} >> GetDownloadLink.ps1
echo $link = $item.href >> GetDownloadLink.ps1
echo Write-Host "$link" >> GetDownloadLink.ps1
cmd "powershell -NoProfile -ExecutionPolicy Unrestricted -File GetDownloadLink.ps1"
var downloadlink = last
# Download and install
batch
wget.exe -O python3.exe --no-check-certificate %downloadlink%"
python3.exe /quiet InstallAllUsers=1 PrependPath=1 TargetDir=%SYSTEMDRIVE%\Python3
# Get version
batch
echo $file = "%SYSTEMDRIVE%\Python3\python.exe" >> GetVersion.ps1
echo $version = (Get-Item $file).VersionInfo.ProductVersion >> GetVersion.ps1
echo Write-Host "$version" >> GetVersion.ps1
cmd "powershell -NoProfile -ExecutionPolicy Unrestricted -File GetVersion.ps1"
var tag = last
meta tag=tag
###################################
# Environment Variables
###################################
# nothing
###################################
# Clean up
###################################
workdir @SYSDRIVE@
batch
rmdir %SYSTEMDRIVE%\Workspace /s /q
###################################
# Startup File
###################################
startup file ("cmd", "/k python -h")
You can’t perform that action at this time.