@echo off setlocal echo Installing gcc 13.2.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%" 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%\mingw64\bin" >nul if errorlevel 1 ( setx PATH "%OLD_PATH%;%INSTALL%\mingw64\bin" >nul ) if exist "%INSTALL%\mingw64\bin\gcc.exe" ( echo gcc installation completed successfully. echo Restart the terminal to apply PATH changes. if not exist "%APP_JSON%" echo []>"%APP_JSON%" exit /b 0 ) echo gcc installation failed. exit /b 1