diff --git a/README.md b/README.md index fcae612a..e0b61110 100644 --- a/README.md +++ b/README.md @@ -6,6 +6,16 @@ Cross-platform version of XIVLauncher, optimized for Steam Deck. Comes with a ve ## Using on Steam Deck If you want to use XIVLauncher on your Steam Deck, feel free to [follow our guide in our FAQ](https://goatcorp.github.io/faq/steamdeck). If you're having trouble, you can [join our Discord server](https://discord.gg/3NMcUV5) - please don't use the GitHub issues for troubleshooting unless you're sure that your problem is an actual issue with XIVLauncher. +## Environment Variables for troubleshooting +| Variable | Description | +| ------------- | -------------- | +| `XL_USERDIR` | Set to an alternate path to override the default `~/.xlcore` config path. For example, `XL_USERDIR=~/.local/share/xlcore`. This will try to create the path if it does not exist, so be careful. +| `XL_SECRET_PROVIDER` | Set to `file` if using the Steam Deck or other desktop session that doesn't have a secret provider. Set to `none` to disable secret provider. | +| `XL_DECK` | Force XIVLauncher to pretend it's Steam Deck. Does not enable the Steam keyboard. | +| `XL_GAMEMODE` | Forces XIVLauncher to pretend it's in Steam Deck Game Mode. Also does not enable the Steam keyboard. | +| `XL_USE_STEAM` | Set to 0 or 1 to enable or disable steam API checks. | +| `XL_APPID` | Set to a steam AppID number to hook that application instead of FFXIV or the free trial. Ignored when using XLM. | + ## Building & Contributing 1. Clone this repository with submodules 2. Make sure you have a recent(.NET 6.0.400+) version of the .NET SDK installed diff --git a/src/XIVLauncher.Core/Program.cs b/src/XIVLauncher.Core/Program.cs index 2b3a89d5..b563e2ed 100644 --- a/src/XIVLauncher.Core/Program.cs +++ b/src/XIVLauncher.Core/Program.cs @@ -174,7 +174,27 @@ private static DalamudUpdater CreateDalamudUpdater() private static void Main(string[] args) { mainArgs = args; - storage = new Storage(APP_NAME); + + bool badxlpath = false; + var badxlpathex = new Exception(); + string? useAltPath = Environment.GetEnvironmentVariable("XL_USERDIR"); + try + { + storage = new Storage(APP_NAME, useAltPath); + } + catch (Exception e) + { + storage = new Storage(APP_NAME); + badxlpath = true; + badxlpathex = e; + } + + SetupLogging(mainArgs); + + if (badxlpath) + { + Log.Error(badxlpathex, $"Bad value for XL_PATH: {useAltPath}. Using ~/.xlcore instead."); + } if (CoreEnvironmentSettings.ClearAll) { @@ -189,7 +209,6 @@ private static void Main(string[] args) if (CoreEnvironmentSettings.ClearLogs) ClearLogs(); } - SetupLogging(mainArgs); LoadConfig(storage); Secrets = GetSecretProvider(storage);