Override data directory on OSX
Override data directory on OSX
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
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
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:
How would I get saves at `/foo/saves` (or anything else under `/foo`), and mods and config ++ under `/foo`?
Code: Select all
open -a /foo/factorio.app
Re: Override data directory on OSX
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
So, I just tested this.
Game is positioned at
Config file is positioned at
Config file content:
Command run:
I'm still seeing my saves in Application Support.
Game is positioned at
Code: Select all
~/foo/factorio.app
Code: Select all
~/foo/config/config.ini
Code: Select all
[path]
read-data=__PATH__executable__/../../data
write-data=/Users/alxandr/foo/data
Code: Select all
open -a /Users/alxandr/foo/factorio.app --args /Users/alxandr/foo/config/config.ini
Re: Override data directory on OSX
You're missing the `-c`
Re: Override data directory on OSX
Thanks, that worked