Page 1 of 1

Multiple Factorio Installs

Posted: Tue Jun 09, 2015 6:40 am
by -root
I'm trying to get multiple factorio installs to work. This is so I can have a different modset active on each one. I tend to forget to deactivate them through the ingame console and when i load save games, that completely borks them.

Is there a way of getting multiple installs to work with a different modset on each OR is there are way of packaging the mods so that I only have to turn on/off ONE mod per savegame?

Re: Multiple Factorio Installs

Posted: Tue Jun 09, 2015 7:12 am
by Martc
According to wiki, it should be possible to have 2 separate zip installations, with separate mod and saves directory. Or zip and normal installation.

Re: Multiple Factorio Installs

Posted: Tue Jun 09, 2015 12:35 pm
by daniel34
It's perfectly possible to have multiple installs of factorio one one pc.
But only one of them can be the Installer version, all others have to be the zip version.

The installer version reads/writes your mods, saves, config to %appdata%\Factorio (at least on windows), that's why you can only have one.
The zip version reads/writes everything it needs from its own folder, completely independent and isolated from other installs.

For example, I have the installer version installed without mods, and currently 2 zip versions for different mod packs.
You can even copy the zip folder onto another computer and continue playing, or just keep it on an usb drive.

Re: Multiple Factorio Installs

Posted: Tue Jun 09, 2015 3:23 pm
by Klonan
Its perfectly easy, I have two directories, one is my 'main' one, which i used the installer to install, with the mod directory being in my romaing folder, the other i have uses its own directory to store the mods, and made straight from the .zip i think. If you want to create more directories you can just copy paste the entire factorio directory if you copied it from the zip.
Installed directory
zip copied directory

Re: Multiple Factorio Installs

Posted: Thu Jun 11, 2015 11:31 pm
by -root
ah! brilliant! thanks guys, i'll be giving it a crack over the weekend.

Re: Multiple Factorio Installs

Posted: Mon Jun 15, 2015 6:43 pm
by ssilk
Is there a way to do something similar on macOs, too?

I know I can run the app directly, but it uses the ~/Library/Application Support for the user. Can this be configured?

Re: Multiple Factorio Installs

Posted: Mon Jun 15, 2015 10:25 pm
by daniel34
I don't own a mac so I can't tell you for sure, but I know that on windows and linux the zip-versions only read and write from their own directory, so I would assume it's the same for mac.
Also, you can configure the read/write path in the config/config.ini file (at least on windows).

Re: Multiple Factorio Installs

Posted: Mon Jun 15, 2015 10:27 pm
by DaveMcW
There is no Mac zip file. ;)

You could keep multiple copies of config.ini, but you would have to copy the one you want into the config folder every time you start the game.

Re: Multiple Factorio Installs

Posted: Tue Jun 16, 2015 8:16 am
by cube
ssilk wrote:Is there a way to do something similar on macOs, too?

I know I can run the app directly, but it uses the ~/Library/Application Support for the user. Can this be configured?
Yes, you can do it on mac too, but you'll have to do some manual changes :-). Unfortunately I've never done that before and currently don't have that much time to research it -- but in general the steps should be something like this:

1) Mount the dmg file
2) Make directory somewhere (let's call it F)
3) Copy factorio.app from the dmg file to F
4) Edit file F/factorio.app/config-path.cfg to contain

Code: Select all

config-path=__PATH__executable__/../../../config
use-system-read-write-data-directories=false
5) Edit file F/config/config.ini to contain

Code: Select all

[path]
write-data=__PATH__executable__/../../..
That should turn the directory F into a portable instalation of Factorio and keep the updates working. But no guarantees :-)
You could also copy your existing config and other data from ~/Library/Application Support/factorio to F and only overwrite the line in config file in step 5, if you don't mind the complications.

Re: Multiple Factorio Installs

Posted: Tue Jun 16, 2015 12:30 pm
by ssilk
Thanks. :) When this works, I make an update in the wiki: https://forums.factorio.com/wiki/inde ... _directory

Re: Multiple Factorio Installs

Posted: Wed Jul 22, 2015 3:10 pm
by Wyrm
As stated, this Mac OS multiple installs guide doesn't work. I've tried a couple of likely locations to put config-path, and no love. It still uses the Application Support directory. What function are you using to figure out __PATH__executable__ in the Mac version, and how is config-path.cfg built from that? If I have that, I can reconstruct where the mac version expects to find its config-path file.

By the way, the Application Support directory should not be used to store user data. Mods and saves are user data and should be moved out of that directory to a configurable base directory in future versions.

Re: Multiple Factorio Installs

Posted: Sat Jul 25, 2015 3:38 pm
by bluegreenash
Hi, I am running MacOS Yosemite, and have been running 0.11.22 and I have a multiplayer campaign.

However I installed 0.12 as a seperate entity, which seems to run fine, however when I tried to use 0.11.22 I found that it was not working properly.

Although it appeared to work, I could load savegames and generate new worlds, you couldn't interact properly, right / left click and zoom no longer functioned.... Not sure what happened there. Any clues as to what I can do to resolve this?

