|
| 1 | +@echo off |
| 2 | + |
| 3 | +setlocal |
| 4 | +setlocal enabledelayedexpansion |
| 5 | +rem mklink requires admin; check or exit |
| 6 | +net session >nul 2>&1 |
| 7 | +if %errorLevel% neq 0 ( |
| 8 | + echo This script requires administrator privileges. |
| 9 | + goto ret |
| 10 | +) |
| 11 | +if [%1]==[] ( |
| 12 | + echo usage: %0 ^<game_installation_dir^> |
| 13 | + goto ret |
| 14 | +) |
| 15 | +set game_root=%1 |
| 16 | +if not exist %game_root% ( |
| 17 | + echo path not found: %game_root% |
| 18 | + goto ret |
| 19 | +) |
| 20 | +for /f "delims=" %%a in ('chdir') do set git_root=%%a |
| 21 | +set git_root="%git_root%" |
| 22 | +pushd %game_root% |
| 23 | +set xbin=_bin_dbg_Win32 _bin_mix_Win32 _bin_rel_Win32 |
| 24 | +for %%b in (%xbin%) do ( |
| 25 | + if not exist %%b ( |
| 26 | + mkdir %%b |
| 27 | + ) |
| 28 | + if not exist %%b\dedicated ( |
| 29 | + mkdir %%b\dedicated |
| 30 | + ) |
| 31 | + cp bin\dbghelp.dll %%b\dbghelp.dll |
| 32 | + cp bin\eax.dll %%b\eax.dll |
| 33 | + cp bin\wrap_oal.dll %%b\wrap_oal.dll |
| 34 | + cp bin\eax.dll %%b\dedicated\eax.dll |
| 35 | + cp bin\wrap_oal.dll %%b\dedicated\wrap_oal.dll |
| 36 | + cp %git_root%\src\Externals\OpenSSL\bin\libeay32.dll %%b\libeay32.dll |
| 37 | + cp %git_root%\src\Externals\OpenSSL\bin\ssleay32.dll %%b\ssleay32.dll |
| 38 | +) |
| 39 | +cp %git_root%\src\Externals\BugTrap\bin\BugTrapD.dll !xbin[0]!\BugTrap.dll |
| 40 | +cp %git_root%\src\Externals\BugTrap\bin\BugTrap.dll !xbin[1]!\BugTrap.dll |
| 41 | +cp %git_root%\src\Externals\BugTrap\bin\BugTrap.dll !xbin[2]!\BugTrap.dll |
| 42 | +if exist gamedata ( |
| 43 | + echo gamedata already exists. Remove/rename it, then |
| 44 | + echo create soft link to "%git_root%\res\gamedata" |
| 45 | + echo -or- |
| 46 | + echo run this script again |
| 47 | +) else ( |
| 48 | + mklink /D gamedata %git_root%\res\gamedata |
| 49 | +) |
| 50 | +popd |
| 51 | +call :make_binup Win32 Debug |
| 52 | +call :make_binup Win32 Mixed |
| 53 | +call :make_binup Win32 Release |
| 54 | +goto ret |
| 55 | + |
| 56 | +rem args: <platform> <configuration> |
| 57 | +:make_binup |
| 58 | +setlocal |
| 59 | +set platform=%~1 |
| 60 | +set conf=%~2 |
| 61 | +set fname=.xrbinup_%conf%_%platform%.cmd |
| 62 | +( ^ |
| 63 | +echo @echo off && ^ |
| 64 | +echo setlocal && ^ |
| 65 | +echo set src=%git_root% && ^ |
| 66 | +echo set dst=%game_root% && ^ |
| 67 | +echo call xrbinup.cmd %%dst%% %%src%% %platform% %conf% && ^ |
| 68 | +echo endlocal ) ^ |
| 69 | +> %fname% |
| 70 | +endlocal |
| 71 | +goto:eof |
| 72 | + |
| 73 | +:ret |
| 74 | +endlocal |
0 commit comments