forked from simulationcraft/simc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
autoextract.bat
69 lines (54 loc) · 1.27 KB
/
autoextract.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
@echo off
setlocal enabledelayedexpansion
set LANG=enUS
set PTR=
if not %1 == ptr goto start
set PTR= ptr
shift
:start
set INPATH_A=%~f1\Data
set INPATH_B=%~f1\Data\%LANG%
set OUTPATH=%~f2
if exist "%INPATH_A%" goto pathb
echo Error: Unable to find WoW path! %INPATH_A%
echo.
goto usage
:pathb
if exist "%INPATH_B%" goto next
echo Error: Unable to find WoW path! %INPATH_B%
echo.
goto usage
:next
if exist "%OUTPATH%" goto okay
echo Error: Unable to find output path!
echo.
goto usage
:okay
set FILES=misc.MPQ
for %%f in ("%INPATH_A%\wow-update-base*.MPQ") do (
set FILES=!FILES! %%~nf.MPQ
)
set BUILD=%FILES:~-9,5%
echo cd "%INPATH_A%" > tmp1.mopaq
echo op %FILES% >> tmp1.mopaq
echo e misc.MPQ DBFilesClient\* "%OUTPATH%\%BUILD%" /fp >> tmp1.mopaq
set FILES=locale-%LANG%.MPQ
for %%f in ("%INPATH_B%\wow-update-%LANG%*.MPQ") do (
set FILES=!FILES! %%~nf.MPQ
)
set BUILD=%FILES:~-9,5%
echo cd "%INPATH_B%" > tmp2.mopaq
echo op %FILES% >> tmp2.mopaq
echo e locale-%LANG%.MPQ DBFilesClient\* "%OUTPATH%\%BUILD%" /fp >> tmp2.mopaq
mkdir "%OUTPATH%\%BUILD%"
MPQEditor.exe /console tmp1.mopaq
del tmp1.mopaq
MPQEditor.exe /console tmp2.mopaq
del tmp2.mopaq
echo Generating...
generate.bat%PTR% %BUILD% "%OUTPATH%"
goto end
:usage
echo Usage: autoextract.bat [ptr] wowpath outpath
:end
endlocal