Files
gyandoot-v2/release/windows/install.bat
Tara Menon 667336bcb9 release(v2.0.0): cross-platform release — Linux/macOS/Windows/WSL
Creates full release package with:
- release/install.sh (universal cross-platform installer)
- release/windows/install.bat (Git Bash/MSYS2)
- release/windows/install.ps1 (PowerShell)
- release/homebrew/gyandoot.rb (Homebrew formula)
- release/archives/ prebuilt binary archives
- release/README.md (platform-specific install guide)
- install.sh updated with same cross-platform logic
- README.md updated
2026-06-13 18:35:14 +05:30

121 lines
5.8 KiB
Batchfile

@echo off
REM ═══════════════════════════════════════════════════════════════════════════
REM GyanDoot v2.0 — Windows Installer (Git Bash / MSYS2)
REM ═══════════════════════════════════════════════════════════════════════════
REM This script installs GyanDoot on Windows via Git Bash or MSYS2.
REM For PowerShell, use: install.ps1
REM ═══════════════════════════════════════════════════════════════════════════
setlocal enabledelayedexpansion
echo.
echo ╔═══════════════════════════════════════╗
echo ║ GyanDoot v2.0 — Windows Installer ║
echo ╚═══════════════════════════════════════╝
echo.
REM ── Check if running in Git Bash / MSYS2 ──────────────────────────────
if not defined MSYSTEM (
echo [WARN] This script requires Git Bash or MSYS2.
echo For PowerShell, use: install.ps1
echo.
echo Or download from: https://git.gyannetra.in/gnpl_admin/gyandoot-release
pause
exit /b 1
)
REM ── Check prerequisites ───────────────────────────────────────────────
echo [CHECK] Rust...
where cargo >nul 2>&1
if errorlevel 1 (
echo [INFO] Rust not found. Installing Rust...
powershell -Command "& {Invoke-WebRequest -Uri https://win.rustup.rs -OutFile '%TEMP%\rustup-init.exe'; Start-Process '%TEMP%\rustup-init.exe' -Wait -ArgumentList '-y'}"
call "%USERPROFILE%\.cargo\env"
echo [OK] Rust installed
) else (
for /f "tokens=*" %%i in ('cargo --version') do echo [OK] %%i
)
echo [CHECK] Node.js...
where node >nul 2>&1
if errorlevel 1 (
echo [WARN] Node.js is required for browser features.
echo Download from: https://nodejs.org (v20+)
echo Or: winget install OpenJS.NodeJS
) else (
for /f "tokens=*" %%i in ('node --version') do echo [OK] Node.js %%i
)
REM ── Build ──────────────────────────────────────────────────────────────
echo.
echo [BUILD] Compiling GyanDoot (this may take a few minutes)...
cd /d "%~dp0.." 2>nul || (
echo [ERR] Could not find project root.
echo Make sure you're running this from the release directory.
pause
exit /b 1
)
cargo build --release
if errorlevel 1 (
echo [ERR] Build failed. Check the error above.
pause
exit /b 1
)
echo [OK] Build complete
REM ── Install binary ────────────────────────────────────────────────────
set "INSTALL_DIR=%USERPROFILE%\.cargo\bin"
if not exist "%INSTALL_DIR%" mkdir "%INSTALL_DIR%"
copy /Y "target\release\gyandoot.exe" "%INSTALL_DIR%\gyandoot.exe" >nul
echo [OK] Installed to %INSTALL_DIR%\gyandoot.exe
REM ── Check PATH ────────────────────────────────────────────────────────
echo !PATH! | findstr /C:"%USERPROFILE%\.cargo\bin" >nul
if errorlevel 1 (
echo [WARN] %USERPROFILE%\.cargo\bin is not in your PATH.
echo Add it manually to your PATH environment variable.
echo Or run: setx PATH "%%USERPROFILE%%\.cargo\bin;%%PATH%%"
echo.
echo Then restart your terminal.
)
REM ── Verify ────────────────────────────────────────────────────────────
echo.
echo [VERIFY] Checking installation...
"%INSTALL_DIR%\gyandoot.exe" --help >nul 2>&1
if errorlevel 1 (
echo [WARN] Installation verification failed.
) else (
echo [OK] GyanDoot installed successfully!
)
REM ── Optional: Camoufox browser ────────────────────────────────────────
echo.
echo ────────────────────────────────────────────
echo Optional: Install Camoufox Browser?
echo Required for: web_search, web_browse tools
echo ────────────────────────────────────────────
set /p INSTALL_CAMOUFOX="Install Camoufox browser? [y/N]: "
if /i "!INSTALL_CAMOUFOX!"=="y" (
echo [INFO] Installing camoufox-browser npm package...
npm install -g camoufox-browser@0.1.0
echo [INFO] Downloading browser binary (~311MB)...
npx --yes camoufox-js@0.11.0 fetch
echo [OK] Camoufox browser installed
)
REM ── Done ──────────────────────────────────────────────────────────────
echo.
echo ╔═══════════════════════════════════════╗
echo ║ GyanDoot v2.0 installed! ║
echo ╚═══════════════════════════════════════╝
echo.
echo Quick start:
echo gyandoot --help
echo gyandoot setup
echo gyandoot run
echo.
pause