From 970d6b1ab2bcf6148515994b725fd386443005fc Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 23 Jun 2026 21:32:35 +0000 Subject: [PATCH] feat(kyber-linux): auto-download KyberLauncher.exe if not present Instead of erroring when the installer is missing, attempt to fetch it automatically: first scrape kyber.gg for a direct .exe link, then fall back to a known CDN path. If download fails, print the manual instruction and exit cleanly. Co-Authored-By: Claude Sonnet 4.6 Claude-Session: https://claude.ai/code/session_01D8ckUJQtj1pH8jtAddBDZs --- scripts/setup-kyber-linux.sh | 35 +++++++++++++++++++++++++++++------ 1 file changed, 29 insertions(+), 6 deletions(-) diff --git a/scripts/setup-kyber-linux.sh b/scripts/setup-kyber-linux.sh index 13d9db3..ae263ae 100755 --- a/scripts/setup-kyber-linux.sh +++ b/scripts/setup-kyber-linux.sh @@ -85,14 +85,37 @@ STEAM_HOME=$(find_steam_home) || { } echo "Steam home: $STEAM_HOME" -# ── Verify Kyber installer ───────────────────────────────────────────────── +# ── Verify / download Kyber installer ───────────────────────────────────── if [ ! -f "$KYBER_INSTALLER" ]; then echo "" - echo "ERROR: Kyber installer not found at: $KYBER_INSTALLER" - echo "" - echo "Download KyberLauncher.exe from https://kyber.gg, then:" - echo " $0 /path/to/KyberLauncher.exe" - exit 1 + echo "Kyber installer not found at: $KYBER_INSTALLER" + echo "Attempting to download KyberLauncher.exe from kyber.gg..." + mkdir -p "$(dirname "$KYBER_INSTALLER")" + # Try to find the download link on kyber.gg, then fall back to known URLs. + echo " Checking kyber.gg for the download link..." + KYBER_DL_URL="" + # Extract the first .exe href from the kyber.gg download page + _raw=$(curl -sL --max-time 15 "https://kyber.gg/download" 2>/dev/null || \ + curl -sL --max-time 15 "https://kyber.gg" 2>/dev/null) + if [ -n "$_raw" ]; then + KYBER_DL_URL=$(echo "$_raw" | grep -oP 'https?://[^"'\''<>\s]+KyberLauncher\.exe' | head -1) + fi + # Known fallback locations (update these if kyber.gg changes hosting) + if [ -z "$KYBER_DL_URL" ]; then + KYBER_DL_URL="https://cdn.kyber.gg/builds/KyberLauncher.exe" + fi + echo " Downloading from: $KYBER_DL_URL" + if curl -L --progress-bar -o "$KYBER_INSTALLER" "$KYBER_DL_URL" \ + && [ -s "$KYBER_INSTALLER" ]; then + echo "Downloaded: $KYBER_INSTALLER" + else + echo "" + echo "ERROR: Automatic download failed." + echo "Download KyberLauncher.exe manually from https://kyber.gg, then:" + echo " $0 /path/to/KyberLauncher.exe" + rm -f "$KYBER_INSTALLER" + exit 1 + fi fi echo "Kyber installer: $KYBER_INSTALLER"