-
Notifications
You must be signed in to change notification settings - Fork 21
Expand file tree
/
Copy path!rel.bat
More file actions
294 lines (264 loc) · 8.06 KB
/
!rel.bat
File metadata and controls
294 lines (264 loc) · 8.06 KB
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
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
@rem Settings
@call xsetup.bat
@rem Local unversioned setup that overrides the main one
@if exist ~setup_local.bat call ~setup_local.bat
@rem Rest things
@set /p VERSION=<VERSION.
@set PRONAME=Unicodia\Unicodia.pro
@set PRONAME_AB=AutoBuilder\AutoBuilder.pro
@set PRONAME_SC=SmartCopy\SmartCopy.pro
@set EXENAME=Unicodia.exe
@set ARCNAME=Unicodia-w64-%VERSION%.7z
@set BUILD=~Build-win64
@set BUILD_AB=~Build-AB-win64
@set BUILD_SC=~Build-SC-win64
@set DEPLOY=~Deploy
@set DEPLOY1=~Deployed
@set DEPLOY2=~Installer
@set SMARTCOPY=%BUILD_SC%\release\SmartCopy.exe
@set UCAUTO=UcAuto.cpp
@set UCLIB=UcAutoLib.cpp
@set UCCOUNT=UcAutoCount.h
@set UCSUTTON=UcAutoSutton.cpp
@set UCSCRIPT=UcAutoScripts.h
@set UCOLDCOMP=UcAutoOldComp.cpp
@set AB_UCAUTO=%BUILD_AB%/%UCAUTO%
@set AB_UCLIB=%BUILD_AB%/%UCLIB%
@set AB_UCCOUNT=%BUILD_AB%/%UCCOUNT%
@set AB_UCSUTTON=%BUILD_AB%/%UCSUTTON%
@set AB_UCSCRIPT=%BUILD_AB%/%UCSCRIPT%
@set AB_UCOLDCOMP=%BUILD_AB%/%UCOLDCOMP%
@path %MINGW%;%PATH%
@echo My version is %VERSION%
@echo.
@echo ===== Checking for tools =====
@if exist %SEVENZIP% goto sz_ok
@echo BAD: 7-zip not found. Install it into standard directory, or change SEVENZIP variable.
@goto end
:sz_ok
@echo 7-zip OK
@if exist %QTDIR%\bin\qmake.exe goto qt_ok
@echo BAD: Qmake not found. Install Qt, and set QTDIR variable.
@goto end
:qt_ok
@echo Qt OK
@if exist %MINGW%\g++.exe goto mingw_ok
@echo BAD: MinGW not found. Install it into standard MSYS directory.
@goto end
:mingw_ok
@echo MinGW OK
@if exist %UTRANSL% goto utransl_ok
@echo BAD: UTransCon not found.
@echo Build it manually from https://github.com/Mercury13/utranslator
@goto end
:utransl_ok
@echo UTranslator OK
@if exist %INNO% goto inno_ok
@echo BAD: Inno Setup not found. It’s a well-known free program.
@goto end
:inno_ok
@echo Inno Setup OK
@echo ===== Creating directories =====
@if exist %DEPLOY% del /S /Q %DEPLOY% >nul
@if exist %DEPLOY% rmdir /S /Q %DEPLOY% >nul
@if exist %DEPLOY2% del /S /Q %DEPLOY2% >nul
@if exist %DEPLOY2% rmdir /S /Q %DEPLOY2% >nul
@if not exist %DEPLOY% md %DEPLOY%
@if not exist %DEPLOY1% md %DEPLOY1%
@if not exist %DEPLOY2% md %DEPLOY2%
@if not exist %BUILD_AB% md %BUILD_AB%
@if not exist %BUILD_SC% md %BUILD_SC%
@if not exist %BUILD% md %BUILD%
@set EMOJIARC=Fonts\emoji.zip
@if exist %EMOJIARC% goto emoji_ok
@echo.
@echo ===== Building graphic emoji =====
@call xtape.bat
@if exist %EMOJIARC% goto emoji_ok
@echo Emoji archive %EMOJIARC% not found!
@goto end
:emoji_ok
@rem echo.
@rem echo ===== Pulling UTranslator =====
@rem cd utranslator
@rem git reset --hard
@rem git pull
@rem cd ..
@echo.
@echo ===== Building SmartCopy =====
@cd %BUILD_SC%
@%QTDIR%\bin\qmake.exe ..\%PRONAME_SC% -r -spec win32-g++ "CONFIG+=release"
@%MINGW%\mingw32-make.exe -f Makefile.Release -j%NUMBER_OF_PROCESSORS%
@cd ..
@echo.
@echo ===== Building AutoBuilder =====
@cd %BUILD_AB%
@%QTDIR%\bin\qmake.exe ..\%PRONAME_AB% -r -spec win32-g++ "CONFIG+=release"
@%MINGW%\mingw32-make.exe -f Makefile.Release -j%NUMBER_OF_PROCESSORS%
@echo.
@echo ===== Running AutoBuilder =====
@release\AutoBuilder.exe
@cd ..
@echo.
@echo ===== Checking for file existence =====
@if not exist %AB_UCAUTO% goto end
@if not exist %AB_UCLIB% goto end
@if not exist %AB_UCCOUNT% goto end
@if not exist %AB_UCSUTTON% goto end
@echo.
@echo ===== Running SmartCopy =====
@%SMARTCOPY% %AB_UCAUTO% Unicodia\Uc\%UCAUTO%
@%SMARTCOPY% %AB_UCLIB% Unicodia\Uc\%UCLIB%
@%SMARTCOPY% %AB_UCCOUNT% Unicodia\Uc\%UCCOUNT%
@%SMARTCOPY% %AB_UCSUTTON% Unicodia\Uc\%UCSUTTON%
@%SMARTCOPY% %AB_UCSCRIPT% Unicodia\Uc\%UCSCRIPT%
@%SMARTCOPY% %AB_UCOLDCOMP% Unicodia\Uc\%UCOLDCOMP%
@if errorlevel 1 goto end
@echo.
@echo ===== Building for Win64 =====
@cd %BUILD%
@%QTDIR%\bin\qmake.exe ..\%PRONAME% -r -spec win32-g++ "CONFIG+=release"
@%MINGW%\mingw32-make.exe -f Makefile.Release -j%NUMBER_OF_PROCESSORS%
@cd ..
@if exist %BUILD%\release\%EXENAME% goto exe_ok
@echo BAD: EXE NOT FOUND
@goto end
:exe_ok
@echo.
@echo ===== Copying files =====
@copy %BUILD%\release\%EXENAME% %DEPLOY%
@copy %MINGW%\libgcc_s_seh-1.dll %DEPLOY%
@copy "%MINGW%\libstdc++-6.dll" %DEPLOY%
@copy %MINGW%\libwinpthread-1.dll %DEPLOY%
@copy %MINGW%\libcrypto-3-x64.dll %DEPLOY%
@copy %MINGW%\libssl-3-x64.dll %DEPLOY%
@copy %QTDIR%\bin\Qt6Core.dll %DEPLOY%
@copy %QTDIR%\bin\Qt6Gui.dll %DEPLOY%
@copy %QTDIR%\bin\Qt6Widgets.dll %DEPLOY%
@copy %QTDIR%\bin\Qt6Svg.dll %DEPLOY%
@copy %QTDIR%\bin\Qt6SvgWidgets.dll %DEPLOY%
@copy MiscFiles\Unicodia.xml %DEPLOY%
@copy LICENSE %DEPLOY%
@rem Used! — need for toolbar icons
@md %DEPLOY%\iconengines
@copy %QTDIR%\plugins\iconengines\qsvgicon.dll %DEPLOY%\iconengines
@rem Unused right now, plain SVG loading does not need this
@rem md %DEPLOY%\imageformats
@rem copy %QTDIR%\plugins\imageformats\qsvg.dll %DEPLOY%\imageformats
@md %DEPLOY%\platforms
@copy %QTDIR%\plugins\platforms\qwindows.dll %DEPLOY%\platforms
@md %DEPLOY%\styles
@copy %QTDIR%\plugins\styles\qwindowsvistastyle.dll %DEPLOY%\styles
@md %DEPLOY%\Fonts
@copy Fonts\* %DEPLOY%\Fonts >nul
@copy MiscFiles\WinManifest\Resources.pri %DEPLOY%
@copy MiscFiles\WinManifest\Unicodia.VisualElementsManifest.xml %DEPLOY%
@md %DEPLOY%\Start
@md %DEPLOY%\Start\en-US
@copy MiscFiles\WinManifest\Root\Start\en-US\*.png %DEPLOY%\Start\en-US
@echo.
@echo ===== Building L10n =====
@md %DEPLOY%\Languages
@rem ...
@rem English, original
@set DIR_EN=%DEPLOY%\Languages\English
@md %DIR_EN%
@copy lang-src\en\locale.xml %DIR_EN%
@%UTRANSL% lang-src\en.uorig -build:%DIR_EN%
@rem no QM for English
@rem ...
@rem Chinese
@set DIR_ZH=%DEPLOY%\Languages\Chinese
@md %DIR_ZH%
@copy lang-src\zh\locale.xml %DIR_ZH%
@%UTRANSL% lang-src\zh.utran -update -build:%DIR_ZH%
@copy %QTDIR%\translations\qtbase_zh_CN.qm %DIR_ZH%
@rem ...
@rem Japanese
@set DIR_JA=%DEPLOY%\Languages\Japanese
@md %DIR_JA%
@copy lang-src\ja\locale.xml %DIR_JA%
@%UTRANSL% lang-src\ja.utran -update -build:%DIR_JA%
@copy %QTDIR%\translations\qtbase_ja.qm %DIR_JA%
@rem ...
@rem Russian, known
@set DIR_RU=%DEPLOY%\Languages\Russian
@md %DIR_RU%
@copy lang-src\ru\locale.xml %DIR_RU%
@%UTRANSL% lang-src\ru.utran -rqupdate -build:%DIR_RU%
@if errorlevel 1 goto end
@copy %QTDIR%\translations\qtbase_ru.qm %DIR_RU%
@rem ...
@rem Turkish
@set DIR_TR=%DEPLOY%\Languages\Turkish
@md %DIR_TR%
@copy lang-src\tr\locale.xml %DIR_TR%
@%UTRANSL% lang-src\tr.utran -update -build:%DIR_TR%
@copy %QTDIR%\translations\qtbase_tr.qm %DIR_TR%
@rem ...
@rem Ukrainian, known
@set DIR_UK=%DEPLOY%\Languages\Ukrainian
@md %DIR_UK%
@copy lang-src\uk\locale.xml %DIR_UK%
@%UTRANSL% lang-src\uk.utran -rqupdate -build:%DIR_UK%
@if errorlevel 1 goto end
@copy %QTDIR%\translations\qtbase_uk.qm %DIR_UK%
@echo.
@echo ===== Making simple archive =====
@set ARCPATH=%DEPLOY1%\%ARCNAME%
@set ARCPATH2=%DEPLOY2%\%ARCNAME%
@if exist %ARCPATH% del %ARCPATH%
@cd %DEPLOY%
@%SEVENZIP% a ..\%ARCPATH% * -mx9 -mmt%NUMBER_OF_PROCESSORS%
@cd ..
@copy %ARCPATH% %ARCPATH2%
@echo.
@echo ===== Making installer =====
@%INNO% /Qp /O%DEPLOY2% MiscFiles/Unicodia-w64.iss
@echo.
@echo ===== Copying USesh font =====
@copy Fonts\UnicodiaSesh.ttf %DEPLOY2%
@echo.
@echo ===== Copying W7/8 compat layer =====
@copy MiscFiles\Win7.8_Compatibility.7z %DEPLOY2%
@echo.
@echo ===== Running auto-tests =====
@set QAFONTS=%BUILD%\font_layout.txt
@set QAHTTP=%BUILD%\http_test.txt
@if exist %QAFONTS% del %QAFONTS%
@if exist %QAHTTP% del %QAHTTP%
@%DEPLOY%\Unicodia.exe /qafonts:%QAFONTS% /qahttp:%QAHTTP%
@rem Checking fonts
@if exist %QAFONTS% goto fqa_exists
@echo FONTS FAILED. No font QA file for some reason.
@echo It should have been at %QAFONTS%.
@goto fqa_done
:fqa_exists
@fc %QAFONTS% AutoQa\font_layout.txt >nul
@if not errorlevel 1 goto fqa_ok
@echo.
@echo FONTS FAILED. I use updated W10, different OS can fail.
@echo The new fonts' QA is %QAFONTS%.
@goto fqa_done
:fqa_ok
@echo Fonts OK
:fqa_done
@rem Checking HTTP
@if exist %QAHTTP% goto hqa_exists
@echo HTTP FAILED. No HTTP(s) QA file for some reason.
@echo It should have been at %QAHTTP%.
@goto hqa_done
:hqa_exists
@fc %QAHTTP% AutoQa\http_test.txt >nul
@if not errorlevel 1 goto hqa_ok
@echo.
@echo HTTP(s) FAILED, this is the new file
@type %QA_HTTP%
@echo .
@goto hqa_done
:hqa_ok
@echo HTTP(s) OK
:hqa_done
@echo.
:end
@pause