@echo off setlocal echo Installing git 2.44.0 ... set "ZIP=%FILE%" set "INSTALL=%INSTALL_DIR%" if not exist "%ZIP%" ( echo ZIP not found: %ZIP% exit /b 1 ) echo Cleaning destination... if exist "%INSTALL%" rmdir /s /q "%INSTALL%" mkdir "%INSTALL%" echo Extracting files... echo ---------------------------------------- tar -xvf "%ZIP%" -C "%INSTALL%" for /f "delims=" %%F in ('tar -xvf "%ZIP%" -C "%INSTALL%"') do ( echo copy %%F ) if errorlevel 1 ( echo Extraction failed. exit /b 1 ) echo ---------------------------------------- echo Extraction complete. echo Setting PATH... for /f "tokens=2,*" %%A in ( 'reg query "HKCU\Environment" /v PATH ^| find "PATH"' ) do set "OLD_PATH=%%B" echo %OLD_PATH% | find /i "%INSTALL%\" >nul if errorlevel 1 ( setx PATH "%OLD_PATH%;%INSTALL%\" >nul ) if exist "%INSTALL%\qemu-img.exe" ( echo Git installation completed successfully. echo Restart the terminal to apply PATH changes. if not exist "%APP_JSON%" echo []>"%APP_JSON%" exit /b 0 ) echo Git installation failed. exit /b 1