diff --git a/install_windows.ps1 b/install_windows.ps1 index eeb0e0a5..47417afb 100644 --- a/install_windows.ps1 +++ b/install_windows.ps1 @@ -14,7 +14,7 @@ foreach ($p_cmd in ("python3", "python", "py")) { cmd /c $RTT_PYTHON --version | findstr "Python" | Out-Null if (!$?) { - echo "Python not installed. Will install python 3.11.2." + echo "Python is not installed. Will install python 3.11.2." echo "Downloading Python." wget -O Python_setup.exe https://www.python.org/ftp/python/3.11.2/python-3.11.2.exe echo "Installing Python." @@ -26,14 +26,18 @@ if (!$?) { } echo "Install Python done. please close the current terminal and run this script again." exit +} else { + echo "Python environment has installed. Jump this step." } $git_url = "https://github.com/git-for-windows/git/releases/download/v2.39.2.windows.1/Git-2.39.2-64-bit.exe" if ($args[0] -eq "--gitee") { + echo "Use gitee mirror server!" $git_url = "https://registry.npmmirror.com/-/binary/git-for-windows/v2.39.2.windows.1/Git-2.39.2-64-bit.exe" } + if (!(Test-Command git)) { - echo "Git not installed. Will install Git." + echo "Git is not installed. Will install Git." echo "Installing git." winget install --id Git.Git -e --source winget if (!$?) { @@ -44,6 +48,8 @@ if (!(Test-Command git)) { cmd /c Git64.exe /quiet PrependPath=1 exit } +} else { + echo "Git environment has installed. Jump this step." } $PIP_SOURCE = "https://pypi.org/simple" @@ -57,6 +63,8 @@ cmd /c $RTT_PYTHON -m pip list -i $PIP_SOURCE --trusted-host $PIP_HOST | Out-Nul if (!$?) { echo "Installing pip." cmd /c $RTT_PYTHON -m ensurepip --upgrade +} else { + echo "Pip has installed. Jump this step." } cmd /c $RTT_PYTHON -m pip install --upgrade pip -i $PIP_SOURCE --trusted-host $PIP_HOST | Out-Null @@ -64,12 +72,16 @@ cmd /c $RTT_PYTHON -m pip install --upgrade pip -i $PIP_SOURCE --trusted-host $P if (!(Test-Command scons)) { echo "Installing scons." cmd /c $RTT_PYTHON -m pip install scons -i $PIP_SOURCE --trusted-host $PIP_HOST +} else { + echo "Scons has installed. Jump this step." } cmd /c $RTT_PYTHON -m pip list -i $PIP_SOURCE --trusted-host $PIP_HOST | findstr "requests" | Out-Null if (!$?) { - echo "Installing requests." + echo "Installing requests module." cmd /c $RTT_PYTHON -m pip install requests -i $PIP_SOURCE --trusted-host $PIP_HOST +} else { + echo "requests module has installed. Jump this step." } $url="https://raw.githubusercontent.com/RT-Thread/env/master/touch_env.ps1" @@ -78,4 +90,5 @@ if ($args[0] -eq "--gitee") { } wget $url -O touch_env.ps1 +echo "run touch_env.ps1" ./touch_env.ps1 $args[0]