Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @setlocal ENABLEEXTENSIONS ENABLEDELAYEDEXPANSION
- @echo OFF
- set MINGWBASEDIR=C:\MinGW
- set batversion=v1.0
- set reportname=Win_Check_Output.txt
- echo QMK Windows Check Output %batversion% > %reportname%
- :: -----------------------------------------------------------------------------
- set header=CURRENT PATHS & call :ReportHeader
- echo.
- for %%A in ("%!!%") do (
- echo %%~A>> %reportname% 2>&1
- )
- echo.>> %reportname% 2>&1
- :: -----------------------------------------------------------------------------
- set header=KEY EXECUTABLE LOCATIONS - GENERAL & call :ReportHeader
- set filename=make.exe & set version_cmd=--version & set version_find="GNU Make" & call :ReportVersion
- :: -----------------------------------------------------------------------------
- set header=EXECUTABLE LOCATIONS - AVR MCU COMPILERS & call :ReportHeader
- set filename=avr-gcc.exe & set version_cmd=--version & set version_find="avr" & call :ReportVersion
- set filename=avr-objcopy.exe & set version_cmd=--version & set version_find="GNU objcopy" & call :ReportVersion
- set filename=avr-objdump.exe & set version_cmd=--version & set version_find="GNU objdump" & call :ReportVersion
- set filename=avr-size.exe & set version_cmd=--version & set version_find="GNU size" & call :ReportVersion
- set filename=avr-ar.exe & set version_cmd=--version & set version_find="GNU ar" & call :ReportVersion
- set filename=avr-nm.exe & set version_cmd=--version & set version_find="GNU nm" & call :ReportVersion
- :: -----------------------------------------------------------------------------
- set header=EXECUTABLE LOCATIONS - ARM MCU COMPILERS & call :ReportHeader
- set filename=arm-none-eabi-gcc.exe & set version_cmd=--version & set version_find="arm-none-eabi-gcc" & call :ReportVersion
- set filename=arm-none-eabi-objcopy.exe & set version_cmd=--version & set version_find="GNU objcopy" & call :ReportVersion
- set filename=arm-none-eabi-objdump.exe & set version_cmd=--version & set version_find="GNU objdump" & call :ReportVersion
- set filename=arm-none-eabi-size.exe & set version_cmd=--version & set version_find="GNU size" & call :ReportVersion
- set filename=arm-none-eabi-ar.exe & set version_cmd=--version & set version_find="GNU ar" & call :ReportVersion
- set filename=arm-none-eabi-nm.exe & set version_cmd=--version & set version_find="GNU nm" & call :ReportVersion
- :: -----------------------------------------------------------------------------
- set header=EXECUTABLE LOCATIONS - NATIVE COMPILERS & call :ReportHeader
- set filename=gcc.exe & set version_cmd=--version & set version_find="gcc" & call :ReportVersion
- set filename=objcopy.exe & set version_cmd=--version & set version_find="GNU objcopy" & call :ReportVersion
- set filename=objdump.exe & set version_cmd=--version & set version_find="GNU objdump" & call :ReportVersion
- set filename=size.exe & set version_cmd=--version & set version_find="GNU size" & call :ReportVersion
- set filename=ar.exe & set version_cmd=--version & set version_find="GNU ar" & call :ReportVersion
- set filename=nm.exe & set version_cmd=--version & set version_find="GNU nm" & call :ReportVersion
- :: -----------------------------------------------------------------------------
- set header=EXECUTABLE LOCATIONS - PROGRAMMERS & call :ReportHeader
- set filename=dfu-programmer.exe & set version_cmd=--version & set version_find="dfu" & call :ReportVersion
- set filename=batchisp.exe & set version_cmd=-version & set version_find="batchisp" & call :ReportVersion
- set filename=dfu-util.exe & call :Report
- set filename=teensy_loader_cli.exe & call :Report
- set filename=hid_bootloader_cli.exe & call :Report
- set filename=avrdude.exe & call :Report
- :: -----------------------------------------------------------------------------
- set header=EXECUTABLE LOCATIONS - OPTIONAL & call :ReportHeader
- set filename=git.exe & set version_cmd=--version & set version_find="git" & call :ReportVersion
- set filename=cppcheck.exe & call :Report
- set filename=cppcheck.exe & call :Report
- set filename=doxygen.exe & call :Report
- set filename=gdb-config.exe & call :Report
- set filename=wget.exe & call :Report
- set filename=unzip.exe & call :Report
- :: -----------------------------------------------------------------------------
- set header=MINGW CHECK - OPTIONAL & call :ReportHeader
- if exist %MINGWBASEDIR% (echo Expected MinGW Base Dir = %MINGWBASEDIR%>> %reportname% 2>&1) else (echo Expected MinGW Base Dir = %MINGWBASEDIR% - Not Found>> %reportname% 2>&1)
- echo.>> %reportname% 2>&1
- set filename=mingw32-make.exe & set version_cmd=--version & set version_find="GNU Make" & call :ReportVersion
- if exist %MINGWBASEDIR%\bin\make.exe (ECHO It is not recommended to have make.exe in mingw/bin>> %reportname% 2>&1)
- echo.>> %reportname% 2>&1
- :: -----------------------------------------------------------------------------
- GOTO ExitBatch
- :ReportHeader
- echo ------------------------------------------------------------------------->> %reportname% 2>&1
- echo.>> %reportname% 2>&1
- echo %header%>> %reportname% 2>&1
- echo.>> %reportname% 2>&1
- exit /b
- :Report
- echo Filename = %filename% >> %reportname% 2>&1
- <nul set /p output="Location = " >> %reportname% 2>&1
- where %filename% >> %reportname% 2> NUL
- if ERRORLEVEL 1 (echo Not Found >> %reportname% 2>&1 & goto :EndReport)
- :EndReport
- echo.>> %reportname% 2>&1
- <nul set /p output="."
- exit /b
- :ReportVersion
- echo Filename = %filename% >> %reportname% 2>&1
- <nul set /p output="Location = " >> %reportname% 2>&1
- where %filename% >> %reportname% 2> NUL
- if ERRORLEVEL 1 (echo Not Found >> %reportname% 2>&1 & goto :EndReportVersion)
- <nul set /p output ="Version = " >> %reportname% 2>&1
- (%filename% %version_cmd% | find %version_find%) >> %reportname% 2>&1
- :EndReportVersion
- echo.>> %reportname% 2>&1
- <nul set /p output="."
- exit /b
- :ExitBatch
- echo Done!
- echo.
- echo See %reportname% for the report.
- endlocal
- exit /b
Add Comment
Please, Sign In to add comment