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" "$HOME/.steam/root/compatibilitytools.d/xlm"
) )
XLM_FOUND="" XLM_FOUND=false
for p in "${XLM_PATHS[@]}"; do for p in "${XLM_PATHS[@]}"; do
if [ -d "$p" ]; then if [ -d "$p" ]; then
XLM_FOUND="$p" XLM_FOUND=true
break break
fi fi
done 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." 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 read -p "Install as XLM pre-launch script? [Y/n]: " INSTALL_PRELAUNCH
if [[ ! "$INSTALL_PRELAUNCH" =~ ^[Nn]$ ]]; then if [[ ! "$INSTALL_PRELAUNCH" =~ ^[Nn]$ ]]; then
if [ -n "$XLM_FOUND" ]; then if [ "$XLM_FOUND" = true ]; then
echo "Found XLM at $XLM_FOUND" for p in "${XLM_PATHS[@]}"; do
mkdir -p "$XLM_FOUND/prelaunch.d" if [ -d "$p" ]; then
ln -sf "$BIN_DIR/xivlauncher-wrapper" "$XLM_FOUND/prelaunch.d/xivlauncher-wrapper" echo "Found XLM at $p"
echo "Successfully linked wrapper to $XLM_FOUND/prelaunch.d/" 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 else
echo "Could not automatically detect XLM installation path." echo "Could not automatically detect XLM installation path."
echo "If you have XLM installed, please enter the path to your XLM compatibility tool folder." echo "If you have XLM installed, please enter the path to your XLM compatibility tool folder."