# TSMusicBot Phase 8: Deployment & Packaging > **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (`- [ ]`) syntax for tracking. **Goal:** Create one-click install experiences for Windows (.exe + portable .zip) and Linux (install script + Docker), plus the first-run Setup Wizard in the WebUI. **Architecture:** Windows uses `pkg` to bundle Node.js into a single .exe with FFmpeg as a sidecar binary. Linux uses a shell script that installs dependencies and configures systemd, plus a Docker image. The Setup Wizard is a Vue.js view that guides users through initial configuration. **Tech Stack:** pkg, Inno Setup/NSIS, Docker, bash --- ### Task 1: Windows start script **Files:** - Create: `scripts/start.bat` - [ ] **Step 1: Create start.bat** ```bat @echo off title TSMusicBot echo Starting TSMusicBot... echo. :: Check if node is available where node >nul 2>&1 if %errorlevel% neq 0 ( echo Node.js is not installed. Please install Node.js 20 LTS from https://nodejs.org pause exit /b 1 ) :: Check if ffmpeg is available where ffmpeg >nul 2>&1 if %errorlevel% neq 0 ( echo FFmpeg not found in PATH. Checking local directory... if exist "%~dp0ffmpeg\ffmpeg.exe" ( set PATH=%~dp0ffmpeg;%PATH% echo Using bundled FFmpeg. ) else ( echo FFmpeg is required. Please install FFmpeg or place it in the ffmpeg\ directory. pause exit /b 1 ) ) :: Install dependencies if needed if not exist "%~dp0node_modules" ( echo Installing dependencies... cd /d "%~dp0" call npm install --production ) :: Start the application cd /d "%~dp0" node dist/index.js pause ``` - [ ] **Step 2: Commit** ```bash git add scripts/start.bat git commit -m "feat: add Windows start script with dependency checks" ``` --- ### Task 2: Linux install script **Files:** - Create: `scripts/install.sh` - [ ] **Step 1: Create install.sh** ```bash #!/usr/bin/env bash set -euo pipefail echo "╔══════════════════════════════════════╗" echo "║ TSMusicBot Installer ║" echo "╚══════════════════════════════════════╝" echo "" INSTALL_DIR="/opt/tsmusicbot" SERVICE_NAME="tsmusicbot" # Detect OS if [ -f /etc/os-release ]; then . /etc/os-release OS=$ID else echo "Unsupported OS" exit 1 fi echo "[1/5] Installing system dependencies..." case $OS in ubuntu|debian) sudo apt-get update -qq sudo apt-get install -y -qq curl ffmpeg ;; centos|rhel|fedora) sudo yum install -y curl ffmpeg ;; arch|manjaro) sudo pacman -S --noconfirm curl ffmpeg ;; *) echo "Unsupported OS: $OS. Please install Node.js 20 and FFmpeg manually." ;; esac echo "[2/5] Installing Node.js 20 LTS..." if ! command -v node &> /dev/null || [[ $(node -v | cut -d. -f1 | tr -d 'v') -lt 20 ]]; then curl -fsSL https://deb.nodesource.com/setup_20.x | sudo -E bash - sudo apt-get install -y -qq nodejs 2>/dev/null || sudo yum install -y nodejs 2>/dev/null fi echo "Node.js $(node -v) installed" echo "[3/5] Downloading TSMusicBot..." sudo mkdir -p "$INSTALL_DIR" # In production, this would download from GitHub releases # For now, copy from current directory if [ -d "$(pwd)/dist" ]; then sudo cp -r "$(pwd)"/* "$INSTALL_DIR/" else echo "Please run this script from the TSMusicBot source directory after building." exit 1 fi echo "[4/5] Installing npm dependencies..." cd "$INSTALL_DIR" sudo npm install --production echo "[5/5] Creating systemd service..." sudo tee /etc/systemd/system/${SERVICE_NAME}.service > /dev/null <
{{ currentStep > i ? '✓' : i + 1 }}
{{ label }}

欢迎使用 TSMusicBot

请设置管理员密码以保护你的 WebUI

连接 TeamSpeak 服务器

登录音乐账号 (可选)

登录后可播放 VIP/付费歌曲,跳过则只能播放免费歌曲

设置完成!

TSMusicBot 已准备就绪

``` - [ ] **Step 2: Add setup route to router** Add to `web/src/router/index.ts` routes array: ```typescript { path: '/setup', name: 'setup', component: () => import('../views/Setup.vue'), }, ``` - [ ] **Step 3: Commit** ```bash git add web/src/views/Setup.vue web/src/router/index.ts git commit -m "feat: add first-run Setup Wizard (4-step guided configuration)" ``` --- ### Task 5: Final build and verify - [ ] **Step 1: Build full project** ```bash cd "C:/Users/saopig1/Music/teamspeak music bot" npm run build ``` Expected: `dist/` (backend) and `web/dist/` (frontend) both exist. - [ ] **Step 2: Run application** ```bash node dist/index.js ``` Expected: Console shows "TSMusicBot started" and "WebUI: http://localhost:3000" - [ ] **Step 3: Final commit** ```bash git add -A git commit -m "chore: Phase 8 complete — deployment scripts, Docker, Setup Wizard. TSMusicBot v0.1.0" ```