Override data directory on OSX

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
User avatar
Alxandr
Inserter
Inserter
Posts: 22
Joined: Wed Feb 15, 2017 5:53 pm
Contact:

Override data directory on OSX

Post 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"?

quyxkh
Smart Inserter
Smart Inserter
Posts: 1028
Joined: Sun May 08, 2016 9:01 am
Contact:

Re: Override data directory on OSX

Post 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

User avatar
Alxandr
Inserter
Inserter
Posts: 22
Joined: Wed Feb 15, 2017 5:53 pm
Contact:

Re: Override data directory on OSX

Post 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`?

quyxkh
Smart Inserter
Smart Inserter
Posts: 1028
Joined: Sun May 08, 2016 9:01 am
Contact:

Re: Override data directory on OSX

Post 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.

User avatar
Alxandr
Inserter
Inserter
Posts: 22
Joined: Wed Feb 15, 2017 5:53 pm
Contact:

Re: Override data directory on OSX

Post 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.

quyxkh
Smart Inserter
Smart Inserter
Posts: 1028
Joined: Sun May 08, 2016 9:01 am
Contact:

Re: Override data directory on OSX

Post by quyxkh »

You're missing the `-c`

User avatar
Alxandr
Inserter
Inserter
Posts: 22
Joined: Wed Feb 15, 2017 5:53 pm
Contact:

Re: Override data directory on OSX

Post by Alxandr »

Thanks, that worked :)

Post Reply

Return to “Technical Help”