|
#!/usr/bin/env bash |
|
|
|
# ============================================================================== |
|
# BG3ModManager Linux Installer |
|
# |
|
# Description: |
|
# Downloads and installs BG3ModManager for Baldur's Gate 3 on Linux. |
|
# Configures necessary Wine/Proton libraries and applies registry fixes |
|
# for execution under the game's Proton prefix. |
|
# |
|
# Author: https://github.com/shawly |
|
# Date: 2026-02-10 |
|
# ============================================================================== |
|
|
|
set -euo pipefail |
|
|
|
# Default install path |
|
INSTALL_DIR="$HOME/Games/BG3ModManager" |
|
APPID="1086940" |
|
DOWNLOAD_URL="https://github.com/LaughingLeader/BG3ModManager/releases/latest/download/BG3ModManager_Latest.zip" |
|
|
|
# Colors |
|
GREEN='\033[0;32m' |
|
BLUE='\033[0;34m' |
|
RED='\033[0;31m' |
|
NC='\033[0m' # No Color |
|
|
|
SCRIPT_NAME=$(basename "$0") |
|
if [ "$SCRIPT_NAME" = "bash" ] || [ "$SCRIPT_NAME" = "sh" ]; then |
|
SCRIPT_NAME="install_bg3mm" |
|
fi |
|
|
|
log() { |
|
echo -e "${BLUE}[$SCRIPT_NAME]${NC} $1" |
|
} |
|
|
|
usage() { |
|
echo "Usage: $0 [INSTALL_DIR]" |
|
echo "Default INSTALL_DIR is $HOME/Games/BG3ModManager" |
|
exit 1 |
|
} |
|
|
|
if [ "$#" -gt 1 ]; then |
|
usage |
|
fi |
|
|
|
if [ "$#" -eq 1 ]; then |
|
INSTALL_DIR="$1" |
|
fi |
|
|
|
# Check dependencies |
|
for cmd in protontricks unzip wget; do |
|
if ! command -v "$cmd" &> /dev/null; then |
|
echo -e "${RED}Error: $cmd is not installed.${NC}" |
|
exit 1 |
|
fi |
|
done |
|
|
|
log "Installing BG3ModManager to $INSTALL_DIR..." |
|
|
|
# Create directory |
|
mkdir -p "$INSTALL_DIR" |
|
|
|
# Download |
|
log "Downloading BG3ModManager..." |
|
wget -q --show-progress -O "$INSTALL_DIR/BG3ModManager.zip" "$DOWNLOAD_URL" |
|
|
|
# Extract |
|
log "Extracting..." |
|
unzip -o -q "$INSTALL_DIR/BG3ModManager.zip" -d "$INSTALL_DIR" |
|
rm "$INSTALL_DIR/BG3ModManager.zip" |
|
|
|
# Install libraries |
|
log "Installing libraries via protontricks (this may take a while)..." |
|
protontricks "$APPID" -q d3dcompiler_47 vcrun2022 dotnetdesktop8 arial fontsmooth=rgb |
|
|
|
# Disable HW Acceleration |
|
log "Disabling HW Acceleration..." |
|
protontricks -c 'wine reg add "HKCU\Software\Microsoft\Avalon.Graphics" /v DisableHWAcceleration /t REG_DWORD /d 1 /f' "$APPID" |
|
|
|
log "Installation complete!" |
|
log "To launch the Mod Manager, run:" |
|
echo -e "${GREEN}protontricks-launch --appid $APPID \"$INSTALL_DIR/BG3ModManager.exe\"${NC}" |