Install.bat 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172
  1. @echo off
  2. cls
  3. SET PACKAGENAME=the FreeRTOS port for fedC and wizC
  4. echo.
  5. echo Hello, I'm the installationscript for %PACKAGENAME%.
  6. echo.
  7. :CHECKFEDC
  8. set FED=C:\Program Files\FED\PIC_C
  9. echo.
  10. echo I'm checking your system for fedC
  11. if not exist "%FED%" goto NOFEDC
  12. echo YES, I found a fedC-installation!
  13. goto FOUNDFED
  14. :NOFEDC
  15. echo I could not find a fedC-installation.
  16. :CHECKWIZC
  17. set FED=C:\Program Files\FED\PIXIE
  18. echo.
  19. echo I'm checking your system for wizC
  20. if not exist "%FED%" goto NOWIZC
  21. echo YES, I found a wizC-installation!
  22. goto FOUNDFED
  23. :noWIZC
  24. echo I could not find a wizC-installation.
  25. :ERROR
  26. echo.
  27. echo.
  28. echo I could not find a FED C-compiler installation on your system.
  29. echo.
  30. echo Perhaps I got confused because you installed fedC or wizC in a non-default directory.
  31. echo If this is the case, please change the path at the top of this install-script.
  32. echo After that rerun the script and I will be happy to try again.
  33. echo.
  34. goto ENDIT
  35. :FOUNDFED
  36. echo.
  37. echo.
  38. set FEDLIBS=%FED%\Libs
  39. set FEDLIBSUSER=%FEDLIBS%\LibsUser
  40. if exist "%FEDLIBS%" goto INSTALL
  41. echo The FED installationdirectory "%FED%"
  42. echo contains no Libs subdirectory. This is weird!
  43. echo.
  44. echo Installation is aborted, sorry...
  45. goto ENDIT
  46. :INSTALL
  47. echo I am about to install %PACKAGENAME%
  48. echo into directory %FEDLIBSUSER%
  49. echo.
  50. echo Press 'enter' to let me do my thing
  51. echo Press 'ctrl-c' to stop me
  52. pause >nul
  53. echo.
  54. echo Installing...
  55. :RESET_READONLY
  56. echo.
  57. echo Removing ReadOnly attributes
  58. attrib -R "%FEDLIBSUSER%\libFreeRTOS\Modules\Croutine.c" >nul
  59. attrib -R "%FEDLIBSUSER%\libFreeRTOS\Modules\Port.c" >nul
  60. attrib -R "%FEDLIBSUSER%\libFreeRTOS\Modules\List.c" >nul
  61. attrib -R "%FEDLIBSUSER%\libFreeRTOS\Modules\Queue.c" >nul
  62. attrib -R "%FEDLIBSUSER%\libFreeRTOS\Modules\Tasks.c" >nul
  63. attrib -R "%FEDLIBSUSER%\libFreeRTOS\Drivers\Tick\Tick.c" >nul
  64. attrib -R "%FEDLIBSUSER%\libFreeRTOS\Drivers\Tick\isrTick.c" >nul
  65. attrib -R "%FEDLIBSUSER%\libFreeRTOS\Include\Portmacro.h" >nul
  66. attrib -R "%FEDLIBSUSER%\libFreeRTOS\Include\Croutine.h" >nul
  67. attrib -R "%FEDLIBSUSER%\libFreeRTOS\Include\List.h" >nul
  68. attrib -R "%FEDLIBSUSER%\libFreeRTOS\Include\Portable.h" >nul
  69. attrib -R "%FEDLIBSUSER%\libFreeRTOS\Include\Projdefs.h" >nul
  70. attrib -R "%FEDLIBSUSER%\libFreeRTOS\Include\Queue.h" >nul
  71. attrib -R "%FEDLIBSUSER%\libFreeRTOS\Include\Semphr.h" >nul
  72. attrib -R "%FEDLIBSUSER%\libFreeRTOS\Include\Task.h" >nul
  73. attrib -R "%FEDLIBSUSER%\FreeRTOS.h" >nul
  74. echo Done
  75. :CREATE_DIRECTORIES
  76. echo.
  77. echo Creating directories (if necessary)...
  78. if not exist "%FEDLIBSUSER%" mkdir "%FEDLIBSUSER%"
  79. if not exist "%FEDLIBSUSER%\libFreeRTOS" mkdir "%FEDLIBSUSER%\libFreeRTOS"
  80. if not exist "%FEDLIBSUSER%\libFreeRTOS\Drivers" mkdir "%FEDLIBSUSER%\libFreeRTOS\Drivers"
  81. if not exist "%FEDLIBSUSER%\libFreeRTOS\Drivers\Tick" mkdir "%FEDLIBSUSER%\libFreeRTOS\Drivers\Tick"
  82. if not exist "%FEDLIBSUSER%\libFreeRTOS\Include" mkdir "%FEDLIBSUSER%\libFreeRTOS\Include"
  83. if not exist "%FEDLIBSUSER%\libFreeRTOS\Modules" mkdir "%FEDLIBSUSER%\libFreeRTOS\Modules"
  84. echo Done
  85. echo.
  86. echo Copying Files...
  87. :COPY_MODULES
  88. echo Modules...
  89. copy /V /Y "Port.c" "%FEDLIBSUSER%\libFreeRTOS\Modules\Port.c" >nul
  90. copy /V /Y "..\..\..\Croutine.c" "%FEDLIBSUSER%\libFreeRTOS\Modules\Croutine.c" >nul
  91. copy /V /Y "..\..\..\List.c" "%FEDLIBSUSER%\libFreeRTOS\Modules\List.c" >nul
  92. copy /V /Y "..\..\..\Queue.c" "%FEDLIBSUSER%\libFreeRTOS\Modules\Queue.c" >nul
  93. copy /V /Y "..\..\..\Tasks.c" "%FEDLIBSUSER%\libFreeRTOS\Modules\Tasks.c" >nul
  94. :COPY_DRIVERS
  95. echo Drivers...
  96. copy /V /Y "Drivers\Tick\Tick.c" "%FEDLIBSUSER%\libFreeRTOS\Drivers\Tick\Tick.c" >nul
  97. copy /V /Y "Drivers\Tick\isrTick.c" "%FEDLIBSUSER%\libFreeRTOS\Drivers\Tick\isrTick.c" >nul
  98. :COPY_HEADERS
  99. echo Headers...
  100. copy /V /Y "portmacro.h" "%FEDLIBSUSER%\libFreeRTOS\Include\Portmacro.h" >nul
  101. copy /V /Y "..\..\..\include\Croutine.h" "%FEDLIBSUSER%\libFreeRTOS\Include\Croutine.h" >nul
  102. copy /V /Y "..\..\..\include\List.h" "%FEDLIBSUSER%\libFreeRTOS\Include\List.h" >nul
  103. copy /V /Y "..\..\..\include\Portable.h" "%FEDLIBSUSER%\libFreeRTOS\Include\Portable.h" >nul
  104. copy /V /Y "..\..\..\include\Projdefs.h" "%FEDLIBSUSER%\libFreeRTOS\Include\Projdefs.h" >nul
  105. copy /V /Y "..\..\..\include\Queue.h" "%FEDLIBSUSER%\libFreeRTOS\Include\Queue.h" >nul
  106. copy /V /Y "..\..\..\include\Semphr.h" "%FEDLIBSUSER%\libFreeRTOS\Include\Semphr.h" >nul
  107. copy /V /Y "..\..\..\include\Task.h" "%FEDLIBSUSER%\libFreeRTOS\Include\Task.h" >nul
  108. copy /V /Y "addFreeRTOS.h" + "..\..\..\include\FreeRTOS.h" "%FEDLIBSUSER%\FreeRTOS.h" >nul
  109. echo Done
  110. :SET_READONLY
  111. echo.
  112. echo Setting files to ReadOnly
  113. attrib +R "%FEDLIBSUSER%\libFreeRTOS\Modules\Port.c" >nul
  114. attrib +R "%FEDLIBSUSER%\libFreeRTOS\Modules\Croutine.c" >nul
  115. attrib +R "%FEDLIBSUSER%\libFreeRTOS\Modules\List.c" >nul
  116. attrib +R "%FEDLIBSUSER%\libFreeRTOS\Modules\Queue.c" >nul
  117. attrib +R "%FEDLIBSUSER%\libFreeRTOS\Modules\Tasks.c" >nul
  118. attrib +R "%FEDLIBSUSER%\libFreeRTOS\Drivers\Tick\Tick.c" >nul
  119. attrib +R "%FEDLIBSUSER%\libFreeRTOS\Drivers\Tick\isrTick.c" >nul
  120. attrib +R "%FEDLIBSUSER%\libFreeRTOS\Include\Portmacro.h" >nul
  121. attrib +R "%FEDLIBSUSER%\libFreeRTOS\Include\Croutine.h" >nul
  122. attrib +R "%FEDLIBSUSER%\libFreeRTOS\Include\List.h" >nul
  123. attrib +R "%FEDLIBSUSER%\libFreeRTOS\Include\Portable.h" >nul
  124. attrib +R "%FEDLIBSUSER%\libFreeRTOS\Include\Projdefs.h" >nul
  125. attrib +R "%FEDLIBSUSER%\libFreeRTOS\Include\Queue.h" >nul
  126. attrib +R "%FEDLIBSUSER%\libFreeRTOS\Include\Semphr.h" >nul
  127. attrib +R "%FEDLIBSUSER%\libFreeRTOS\Include\Task.h" >nul
  128. attrib +R "%FEDLIBSUSER%\FreeRTOS.h" >nul
  129. echo Done
  130. :FINISHED
  131. echo.
  132. echo The installation of %PACKAGENAME% is completed.
  133. echo.
  134. echo Please review the installation instructions as additional libraries
  135. echo and fedC/wizC configuration settings may be needed for FreeRTOS
  136. echo to function correctly.
  137. goto ENDIT
  138. :ENDIT
  139. echo.
  140. echo.
  141. echo Press 'enter' to close this window
  142. pause >nul