Page 1 of 1

Override data directory on OSX

Posted: Sat Apr 29, 2017 7:02 pm
by Alxandr
Hi. I'm trying to override the data directory on OSX. I've tried following guides at https://wiki.factorio.com/Application_directory and viewtopic.php?f=49&t=12819&p=87281#p87281, and I've tried moving the config-path.cfg to different places in the file hierarchy (both outside and inside factorio.app) but have not managed to achieve any success. Could we please get some specific instructions on which files needs to go where (relative to what other files), and what the content need to be in order to run factorio so that it does not touch "Library/Application Support"?

Re: Override data directory on OSX

Posted: Sat Apr 29, 2017 7:56 pm
by quyxkh
config-path.cfg in the install dir (afaict factorio just looks two levels up from the executable) says where to find the config if you don't specify one on the command line. read-path and write-path in that config say where the data dirs are, paths are relative to the start dir but `.` doesn't work, but a symlink fixes that, minimal local server setup looks to be

Code: Select all

mkdir mygame; cd $_; ln -s . data
printf >config.ini %s\\n [path] read-data=__PATH__executable__/../../data write-data=data
/path/to/your/factorio -c config.ini --create saves/mp.zip
/path/to/your/factorio -c config.ini --start-server-load-latest

Re: Override data directory on OSX

Posted: Sat Apr 29, 2017 9:07 pm
by Alxandr
I'm not running factorio from the command line though. Or rather, I am, but I'm not running it as a normal process, I'm starting it using the `open` command. To get more concrete, let's say I have factorio installed at /foo, in which case I can start it using:

Code: Select all

open -a /foo/factorio.app
How would I get saves at `/foo/saves` (or anything else under `/foo`), and mods and config ++ under `/foo`?

Re: Override data directory on OSX

Posted: Sat Apr 29, 2017 9:14 pm
by quyxkh
Unless something's changed about how `open` works on the mac, you can pass arguments after `--args`, replace /path/to etc above with `open -a factorio --args` or whatever.

Re: Override data directory on OSX

Posted: Sat Apr 29, 2017 9:59 pm
by Alxandr
So, I just tested this.

Game is positioned at

Code: Select all

~/foo/factorio.app
Config file is positioned at

Code: Select all

~/foo/config/config.ini
Config file content:

Code: Select all

[path]
read-data=__PATH__executable__/../../data
write-data=/Users/alxandr/foo/data
Command run:

Code: Select all

open -a /Users/alxandr/foo/factorio.app --args /Users/alxandr/foo/config/config.ini
I'm still seeing my saves in Application Support.

Re: Override data directory on OSX

Posted: Sat Apr 29, 2017 10:10 pm
by quyxkh
You're missing the `-c`

Re: Override data directory on OSX

Posted: Sat Apr 29, 2017 10:24 pm
by Alxandr
Thanks, that worked :)