refactor: improve XLM detection and enable multi-path pre-launch script installation

This commit is contained in:
CPTN Cosmo 2026-04-18 15:39:41 +02:00
parent 940217d95d
commit 16719f7400

View file

@ -202,10 +202,10 @@ XLM_PATHS=(
"$HOME/.steam/root/compatibilitytools.d/xlm"
)
XLM_FOUND=""
XLM_FOUND=false
for p in "${XLM_PATHS[@]}"; do
if [ -d "$p" ]; then
XLM_FOUND="$p"
XLM_FOUND=true
break
fi
done
@ -214,11 +214,15 @@ echo "Would you like to install the wrapper as a pre-launch script for XLM?"
echo "This allows the OTP injector to run automatically when launching FFXIV via Steam with XLM."
read -p "Install as XLM pre-launch script? [Y/n]: " INSTALL_PRELAUNCH
if [[ ! "$INSTALL_PRELAUNCH" =~ ^[Nn]$ ]]; then
if [ -n "$XLM_FOUND" ]; then
echo "Found XLM at $XLM_FOUND"
mkdir -p "$XLM_FOUND/prelaunch.d"
ln -sf "$BIN_DIR/xivlauncher-wrapper" "$XLM_FOUND/prelaunch.d/xivlauncher-wrapper"
echo "Successfully linked wrapper to $XLM_FOUND/prelaunch.d/"
if [ "$XLM_FOUND" = true ]; then
for p in "${XLM_PATHS[@]}"; do
if [ -d "$p" ]; then
echo "Found XLM at $p"
mkdir -p "$p/prelaunch.d"
ln -sf "$BIN_DIR/xivlauncher-wrapper" "$p/prelaunch.d/xivlauncher-wrapper"
echo "Successfully linked wrapper to $p/prelaunch.d/"
fi
done
else
echo "Could not automatically detect XLM installation path."
echo "If you have XLM installed, please enter the path to your XLM compatibility tool folder."