Space Engineers auto-updating Dedicated Server

Space Engineers dedicated servers come with one big down-fall: No automatic updating for the dedicated server. Your client does auto-update which is annoying and so I decided to make a small powershell script using DropBox and Junction.

What I did was junction the directory from Steam that includes the DedicatedServer zip (located in C:\Program Files (x86)\Steam\steamapps\common\SpaceEngineers\Tools) into my Dropbox folder. I then setup my server to use Dropbox to download this onto the server automatically. Using the script below I then check this zip file versus the current zip file on the server.

$local = Get-item C:\SpaceEngineers\DedicatedServer.zip
$remote = Get-item C:\Users\Administrator\dropbox\SEtools\DedicatedServer.zip

if($remote.LastWriteTime -gt $local.LastWriteTime) {
 write-host "Remote is newer, copying ZIP from Dropbox..."
 Copy-Item C:\Users\Administrator\dropbox\SEtools\DedicatedServer.zip -Destination C:\SpaceEngineers
 write-host "Stopping Service..."
 Stop-Service "Space Engineers"
 write-host "Extracting zip..."
 .'C:\Program Files\7-Zip\7z.exe' x -aoa C:\SpaceEngineers\DedicatedServer.zip -oC:\SpaceEngineers
 write-host "Starting Service"
 Start-Service "Space Engineers"
} else {
 write-host "No update required"
}
write-host "Program done, exiting"

Using this method you can automatically update a server without having to connect to it, ofcourse there still is the part where DropBox will need to do a sync. I’m still looking into making this more efficient!

Leave a Reply

Your email address will not be published. Required fields are marked *