-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathbuild.cmd
184 lines (152 loc) · 11.6 KB
/
build.cmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
@Echo Off
Rem Map build cmd-file generated by mapbuilder on 1-4-2022 16:41:38
Rem Output of this cmd-file will be written to the log-file: C:\Garmin\Temp\8801 - JBM - Interlaken\build.log
Rem --------------------------------------------------------------------------------
ECHO # Start %date% %Time:~0,-3% executing cmd-file [C:\Garmin\Temp\8801 - JBM - Interlaken\build.cmd]
ECHO # ----------------------------------------------------------------------------------------------------------------------
Echo.
ECHO # Start %date% %Time:~0,-3% executing cmd-file [C:\Garmin\Temp\8801 - JBM - Interlaken\build.cmd]>"C:\Garmin\Temp\8801 - JBM - Interlaken\build.log"
ECHO # ---------------------------------------------------------------------------------------------------------------------->>"C:\Garmin\Temp\8801 - JBM - Interlaken\build.log"
Rem Clear previous splitter output-folder
Del /q "C:\Garmin\Temp\8801 - JBM - Interlaken\Output Splitter\*.*"
Rem Execute splitter on C:\Garmin\Sources\Geofabrik\switzerland-latest.osm.pbf
Echo # %Time:~0,-3% Execute splitter on C:\Garmin\Sources\Geofabrik\switzerland-latest.osm.pbf>>"C:\Garmin\Temp\8801 - JBM - Interlaken\build.log"
Echo # %Time:~0,-3% Execute splitter on C:\Garmin\Sources\Geofabrik\switzerland-latest.osm.pbf
Java -Xmx26000m -jar "C:\Data\Dropbox\Garmin\Software\splitter-r645\splitter.jar" --output-dir="C:\Garmin\Temp\8801 - JBM - Interlaken\Output Splitter" --max-nodes=2400000 --mapid=88010001 --geonames-file=C:\Garmin\Sources\cities15000.zip --write-kml="C:\Garmin\Temp\8801 - JBM - Interlaken\Output Splitter\splitter.kml" --polygon-file="C:\Garmin\Temp\8801 - JBM - Interlaken\splitter.poly" "C:\Garmin\Sources\Geofabrik\switzerland-latest.osm.pbf" > "C:\Garmin\Temp\8801 - JBM - Interlaken\splitter.log"
If Not [%ErrorLevel%]==[0] Goto LBL_ERROR_SPLITTER
Rem Register splitter datestamp
Echo # %Time:~0,-3% Register splitter datestamp>>"C:\Garmin\Temp\8801 - JBM - Interlaken\build.log"
Echo # %Time:~0,-3% Register splitter datestamp
Echo "C:\Garmin\Sources\Geofabrik\switzerland-latest.osm.pbf">"C:\Garmin\Temp\8801 - JBM - Interlaken\Output Splitter\20220401.dat"
Rem Clear map-output folder C:\Garmin\Temp\8801 - JBM - Interlaken\Output Map\
Echo # %Time:~0,-3% Clear map-output folder C:\Garmin\Temp\8801 - JBM - Interlaken\Output Map\>>"C:\Garmin\Temp\8801 - JBM - Interlaken\build.log"
Echo # %Time:~0,-3% Clear map-output folder C:\Garmin\Temp\8801 - JBM - Interlaken\Output Map\
Del /q "C:\Garmin\Temp\8801 - JBM - Interlaken\Output Map\*.*" >NUL
Rem Create typ-file from C:\Data\Dropbox\Garmin\Build\Typ\jbm.txt
Echo # %Time:~0,-3% Create typ-file from C:\Data\Dropbox\Garmin\Build\Typ\jbm.txt>>"C:\Garmin\Temp\8801 - JBM - Interlaken\build.log"
Echo # %Time:~0,-3% Create typ-file from C:\Data\Dropbox\Garmin\Build\Typ\jbm.txt
Java -jar "C:\Data\Dropbox\Garmin\Software\mkgmap-r4897\mkgmap.jar" --output-dir="C:\Garmin\Temp\8801 - JBM - Interlaken\Output Map" --family-id=8801 --code-page=65001 "C:\Data\Dropbox\Garmin\Build\Typ\jbm.txt">>"C:\Garmin\Temp\8801 - JBM - Interlaken\build.log"
If Not [%ErrorLevel%]==[0] Goto LBL_ERROR_MKGMAP_TYP
Echo # %Time:~0,-3% Options:jbmoptiondebug=info;jbmoptionpersonal=true;jbmoptionfixme=false;jbmoptionbicycle=false;jbmoptionhiking=false
Rem Log mkgmap versionnumber
Echo # %Time:~0,-3% Log mkgmap versionnumber>>"C:\Garmin\Temp\8801 - JBM - Interlaken\build.log"
Echo # %Time:~0,-3% Log mkgmap versionnumber
Java -jar "C:\Data\Dropbox\Garmin\Software\mkgmap-r4897\mkgmap.jar" --version 2>>"C:\Garmin\Temp\8801 - JBM - Interlaken\build.log" > NUL
If Not [%ErrorLevel%]==[0] Goto LBL_ERROR_MKGMAP_VERSION
Rem Execute mkgmap
Echo # %Time:~0,-3% Execute mkgmap>>"C:\Garmin\Temp\8801 - JBM - Interlaken\build.log"
Echo # %Time:~0,-3% Execute mkgmap
Java -Xmx26000m -jar "C:\Data\Dropbox\Garmin\Software\mkgmap-r4897\mkgmap.jar" --output-dir="C:\Garmin\Temp\8801 - JBM - Interlaken\Output Map" --read-config="C:\Garmin\Temp\8801 - JBM - Interlaken\mkgmap.args" --read-config="C:\Data\Dropbox\Garmin\Build\Style - Jbm - Test\config.skipmdrindex" --description="JBM - Interlaken (1-4-2022 16u41)" --read-config="C:\Garmin\Temp\8801 - JBM - Interlaken\Output Splitter\template.args" "C:\Garmin\Temp\8801 - JBM - Interlaken\Output Map\jbm.typ" 1>>"C:\Garmin\Temp\8801 - JBM - Interlaken\build.log" 2>"C:\Garmin\Temp\8801 - JBM - Interlaken\mkgmap.debug"
If Not [%ErrorLevel%]==[0] Goto LBL_ERROR_MKGMAP
Rem Copy gmapsupp to final destination folder
Echo # %Time:~0,-3% Copy gmapsupp to final destination folder>>"C:\Garmin\Temp\8801 - JBM - Interlaken\build.log"
Echo # %Time:~0,-3% Copy gmapsupp to final destination folder
Move /y "C:\Garmin\Temp\8801 - JBM - Interlaken\Output Map\gmapsupp.img" "C:\Garmin\Install\Jbm\JBM - Interlaken.img" >NUL
If Not [%ErrorLevel%]==[0] Goto LBL_ERROR_COPY_GMAPSUPP
Rem Copy build sources and logfiles
Echo # %Time:~0,-3% Copy build sources and logfiles>>"C:\Garmin\Temp\8801 - JBM - Interlaken\build.log"
Echo # %Time:~0,-3% Copy build sources and logfiles
Copy /y "C:\Garmin\Temp\8801 - JBM - Interlaken\mkgmap.style.zip" "C:\Garmin\Temp\8801 - JBM - Interlaken\Output Map\" >NUL
Copy /y "C:\Garmin\Temp\8801 - JBM - Interlaken\mkgmap.args" "C:\Garmin\Temp\8801 - JBM - Interlaken\Output Map\" >NUL
Copy /y "C:\Garmin\Temp\8801 - JBM - Interlaken\validation.log" "C:\Garmin\Temp\8801 - JBM - Interlaken\Output Map\" >NUL
Copy /y "C:\Garmin\Temp\8801 - JBM - Interlaken\build.log" "C:\Garmin\Temp\8801 - JBM - Interlaken\Output Map\" >NUL
If Not [%ErrorLevel%]==[0] Goto LBL_ERROR_COPY_SOURCES
Rem Create nsis installer
Echo # %Time:~0,-3% Create nsis installer>>"C:\Garmin\Temp\8801 - JBM - Interlaken\build.log"
Echo # %Time:~0,-3% Create nsis installer
"c:\Program Files (x86)\NSIS\makensis.exe" "C:\Garmin\Temp\8801 - JBM - Interlaken\Output Map\osmmap.nsi">>"C:\Garmin\Temp\8801 - JBM - Interlaken\build.log" 2>&1
If Not [%ErrorLevel%]==[0] Goto LBL_ERROR_CREATE_NSIS
Rem Move installer to final destination
Echo # %Time:~0,-3% Move installer to final destination>>"C:\Garmin\Temp\8801 - JBM - Interlaken\build.log"
Echo # %Time:~0,-3% Move installer to final destination
Move /y "C:\Garmin\Temp\8801 - JBM - Interlaken\Output Map\JBM - Interlaken.exe" "C:\Garmin\Install\Jbm\" >NUL
If Not [%ErrorLevel%]==[0] Goto LBL_ERROR_COPY_INSTALLER
Rem Kill basecamp if still running prior to installation
Echo # %Time:~0,-3% Kill basecamp if still running prior to installation>>"C:\Garmin\Temp\8801 - JBM - Interlaken\build.log"
Echo # %Time:~0,-3% Kill basecamp if still running prior to installation
tasklist /FI "IMAGENAME eq BaseCamp.exe" 2>NUL | find /I /N "BaseCamp.exe">NUL
IF [%ERRORLEVEL%]==[1] Goto LBL_BASECAMP_NOTRUNNING
taskkill /f /im BaseCamp.exe > NUL
TIMEOUT /T 2 > NUL
GOTO LBL_BASECAMP_END
:LBL_BASECAMP_NOTRUNNING
Set ERRORLEVEL=
:LBL_BASECAMP_END
If Not [%ErrorLevel%]==[0] Goto LBL_ERROR_KILLBASECAMP
Rem Execute full installer
Echo # %Time:~0,-3% Execute full installer>>"C:\Garmin\Temp\8801 - JBM - Interlaken\build.log"
Echo # %Time:~0,-3% Execute full installer
"C:\Garmin\Install\Jbm\JBM - Interlaken.exe" /S
If Not [%ErrorLevel%]==[0] Goto LBL_ERROR_EXECUTE_INSTALLER
Rem Clear map-output folder C:\Garmin\Temp\8801 - JBM - Interlaken\Output Map\
Echo # %Time:~0,-3% Clear map-output folder C:\Garmin\Temp\8801 - JBM - Interlaken\Output Map\>>"C:\Garmin\Temp\8801 - JBM - Interlaken\build.log"
Echo # %Time:~0,-3% Clear map-output folder C:\Garmin\Temp\8801 - JBM - Interlaken\Output Map\
Del /q "C:\Garmin\Temp\8801 - JBM - Interlaken\Output Map\*.*" >NUL
Rem Clear basecamp tile-cache
Echo # %Time:~0,-3% Clear basecamp tile-cache>>"C:\Garmin\Temp\8801 - JBM - Interlaken\build.log"
Echo # %Time:~0,-3% Clear basecamp tile-cache
IF EXIST "%userprofile%\AppData\Local\Garmin\BaseCamp\TileCache\*.tile" (Del /q "%userprofile%\AppData\Local\Garmin\BaseCamp\TileCache\*.tile") >NUL
If Not [%ErrorLevel%]==[0] Goto LBL_ERROR_CLEARTILECACHE
Rem Finished succesfully
Goto LBL_SUCCES
:LBL_ERROR_SPLITTER
Echo # %Time:~0,-3% Error while executing splitter, see splitter.log for details
Echo # %Time:~0,-3% Error while executing splitter, see splitter.log for details>>"C:\Garmin\Temp\8801 - JBM - Interlaken\build.log"
Goto LBL_END
:LBL_ERROR_MKGMAP_VERSION
Echo # %Time:~0,-3% Error while logging mkgmap version number prior to execution, see mkgmap.debug and build.log for details
Echo # %Time:~0,-3% Error while logging mkgmap version number prior to execution, see mkgmap.debug and build.log for details>>"C:\Garmin\Temp\8801 - JBM - Interlaken\build.log"
Goto LBL_END
:LBL_ERROR_MKGMAP
Echo # %Time:~0,-3% Error while executing mkgmap, see mkgmap.debug and build.log for details
Echo # %Time:~0,-3% Error while executing mkgmap, see mkgmap.debug and build.log for details>>"C:\Garmin\Temp\8801 - JBM - Interlaken\build.log"
Goto LBL_END
:LBL_ERROR_MKGMAP_TYP
Echo # %Time:~0,-3% Error while creating typ-file with mkgmap, see mkgmap.debug and build.log for details
Echo # %Time:~0,-3% Error while creating typ-file with mkgmap, see mkgmap.debug and build.log for details>>"C:\Garmin\Temp\8801 - JBM - Interlaken\build.log"
Goto LBL_END
:LBL_ERROR_CREATE_NSIS
Echo # %Time:~0,-3% Error while creating nsis installer exe, see build.log for details
Echo # %Time:~0,-3% Error while creating nsis installer exe, see build.log for details>>"C:\Garmin\Temp\8801 - JBM - Interlaken\build.log"
Goto LBL_END
:LBL_ERROR_KILLBASECAMP
Echo # %Time:~0,-3% Error while testing for running or killing basecamp prior to installation, see build.log for details
Echo # %Time:~0,-3% Error while testing for running or killing basecamp prior to installation, see build.log for details>>"C:\Garmin\Temp\8801 - JBM - Interlaken\build.log"
Goto LBL_END
:LBL_ERROR_COPY_SOURCES
Echo # %Time:~0,-3% Error while copying source build files, see build.log for details
Echo # %Time:~0,-3% Error while copying source build files, see build.log for details>>"C:\Garmin\Temp\8801 - JBM - Interlaken\build.log"
Goto LBL_END
:LBL_ERROR_CREATE_ZIP
Echo # %Time:~0,-3% Error while creating zip, see build.log for details
Echo # %Time:~0,-3% Error while creating zip, see build.log for details>>"C:\Garmin\Temp\8801 - JBM - Interlaken\build.log"
Goto LBL_END
:LBL_ERROR_COPY_INSTALLER
Echo # %Time:~0,-3% Error while copying installer exe, see build.log for details
Echo # %Time:~0,-3% Error while copying installer exe, see build.log for details>>"C:\Garmin\Temp\8801 - JBM - Interlaken\build.log"
Goto LBL_END
:LBL_ERROR_COPY_GMAPSUPP
Echo # %Time:~0,-3% Error while copying gmapsupp.img, see build.log for details
Echo # %Time:~0,-3% Error while copying gmapsupp.img, see build.log for details>>"C:\Garmin\Temp\8801 - JBM - Interlaken\build.log"
Goto LBL_END
:LBL_ERROR_COPY_OUTPUTMAP
Echo # %Time:~0,-3% Error while copying output map files, see build.log for details
Echo # %Time:~0,-3% Error while copying output map files, see build.log for details>>"C:\Garmin\Temp\8801 - JBM - Interlaken\build.log"
Goto LBL_END
:LBL_ERROR_EXECUTE_INSTALLER
Echo # %Time:~0,-3% Error while executing installer exe, see build.log for details
Echo # %Time:~0,-3% Error while executing installer exe, see build.log for details>>"C:\Garmin\Temp\8801 - JBM - Interlaken\build.log"
Goto LBL_END
:LBL_ERROR_CLEARTILECACHE
Echo # %Time:~0,-3% Error while clearing basecamp tile-cache, see build.log for details
Echo # %Time:~0,-3% Error while clearing basecamp tile-cache, see build.log for details>>"C:\Garmin\Temp\8801 - JBM - Interlaken\build.log"
Goto LBL_END
Rem The end
:LBL_SUCCES
Echo # %Time:~0,-3% Succesfully executed build.cmd, see validation.log and build.log for details
Echo # %Time:~0,-3% Succesfully executed build.cmd, see validation.log and build.log for details>>"C:\Garmin\Temp\8801 - JBM - Interlaken\build.log"
Goto LBL_END
:LBL_END
Echo.
Echo # Pause debug parameter is set, press any key to finish
Pause >NUL