97 lines
2.3 KiB
Batchfile
97 lines
2.3 KiB
Batchfile
@echo off
|
|
echo ========================================
|
|
echo Family Hub - Prerequisites Check
|
|
echo ========================================
|
|
echo.
|
|
|
|
set PYTHON_OK=0
|
|
set NODE_OK=0
|
|
set NPM_OK=0
|
|
|
|
REM Check Python
|
|
echo [1/3] Checking Python...
|
|
where python >nul 2>nul
|
|
if %ERRORLEVEL% EQU 0 (
|
|
for /f "tokens=*" %%i in ('python --version 2^>^&1') do set PYTHON_VERSION=%%i
|
|
echo [OK] !PYTHON_VERSION!
|
|
set PYTHON_OK=1
|
|
) else (
|
|
echo [MISSING] Python not found in PATH
|
|
echo Download from: https://www.python.org/downloads/
|
|
)
|
|
echo.
|
|
|
|
REM Check Node.js
|
|
echo [2/3] Checking Node.js...
|
|
where node >nul 2>nul
|
|
if %ERRORLEVEL% EQU 0 (
|
|
for /f "tokens=*" %%i in ('node --version 2^>^&1') do set NODE_VERSION=%%i
|
|
echo [OK] Node.js !NODE_VERSION!
|
|
set NODE_OK=1
|
|
) else (
|
|
echo [MISSING] Node.js not found in PATH
|
|
echo Download from: https://nodejs.org/
|
|
)
|
|
echo.
|
|
|
|
REM Check npm
|
|
echo [3/3] Checking npm...
|
|
where npm >nul 2>nul
|
|
if %ERRORLEVEL% EQU 0 (
|
|
for /f "tokens=*" %%i in ('npm --version 2^>^&1') do set NPM_VERSION=%%i
|
|
echo [OK] npm v!NPM_VERSION!
|
|
set NPM_OK=1
|
|
) else (
|
|
echo [MISSING] npm not found in PATH
|
|
echo (npm is included with Node.js)
|
|
)
|
|
echo.
|
|
|
|
REM Summary
|
|
echo ========================================
|
|
echo Summary
|
|
echo ========================================
|
|
if %PYTHON_OK%==1 (
|
|
echo Python: [OK]
|
|
) else (
|
|
echo Python: [MISSING]
|
|
)
|
|
|
|
if %NODE_OK%==1 (
|
|
echo Node.js: [OK]
|
|
) else (
|
|
echo Node.js: [MISSING]
|
|
)
|
|
|
|
if %NPM_OK%==1 (
|
|
echo npm: [OK]
|
|
) else (
|
|
echo npm: [MISSING]
|
|
)
|
|
|
|
echo.
|
|
|
|
if %PYTHON_OK%==1 if %NODE_OK%==1 if %NPM_OK%==1 (
|
|
echo ========================================
|
|
echo All prerequisites installed!
|
|
echo ========================================
|
|
echo.
|
|
echo You can now proceed with:
|
|
echo 1. download-source.bat
|
|
echo 2. setup.bat
|
|
echo.
|
|
) else (
|
|
echo ========================================
|
|
echo Some prerequisites are missing!
|
|
echo ========================================
|
|
echo.
|
|
echo Please install the missing software:
|
|
if %PYTHON_OK%==0 echo - Python 3.9+ from https://www.python.org/downloads/
|
|
if %NODE_OK%==0 echo - Node.js 16+ from https://nodejs.org/
|
|
echo.
|
|
echo Make sure to check "Add to PATH" during installation!
|
|
echo.
|
|
)
|
|
|
|
pause
|