From 16719f7400ddfd2b8f93785a6deb8e92a6bf07a3 Mon Sep 17 00:00:00 2001 From: cosmo Date: Sat, 18 Apr 2026 15:39:41 +0200 Subject: [PATCH] refactor: improve XLM detection and enable multi-path pre-launch script installation --- installer.sh | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/installer.sh b/installer.sh index 94f93e9..231d146 100755 --- a/installer.sh +++ b/installer.sh @@ -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."