Files
kiwistation/tools/tgstation-server/install.bat
T
MrStonedOne 291e21b594 Improves server tools.
You can now specify a branch name to follow.
Server tools can now automatically push compiled changelogs to remote
Server tools will no longer fail to update properly if updated twice within one round.
Server tools will properly clean the git repo before updating.
Server tools will now properly copy over git's HEAD log so the game can detect its current revision.
Removed some debug lines that get left over and improved the output of the update script.
2015-05-19 12:48:57 -07:00

80 lines
2.3 KiB
Batchfile

@echo off
@title Server Tools Installer.
set HOME = %USERPROFILE%
call config.bat
echo This will download the game code from git and install the all the files and folders and symbolic links needed to use the server tools in to the current directory.
echo This requires git be installed.
echo Once this is done, you can safely delete this file if you wish.
echo Ready?
pause
call bin/findgit.bat
echo Downloading repo....
git clone %REPO_URL% gitrepo
IF %ERRORLEVEL% NEQ 0 (
echo git clone failed. aborting.
pause
goto ABORT
)
cd gitrepo
git checkout %REPO_BRANCH%
cd ..
echo Repo downloaded.
echo Setting up folders...
mkdir gamecode\a
mkdir gamecode\b
mkdir gamecode\override
mkdir gamedata
mkdir bot
echo Copying things around....
echo (1/3)
xcopy gitrepo\data gamedata\data /Y /X /K /R /H /I /C /V /E /Q >nul
xcopy gitrepo\config gamedata\config /Y /X /K /R /H /I /C /V /E /Q >nul
xcopy gitrepo\cfg gamedata\cfg /Y /X /K /R /H /I /C /V /E /Q >nul
xcopy gitrepo\bot bot /Y /X /K /R /H /I /C /V /E /Q >nul
echo (2/3)
xcopy gitrepo gamecode\a /Y /X /K /R /H /I /C /V /E /Q /EXCLUDE:copyexclude.txt >nul
mkdir gamecode\a\.git\logs\
copy gitrepo\.git\logs\HEAD gamecode\a\.git\logs\HEAD /D /V /Y >nul
echo (3/3)
xcopy gitrepo gamecode\b /Y /X /K /R /H /I /C /V /E /Q /EXCLUDE:copyexclude.txt >nul
mkdir gamecode\b\.git\logs >nul
copy gitrepo\.git\logs\HEAD gamecode\b\.git\logs\HEAD /D /V /Y >nul
echo done.
echo Setting up symbolic links.
mklink gamecode\a\nudge.py ..\..\bot\nudge.py
mklink gamecode\a\CORE_DATA.py ..\..\bot\CORE_DATA.py
mklink /d gamecode\a\data ..\..\gamedata\data
mklink /d gamecode\a\config ..\..\gamedata\config
mklink /d gamecode\a\cfg ..\..\gamedata\cfg
mklink gamecode\b\nudge.py ..\..\bot\nudge.py
mklink gamecode\b\CORE_DATA.py ..\..\bot\CORE_DATA.py
mklink /d gamecode\b\data ..\..\gamedata\data
mklink /d gamecode\b\config ..\..\gamedata\config
mklink /d gamecode\b\cfg ..\..\gamedata\cfg
mklink /d gamefolder gamecode\a
echo Compiling for the first time.
echo Compiling change log.
cd gamecode\a
call python tools\ss13_genchangelog.py html/changelog.html html/changelogs
cd ..\..
echo Compiling game.
call bin\build.bat
if %DM_EXIT% neq 0 echo DM compile failed.
echo Done. You may start the server using the start server program or change the game config in gamedata\config
pause
:ABORT