51891b766c
Added "/service" switch, to prompt the binary to attempt starting as a service. Added service* methods, to control service startup. Split up main() into universalMain(), which contains the startup code for both service and normal start. Added cRoot::m_RunningAsService bool, Added cRoot::SetStopping(bool) to allow a stop request to be sent by the service controller. Added cBlockIDMap::init() to avoid loading items.ini before the working directory has been set.
7 lines
287 B
Batchfile
7 lines
287 B
Batchfile
rem Alter this if you need to install multiple instances.
|
|
@echo off
|
|
set SERVICENAME="MCServer"
|
|
|
|
set CURRENTDIR=%CD%
|
|
sc create %SERVICENAME% binPath= "%CURRENTDIR%\MCServer.exe /service" start= auto DisplayName= %SERVICENAME%
|
|
sc description %SERVICENAME% "Minecraft server instance" |