Tuesday 7 May 2013

Minecraft Service

Download Minecraft Server
Download the latest Minecraft Server
Run it, and check that it is the correct version.

Download CraftBukkit
Download CraftBukkit
Edit the batch file RunServerWithMods.cmd:

@ECHO OFF
SET BINDIR=%~dp0
CD /D "%BINDIR%"
"C:\Program Files (x86)\Java\jre7\bin\java.exe" -Xmx1024M -Xms1024M -jar craftbukkit-1.5.2-R0.2-20130608.060232-13.jar -nojline

Test the server
Test the server by running RunServerWithMods.cmd. Check that the latest client will work with the new server.
Install Summary - Download yajsw and extract to any folder.
- Open task manager and find the "java" pid under processes. This is most likely your minecraft server.
- Open a command prompt and browse to the "bat" folder under yajsw. (ex. D:\yajsw-beta-10.3\bat).
- Run genConfig.bat  (ex. genConfig.bat 2467).

Note that the config writes the value
wrapper.java.app.jar = craftbukkit-1.5.2-R0.2-20130608.060232-13.jar

for future updates to Minecraft you just need to change this line entry pointing to the new bukkit version.

wrapper.conf
- Browse to "conf" folder (ex. D:\yajsw-beta-10.3\conf) and open wrapper.conf in a text editor.
- Set the working directory (wrapper.working.dir) to your minecraft .jar server file. (ex. \minecraftserver\ for D:\minecraftserver\).
- Uncomment wrapper.app.password and enter your admin account password. Make sure the username on the line above is correct (mine was MinecraftService).
- Fill in service name and descriptions (wrapper.ntservice.name)

Create/Install Service
- Run installService.bat from the bat directory. (ex. D:\yajsw-beta-10.3\bat)
- Open Services Manager through administration tools.
- Right click the server, properties.
- Browse to "Log On" tab.
- Change to "This Account" and use the same account in your wrapper.conf.

Start the service.

You may want to create a new user account for the service. In this scenario, go to Computer Management > User Rights Assignment and Configure for Logon as a Service. I also made my service account a member of the administrators service.

No comments:

Post a Comment