IBNobody

QMK Windows Check

Sep 14th, 2016
140
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Batch 5.83 KB | None | 0 0
  1. @setlocal ENABLEEXTENSIONS ENABLEDELAYEDEXPANSION
  2. @echo OFF
  3. set MINGWBASEDIR=C:\MinGW
  4. set batversion=v1.0
  5. set reportname=Win_Check_Output.txt
  6. echo QMK Windows Check Output %batversion% > %reportname%
  7.  
  8. :: -----------------------------------------------------------------------------
  9.  
  10. set header=CURRENT PATHS & call :ReportHeader
  11. echo.
  12. for %%A in ("%!!%") do (
  13.     echo %%~A>> %reportname% 2>&1
  14. )
  15. echo.>> %reportname% 2>&1
  16.  
  17. :: -----------------------------------------------------------------------------
  18.  
  19. set header=KEY EXECUTABLE LOCATIONS - GENERAL & call :ReportHeader
  20.  
  21. set filename=make.exe & set version_cmd=--version & set version_find="GNU Make" & call :ReportVersion
  22.  
  23. :: -----------------------------------------------------------------------------
  24.  
  25. set header=EXECUTABLE LOCATIONS - AVR MCU COMPILERS & call :ReportHeader
  26.  
  27. set filename=avr-gcc.exe & set version_cmd=--version & set version_find="avr" & call :ReportVersion
  28. set filename=avr-objcopy.exe & set version_cmd=--version & set version_find="GNU objcopy" & call :ReportVersion
  29. set filename=avr-objdump.exe & set version_cmd=--version & set version_find="GNU objdump" & call :ReportVersion
  30. set filename=avr-size.exe & set version_cmd=--version & set version_find="GNU size" & call :ReportVersion
  31. set filename=avr-ar.exe & set version_cmd=--version & set version_find="GNU ar" & call :ReportVersion
  32. set filename=avr-nm.exe & set version_cmd=--version & set version_find="GNU nm" & call :ReportVersion
  33.  
  34. :: -----------------------------------------------------------------------------
  35.  
  36. set header=EXECUTABLE LOCATIONS - ARM MCU COMPILERS & call :ReportHeader
  37.  
  38. set filename=arm-none-eabi-gcc.exe & set version_cmd=--version & set version_find="arm-none-eabi-gcc" & call :ReportVersion
  39. set filename=arm-none-eabi-objcopy.exe & set version_cmd=--version & set version_find="GNU objcopy" & call :ReportVersion
  40. set filename=arm-none-eabi-objdump.exe & set version_cmd=--version & set version_find="GNU objdump" & call :ReportVersion
  41. set filename=arm-none-eabi-size.exe & set version_cmd=--version & set version_find="GNU size" & call :ReportVersion
  42. set filename=arm-none-eabi-ar.exe & set version_cmd=--version & set version_find="GNU ar" & call :ReportVersion
  43. set filename=arm-none-eabi-nm.exe & set version_cmd=--version & set version_find="GNU nm" & call :ReportVersion
  44.  
  45. :: -----------------------------------------------------------------------------
  46.  
  47. set header=EXECUTABLE LOCATIONS - NATIVE COMPILERS & call :ReportHeader
  48.  
  49. set filename=gcc.exe & set version_cmd=--version & set version_find="gcc" & call :ReportVersion
  50. set filename=objcopy.exe & set version_cmd=--version & set version_find="GNU objcopy" & call :ReportVersion
  51. set filename=objdump.exe & set version_cmd=--version & set version_find="GNU objdump" & call :ReportVersion
  52. set filename=size.exe & set version_cmd=--version & set version_find="GNU size" & call :ReportVersion
  53. set filename=ar.exe & set version_cmd=--version & set version_find="GNU ar" & call :ReportVersion
  54. set filename=nm.exe & set version_cmd=--version & set version_find="GNU nm" & call :ReportVersion
  55.  
  56. :: -----------------------------------------------------------------------------
  57.  
  58. set header=EXECUTABLE LOCATIONS - PROGRAMMERS & call :ReportHeader
  59.  
  60. set filename=dfu-programmer.exe & set version_cmd=--version & set version_find="dfu" & call :ReportVersion
  61. set filename=batchisp.exe & set version_cmd=-version & set version_find="batchisp" & call :ReportVersion
  62. set filename=dfu-util.exe & call :Report
  63. set filename=teensy_loader_cli.exe & call :Report
  64. set filename=hid_bootloader_cli.exe & call :Report
  65. set filename=avrdude.exe & call :Report
  66.  
  67. :: -----------------------------------------------------------------------------
  68.  
  69. set header=EXECUTABLE LOCATIONS - OPTIONAL & call :ReportHeader
  70. set filename=git.exe & set version_cmd=--version & set version_find="git" & call :ReportVersion
  71. set filename=cppcheck.exe & call :Report
  72. set filename=cppcheck.exe & call :Report
  73. set filename=doxygen.exe & call :Report
  74. set filename=gdb-config.exe & call :Report
  75. set filename=wget.exe & call :Report
  76. set filename=unzip.exe & call :Report
  77.  
  78. :: -----------------------------------------------------------------------------
  79.  
  80. set header=MINGW CHECK - OPTIONAL & call :ReportHeader
  81. if exist %MINGWBASEDIR% (echo Expected MinGW Base Dir = %MINGWBASEDIR%>> %reportname% 2>&1) else (echo Expected MinGW Base Dir = %MINGWBASEDIR% - Not Found>> %reportname% 2>&1)
  82. echo.>> %reportname% 2>&1
  83. set filename=mingw32-make.exe & set version_cmd=--version & set version_find="GNU Make" & call :ReportVersion
  84. if exist %MINGWBASEDIR%\bin\make.exe (ECHO It is not recommended to have make.exe in mingw/bin>> %reportname% 2>&1)
  85. echo.>> %reportname% 2>&1
  86. :: -----------------------------------------------------------------------------
  87.  
  88. GOTO ExitBatch
  89.  
  90. :ReportHeader
  91. echo ------------------------------------------------------------------------->> %reportname% 2>&1
  92. echo.>> %reportname% 2>&1
  93. echo %header%>> %reportname% 2>&1
  94. echo.>> %reportname% 2>&1
  95. exit /b
  96.  
  97.  
  98. :Report
  99. echo Filename = %filename% >> %reportname% 2>&1
  100. <nul set /p output="Location = " >> %reportname% 2>&1
  101. where %filename%  >> %reportname% 2> NUL
  102. if ERRORLEVEL 1 (echo Not Found >> %reportname% 2>&1 & goto :EndReport)
  103.  
  104. :EndReport
  105. echo.>> %reportname% 2>&1
  106. <nul set /p output="."
  107. exit /b
  108.  
  109. :ReportVersion
  110. echo Filename = %filename% >> %reportname% 2>&1
  111. <nul set /p output="Location = " >> %reportname% 2>&1
  112. where %filename%  >> %reportname% 2> NUL
  113. if ERRORLEVEL 1 (echo Not Found >> %reportname% 2>&1 & goto :EndReportVersion)
  114. <nul set /p output ="Version  = " >> %reportname% 2>&1
  115.  
  116. (%filename% %version_cmd% | find %version_find%) >> %reportname% 2>&1
  117.  
  118. :EndReportVersion
  119. echo.>> %reportname% 2>&1
  120. <nul set /p output="."
  121. exit /b
  122.  
  123. :ExitBatch
  124. echo Done!
  125. echo.
  126. echo See %reportname% for the report.
  127. endlocal
  128. exit /b
Add Comment
Please, Sign In to add comment