mirror of
https://github.com/platformio/platformio-core.git
synced 2026-04-29 10:23:18 +02:00
Simplified installation process of PlatformIO // Resolve #274
This commit is contained in:
@@ -59,17 +59,12 @@ function InstallPython ($python_version, $architecture, $python_home) {
|
||||
|
||||
|
||||
function InstallPip ($python_home) {
|
||||
$pip_path = $python_home + "/Scripts/pip.exe"
|
||||
$python_path = $python_home + "/python.exe"
|
||||
if (-not(Test-Path $pip_path)) {
|
||||
Write-Host "Installing pip..."
|
||||
$webclient = New-Object System.Net.WebClient
|
||||
$webclient.DownloadFile($GET_PIP_URL, $GET_PIP_PATH)
|
||||
Write-Host "Executing:" $python_path $GET_PIP_PATH
|
||||
Start-Process -FilePath "$python_path" -ArgumentList "$GET_PIP_PATH" -Wait -Passthru
|
||||
} else {
|
||||
Write-Host "pip already installed."
|
||||
}
|
||||
Write-Host "Installing pip..."
|
||||
$webclient = New-Object System.Net.WebClient
|
||||
$webclient.DownloadFile($GET_PIP_URL, $GET_PIP_PATH)
|
||||
Write-Host "Executing:" $python_path $GET_PIP_PATH
|
||||
Start-Process -FilePath "$python_path" -ArgumentList "$GET_PIP_PATH" -Wait -Passthru
|
||||
}
|
||||
|
||||
function InstallPackage ($python_home, $pkg) {
|
||||
|
||||
@@ -87,21 +87,17 @@ def install_pip():
|
||||
|
||||
|
||||
def install_pypi_packages(packages):
|
||||
for pipargs in packages:
|
||||
print (exec_python_cmd([
|
||||
"-m", "pip.__main__" if sys.version_info < (2, 7, 0) else "pip",
|
||||
"install", "-U"] + pipargs))
|
||||
print (exec_python_cmd([
|
||||
"-m", "pip.__main__" if sys.version_info < (2, 7, 0) else "pip",
|
||||
"install", "-U"] + packages))
|
||||
|
||||
|
||||
def main():
|
||||
steps = [
|
||||
("Fixing Windows %PATH% Environment", fix_winpython_pathenv, []),
|
||||
("Installing Python Package Manager", install_pip, []),
|
||||
("Installing PlatformIO and dependencies", install_pypi_packages, [
|
||||
[["setuptools"], ["platformio"], [
|
||||
"--egg", "http://dl.platformio.org/scons.zip"
|
||||
]]
|
||||
])
|
||||
("Installing PlatformIO and dependencies", install_pypi_packages,
|
||||
[["setuptools", "platformio"]])
|
||||
]
|
||||
|
||||
if not IS_WINDOWS:
|
||||
|
||||
Reference in New Issue
Block a user