Skip to content

filesystem

Joey Foo edited this page Feb 9, 2016 · 1 revision

#Organization of files and folders

This page describes how openBVE stores its program data (e.g. language files) and user data (e.g. settings).

Without further configuration, the default model is used. If you want a different organization, please see below for methods of customization.

##Note

The content of this page is outdated. The latest releases of openBVE includes a configuration that should save files into the install directory.


##Default model

By default, all application data (e.g. images) is stored in the install directory. This is the folder where OpenBve.exe is located.

All userdata (e.g. settings) is stored in a folder specific to the operating system:

Operating system USERDATA folder
Windows XP C:\Documents and Settings\USER\Application Data\openBVE
Windows Vista/7 C:\Users\USER\AppData\Roaming\OpenBVE
Linux / Mac OS X ~/.config/openBVE

The default model then stores various items in the following locations:

Data Location
Application data INSTALLDIRECTORY/Data
Settings USERDATA/Settings
Managed content USERDATA/ManagedContent
Initial Route folder USERDATA/LegacyContent/Railway/Route
Initial Train folder USERDATA/LegacyContent/Train

##Customized model

If you want to use a different file organization than the default model presented above, you have to create a configuration file. You can use either one of the following ways in order to make openBVE recognize this file:

  • Place the file filesystem.cfg inside INSTALLDIRECTORY/UserData/Settings, where INSTALLDIRECTORY is the folder where OpenBve.exe is located.
  • Via the command line, include the parameter /filesystem=CONFIGFILE, where CONFIGFILE is the fully-qualified path to the configuration file.

The configuration file has the following format:

Data = FOLDER
ManagedContent = FOLDER1, FOLDER2, FOLDER3, ...
Settings = FOLDER
InitialRoute = FOLDER
InitialTrain = FOLDER
RestartProcess = FILE
RestartArguments = ARGUMENTS

All FOLDER and FILE must be absolute paths and can contain the following symbolic values:

Symbolic value Description
$[AssemblyFile] The path to the executing assembly (OpenBve.exe)
$[AssemblyFolder] The folder where the executing assembly is stored
$[ApplicationData] The OS-specific folder where user-specific application data is stored
$[CommonApplicationData] The OS-specific folder where all-user application data is stored
$[Personal] The OS-specific home directory of the current user

Data is the folder where static application data is stored. This contains the folders Compatiblity, Flags, and Languages, among others.

ManagedContent is the folder where managed content is stored. You can also specify multiple folders separated by comma.

Settings is the folder where user-specific settings are stored. This includes the files settings.cfg, controls.cfg and log.txt, among others.

InitialRoute is the default folder where the main menu browses for legacy routes. Once the user browses to a different folder, this is stored in the settings.cfg.

InitialTrain is the default folder where the main menu browses for legacy trains. Once the user browses to a different folder, this is stored in the settings.cfg.

RestartProcess is the path to the file that is executed if the user selects to return to the main menu.

RestartArguments are the command-line arguments that are passed to the process that is executed when the user selects to return to the main menu.

For managed content, you can specify multiple lookup directories. In this case, openBVE will always install new packages to the first directory specified, but will find packages regardless of where they are stored (meaning, you can move individual packages from one directory to another manually).

Examples

A configuration file that describes the default model:

Data = $[AssemblyFolder]/Data
ManagedContent = $[ApplicationData]/openBVE/ManagedContent
Settings = $[ApplicationData]/openBVE/Settings
InitialRoute = $[ApplicationData]/openBVE/LegacyContent/Railway/Route
InitialTrain = $[ApplicationData]/openBVE/LegacyContent/Train
RestartProcess = $[AssemblyFile]
RestartArguments =

A configuration file that stores all userdata in the install directory:

Data = $[AssemblyFolder]/Data
ManagedContent = $[AssemblyFolder]/UserData/ManagedContent
Settings = $[AssemblyFolder]/UserData/Settings
InitialRoute = $[AssemblyFolder]/UserData/LegacyContent/Railway/Route
InitialTrain = $[AssemblyFolder]/UserData/LegacyContent/Train
RestartProcess = $[AssemblyFile]
RestartArguments =