Thanks


I worked this out....... somewhere along the line the way keybinds for the mouse changed. and I had a whole bunch of invalid keybinds
I had red entries for all my mouse inputs, I resolved this by re-making all my keybinds for mouse button presses to change "Mouse Button 1" to "Mouse Left Button" etc..

go figure..

hmmm continuing n this.... this has happened again... the key binds for the mouse have changed and become invalid...not sure what to do about this but rebind the keys each time.

Re: Multiple Factorio Installs

Posted: Thu Apr 14, 2016 11:36 pm
by realm174
Sorry for reviving an older post... I've been trying to figure out how to do this, and came across this post. I bought my game on Steam. There's no installer or zip version that I can see. Does that mean I don't have the option to do that? Or is there a different way for Steam customers?

Re: Multiple Factorio Installs

Posted: Fri Apr 15, 2016 12:32 am
by daniel34
You can make an account at factorio.com and connect that account with your steam account. Then you are able to download the DRM-free installer and zip-versions.

Re: Multiple Factorio Installs

Posted: Fri Apr 15, 2016 5:14 pm
by realm174
Fantastic, thanks for the prompt response Daniel, that worked perfectly!!

Re: Multiple Factorio Installs

Posted: Thu Dec 30, 2021 12:48 am
by sorahn
Since the wiki points to this thread, I'm resurrecting it from the way past dead for working instructions for the latest version (1.1.50, and macOS).

* in factorio.app/config-path.cfg

Code: Select all

config-path=__PATH__executable__/../config
use-system-read-write-data-directories=false
* in factorio.app/Contents/config/config.ini

Code: Select all

[path]
read-data=__PATH__executable__/../data
write-data=__PATH__executable__/..
You need the read-data and the write-data config values. And the folder structure for the mac version is a lot flatter than it was previously.

Re: Multiple Factorio Installs

Posted: Sat Oct 19, 2024 6:08 pm
by nugget_in_biscuit
I wanted to share an update to this thread since it is one of the only resources covering getting multiple installs working on Mac OS in the final stable release of factorio V1.

I want to share as much information as possible in the hopes that the next sucker engineer doesn't have to spend several hours of research on this.

Here is the short version for those with a CS background:

Factorio appears to ignore any changes we make to the .app contents. We are going to need to drop an unmodified copy into a folder of our choosing, set up our .ini file, set up a folder for factorio to save its data, and then finally use the automator utility to generate a bash terminal command that we can run from our GUI (this last part is optional, but will save hassle).

For the most part, you can follow this guide: https://jamespanther.com/writings/facto ... ltiplayer/, except we will do the following differently:

1) Set up a game data folder inside the folder you store the .app in, and configure the .ini to point to that folder instead of the values used elsewhere in this thread and in the linked article. It should look like this:
[path]
read-data=__PATH__executable__/../data
write-data=<path_to_factorio>/game_data

2) Set up your terminal command to point directly to your game data folder. It should look like this:
open -a <path_to_factorio>/factorio.app --args -c <path_to_factorio>/config/config.ini




Here is a step-by-step explanation aimed at someone without a CS background:

In my testing it appears that the original method of modifying files inside of the .app no longer works. As noted by earlier posters, Mac OS doesn't have a self-contained .zip version. Instead, you download something called a .dmg file. Double click on this, and you should see the familiar interface for installing applications to your Mac - on the left is Factorio.app, and on the right is your applications folder. If you only need one copy of factorio, you can simply drag the program into your applications folder and start building. Unfortunately, that setup is hardcoded to read and write data from "/Users/<username>/Library/Application Support/factorio". This tutorial will show you how configure standalone installs of factorio with independent saves and mods.

The very first thing we should do is create a folder somewhere on our computer where we want factorio to live. This can be anywhere - I recommend a folder inside of Documents because it is easy to remember and syncs with iCloud by default. Once you create this folder, you should copy factorio.app into it, and then create two empty folders: "config" and "game_data" (note: make sure to use lowercase). The former will store a document that tells factorio to store all user data inside of /game_data. Let's set up that document. Considering that you are reading this guide, I'm going to assume you already have installed and played factorio at least once. We are going to borrow that install's configuration file. Use finder to navigate to the following location: "/Users/<username>/Library/Application Support/factorio/config" (if you can't find it, hit shift-command-G and type the filepath manually). You should see a single file called "config.ini" - copy and paste it into the /config folder you created earlier. Open the file (you may need to manually launch TextEdit and browse to the file) and look for these three lines near the top:

[path]
read-data=__PATH__system-read-data__
write-data=__PATH__system-write-data__

These lines tell factorio where it should be reading and writing internal game data and user data. Let's change these three lines to look like this:

[path]
read-data=__PATH__executable__/../data
write-data=<path_to_factorio>/game_data

As a reminder, <path_to_factorio> is the filepath to the folder you created earlier that contains factorio.app, /config, and /game_data. You can get this by right clicking the folder in finder and copying the file path (it will correctly format everything). By default Mac OS won't copy the folder name itself, so be sure to type in the name of your factorio folder if it doesn't. Be carefull not to mess with any of the other lines in this file. Double check that you aren't editing the copy inside of "Application Support", and then save it and close the file.

