In other languages: Deutsch 日本語 Polski Русский Türkçe 简体中文

Application directory: Difference between revisions

From Official Factorio Wiki
Jump to navigation Jump to search
(→‎Locations: Updated information on Steam Cloud saves, and added instructions on how to transfer blueprint collections from a website install to a Steam install.)
 
(60 intermediate revisions by 22 users not shown)
Line 1: Line 1:
The application directory stores
{{Languages}}
* the saves (every save is a zip-file)
== Overview ==
* the [[Mods]]
Depending on your installation method and OS, you will have one or two directories that contain Factorio assets, and one that contains user data, such as saves and mods.
* scenarios
* configuration
* logs (since v0.10.0).


The directory structure is self-explaining.
== User data directory ==
The user data directory is where personal files are stored:
* Save files <code>./saves</code>
* Mods <code>./mods</code>
* Script-output, e.g. from /screenshot <code>./script-output</code>
* Local [[scenario system|scenarios]] <code>./scenarios</code>
* Local settings <code>./config/config.ini</code>
* [[log file]]s <code>factorio-*.log</code>
* Crash dump files <code>factorio-dump-*.dmp</code>


You can delete for example the configuration-file; it will be generated new with the defaults.
=== Locations ===
Search your computer for the directory location, or type the path into your file manager address bar.


It is recommended to create backups from this directory, before you install a new version.
Windows:


%appdata%\Factorio


== Installation by Zip-package ==
:The <code>%appdata%</code> shorthand translates to your local version of <code>C:\Users\[user name]\AppData\Roaming</code>
Zip package is just one Factorio directory that doesn't need to be installed, all the saves are there locally easy to find.


== Installation via Installer ==
MacOSX:
=== Windows ===


Installation package follows UAC. For that case the factorio directory is where you install it (Program files by default) and the user data (saves, player data etc) are stored in
~/Library/Application Support/factorio
C:\Users\<username>\AppData\Roaming\Factorio
 
Windows Vista and newer (UAC activ):
Linux distributions:
%appdata%\factorio
 
~/.factorio
 
:When using the Flatpak version of steam, all paths start from <code>~/.var/app/com.valvesoftware.Steam/</code> instead.
 
When using Steam on Windows, the config.ini, achievements.dat, modded-achievements.dat, player-data.json, and a compressed copy of blueprint-storage-2.dat(.zstd) can also be found in


=== MacOSx ===
C:\Program Files (x86)\Steam\userdata\[user number]\427520\remote
The application should be by default installed in the Apps.
 
Whereas the data is stored under
On Linux, the equivalent folder can be found in  
  ~/Library/Application Support/factorio
 
Which is equivalent to
  ~/.steam/steam/userdata/[user number]/427520/remote
/users/<username>/Library/Application Support/factorio
 
Before copying blueprint-storage-2.dat from a website install of Factorio to a Steam install, disable Steam Cloud Save, and delete blueprint-storage-2.dat.zstd from "remote". Keep Steam Cloud Save disabled to avoid having your blueprints overwritten.
 
== Application directory ==
The application directory stores three things:
* Factorio executables <code>./bin</code>
* Data for vanilla Factorio <code>./data</code>
* API documentation <code>./doc-html</code>
 
=== Locations ===
 
Windows:
 
C:\Program Files (x86)\Steam\steamapps\common\Factorio
C:\Program Files\Factorio
 
MacOSX:


'''If you don't see this folder it is invisible for you.''' Search in the internet for for example about ''"make library folder visible macos"''.
~/Library/Application Support/Steam/steamapps/common/Factorio/factorio.app/Contents
/Applications/factorio.app/Contents


Example link: http://finerthings.in/featured/lion-library-folder-visible/
Linux:


=== Linux ===
~/.steam/steam/steamapps/common/Factorio
Data is stored under
  ~/.factorio
  ~/.factorio


==Changing the save directory==
== Changing the user data directory ==
 
You can create a file <code>config-path.cfg</code> to configure Factorio to any directory.
 
