From 97542107dc657dd312d9da472c71e2b99208661c Mon Sep 17 00:00:00 2001 From: VakarisZ Date: Thu, 3 Oct 2019 17:20:14 +0300 Subject: [PATCH] Fixed bug that caused PATH not to be refreshed after python installation --- deployment_scripts/deploy_windows.ps1 | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/deployment_scripts/deploy_windows.ps1 b/deployment_scripts/deploy_windows.ps1 index c7192a4c8..87d6bc8cf 100644 --- a/deployment_scripts/deploy_windows.ps1 +++ b/deployment_scripts/deploy_windows.ps1 @@ -56,13 +56,12 @@ function Deploy-Windows([String] $monkey_home = (Get-Item -Path ".\").FullName, "Select 'add to PATH' when installing" $webClient.DownloadFile($PYTHON_URL, $TEMP_PYTHON_INSTALLER) Start-Process -Wait $TEMP_PYTHON_INSTALLER -ErrorAction Stop - $env:Path = [System.Environment]::GetEnvironmentVariable("Path","Machine") + $env:Path = [System.Environment]::GetEnvironmentVariable("Path","Machine") + ";" + [System.Environment]::GetEnvironmentVariable("Path","User") Remove-Item $TEMP_PYTHON_INSTALLER # Check if installed correctly $version = cmd.exe /c '"python" --version 2>&1' if ( $version -like '* is not recognized*' ) { - "Python is not found in PATH. If you just installed python you need to restart cmd. - Else, add it manually or reinstall python." + "Python is not found in PATH. Add it to PATH and relaunch the script." return } }