At this point I recommend testing your progress so far by double clicking on factorio.app. You may be dismayed to see that the game is still looking for its data in the default folder, but that's what we are about to fix.

As of the writing of this post, there doesn't appear to be a working option to configure factorio to read the .ini file we just set up if we launch it by clicking on the program itself. Instead, we are going to need to use something called the terminal. This is a text-based utility that allows us to pass very specific commands directly to our operating system. Many programs - including factorio - can be passed special data and commands when launched from the terminal. This guide isn't a terminal tutorial so I'm going to give you very specific instructions to follow:


1) Open spotlight search by clicking on the magnifying glass icon in the upper right side of your screen or hitting "shift-space"
2) Type "terminal" and hit enter
3) Type the following command exactly as formatted.

open -a <path_to_factorio>/factorio.app --args -c <path_to_factorio>/config/config.ini

Note 1) Any whitespace is made by hitting the space bar a single time - do not hit tab.
Note 2) "--args" does indeed use two dashes. That's not a typo.
Note 3) DO NOT PRECEED THIS COMMAND WITH "SUDO" - I know it's a meme, but there is a tiny yet nonzero chance you could do something bad if you type this command incorrectly.
4) Hit enter. Factorio should open to a clean install. Verify this by looking for mods and existing save files. Create a new game and save it. You should see it pop up in /game_data. Close factorio and go back to the terminal. Hit the "up" key once to repopulate the command you just typed in, then hit enter again. Repeat the functionality test to verify factorio is still saving games to /game_data, and isn't trying to pull data from elsewhere. This is an important step because you will run into issues on the second launch if you mess anything up.
5) Go back to the terminal and copy the exact command you used previously. You can select text normally in modern Mac OS so this should be easy.


You now have a working scheme for launching a standalone copy of factorio. But it's kind of annoying to use the terminal any time we want to launch our program. In keeping with the theme of the game, let's use some automation:


1) Use spotlight search to open a program called "automator"
2) The program should open to a default screen asking you to choose a type for your document. If it doesn't you can select the option to create a new document. Select "Application" then click the blue "choose" button.
3) The interface here is pretty complex, but don't worry. Start in the leftmost column and select "Utilities". Next, look in the adjacent column for a line titled "Run Shell Script" and double click on it.
4) A new interface should appear. Let's check the two dropdowns at the top - make sure the left one ("Shell:") is set to "/bin/bash", and the right one ("Pass input") is set to "to stdin".
5) Let's put the terminal command we copied earlier into the text field (by default it will say "cat" - you should delete this before you paste your command).
6) Click on "File" > "Save As" in the bar at the top of your computer screen. Set the name of your automation to whatever you want (ex: "launcher.app", "biters.app", "black_hole_of_time.app") and save it to the same folder you are storing factorio.app in. Test your automation by double clicking on it in finder. From now on you should always launch this copy of factorio using this program.


Repeat this process as many times as you want. I recommend that you make a copy of the factorio folder you just set up and set it aside. Every time you want to make a new install you can copy the entire folder and edit the file paths inside of config.ini and your automation (do this by launching "automator" and using its open file commands).




A couple of troubleshooting tips:
“I tried to open factorio, but I get a notice the application is damaged and should be moved to the trash” - You opened the .app and messed with its contents before opening that specific app in that specific folder. Mac OS isn’t a fan of opening signed code for the first time if it’s been changed in any way. This is unrecoverable and you should swap in a new copy from your .dmg. Any saves stored inside of the .app should work fine so you shouldn't worry about data loss (although it would be impressive if you managed to set up data before getting factorio to fail the initial verification process).

“Factorio opened fine the first time, but now I get an odd error about a lock file” - You set your .ini file according to the earlier posts in this thread instead of my guide. Factorio set up a /data folder inside of the .app, and this causes issues when you try to open the game for the second time. Right click the .app and select “open package contents.” Copy all of the data out of the /data folder and drop it into the folder my guide has you make. Fix your .ini, swap in a fresh install of factorio.app, and try again.

“I did everything you said and it’s still not working” - Try adding a .cfg file to the same folder you are storing this install of factorio in. Probably won’t help but might do something. If that doesn’t work, your best bet is to start over. Luckily, all of your data lives in the folder you created earlier so you can start with a fresh copy of the game without consequences.

"What does <username> mean?" - Anytime you see <XXX> you should drop specifics to your computer there. So <username> becomes your user name, and <path_to_factorio> is the path to the folder you are storing factorio inside of.

"When I tested my launch command in the terminal I got an error that my files didn't exist" - Either you typed the path in wrong, or your path contains whitespaces and you didn't surround the path with "quotes".

Re: Multiple Factorio Installs

Posted: Wed Oct 30, 2024 12:35 pm
by karamanolev
Just tested this with Factorio: Space Age 2.0.11 on macOS Sequoia 15.0.1 and it worked perfectly, the key being the last post by nugget_in_biscuit and not the information provided before that.