In order to change the user data directory, user must edit the location of the "write-data" entry in the file <code>(Game install directory)/config/config.ini</code>. This affects the location of mods, scenario and temp.
 
==== macOS ====
 
There are two ways to change the user data location on macOS. One is to change the contents of '''factorio.app''' in your Applications folder. It is simpler, but macOS will prevent the modified app from running in some cases. The other is to surround '''factorio.app''' with special configuration files, and then to run Factorio in a special way. It is more complex, but won't provoke macOS to cause you problems.
 
As background, know that '''factorio.app''', although it looks like a single file, is in fact a "package", also known as an "app bundle". This is a special kind of directory. Using the right Finder command, you can open the package, and change the files and directories within. However, macOS has a [https://support.apple.com/en-ca/guide/security/sec5599b66df/web security system called Gatekeeper]. In certain situations, Gatekeeper will check that the app bundle is completely identical to its original contents. Gatekeeper will notice any modifications you make within the app bundle. It will cause macOS to refuse to run the app. When and how often Gatekeeper checks differs by macOS version. It is very likely to check when you first run an application. In newer versions of macOS, like macOS Sequoia 15, it will check more often, even after your first run.
 
If you are willing to modify the Factorio app bundle, then create <code>factorio.app/config-path.cfg</code> with the following contents:
 
config-path=__PATH__executable__/../config
use-system-read-write-data-directories=false
 
Update <code>factorio.app/Contents/config/config.ini</code>
[path]
read-data=__PATH__executable__/../data
write-data=__PATH__executable__/..
 
If you do not wish to modify the Factorio app bundle, follow the instructions in '''[http://www.factorioforums.com/forum/viewtopic.php?f=49&t=12819&p=87281#p87281 this forum discussion]'''.
 
==== Linux ====
Update <code>__Game_Install_directory/config-path.cfg</code>
 
use-system-read-write-data-directories=true
 
Update <code>__Game_Install_directory/config/config.ini</code>
 
[path]
read-data=__PATH__executable__/../../data
write-data=.local/share/factorio
 
You could set the <code>write-data</code> value to '''<code>.factorio</code>''' if you prefer.
 
Once you have done this, you can remove write permissions to the entire game installation directory '''except''' for <code>config/config.ini</code>, which '''must''' be writable by all people who wish to play the game.
 
Note that if someone changes any options, in-game, those option changes will apply to everyone who plays on the same computer.
 
== Installation from Zip File ==
The unzipped Factorio directory.
 
A list of all things found here:
 
* Save games (as zip files)
* User-installed/created [[Mods]].
* User-installed/created scenarios.
* User configuration and settings storage
* [[Log file]] (factorio-*.log)
* Player data (player-data.json)
 
Note: Deleting the configuration file will result in a default replacement being generated upon the next Factorio launch.
 
It is recommended to create backups from this directory (of saves, config, etc) before installing a new version.
 
== See also ==
* [[Install guide]]
* [[Installing Mods]]
* [http://www.factorioforums.com/forum/viewtopic.php?f=5&t=8294 Linux Version - Save games in $HOME somewhere]


It is possible to change the save directory for Factorio. This can be done by editing the location of the "write-data" entry in the ''config-paths.cfg'' file, though this also affects the location of the other directories (mods, scenario, temp). If you want to move only the location of your save files you can [[Application_Directory/Changing_the_save_directory|change the the save directory using symlinks]].
{{C|Main}}

Latest revision as of 06:48, 27 November 2024

Overview

Depending on your installation method and OS, you will have one or two directories that contain Factorio assets, and one that contains user data, such as saves and mods.

User data directory

The user data directory is where personal files are stored:

  • Save files ./saves
  • Mods ./mods
  • Script-output, e.g. from /screenshot ./script-output
  • Local scenarios ./scenarios
  • Local settings ./config/config.ini
  • log files factorio-*.log
  • Crash dump files factorio-dump-*.dmp

Locations

Search your computer for the directory location, or type the path into your file manager address bar.

Windows:

%appdata%\Factorio
The %appdata% shorthand translates to your local version of C:\Users\[user name]\AppData\Roaming

MacOSX:

~/Library/Application Support/factorio

Linux distributions:

~/.factorio
When using the Flatpak version of steam, all paths start from ~/.var/app/com.valvesoftware.Steam/ instead.

When using Steam on Windows, the config.ini, achievements.dat, modded-achievements.dat, player-data.json, and a compressed copy of blueprint-storage-2.dat(.zstd) can also be found in

C:\Program Files (x86)\Steam\userdata\[user number]\427520\remote

On Linux, the equivalent folder can be found in

~/.steam/steam/userdata/[user number]/427520/remote

Before copying blueprint-storage-2.dat from a website install of Factorio to a Steam install, disable Steam Cloud Save, and delete blueprint-storage-2.dat.zstd from "remote". Keep Steam Cloud Save disabled to avoid having your blueprints overwritten.

Application directory

The application directory stores three things:

  • Factorio executables ./bin
  • Data for vanilla Factorio ./data
  • API documentation ./doc-html

Locations

Windows:

C:\Program Files (x86)\Steam\steamapps\common\Factorio
C:\Program Files\Factorio

MacOSX:

~/Library/Application Support/Steam/steamapps/common/Factorio/factorio.app/Contents
/Applications/factorio.app/Contents

Linux:

~/.steam/steam/steamapps/common/Factorio
~/.factorio

Changing the user data directory

You can create a file config-path.cfg to configure Factorio to any directory.

In order to change the user data directory, user must edit the location of the "write-data" entry in the file (Game install directory)/config/config.ini. This affects the location of mods, scenario and temp.

macOS

There are two ways to change the user data location on macOS. One is to change the contents of factorio.app in your Applications folder. It is simpler, but macOS will prevent the modified app from running in some cases. The other is to surround factorio.app with special configuration files, and then to run Factorio in a special way. It is more complex, but won't provoke macOS to cause you problems.

As background, know that factorio.app, although it looks like a single file, is in fact a "package", also known as an "app bundle". This is a special kind of directory. Using the right Finder command, you can open the package, and change the files and directories within. However, macOS has a security system called Gatekeeper. In certain situations, Gatekeeper will check that the app bundle is completely identical to its original contents. Gatekeeper will notice any modifications you make within the app bundle. It will cause macOS to refuse to run the app. When and how often Gatekeeper checks differs by macOS version. It is very likely to check when you first run an application. In newer versions of macOS, like macOS Sequoia 15, it will check more often, even after your first run.

If you are willing to modify the Factorio app bundle, then create factorio.app/config-path.cfg with the following contents:

config-path=__PATH__executable__/../config
use-system-read-write-data-directories=false

Update factorio.app/Contents/config/config.ini

[path]
read-data=__PATH__executable__/../data
write-data=__PATH__executable__/.. 

If you do not wish to modify the Factorio app bundle, follow the instructions in this forum discussion.

Linux

Update __Game_Install_directory/config-path.cfg

use-system-read-write-data-directories=true

Update __Game_Install_directory/config/config.ini

[path]
read-data=__PATH__executable__/../../data
write-data=.local/share/factorio

You could set the write-data value to .factorio if you prefer.

Once you have done this, you can remove write permissions to the entire game installation directory except for config/config.ini, which must be writable by all people who wish to play the game.

Note that if someone changes any options, in-game, those option changes will apply to everyone who plays on the same computer.

Installation from Zip File

The unzipped Factorio directory.

A list of all things found here:

  • Save games (as zip files)
  • User-installed/created Mods.
  • User-installed/created scenarios.
  • User configuration and settings storage
  • Log file (factorio-*.log)
  • Player data (player-data.json)

Note: Deleting the configuration file will result in a default replacement being generated upon the next Factorio launch.

It is recommended to create backups from this directory (of saves, config, etc) before installing a new version.

See also