Auto Update of Windows Headless

Anything that prevents you from playing the game properly. Do you have issues playing for the game, downloading it or successfully running it on your computer? Let us know here.
Post Reply
Sergeant_Steve
Inserter
Inserter
Posts: 22
Joined: Tue Jun 28, 2016 10:24 pm
Contact:

Auto Update of Windows Headless

Post by Sergeant_Steve »

As the title suggests is there a way to update the Headless verison of Factorio on Windows via Command line? Reason being I have a headless Windows Server and have to have a copy of the Zip version of Factorio on my Laptop so I can run it to update it instead of having to download the full Zip again and extract it over the top which takes longer.

I tried to use the command Oxyd posted on viewtopic.php?f=49&t=14395 after installing WGET and having Curl in its own folder in the Factorio folder but it gets to

Code: Select all

| sed -n 's/\["\(.*\)"\]/\1/p')
and then Command Prompt just says:

Code: Select all

'sed' is not recognized as an internal or external command,
operable program or batch file.
which I can fully understand since "sed" isn't a normal Windows Command.

The full code I am tyring to use is

Code: Select all

wget -O update.zip --no-check-certificate $(curl "https://www.factorio.com/updater/get-download-link?username=${Username}&token=${token}&package=core-win64&from=0.14.3&to=0.14.4&isTarget=true&apiVersion=2" | sed -n 's/\["\(.*\)"\]/\1/p')
Obviously I've put my Factorio Username and Token in but removed it for the purposes of posting here. Do I need the stuff at the end or is there some other method to update Factorio on my Headless Windows server that will save me a lot of time and effort when updating Factorio.

User avatar
DaveMcW
Smart Inserter
Smart Inserter
Posts: 3700
Joined: Tue May 13, 2014 11:06 am
Contact:

Re: Auto Update of Windows Headless

Post by DaveMcW »

Sergeant_Steve wrote:Do I need the stuff at the end or is there some other method to update Factorio on my Headless Windows server that will save me a lot of time and effort when updating Factorio.
The download link is returned in the format:

Code: Select all

["http://example.com/download-link"]
wget requires a link in the format:

Code: Select all

http://example.com/download-link
The sed line simply removes the first 2 and last 2 characters. If you can't use sed, you can do it with your favorite programming tool.

posila
Factorio Staff
Factorio Staff
Posts: 5202
Joined: Thu Jun 11, 2015 1:35 pm
Contact:

Re: Auto Update of Windows Headless

Post by posila »

Imho the best solution for Windows server it to use SteamCMD

Sergeant_Steve
Inserter
Inserter
Posts: 22
Joined: Tue Jun 28, 2016 10:24 pm
Contact:

Re: Auto Update of Windows Headless

Post by Sergeant_Steve »

posila wrote:Imho the best solution for Windows server it to use SteamCMD
OK so I eventually figured out how to get this working after reading posts on other forums, works fine with a Batch file on my laptop so I just copied the entire folder across to my headless server and reconfigured it for the folders I want it to be in etc.

However I seem to be unable to use --start-server-load-latest because it gives me an error that it can't find an info.json in the factorio.exe file location. It works if I specify the map and its location (using quotes around the location path since there are spaces in the path name), but I found it easier to just say load the latest one because then if the server crashes for whatever reason and it didn't save to "map.zip" that you load but one of the autosaves was later than "map.zip" then it would start on that and progress onwards until you Quit the server and then it would save as "map.zip".

posila
Factorio Staff
Factorio Staff
Posts: 5202
Joined: Thu Jun 11, 2015 1:35 pm
Contact:

Re: Auto Update of Windows Headless

Post by posila »

I think the issue is that Steam version uses for %APPDATA%\Factorio as write-folder, so it searches the latest save in %APPDATA%\Factorio\saves. If there is something in that folder, that is not a save, it might complain about missing info.json.

You can override write folder by editing config.ini in %APPDATA%\Factorio\config\

Post Reply

Return to “Technical Help”