Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat/launch_bat_c++_build_tools #48

Merged
merged 3 commits into from
Sep 26, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 27 additions & 6 deletions launch.bat
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,11 @@ goto Start
:Try_Install_Dependencies
:: Check for git installation
where git >nul 2>&1
if %errorlevel% neq 0 (
if !errorlevel! neq 0 (
echo Git is not found.

where winget >nul 2>&1
if %errorlevel% neq 0 (
if !errorlevel! neq 0 (
echo Please install Git and try again.
set %~1=1
goto:eof
Expand All @@ -63,13 +63,33 @@ goto Start
)
)

:: Check for C++ build tools. 'cl' is the C++ compiler.
where cl >nul 2>&1
if !errorlevel! neq 0 (
echo "Microsoft C++ Build Tools not found."

where winget >nul 2>&1
if !errorlevel! neq 0 (
echo "Please install Microsoft C++ Build Tools and try again."
) else (
echo "Installing Microsoft C++ Build Tools..."
winget install Microsoft.VisualStudio.2022.BuildTools --override "--wait --add Microsoft.VisualStudio.Workload.VCTools --includeRecommended"
)

echo "Once installed, please run this script from the 'Developer Command Prompt for Visual Studio'."
echo "That command prompt has the needed environment variables for compiling C++ code."

set %~1=1
goto:eof
)

:: Check for python installation
where "%PYTHON_CMD%" >nul 2>&1
if %errorlevel% neq 0 (
if !errorlevel! neq 0 (
echo Python is not found.

where winget >nul 2>&1
if %errorlevel% neq 0 (
if !errorlevel! neq 0 (
echo Please install Python and try again.
set %~1=1
goto:eof
Expand All @@ -81,7 +101,7 @@ goto Start

:: Check that pip is installed
"%PYTHON_CMD%" -m ensurepip
if %errorlevel% neq 0 (
if !errorlevel! neq 0 (
echo Installing pip ...
"%PYTHON_CMD%" -m ensurepip --upgrade
)
Expand All @@ -100,7 +120,7 @@ goto Start
:Install_And_Activate_Venv_If_Needed
if exist "%CLONE_DIR%\.installed" (
echo Project is already installed.

cd "%CLONE_DIR%"
call :Activate_Venv

Expand Down Expand Up @@ -154,6 +174,7 @@ if exist "%SRC_DIR%\.git" (
)

call :Install_And_Activate_Venv_If_Needed
if !SHOULD_EXIT! neq 0 exit /b 1

echo ------------------------------------------------------------

Expand Down