-
Notifications
You must be signed in to change notification settings - Fork 58
/
Windows_Install_Script.bat
360 lines (333 loc) · 13.7 KB
/
Windows_Install_Script.bat
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
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
@ECHO OFF
REM ########################################################################################################
REM USER CONFIGURATION REQUIRED FOR AUTOMATIC IMPORT OF DATA - PLEASE UPDATE THIS DATA FOR YOUR INSTALLATION
REM ########################################################################################################
SET CMangos="C:\CMangos"
SET ACID="C:\CMangos\ACID\acid_tbc"
SET User="mangos"
SET Password="mangos"
SET WorldDB="mangos"
SET CharactersDB="characters"
SET RealmdDB="realmd"
REM ##################################################################################################
REM DO NOT EDIT ANYTHING BELOW THIS LINE - ALL CONFIGURATION REQUIRED LOCATED IN INSTALL_SCRIPT_Config
REM ##################################################################################################
SET CurrentVersion="1.5.1"
SET StableVersion="1.5.0"
CLS
ECHO =====================================================================
ECHO TBC-DB INSTALLATION HELPER SCRIPT - SIMPLIFIED MANAGEMENT FOR USERS
ECHO (MYSQL INSTALL MUST SUPPORT BIN PATH FOR COMMAND PROMPT FUNCTIONS)
ECHO =====================================================================
ECHO.
:MENU
ECHO ...........................................................................
ECHO Choose Preferred Installation Option - (If Updating Option #1 Is Suggested)
ECHO ...........................................................................
ECHO.
ECHO 1 - TBC-DB Full Database Install with Newest Data and Latest CMangos and ACID
ECHO 2 - TBC-DB Full Database From Older Stable Release NO CUSTOM CONTENT INCLUDED
ECHO 3 - Database Reset (%WorldDB% and %CharactersDB%) - DB WIPE
ECHO 4 - BRAND NEW FIRST TIME INSTALLATION - Create Databases and Import Latest Data
ECHO 5 - INSTALLATION REMOVAL - Remove and Delete All Default Databases
ECHO 6 - EXIT (No Changes)
ECHO.
ECHO ----------------------------------------------------------------------------
ECHO (MAKE SURE YOUR CMaNGOS-TBC AND ACID-TBC REPOS ARE UP TO DATE FIRST)
ECHO ----------------------------------------------------------------------------
SET /P M=Type 1, 2, 3, 4, 5 or 6 then press ENTER:
IF %M%==1 GOTO OPTION1
IF %M%==2 GOTO OPTION2
IF %M%==3 GOTO OPTION3
IF %M%==4 GOTO OPTION4
IF %M%==5 GOTO OPTION5
IF %M%==6 GOTO EOF
:OPTION1
CLS
ECHO =====================================================================
ECHO TBC-DB Full Database Install with Newest Data and Latest SD2 and ACID
ECHO =====================================================================
ECHO.
ECHO .......................................
ECHO Please Confirm Your Installation Option
ECHO .......................................
ECHO.
ECHO 1 - Yes, I Am Sure! Lets Get The Show On The Road!
ECHO 2 - Pressed Wrong Button, Return To Main Menu
ECHO.
SET /P M=Type 1 or 2 then press ENTER:
IF %M%==1 GOTO LATEST
IF %M%==2 GOTO MENU
:OPTION2
CLS
ECHO ======================================================================
ECHO TBC-DB Full Database From Older Stable Release and Latest SD2 and ACID
ECHO ======================================================================
ECHO.
ECHO .......................................
ECHO Please Confirm Your Installation Option
ECHO .......................................
ECHO.
ECHO 1 - Yes, I Am Sure! Lets Get The Show On The Road!
ECHO 2 - Pressed Wrong Button, Return To Main Menu
ECHO.
SET /P M=Type 1 or 2 then press ENTER:
IF %M%==1 GOTO STABLE
IF %M%==2 GOTO MENU
:OPTION3
CLS
ECHO ===========================================================================
ECHO Database Reset (%WorldDB% and %CharactersDB%) - DB WIPE - NO GAME CONTENT
ECHO ===========================================================================
ECHO.
ECHO .......................................
ECHO Please Confirm Your Installation Option
ECHO .......................................
ECHO.
ECHO 1 - Yes, I Am Sure! Lets Get The Show On The Road!
ECHO 2 - Pressed Wrong Button, Return To Main Menu
ECHO.
SET /P M=Type 1 or 2 then press ENTER:
IF %M%==1 GOTO RESET
IF %M%==2 GOTO MENU
:OPTION4
CLS
ECHO ===========================================================================
ECHO BRAND NEW FIRST TIME INSTALLATION - Create Databases and Import Latest Data
ECHO ===========================================================================
ECHO.
ECHO .......................................
ECHO Please Confirm Your Installation Option
ECHO .......................................
ECHO.
ECHO 1 - Yes, I Am Sure! Lets Get The Show On The Road!
ECHO 2 - Pressed Wrong Button, Return To Main Menu
ECHO.
SET /P M=Type 1 or 2 then press ENTER:
IF %M%==1 GOTO NEWSETUP
IF %M%==2 GOTO MENU
:OPTION5
CLS
ECHO ==============================================================
ECHO INSTALLATION REMOVAL - Remove and Delete All Default Databases
ECHO ==============================================================
ECHO.
ECHO .......................................
ECHO Please Confirm Your Installation Option
ECHO .......................................
ECHO.
ECHO 1 - Yes, I Am Sure! Lets Get The Show On The Road!
ECHO 2 - Pressed Wrong Button, Return To Main Menu
ECHO.
SET /P M=Type 1 or 2 then press ENTER:
IF %M%==1 GOTO DELETE
IF %M%==2 GOTO MENU
:LATEST
ECHO.
ECHO --------------------
ECHO REMOVE OLD SQL FILES
ECHO --------------------
RD /S /Q Temp_Created_Files
MD Temp_Created_Files
ECHO.
ECHO ----------------------------------------------------------------------
ECHO BUILDING COMPLETE NEW FULL DB FROM NEWEST TBC-DB / CMANGOS / ACID DATA
ECHO ----------------------------------------------------------------------
copy /a %CMangos%\sql\base\mangos.sql /b Temp_Created_Files\000_CMangos_Base.sql
copy /a Current_Release\Full_DB\*.sql /b Temp_Created_Files\001_TBCDB_Full.sql
copy /a Updates\*.sql /b Temp_Created_Files\010_TBCDB_NewData.sql
copy /a Updates\Custom_Data\*.sql /b Temp_Created_Files\011_TBCDB_Custom_Data.sql
copy /a %CMangos%\sql\scriptdev2\scriptdev2.sql /b Temp_Created_Files\012_SD2_Full.sql
copy /a %ACID%\acid_tbc.sql /b Temp_Created_Files\013_ACID_TBC.sql
copy /a Temp_Created_Files\*.sql /b %CurrentVersion%_FULL.sql
RD /S /Q Temp_Created_Files
ECHO.
ECHO --------------------------------------------------------------
ECHO PLEASE BE PATIENT WHILE NEW DATA IS IMPORTING TO THE DATABASES
ECHO --------------------------------------------------------------
mysql.exe --user=%User% --password=%Password% %WorldDB% < %CurrentVersion%_FULL.sql
ECHO.
ECHO --------------------
ECHO REMOVE OLD SQL FILES
ECHO --------------------
del /s %CurrentVersion%_FULL.sql
ECHO.
ECHO -------------------------------------------------------------------
ECHO DATABASE UPDATES ARE COMPLETE - PRESS ANY KEY TO RETURN TO THE MENU
ECHO -------------------------------------------------------------------
ECHO.
PAUSE
CLS
GOTO MENU
:STABLE
ECHO.
ECHO --------------------
ECHO REMOVE OLD SQL FILES
ECHO --------------------
RD /S /Q Temp_Created_Files
MD Temp_Created_Files
ECHO.
ECHO ---------------------------------------------------------------------------------
ECHO BUILDING COMPLETE NEW FULL DB FROM OLDER STABLE TBC-DB / CMANGOS / ACID DATA
ECHO ---------------------------------------------------------------------------------
copy /a %CMangos%\sql\base\mangos.sql /b Temp_Created_Files\000_CMangos_Base.sql
copy /a Current_Release\Full_DB\*.sql /b Temp_Created_Files\001_TBCDB_Full.sql
copy /a %CMangos%\sql\scriptdev2\scriptdev2.sql /b Temp_Created_Files\012_SD2_Full.sql
copy /a %ACID%\acid_tbc.sql /b Temp_Created_Files\013_ACID_TBC.sql
copy /a Temp_Created_Files\*.sql /b %StableVersion%_FULL.sql
RD /S /Q Temp_Created_Files
ECHO.
ECHO --------------------------------------------------------------
ECHO PLEASE BE PATIENT WHILE NEW DATA IS IMPORTING TO THE DATABASES
ECHO --------------------------------------------------------------
mysql.exe --user=%User% --password=%Password% %WorldDB% < %StableVersion%_FULL.sql
ECHO.
ECHO --------------------
ECHO REMOVE OLD SQL FILES
ECHO --------------------
del /s %StableVersion%_FULL_STABLE.sql
ECHO.
ECHO -------------------------------------------------------------------
ECHO DATABASE UPDATES ARE COMPLETE - PRESS ANY KEY TO RETURN TO THE MENU
ECHO -------------------------------------------------------------------
ECHO.
PAUSE
CLS
GOTO MENU
:RESET
ECHO.
ECHO --------------------
ECHO REMOVE OLD SQL FILES
ECHO --------------------
RD /S /Q Temp_Created_Files
MD Temp_Created_Files
ECHO.
ECHO -------------------------------------------------------------------
ECHO DELETE GAME DATABASES AND THEN RE-CREATE THEM TO IMPORT PROPER DATA
ECHO -------------------------------------------------------------------
mysqladmin.exe --user=%User% --password=%Password% -f DROP %WorldDB%
mysqladmin.exe --user=%User% --password=%Password% -f DROP %CharactersDB%
ECHO.
ECHO --------------------
ECHO CREATE NEW DATABASES
ECHO --------------------
mysqladmin.exe --user=%User% --password=%Password% CREATE %WorldDB%
mysqladmin.exe --user=%User% --password=%Password% CREATE %CharactersDB%
ECHO.
ECHO -----------------------------------------------------
ECHO IMPORT BASE DATA INTO DATABASES - NO CONTENT INCLUDED
ECHO -----------------------------------------------------
mysql.exe --user=%User% --password=%Password% %WorldDB% < %CMangos%\sql\base\mangos.sql
mysql.exe --user=%User% --password=%Password% %CharactersDB% < %CMangos%\sql\base\characters.sql
ECHO.
ECHO --------------------
ECHO REMOVE OLD SQL FILES
ECHO --------------------
RD /S /Q Temp_Created_Files
ECHO.
ECHO ------------------------------------------------------------------------
ECHO DATABASES HAVE BEEN RESTORED TO ORIGINAL EMPTY STATE - READY FOR CONTENT
ECHO (PRESS ANY KEY TO RETURN TO THE MAIN MENU)
ECHO ------------------------------------------------------------------------
ECHO.
PAUSE
CLS
GOTO MENU
:NEWSETUP
ECHO.
ECHO --------------------
ECHO REMOVE OLD SQL FILES
ECHO --------------------
RD /S /Q Temp_Created_Files
MD Temp_Created_Files
ECHO.
ECHO -----------------------------------------
ECHO DELETE EXISTING GAME DATA FOR FRESH SETUP
ECHO -----------------------------------------
mysql.exe --user=%User% --password=%Password% < Tools\Install_Script_Helpers\TBC-DB_Drop_Mysql.sql
ECHO.
ECHO -------------------------------------------------
ECHO CREATE MYSQL USER AND NEW REQUIRED GAME DATABASES
ECHO -------------------------------------------------
mysql.exe --user=%User% --password=%Password% < %CMangos%\sql\create\db_create_mysql.sql
ECHO.
ECHO -----------------------------
ECHO LOAD DATABASE TABLE STRUCTURE
ECHO -----------------------------
mysql.exe --user=%User% --password=%Password% %WorldDB% < %CMangos%\sql\base\mangos.sql
mysql.exe --user=%User% --password=%Password% %CharactersDB% < %CMangos%\sql\base\characters.sql
mysql.exe --user=%User% --password=%Password% %RealmdDB% < %CMangos%\sql\base\realmd.sql
ECHO.
ECHO ----------------------------------------------------------------------
ECHO BUILDING COMPLETE NEW FULL DB FROM NEWEST TBC-DB / CMANGOS / ACID DATA
ECHO ----------------------------------------------------------------------
copy /a %CMangos%\sql\base\mangos.sql /b Temp_Created_Files\000_CMangos_Base.sql
copy /a Current_Release\Full_DB\*.sql /b Temp_Created_Files\001_TBCDB_Full.sql
copy /a Updates\*.sql /b Temp_Created_Files\010_TBCDB_NewData.sql
copy /a Updates\Custom_Data\*.sql /b Temp_Created_Files\011_TBCDB_Custom_Data.sql
copy /a %CMangos%\sql\scriptdev2\scriptdev2.sql /b Temp_Created_Files\012_SD2_Full.sql
copy /a %ACID%\acid_tbc.sql /b Temp_Created_Files\013_ACID_TBC.sql
copy /a Temp_Created_Files\*.sql /b %CurrentVersion%_FULL.sql
RD /S /Q Temp_Created_Files
ECHO.
ECHO --------------------------------------------------------------
ECHO PLEASE BE PATIENT WHILE NEW DATA IS IMPORTING TO THE DATABASES
ECHO --------------------------------------------------------------
mysql.exe --user=%User% --password=%Password% %WorldDB% < %CurrentVersion%_FULL.sql
ECHO.
ECHO --------------------
ECHO REMOVE OLD SQL FILES
ECHO --------------------
del /s %CurrentVersion%_FULL.sql
RD /S /Q Temp_Created_Files
ECHO.
ECHO -------------------------------------------------------------------
ECHO CONGRATULATIONS - BRAND NEW INSTALLATION IS NOW COMPLETE USING
ECHO THE DEFAULT DATABASE NAMES AND DATABASE USERNAMES. MAKE SURE YOU
ECHO COMPILE CMANGOS AND SCRIPTDEV2 AND CONFIGURE YOUR REALMD DATABASE
ECHO AND SETUP YOUR SERVER CONFIG FILES AS PER NORMAL INSTALL GUIDES
ECHO -------------------------------------------------------------------
PAUSE
CLS
GOTO MENU
:DELETE
ECHO.
ECHO --------------------
ECHO REMOVE OLD SQL FILES
ECHO --------------------
RD /S /Q Temp_Created_Files
MD Temp_Created_Files
ECHO.
ECHO -----------------------------------------------------------
ECHO DELETE EXISTING CMANGOS / SD2 GAME DATABASES AND MYSQL USER
ECHO -----------------------------------------------------------
mysql.exe --user=%User% --password=%Password% < Tools\Install_Script_Helpers\TBC-DB_Drop_Mysql.sql
ECHO.
ECHO -------------------------------------------------------------
ECHO ALL DEFAULT DATABASES HAVE BEEN DELETED AND USERS CLEANED OUT
ECHO -------------------------------------------------------------
PAUSE
CLS
GOTO MENU
:EOF
ECHO.
ECHO --------------------------------
ECHO REMOVE OLD SQL FILES AND FOLDERS
ECHO --------------------------------
RD /S /Q Temp_Created_Files
CLS
ECHO.
ECHO -------------------------------------------------------
ECHO IF YOU HAVE UPDATED YOUR TBC-DB DATABASE MAKE SURE THAT
ECHO YOU REMEMBER TO COMPILE YOUR UPDATED CMANGOS AND SD2
ECHO CODE TO COMPLETE THE UPGRADE, FAILURE TO DO SO WILL
ECHO CAUSE YOU MORE HEADACHES THEN IT IS WORTH AND FAILURE!
ECHO YOU MUST ALSO MANUALLY IMPORT ANY REALMD AND CHARACTERS
ECHO DB UPDATES (ONLY YOUR MANGOS/WORLD DB WAS UPDATED!!!
ECHO.
ECHO -------------------------------------------------------
ECHO THANK YOU FOR FLYING WITH US AND HOPE TO SEE YOU AGAIN
ECHO -------------------------------------------------------
ECHO.
PAUSE
ECHO.