forked from mysql/mysql-workbench
-
Notifications
You must be signed in to change notification settings - Fork 0
/
PrepareOutputDir.cmd
executable file
·294 lines (225 loc) · 14 KB
/
PrepareOutputDir.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
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
@echo off
rem -------------------------------------------------------------------------------
rem Check parameter
if [%1] == [] goto Usage
if [%2] == [] goto Usage
if [%3] == [] goto Usage
rem -------------------------------------------------------------------------------
rem Script start
echo Preparing output directory...
rem -------------------------------------------------------------------------------
rem Set directory variables
set LIBRARY_DIR=%1library
echo Library directory: %LIBRARY_DIR%
set RES_DIR=%1res
echo Resources directory: %RES_DIR%
set IMAGES_DIR=%1images
echo Images directory: %IMAGES_DIR%
set SCRIPTS_DIR=%1scripts
echo Scripts directory: %SCRIPTS_DIR%
if %2 == Debug ( set ADDITIONAL_LIBFOLDER=debug\)
set EXT_LIB_DIR=%WB_3DPARTY_PATH%\%ADDITIONAL_LIBFOLDER%Lib
echo Windows resource directory: %EXT_LIB_DIR%
set EXT_BIN_DIR=%WB_3DPARTY_PATH%\bin
echo External binary directory: %EXT_BIN_DIR%
set TARGET_DIR=%1bin\%3\%2
echo Target directory: %TARGET_DIR%
set PYTHON_COMMON_DIR=%WB_3DPARTY_PATH%\Python\lib
echo Python common library directory: %PYTHON_COMMON_DIR%
set PYTHON_DIR=%WB_3DPARTY_PATH%\Python
echo Python directory: %PYTHON_DIR%
set PYTHON_LIB_DIR=%WB_3DPARTY_PATH%\Python\Libs
echo Python library directory: %PYTHON_LIB_DIR%
set PYTHON_DLLS_DIR=%WB_3DPARTY_PATH%\Python\Dlls
echo Python dlls directory: %PYTHON_DLLS_DIR%
rem -------------------------------------------------------------------------------
rem Copy the files to the target directory
echo Copy Struct files ...
if not exist %TARGET_DIR%\structs mkdir %TARGET_DIR%\structs
xcopy /i /s /y /d %RES_DIR%\grt\structs*.xml %TARGET_DIR%\structs\. 1> nul 2> nul
echo Copy image files ...
if not exist %TARGET_DIR%\images\grt\structs mkdir %TARGET_DIR%\images\grt\structs
if not exist %TARGET_DIR%\images\icons mkdir %TARGET_DIR%\images\icons
if not exist %TARGET_DIR%\images\cursors mkdir %TARGET_DIR%\images\cursors
if not exist %TARGET_DIR%\images\ui mkdir %TARGET_DIR%\images\ui
if not exist %TARGET_DIR%\images\home mkdir %TARGET_DIR%\images\home
if not exist %TARGET_DIR%\images\sql mkdir %TARGET_DIR%\images\sql
xcopy /i /s /y /d %IMAGES_DIR%\grt\*.png %TARGET_DIR%\images\grt\. 1> nul 2> nul
xcopy /i /s /y /d %IMAGES_DIR%\grt\structs\*.png %TARGET_DIR%\images\grt\structs\. 1> nul 2> nul
xcopy /i /y /d %IMAGES_DIR%\icons\*.png %TARGET_DIR%\images\icons\. 1> nul 2> nul
xcopy /i /s /y /d %IMAGES_DIR%\toolbar\*.png %TARGET_DIR%\images\icons\. 1> nul 2> nul
xcopy /i /s /y /d %IMAGES_DIR%\changeset\*.png %TARGET_DIR%\images\icons\. 1> nul 2> nul
xcopy /i /s /y /d %IMAGES_DIR%\admin\*.png %TARGET_DIR%\images\icons\. 1> nul 2> nul
xcopy /i /s /y /d %IMAGES_DIR%\migration\*.png %TARGET_DIR%\images\icons\. 1> nul 2> nul
xcopy /i /s /y /d %IMAGES_DIR%\cursors\*.png %TARGET_DIR%\images\cursors\. 1> nul 2> nul
xcopy /i /s /y /d %IMAGES_DIR%\icons\MySQLWorkbench.ico %TARGET_DIR%\images\icons\. 1> nul 2> nul
xcopy /i /s /y /d %IMAGES_DIR%\icons\MySQLWorkbenchDoc.ico %TARGET_DIR%\. 1> nul 2> nul
xcopy /i /s /y /d %IMAGES_DIR%\ui\*.png %TARGET_DIR%\images\ui\. 1> nul 2> nul
xcopy /i /s /y /d %IMAGES_DIR%\ui\*.xpm %TARGET_DIR%\images\ui\. 1> nul 2> nul
xcopy /i /s /y /d %IMAGES_DIR%\home\*.png %TARGET_DIR%\images\home\. 1> nul 2> nul
xcopy /i /s /y /d %IMAGES_DIR%\sql\*.png %TARGET_DIR%\images\sql\. 1> nul 2> nul
echo Copy Resource files ..
if not exist %TARGET_DIR%\data mkdir %TARGET_DIR%\data
xcopy /i /s /y /d %RES_DIR%\grtdata\*.xml %TARGET_DIR%\data\. 1> nul 2> nul
xcopy /i /s /y /d %RES_DIR%\wbdata\*.xml %TARGET_DIR%\data\. 1> nul 2> nul
xcopy /i /s /y /d %RES_DIR%\wbdata\data.db %TARGET_DIR%\data\. 1> nul 2> nul
if not exist %TARGET_DIR%\mysql.profiles mkdir %TARGET_DIR%\mysql.profiles
copy %RES_DIR%\mysql.profiles\*.xml %TARGET_DIR%\mysql.profiles\. 1> nul 2> nul
if not exist %TARGET_DIR%\snippets mkdir %TARGET_DIR%\snippets
copy %RES_DIR%\snippets\*.txt %TARGET_DIR%\snippets\. 1> nul 2> nul
if not exist %TARGET_DIR%\script_templates mkdir %TARGET_DIR%\script_templates
copy %RES_DIR%\scripts\script_templates\*.txt %TARGET_DIR%\script_templates\. 1> nul 2> nul
if not exist %TARGET_DIR%\sys mkdir %TARGET_DIR%\sys
xcopy /i /s /y /d %RES_DIR%\scripts\sys %TARGET_DIR%\sys 1> nul 2> nul
echo Copy Scripting Libraries...
xcopy /i /s /y /d %RES_DIR%\scripts\vbs\*.vbs %TARGET_DIR%\
xcopy /i /s /y /d %RES_DIR%\scripts\python\*.py %TARGET_DIR%\
xcopy /i /s /y /d %RES_DIR%\scripts\snippets\shell_snippets.* %TARGET_DIR%\
xcopy /i /s /y /d %LIBRARY_DIR%\sshtunnel\sshtunnel.py %TARGET_DIR%\
xcopy /i /s /y /d %RES_DIR%\scripts\shell\*.vbs %TARGET_DIR%\
if not exist %TARGET_DIR%\firewall\ mkdir %TARGET_DIR%\firewall
xcopy /i /s /y /d %RES_DIR%\scripts\firewall\* %TARGET_DIR%\firewall 1> nul 2> nul
echo Copy python workbench files
if not exist %TARGET_DIR%\workbench mkdir %TARGET_DIR%\workbench
xcopy /i /s /y /d %LIBRARY_DIR%\python\workbench\*.py %TARGET_DIR%\workbench
echo Copy python/mforms
xcopy /i /s /y /d %LIBRARY_DIR%\forms\swig\mforms.py %TARGET_DIR%\
xcopy /i /s /y /d %LIBRARY_DIR%\forms\swig\cairo.py %TARGET_DIR%\
echo Copy executables ...
xcopy /i /s /y /d %EXT_BIN_DIR%\mysqldump.exe %TARGET_DIR%\.
xcopy /i /s /y /d %EXT_BIN_DIR%\mysql.exe %TARGET_DIR%\.
xcopy /i /s /y /d %EXT_BIN_DIR%\ogrinfo.exe %TARGET_DIR%\.
xcopy /i /s /y /d %EXT_BIN_DIR%\ogr2ogr.exe %TARGET_DIR%\.
rem Do not remove
rem Python executable needed by MSI Custom Action (to precompile Python files) and maybe some externally executed scripts...
rem xcopy /i /s /y /d %EXT_BIN_DIR%\python*.exe %TARGET_DIR%\.
if %2 == Debug ( set DEBUG_PREFIX=_d)
if not %2 == Debug ( set EXCLUDE_CMD=/xf *_d.* )
robocopy %PYTHON_DIR% %TARGET_DIR% python37%DEBUG_PREFIX%.dll %EXCLUDE_CMD%
robocopy %PYTHON_DIR% %TARGET_DIR% python%DEBUG_PREFIX%.exe %EXCLUDE_CMD%
robocopy %PYTHON_DIR% %TARGET_DIR%\python\site-packages pyodbc*%DEBUG_PREFIX%.pyd %EXCLUDE_CMD%
rem =========== Python ============================
echo * Python libraries ...
if not exist %TARGET_DIR%\python mkdir %TARGET_DIR%\python 1> nul 2> nul
if not exist %TARGET_DIR%\python\lib mkdir %TARGET_DIR%\python\lib 1> nul 2> nul
if not exist %TARGET_DIR%\python\DLLs mkdir %TARGET_DIR%\python\DLLs 1> nul 2> nul
if not exist %TARGET_DIR%\python\site-packages mkdir %TARGET_DIR%\python\site-packages 1> nul 2> nul
rem the shared python files
xcopy /i /y /d %PYTHON_COMMON_DIR%\*.py %TARGET_DIR%\python\lib 1> nul 2> nul
xcopy /i /s /y /d %PYTHON_COMMON_DIR%\multiprocessing %TARGET_DIR%\python\lib\multiprocessing 1> nul 2> nul
xcopy /i /s /y /d %PYTHON_COMMON_DIR%\email %TARGET_DIR%\python\lib\email 1> nul 2> nul
xcopy /i /s /y /d %PYTHON_COMMON_DIR%\encodings %TARGET_DIR%\python\lib\encodings 1> nul 2> nul
xcopy /i /s /y /d %PYTHON_COMMON_DIR%\logging %TARGET_DIR%\python\lib\logging 1> nul 2> nul
xcopy /i /s /y /d %PYTHON_COMMON_DIR%\json %TARGET_DIR%\python\lib\json 1> nul 2> nul
xcopy /i /s /y /d %PYTHON_COMMON_DIR%\collections %TARGET_DIR%\python\lib\collections 1> nul 2> nul
xcopy /i /s /y /d %PYTHON_COMMON_DIR%\sqlite3 %TARGET_DIR%\python\lib\sqlite3 1> nul 2> nul
xcopy /i /s /y /d %PYTHON_COMMON_DIR%\xml %TARGET_DIR%\python\lib\xml 1> nul 2> nul
xcopy /i /s /y /d %PYTHON_COMMON_DIR%\importlib %TARGET_DIR%\python\lib\importlib 1> nul 2> nul
xcopy /i /s /y /d %PYTHON_COMMON_DIR%\asyncio %TARGET_DIR%\python\lib\asyncio 1> nul 2> nul
xcopy /i /s /y /d %PYTHON_COMMON_DIR%\concurrent %TARGET_DIR%\python\lib\concurrent 1> nul 2> nul
xcopy /i /s /y /d %PYTHON_COMMON_DIR%\ctypes %TARGET_DIR%\python\lib\ctypes 1> nul 2> nul
xcopy /i /s /y /d %PYTHON_COMMON_DIR%\curses %TARGET_DIR%\python\lib\curses 1> nul 2> nul
xcopy /i /s /y /d %PYTHON_COMMON_DIR%\dbm %TARGET_DIR%\python\lib\dbm 1> nul 2> nul
xcopy /i /s /y /d %PYTHON_COMMON_DIR%\distutils %TARGET_DIR%\python\lib\distutils 1> nul 2> nul
xcopy /i /s /y /d %PYTHON_COMMON_DIR%\ensurepip %TARGET_DIR%\python\lib\ensurepip 1> nul 2> nul
xcopy /i /s /y /d %PYTHON_COMMON_DIR%\html %TARGET_DIR%\python\lib\html 1> nul 2> nul
xcopy /i /s /y /d %PYTHON_COMMON_DIR%\http %TARGET_DIR%\python\lib\http 1> nul 2> nul
xcopy /i /s /y /d %PYTHON_COMMON_DIR%\idlelib %TARGET_DIR%\python\lib\idlelib 1> nul 2> nul
xcopy /i /s /y /d %PYTHON_COMMON_DIR%\msilib %TARGET_DIR%\python\lib\msilib 1> nul 2> nul
xcopy /i /s /y /d %PYTHON_COMMON_DIR%\multiprocessing %TARGET_DIR%\python\lib\multiprocessing 1> nul 2> nul
xcopy /i /s /y /d %PYTHON_COMMON_DIR%\pydoc_data %TARGET_DIR%\python\lib\pydoc_data 1> nul 2> nul
xcopy /i /s /y /d %PYTHON_COMMON_DIR%\tkinter %TARGET_DIR%\python\lib\tkinter 1> nul 2> nul
xcopy /i /s /y /d %PYTHON_COMMON_DIR%\turtledemo %TARGET_DIR%\python\lib\turtledemo 1> nul 2> nul
xcopy /i /s /y /d %PYTHON_COMMON_DIR%\urllib %TARGET_DIR%\python\lib\urllib 1> nul 2> nul
xcopy /i /s /y /d %PYTHON_COMMON_DIR%\venv %TARGET_DIR%\python\lib\venv 1> nul 2> nul
xcopy /i /s /y /d %PYTHON_COMMON_DIR%\wsgiref %TARGET_DIR%\python\lib\wsgiref 1> nul 2> nul
xcopy /i /s /y /d %PYTHON_COMMON_DIR%\xmlrpc %TARGET_DIR%\python\lib\xmlrpc 1> nul 2> nul
robocopy %PYTHON_COMMON_DIR%\lib2to3 %TARGET_DIR%\python\lib\lib2to3 /E /xd %PYTHON_COMMON_DIR%\lib2to3\tests\
robocopy %PYTHON_DLLS_DIR% %TARGET_DIR%\python\DLLs *%DEBUG_PREFIX%.pyd %EXCLUDE_CMD% _ctypes_test*.pyd
robocopy %PYTHON_DIR% %TARGET_DIR%\python\site-packages\ pyodbc%DEBUG_PREFIX%*.pyd %EXCLUDE_CMD%
robocopy %PYTHON_DIR%\ %TARGET_DIR%\python\DLLs *sqlite3*%DEBUG_PREFIX%.dll %EXCLUDE_CMD%
rem site packages that are release type independent
rem xcopy /i /s /y /d %PYTHON_COMMON_DIR%\site-packages\paramiko %TARGET_DIR%\python\site-packages\paramiko 1> nul 2> nul
rem xcopy /i /s /y /d %PYTHON_COMMON_DIR%\site-packages\ecdsa %TARGET_DIR%\python\site-packages\ecdsa 1> nul 2> nul
rem site packages for debug/release types
rem robocopy %PYTHON_DIR%\pysqlite2 %TARGET_DIR%\python\site-packages\pysqlite2 *%DEBUG_PREFIX%.pyd %EXCLUDE_CMD%
rem xcopy /i /s /y /d %PYTHON_DIR%\pysqlite2\*.py %TARGET_DIR%\python\site-packages\pysqlite2 1> nul 2> nul
xcopy /i /s /y /d %PYTHON_LIB_DIR%\site-packages\*.pyd %TARGET_DIR%\python\site-packages\ 1> nul 2> nul
rem =======================================
if %2 == Debug ( set DEBUG_PREFIX=d)
echo * SSL libraries ...
xcopy /i /s /y /d %EXT_LIB_DIR%\libcrypto-1_1-x64.dll %TARGET_DIR%\.
xcopy /i /s /y /d %EXT_LIB_DIR%\libssl-1_1-x64.dll %TARGET_DIR%\.
echo * glib libraries ...
xcopy /i /s /y /d %EXT_LIB_DIR%\glib*.dll %TARGET_DIR%\.
xcopy /i /s /y /d %EXT_LIB_DIR%\gmodule*.dll %TARGET_DIR%\.
xcopy /i /s /y /d %EXT_LIB_DIR%\gobject*.dll %TARGET_DIR%\.
xcopy /i /s /y /d %EXT_LIB_DIR%\gthread*.dll %TARGET_DIR%\.
rem xcopy /i /s /y /d %EXT_LIB_DIR%\intl.dll %TARGET_DIR%\.
echo * libxml2 libraries ...
xcopy /i /s /y /d %EXT_LIB_DIR%\libxml2.dll %TARGET_DIR%\.
xcopy /i /s /y /d %EXT_LIB_DIR%\iconv.dll %TARGET_DIR%\.
echo * zlib + libzip libraries ...
xcopy /i /s /y /d %EXT_LIB_DIR%\zlib%DEBUG_PREFIX%.dll %TARGET_DIR%\.
xcopy /i /s /y /d %EXT_LIB_DIR%\zip.dll %TARGET_DIR%\.
echo * ANTLR4 runtime lib ...
xcopy /i /s /y /d %EXT_LIB_DIR%\antlr4-runtime.dll %TARGET_DIR%\.
echo * cairo library ...
xcopy /i /s /y /d %EXT_LIB_DIR%\libcairo.dll %TARGET_DIR%\. 1> nul 2> nul
echo * png library ...
xcopy /i /s /y /d %EXT_LIB_DIR%\libpng16%DEBUG_PREFIX%.dll %TARGET_DIR%\. 1> nul 2> nul
echo * pixman library ...
xcopy /i /s /y /d %EXT_LIB_DIR%\pixman*.dll %TARGET_DIR%\. 1> nul 2> nul
echo * cppconn library ...
xcopy /i /s /y /d %EXT_LIB_DIR%\mysqlcppconn-9-vs14.dll %TARGET_DIR%\. 1> nul 2> nul
echo * pcre library ...
xcopy /i /s /y /d %EXT_LIB_DIR%\pcre%DEBUG_PREFIX%.dll %TARGET_DIR%\. 1> nul 2> nul
xcopy /i /s /y /d %EXT_LIB_DIR%\pcrecpp%DEBUG_PREFIX%.dll %TARGET_DIR%\. 1> nul 2> nul
echo * sqlite library ...
xcopy /i /s /y /d %EXT_LIB_DIR%\sqlite3.dll %TARGET_DIR%\. 1> nul 2> nul
echo * vsqlite++ library ...
xcopy /i /s /y /d %EXT_LIB_DIR%\vsqlite++.dll %TARGET_DIR%\. 1> nul 2> nul
echo * gdal library + tools ...
xcopy /i /s /y /d %EXT_LIB_DIR%\gdal*.dll %TARGET_DIR%\. 1> nul 2> nul
xcopy /i /s /y /d %EXT_LIB_DIR%\*.exe %TARGET_DIR%\. 1> nul 2> nul
echo * ssh library ...
xcopy /i /s /y /d %EXT_LIB_DIR%\ssh.dll %TARGET_DIR%\.
echo * auth plugins ...
if %2 == Release xcopy /i /s /y /d %EXT_LIB_DIR%\authentication_ldap_sasl_client.dll %TARGET_DIR%\.
if %2 == Release xcopy /i /s /y /d %EXT_LIB_DIR%\authentication_kerberos_client.dll %TARGET_DIR%\.
echo * Templates
if not exist %TARGET_DIR%\modules\data\sqlide mkdir %TARGET_DIR%\modules\data\sqlide
xcopy /i /s /y /d %RES_DIR%\sqlidedata\templates\*.* %TARGET_DIR%\modules\data\sqlide\. 1> nul 2> nul
echo * Context Help
xcopy /i /s /y /d %RES_DIR%\sqlidedata\context-help\*.* %TARGET_DIR%\modules\data\sqlide\. 1> nul 2> nul
echo * Copy Sample Files
if not exist %TARGET_DIR%\extras mkdir %TARGET_DIR%\extras
xcopy /i /y /d %1samples\models\* %TARGET_DIR%\extras 1> nul 2> nul
echo * README
if %2 == Release_OSS xcopy /i /y /d %1README.md %TARGET_DIR%
if not %2 == Release_OSS xcopy /i /y /d %1README-commercial.md %TARGET_DIR%
echo * License
if %2 == Release_OSS xcopy /i /y /d %1license.txt %TARGET_DIR%
if not %2 == Release_OSS xcopy /i /y /d %1license-commercial.txt %TARGET_DIR%
rem -------------------------------------------------------------------------------
rem Call sub-scripts
call %1\modules\PrepareOutputDir.cmd %1 %2 %3
rem -------------------------------------------------------------------------------
rem Work is done
echo Output directory preparation complete.
rem Make sure to reset error level
set ERRORLEVEL=0
goto EndOfScript
:Usage
echo This script sets up the output directory so that applications can be started from there and find
echo all directories and files as in the final distribution. The script takes 3 parameters, the
echo SolutionDirectory and ConfigurationName.
echo Use an ABSOLUTE PATH to the solution directory and end it with a backslash!
echo .
echo Usage:
echo %0 SolutionDirectory ConfigurationName Architecture
echo .
echo Example:
echo %0 "C:\Documents and Settings\mysqldev\My Documents\work\mysql-workbench\" Debug x64
echo .
:EndOfScript