Page 1 of 1

Use folder env vars for all platforms ?

Posted: Tue Mar 31, 2026 2:36 pm
by Lone_Wolf
from master Documentation/docs/index.md

Code: Select all

## Linux

The AppImage can be configured to use alternative locations by setting various environment variables:

| Environment Variable | Value  | Game Folder                                      |
|:---------------------|:-------|:-------------------------------------------------|
| `OO_DIRTYPE`         | xdg    | `$HOME/.local/share/Oolite`                      |
| `OO_DIRTYPE`         | legacy | `$HOME` (old folder structure - not recommended) |

More intricate setups are possible by specifying individual environment variables for different folders:

| Environment Variable      | Description                             | Default Path (if unset)                  |
|:--------------------------|:----------------------------------------|:-----------------------------------------|
| `OO_SAVEDIR`              | Directory for saved games               | `$GAME_DATA/SavedGames`                  |
| `OO_SNAPSHOTSDIR`         | Directory for screenshots/snapshots     | `$GAME_DATA/Snapshots`                   |
| `OO_LOGSDIR`              | Directory for game log files            | `$GAME_DATA/.logs`                       |
| `OO_MANAGEDADDONSDIR`     | Directory for OXPs managed by the game  | `$GAME_DATA/.ManagedAddOns`              |
| `OO_USERADDONSDIR`        | User-specified directory for OXPs       | `$GAME_DATA/AddOns`                      |
| `OO_ADDONSEXTRACTDIR`     | Directory for extracted OXPs            | `${OO_USERADDONSDIR:-$GAME_DATA/AddOns}` |
| `OO_ADDITIONALADDONSDIRS` | List of extra addon search paths        |                                          |
| `OO_GNUSTEPDIR`           | GNUstep directory                       | `$GAME_DATA/.GNUstep`                    |
| `OO_GNUSTEPDEFAULTSDIR`   | User preferences defaults file location | `$GAME_DATA`                             |
I feel that this could be very useful for many more platforms then just linux appimages .

Windows, *BSDs, macOS and Google Android all support environment vars.

Re: Use folder env vars for all platforms ?

Posted: Tue Mar 31, 2026 4:43 pm
by Commander_X
Lone_Wolf wrote: Tue Mar 31, 2026 2:36 pm
[...]
Windows, *BSDs, macOS and Google Android all support environment vars.
They do, but I think for Windows the choice is to hardcode them into the .exe file.

BTW of env vars, I was very pleasantly surprised when using the run_oolite.sh script in the build directory, to find out that finally one of the missing features I envied Windows version for, was available: per-instance conf/saves/addons, and the rest, as opposed to per-user.

Alas, it gets wiped out during a "make clean", but I can live with that.