feat: add verified Linux install script

This commit is contained in:
Admin 2026-09-23 23:18:07 +00:00
parent 5e7d757978
commit 2936e71386
3 changed files with 79 additions and 0 deletions

View File

@ -27,3 +27,13 @@ Windows cross-build:
cargo install --locked cargo-xwin cargo install --locked cargo-xwin
npm run bundle:windows npm run bundle:windows
``` ```
## Linux install script
Download and run the checked installer:
```bash
curl -fsSL https://fieldlens.arrowstack.dev/downloads/install.sh | sh
```
The script supports x86_64/amd64 Debian/Ubuntu-style systems, downloads the public `.deb`, verifies its SHA-256, then installs it with the system package manager.

2
downloads/SHA256SUMS Normal file
View File

@ -0,0 +1,2 @@
2b8e73617c13603e88b37dd51da1b01093b2cb4022dcbe6ec2447982d771c5b8 fieldlens-print-linux-x64.deb
82ac870a10591e05b144b61e3f5303a4e0fcb665668e8f02dfc93dca36c4a7ff fieldlens-print-windows-x64-setup.exe

67
downloads/install.sh Normal file
View File

@ -0,0 +1,67 @@
#!/usr/bin/env sh
set -eu
BASE_URL="${FIELDLENS_DOWNLOAD_BASE_URL:-https://git.arrowstack.dev/Admin/fieldlens-desktop/raw/branch/main/downloads}"
PACKAGE="fieldlens-print-linux-x64.deb"
EXPECTED_SHA256="2b8e73617c13603e88b37dd51da1b01093b2cb4022dcbe6ec2447982d771c5b8"
say() {
printf '%s\n' "$*"
}
fail() {
printf 'FieldLens Print installer: %s\n' "$*" >&2
exit 1
}
case "$(uname -m)" in
x86_64|amd64) ;;
*) fail "this installer currently supports x86_64/amd64 Linux only" ;;
esac
command -v sha256sum >/dev/null 2>&1 || fail "sha256sum is required"
tmpdir="$(mktemp -d 2>/dev/null || mktemp -d -t fieldlens-print)"
trap 'rm -rf "$tmpdir"' EXIT HUP INT TERM
package_path="$tmpdir/$PACKAGE"
package_url="$BASE_URL/$PACKAGE"
say "Downloading FieldLens Print..."
if command -v curl >/dev/null 2>&1; then
curl -fL --retry 3 --retry-delay 1 -o "$package_path" "$package_url"
elif command -v wget >/dev/null 2>&1; then
wget -O "$package_path" "$package_url"
else
fail "curl or wget is required"
fi
actual_sha256="$(sha256sum "$package_path" | awk '{print $1}')"
if [ "$actual_sha256" != "$EXPECTED_SHA256" ]; then
fail "checksum verification failed"
fi
say "Checksum verified."
if [ "$(id -u)" -eq 0 ]; then
sudo_cmd=""
elif command -v sudo >/dev/null 2>&1; then
sudo_cmd="sudo"
else
fail "root access or sudo is required to install the package"
fi
if command -v apt-get >/dev/null 2>&1; then
say "Installing FieldLens Print..."
$sudo_cmd apt-get install -y "$package_path"
elif command -v apt >/dev/null 2>&1; then
say "Installing FieldLens Print..."
$sudo_cmd apt install -y "$package_path"
elif command -v dpkg >/dev/null 2>&1; then
say "Installing FieldLens Print..."
$sudo_cmd dpkg -i "$package_path"
else
fail "this installer currently supports Debian/Ubuntu-style systems"
fi
say "FieldLens Print installed successfully."