From e5d63f7ed3127f026db07eeeeda8522610b364cf Mon Sep 17 00:00:00 2001 From: Arron Ohnemus Date: Sun, 14 Jun 2026 21:42:57 -0500 Subject: [PATCH 1/2] feat: enhance installation process with install.sh and uninstall.sh scripts, update .gitignore for build artifacts --- .gitignore | 7 +++++++ README.md | 18 +++++++++++------- install.sh | 14 ++++++++++++++ packaging/arch/PKGBUILD | 28 ++++++++++++---------------- uninstall.sh | 4 ++++ 5 files changed, 48 insertions(+), 23 deletions(-) create mode 100755 install.sh create mode 100755 uninstall.sh diff --git a/.gitignore b/.gitignore index 5ef6a52..1d7cb62 100644 --- a/.gitignore +++ b/.gitignore @@ -39,3 +39,10 @@ yarn-error.log* # typescript *.tsbuildinfo next-env.d.ts + +# makepkg build artifacts +packaging/arch/src/ +packaging/arch/pkg/ +packaging/arch/lokiasam-*/ +packaging/arch/*.pkg.tar.* +packaging/arch/*.tar.gz diff --git a/README.md b/README.md index 2a2d12e..a2609d6 100644 --- a/README.md +++ b/README.md @@ -55,26 +55,30 @@ sudo dnf install ./LokiASAM_*_x86_64.rpm AppImage and pre-built binaries do not work reliably on rolling-release distros due to bundled library conflicts. Build from source instead: ```bash +# Install build dependencies +sudo pacman -S --needed rust nodejs pnpm + +# Clone and install git clone https://github.com/LokiRothbrook/LokiASAM.git -cd LokiASAM/packaging/arch -makepkg -si +cd LokiASAM +chmod +x install.sh +./install.sh ``` -`makepkg -si` builds the app using your system's native libraries and installs it via pacman — icons, the `.desktop` entry, and shell integration all work correctly out of the box. +`install.sh` builds the app and installs it via pacman — icons, the `.desktop` entry, and shell integration all work correctly out of the box. To uninstall: ```bash -sudo pacman -R lokiasam +./uninstall.sh ``` -To update, pull the latest source and rebuild: +To update, pull the latest source and reinstall: ```bash cd LokiASAM git pull -cd packaging/arch -makepkg -si +./install.sh ``` ### Generic Linux (AppImage) diff --git a/install.sh b/install.sh new file mode 100755 index 0000000..86e8762 --- /dev/null +++ b/install.sh @@ -0,0 +1,14 @@ +#!/usr/bin/env bash +set -euo pipefail + +cd "$(dirname "$0")" + +echo "==> Installing dependencies..." +pnpm install --frozen-lockfile + +echo "==> Building LokiASAM..." +pnpm tauri build --no-bundle + +echo "==> Packaging and installing via pacman..." +cd packaging/arch +makepkg -si diff --git a/packaging/arch/PKGBUILD b/packaging/arch/PKGBUILD index c07585e..5d4a424 100644 --- a/packaging/arch/PKGBUILD +++ b/packaging/arch/PKGBUILD @@ -13,32 +13,28 @@ depends=( "librsvg" "xdg-utils" ) -makedepends=( - "rust" - "cargo" - "nodejs" - "pnpm" - "git" -) +makedepends=() install=lokiasam.install -source=("$pkgname-$pkgver::git+$url.git#tag=v$pkgver") -sha256sums=("SKIP") + +source=() +sha256sums=() + +_repodir="$(realpath "$startdir/../..")" build() { - cd "$srcdir/$pkgname-$pkgver" - pnpm install --frozen-lockfile - pnpm tauri build --bundles none + # The binary is built by install.sh before makepkg runs. + # Nothing to do here. + : } package() { - cd "$srcdir/$pkgname-$pkgver" - # Binary - install -Dm755 "src-tauri/target/release/lokiasam" "$pkgdir/usr/bin/lokiasam" + install -Dm755 "$_repodir/src-tauri/target/release/lokiasam" \ + "$pkgdir/usr/bin/lokiasam" # Icons for size in 32x32 128x128 256x256 512x512; do - local src="src-tauri/icons/${size}.png" + local src="$_repodir/src-tauri/icons/${size}.png" if [[ -f "$src" ]]; then install -Dm644 "$src" \ "$pkgdir/usr/share/icons/hicolor/${size}/apps/xyz.lokisoft.lokiasam.png" diff --git a/uninstall.sh b/uninstall.sh new file mode 100755 index 0000000..5137223 --- /dev/null +++ b/uninstall.sh @@ -0,0 +1,4 @@ +#!/usr/bin/env bash +set -euo pipefail + +sudo pacman -R lokiasam From e8d0a0f810e7b5db7906f8f439fe5d85702aea9f Mon Sep 17 00:00:00 2001 From: Arron Ohnemus Date: Sun, 14 Jun 2026 21:46:25 -0500 Subject: [PATCH 2/2] feat: enhance installation and uninstallation scripts with distro detection, update version to 0.13.1 --- README.md | 31 +++++++++---- install.sh | 94 ++++++++++++++++++++++++++++++++++++--- package.json | 2 +- packaging/arch/PKGBUILD | 2 +- src-tauri/Cargo.lock | 2 +- src-tauri/Cargo.toml | 2 +- src-tauri/tauri.conf.json | 2 +- uninstall.sh | 52 +++++++++++++++++++++- 8 files changed, 166 insertions(+), 21 deletions(-) diff --git a/README.md b/README.md index a2609d6..2829381 100644 --- a/README.md +++ b/README.md @@ -52,20 +52,18 @@ sudo dnf install ./LokiASAM_*_x86_64.rpm ### Arch Linux / CachyOS / Manjaro -AppImage and pre-built binaries do not work reliably on rolling-release distros due to bundled library conflicts. Build from source instead: +AppImage and pre-built binaries do not work reliably on rolling-release distros due to bundled library conflicts. Build from source instead using the universal install script: ```bash # Install build dependencies sudo pacman -S --needed rust nodejs pnpm -# Clone and install git clone https://github.com/LokiRothbrook/LokiASAM.git cd LokiASAM -chmod +x install.sh ./install.sh ``` -`install.sh` builds the app and installs it via pacman — icons, the `.desktop` entry, and shell integration all work correctly out of the box. +The script builds the app and installs it via pacman — icons, the `.desktop` entry, and shell integration all work correctly out of the box. To uninstall: @@ -73,12 +71,10 @@ To uninstall: ./uninstall.sh ``` -To update, pull the latest source and reinstall: +To update, pull the latest source and run the script again: ```bash -cd LokiASAM -git pull -./install.sh +cd LokiASAM && git pull && ./install.sh ``` ### Generic Linux (AppImage) @@ -108,7 +104,24 @@ Run the `LokiASAM_*_x64-setup.exe` installer. - Linux: `webkit2gtk-4.1`, `libappindicator-gtk3`, `librsvg`, `patchelf` - Windows: WebView2 (ships with Windows 11; installer available for Windows 10) -**Steps** +**Universal install script (Linux)** + +`install.sh` detects your distro and builds + installs the native package automatically: + +| Distro family | Build output | Installer | +|---|---|---| +| Arch / CachyOS / Manjaro | binary | `makepkg` → `pacman` | +| Debian / Ubuntu / Mint | `.deb` | `dpkg` + `apt` | +| Fedora / openSUSE / RHEL | `.rpm` | `dnf` / `zypper` / `rpm` | + +```bash +git clone https://github.com/LokiRothbrook/LokiASAM.git +cd LokiASAM +./install.sh # build and install +./uninstall.sh # remove +``` + +**Manual steps (dev / Windows)** ```bash git clone https://github.com/LokiRothbrook/LokiASAM.git diff --git a/install.sh b/install.sh index 86e8762..782e0c4 100755 --- a/install.sh +++ b/install.sh @@ -3,12 +3,94 @@ set -euo pipefail cd "$(dirname "$0")" -echo "==> Installing dependencies..." +# --------------------------------------------------------------------------- +# Distro detection +# --------------------------------------------------------------------------- +detect_family() { + if [[ ! -f /etc/os-release ]]; then + echo "unknown" + return + fi + local id id_like + id=$(grep -E '^ID=' /etc/os-release | cut -d= -f2 | tr -d '"') + id_like=$(grep -E '^ID_LIKE=' /etc/os-release | cut -d= -f2 | tr -d '"' || true) + + if [[ "$id" == "arch" || "$id_like" == *"arch"* ]]; then + echo "arch" + elif [[ "$id" == "debian" || "$id_like" == *"debian"* ]]; then + echo "deb" + elif [[ "$id" == "fedora" || "$id" == "rhel" || "$id" == "centos" || \ + "$id" == opensuse* || "$id_like" == *"fedora"* || \ + "$id_like" == *"rhel"* || "$id_like" == *"suse"* ]]; then + echo "rpm" + else + echo "unknown" + fi +} + +FAMILY=$(detect_family) + +if [[ "$FAMILY" == "unknown" ]]; then + echo "ERROR: Could not detect a supported Linux distribution." + echo "Supported: Arch/CachyOS/Manjaro, Debian/Ubuntu/Mint, Fedora/openSUSE/RHEL" + exit 1 +fi + +echo "==> Detected package family: $FAMILY" + +# --------------------------------------------------------------------------- +# Install JS dependencies (all distros) +# --------------------------------------------------------------------------- +echo "==> Installing JS dependencies..." pnpm install --frozen-lockfile -echo "==> Building LokiASAM..." -pnpm tauri build --no-bundle +# --------------------------------------------------------------------------- +# Build and install +# --------------------------------------------------------------------------- +case "$FAMILY" in + arch) + echo "==> Building LokiASAM (no bundle)..." + pnpm tauri build --no-bundle + + echo "==> Installing via pacman..." + cd packaging/arch + makepkg -si + ;; + + deb) + echo "==> Building LokiASAM .deb package..." + pnpm tauri build --bundles deb + + DEB=$(find src-tauri/target/release/bundle/deb -name "*.deb" | head -1) + if [[ -z "$DEB" ]]; then + echo "ERROR: .deb package not found after build." + exit 1 + fi + + echo "==> Installing $DEB..." + sudo dpkg -i "$DEB" + sudo apt-get install -f -y + ;; + + rpm) + echo "==> Building LokiASAM .rpm package..." + pnpm tauri build --bundles rpm + + RPM=$(find src-tauri/target/release/bundle/rpm -name "*.rpm" | head -1) + if [[ -z "$RPM" ]]; then + echo "ERROR: .rpm package not found after build." + exit 1 + fi + + echo "==> Installing $RPM..." + if command -v dnf &>/dev/null; then + sudo dnf install -y "$RPM" + elif command -v zypper &>/dev/null; then + sudo zypper install -y "$RPM" + else + sudo rpm -i "$RPM" + fi + ;; +esac -echo "==> Packaging and installing via pacman..." -cd packaging/arch -makepkg -si +echo "==> LokiASAM installed successfully." diff --git a/package.json b/package.json index 82e5305..55ce545 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "lokiasam", - "version": "0.13.0", + "version": "0.13.1", "private": true, "scripts": { "dev": "next dev", diff --git a/packaging/arch/PKGBUILD b/packaging/arch/PKGBUILD index 5d4a424..6b4d398 100644 --- a/packaging/arch/PKGBUILD +++ b/packaging/arch/PKGBUILD @@ -1,6 +1,6 @@ # Maintainer: Arron Ohnemus pkgname=lokiasam -pkgver=0.13.0 +pkgver=0.13.1 pkgrel=1 pkgdesc="Loki ARK Survival Ascended Server Manager — a desktop app for managing dedicated ASA servers" arch=("x86_64") diff --git a/src-tauri/Cargo.lock b/src-tauri/Cargo.lock index 821c3f6..f5cf127 100644 --- a/src-tauri/Cargo.lock +++ b/src-tauri/Cargo.lock @@ -2727,7 +2727,7 @@ dependencies = [ [[package]] name = "lokiasam" -version = "0.13.0" +version = "0.13.1" dependencies = [ "configparser", "flate2", diff --git a/src-tauri/Cargo.toml b/src-tauri/Cargo.toml index b300fd2..50e8098 100644 --- a/src-tauri/Cargo.toml +++ b/src-tauri/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "lokiasam" -version = "0.13.0" +version = "0.13.1" description = "Loki Ark Survival Ascended Server Manager" authors = ["Loki"] license = "GPL-3.0-or-later" diff --git a/src-tauri/tauri.conf.json b/src-tauri/tauri.conf.json index 0cb0f72..a8ea526 100644 --- a/src-tauri/tauri.conf.json +++ b/src-tauri/tauri.conf.json @@ -1,7 +1,7 @@ { "$schema": "https://schema.tauri.app/config/2", "productName": "LokiASAM", - "version": "0.13.0", + "version": "0.13.1", "identifier": "xyz.lokisoft.lokiasam", "build": { "frontendDist": "../out", diff --git a/uninstall.sh b/uninstall.sh index 5137223..e96698f 100755 --- a/uninstall.sh +++ b/uninstall.sh @@ -1,4 +1,54 @@ #!/usr/bin/env bash set -euo pipefail -sudo pacman -R lokiasam +# --------------------------------------------------------------------------- +# Distro detection +# --------------------------------------------------------------------------- +detect_family() { + if [[ ! -f /etc/os-release ]]; then + echo "unknown" + return + fi + local id id_like + id=$(grep -E '^ID=' /etc/os-release | cut -d= -f2 | tr -d '"') + id_like=$(grep -E '^ID_LIKE=' /etc/os-release | cut -d= -f2 | tr -d '"' || true) + + if [[ "$id" == "arch" || "$id_like" == *"arch"* ]]; then + echo "arch" + elif [[ "$id" == "debian" || "$id_like" == *"debian"* ]]; then + echo "deb" + elif [[ "$id" == "fedora" || "$id" == "rhel" || "$id" == "centos" || \ + "$id" == opensuse* || "$id_like" == *"fedora"* || \ + "$id_like" == *"rhel"* || "$id_like" == *"suse"* ]]; then + echo "rpm" + else + echo "unknown" + fi +} + +FAMILY=$(detect_family) + +case "$FAMILY" in + arch) + sudo pacman -R lokiasam + ;; + deb) + sudo apt remove -y lokiasam 2>/dev/null || sudo dpkg -r lokiasam + ;; + rpm) + if command -v dnf &>/dev/null; then + sudo dnf remove -y lokiasam + elif command -v zypper &>/dev/null; then + sudo zypper remove -y lokiasam + else + sudo rpm -e lokiasam + fi + ;; + *) + echo "ERROR: Could not detect a supported Linux distribution." + echo "Remove manually: the binary is at /usr/bin/lokiasam" + exit 1 + ;; +esac + +echo "==> LokiASAM uninstalled."