Page 1 of 1

Auto Update of Windows Headless

Posted: Sat Sep 10, 2016 4:13 pm
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.

Re: Auto Update of Windows Headless

Posted: Sun Sep 11, 2016 3:32 am
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.

Re: Auto Update of Windows Headless

Posted: Sun Sep 11, 2016 10:16 pm
by posila
Imho the best solution for Windows server it to use SteamCMD

Re: Auto Update of Windows Headless

Posted: Mon Sep 12, 2016 9:53 pm
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".

Re: Auto Update of Windows Headless

Posted: Mon Sep 12, 2016 10:06 pm
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\