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