Improve Windows build script with comprehensive dependency checking
Enhanced build.bat to automatically detect and offer to install all required dependencies for users with minimal Windows dev environment: - Check for winget availability (required for auto-installation) - Detect and offer to install Git (recommended for development) - Improved GCC/MinGW detection with fallback instructions - Better error messages for users without winget - Graceful degradation when automatic installation is not available This ensures Jake and other users with just Go installed can run the build script and get prompted to install everything needed automatically. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
parent
3c21eb43e8
commit
82ae40e0ec
|
|
@ -20,6 +20,56 @@ echo 📦 Go version:
|
||||||
go version
|
go version
|
||||||
echo.
|
echo.
|
||||||
|
|
||||||
|
REM ----------------------------
|
||||||
|
REM Check for winget (required for auto-install)
|
||||||
|
REM ----------------------------
|
||||||
|
set WINGET_AVAILABLE=0
|
||||||
|
where winget >nul 2>&1
|
||||||
|
if %ERRORLEVEL% equ 0 (
|
||||||
|
set WINGET_AVAILABLE=1
|
||||||
|
echo ✓ winget found (automatic installation available)
|
||||||
|
) else (
|
||||||
|
echo ⚠️ winget not found (manual installation will be required)
|
||||||
|
echo To enable automatic installation, update to Windows 10 1809+ or Windows 11
|
||||||
|
)
|
||||||
|
echo.
|
||||||
|
|
||||||
|
REM ----------------------------
|
||||||
|
REM Check for Git (recommended for development)
|
||||||
|
REM ----------------------------
|
||||||
|
where git >nul 2>&1
|
||||||
|
if %ERRORLEVEL% equ 0 (
|
||||||
|
echo ✓ Git found
|
||||||
|
git --version
|
||||||
|
) else (
|
||||||
|
echo ⚠️ Git not found (recommended for development)
|
||||||
|
|
||||||
|
if !WINGET_AVAILABLE! equ 1 (
|
||||||
|
echo.
|
||||||
|
echo Would you like to install Git automatically? (Y/N):
|
||||||
|
set /p install_git=
|
||||||
|
|
||||||
|
if /I "!install_git!"=="Y" (
|
||||||
|
echo.
|
||||||
|
echo 📥 Installing Git via winget...
|
||||||
|
winget install -e --id=Git.Git
|
||||||
|
set GIT_INSTALL_RESULT=!ERRORLEVEL!
|
||||||
|
|
||||||
|
if !GIT_INSTALL_RESULT! equ 0 (
|
||||||
|
echo ✓ Git installed successfully!
|
||||||
|
echo Please restart your terminal and run this script again.
|
||||||
|
exit /b 0
|
||||||
|
) else (
|
||||||
|
echo ❌ Failed to install Git automatically.
|
||||||
|
echo Please install manually from: https://git-scm.com/
|
||||||
|
)
|
||||||
|
)
|
||||||
|
) else (
|
||||||
|
echo Please install Git from: https://git-scm.com/
|
||||||
|
)
|
||||||
|
)
|
||||||
|
echo.
|
||||||
|
|
||||||
REM ----------------------------
|
REM ----------------------------
|
||||||
REM Check for GCC (required for CGO)
|
REM Check for GCC (required for CGO)
|
||||||
REM ----------------------------
|
REM ----------------------------
|
||||||
|
|
@ -29,6 +79,8 @@ if %ERRORLEVEL% neq 0 (
|
||||||
echo.
|
echo.
|
||||||
echo VideoTools requires MinGW-w64 to build on Windows.
|
echo VideoTools requires MinGW-w64 to build on Windows.
|
||||||
echo.
|
echo.
|
||||||
|
|
||||||
|
if !WINGET_AVAILABLE! equ 1 (
|
||||||
echo Would you like to install MinGW-w64 automatically? (Y/N):
|
echo Would you like to install MinGW-w64 automatically? (Y/N):
|
||||||
set /p install_gcc=
|
set /p install_gcc=
|
||||||
|
|
||||||
|
|
@ -65,17 +117,22 @@ if %ERRORLEVEL% neq 0 (
|
||||||
exit /b 1
|
exit /b 1
|
||||||
)
|
)
|
||||||
) else (
|
) else (
|
||||||
|
echo Skipping automatic installation.
|
||||||
|
)
|
||||||
|
) else (
|
||||||
|
echo winget is not available on this system.
|
||||||
|
)
|
||||||
|
|
||||||
|
REM Show manual installation instructions if we get here
|
||||||
echo.
|
echo.
|
||||||
echo ❌ GCC is required to build VideoTools on Windows.
|
echo ❌ GCC is required to build VideoTools on Windows.
|
||||||
echo.
|
echo.
|
||||||
echo Please install MinGW-w64:
|
echo Please install MinGW-w64 manually:
|
||||||
echo 1. Install MSYS2 from https://www.msys2.org/
|
echo 1. Install MSYS2 from https://www.msys2.org/
|
||||||
echo 2. Run: pacman -S mingw-w64-x86_64-gcc
|
echo 2. Run: pacman -S mingw-w64-x86_64-gcc
|
||||||
echo 3. Add C:\msys64\mingw64\bin to your PATH
|
echo 3. Add C:\msys64\mingw64\bin to your PATH
|
||||||
|
echo 4. Restart your terminal and run this script again
|
||||||
echo.
|
echo.
|
||||||
echo Or install via winget:
|
|
||||||
echo winget install MSYS2.MSYS2
|
|
||||||
echo C:\msys64\usr\bin\bash.exe -lc "pacman -S --noconfirm mingw-w64-x86_64-gcc"
|
|
||||||
exit /b 1
|
exit /b 1
|
||||||
)
|
)
|
||||||
) else (
|
) else (
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user