From 4887abc5773b33ab1e213ed5f528dfebd242e2cd Mon Sep 17 00:00:00 2001 From: salmonik Date: Sun, 1 Nov 2026 22:23:00 +0100 Subject: v4.4.0: stable installers that follow the newest published build Adds web/latest.php: a plain-text feed of the newest version with each artifact's filename and SHA-256. The per-release generated installers are replaced by stable web/install.sh and web/install.ps1; both read the feed, pick the newest build, verify it, install per-user and add a launcher. Publishing a new app version no longer regenerates or versions the installers. publish.sh drops the installer renderer and Python dependency. deploy.sh now also verifies latest.php against the local artifacts and that the served installer scripts match the repository. --- scripts/installers/linux.sh.in | 78 ----------------------------------- scripts/installers/windows.ps1.in | 87 --------------------------------------- 2 files changed, 165 deletions(-) delete mode 100644 scripts/installers/linux.sh.in delete mode 100644 scripts/installers/windows.ps1.in (limited to 'scripts/installers') diff --git a/scripts/installers/linux.sh.in b/scripts/installers/linux.sh.in deleted file mode 100644 index 5b53c02..0000000 --- a/scripts/installers/linux.sh.in +++ /dev/null @@ -1,78 +0,0 @@ -#!/usr/bin/env bash -# Zagan-Bet desktop installer for Linux. -# -# Verifies the app against its published SHA-256, installs it for the current -# user and adds a launcher. Put the downloaded app next to this script, or run -# the script on its own and it will fetch the matching binary. -set -euo pipefail - -VERSION="__VERSION__" -BINARY="__BINARY__" -SHA256="__SHA256__" -URL="__URL__" - -say() { printf '%s\n' "$*"; } -die() { printf 'install: %s\n' "$*" >&2; exit 1; } - -command -v sha256sum >/dev/null 2>&1 || die "sha256sum is required" - -here=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd) -source_file="" -for candidate in "$here/$BINARY" "./$BINARY" "$HOME/Downloads/$BINARY"; do - if [ -f "$candidate" ]; then - source_file=$candidate - break - fi -done - -cleanup="" -if [ -z "$source_file" ]; then - command -v curl >/dev/null 2>&1 || die "put $BINARY next to this installer, or install curl" - cleanup=$(mktemp) || die "cannot create a temporary file" - say "Downloading $BINARY..." - curl -fsSL --max-time 300 "$URL" -o "$cleanup" || die "download failed" - source_file=$cleanup -fi -trap 'if [ -n "$cleanup" ]; then rm -f "$cleanup"; fi' EXIT - -actual=$(sha256sum "$source_file" | awk '{print $1}') -[ "$actual" = "$SHA256" ] || die "checksum mismatch: expected $SHA256, got $actual" - -bin_dir="${XDG_BIN_HOME:-$HOME/.local/bin}" -data_dir="${XDG_DATA_HOME:-$HOME/.local/share}" -app="$bin_dir/zagan-bet-gui" -desktop_dir="$data_dir/applications" -icon_dir="$data_dir/icons/hicolor/scalable/apps" - -mkdir -p "$bin_dir" "$desktop_dir" "$icon_dir" -install -m 0755 "$source_file" "$app" - -cat > "$icon_dir/zagan-bet.svg" <<'ICON' -__ICON__ -ICON - -cat > "$desktop_dir/zagan-bet.desktop" </dev/null 2>&1; then - update-desktop-database "$desktop_dir" >/dev/null 2>&1 || true -fi -if command -v gtk-update-icon-cache >/dev/null 2>&1; then - gtk-update-icon-cache -q "$data_dir/icons/hicolor" >/dev/null 2>&1 || true -fi - -say "Installed Zagan-Bet $VERSION to $app" -say "A launcher was added to your applications menu." -case ":$PATH:" in - *":$bin_dir:"*) ;; - *) say "Add $bin_dir to PATH to start it as 'zagan-bet-gui'." ;; -esac diff --git a/scripts/installers/windows.ps1.in b/scripts/installers/windows.ps1.in deleted file mode 100644 index 4b8e61d..0000000 --- a/scripts/installers/windows.ps1.in +++ /dev/null @@ -1,87 +0,0 @@ -# Zagan-Bet desktop installer for Windows. -# -# Verifies the app against its published SHA-256, installs it for the current -# user and adds a Start-menu shortcut. Put the downloaded app next to this -# script, or run the script on its own and it will fetch the matching binary. -# -# Run it with: -# powershell -ExecutionPolicy Bypass -File .\zagan-bet-gui-*-install.ps1 -# Add -NoPause to run it unattended. -param([switch]$NoPause) - -$ErrorActionPreference = "Stop" - -$Version = "__VERSION__" -$Binary = "__BINARY__" -$Sha256 = "__SHA256__" -$Url = "__URL__" - -function Finish([int]$Code) { - if (-not $NoPause) { - Read-Host "Press Enter to close" | Out-Null - } - exit $Code -} - -function Stop-Install([string]$Message) { - Write-Host "install: $Message" -ForegroundColor Red - Finish 1 -} - -$here = Split-Path -Parent $MyInvocation.MyCommand.Path -$candidates = @( - (Join-Path $here $Binary), - (Join-Path (Get-Location) $Binary), - (Join-Path $env:USERPROFILE "Downloads\$Binary") -) -$sourceFile = $null -foreach ($candidate in $candidates) { - if (Test-Path -LiteralPath $candidate) { - $sourceFile = $candidate - break - } -} - -$temporary = $null -if (-not $sourceFile) { - $temporary = Join-Path ([System.IO.Path]::GetTempPath()) $Binary - Write-Host "Downloading $Binary..." - try { - Invoke-WebRequest -Uri $Url -OutFile $temporary -UseBasicParsing - } catch { - Stop-Install "download failed: $_" - } - $sourceFile = $temporary -} - -try { - $actual = (Get-FileHash -LiteralPath $sourceFile -Algorithm SHA256).Hash.ToLowerInvariant() - if ($actual -ne $Sha256.ToLowerInvariant()) { - Stop-Install "checksum mismatch: expected $Sha256, got $actual" - } - - $installDir = Join-Path $env:LOCALAPPDATA "Programs\Zagan-Bet" - New-Item -ItemType Directory -Force -Path $installDir | Out-Null - $target = Join-Path $installDir "zagan-bet-gui.exe" - Copy-Item -LiteralPath $sourceFile -Destination $target -Force - - $startMenu = Join-Path $env:APPDATA "Microsoft\Windows\Start Menu\Programs" - New-Item -ItemType Directory -Force -Path $startMenu | Out-Null - $shortcutPath = Join-Path $startMenu "Zagan-Bet.lnk" - $shell = New-Object -ComObject WScript.Shell - $shortcut = $shell.CreateShortcut($shortcutPath) - $shortcut.TargetPath = $target - $shortcut.WorkingDirectory = $installDir - $shortcut.IconLocation = "$target,0" - $shortcut.Description = "Slots, roulette, blackjack and crash" - $shortcut.Save() - - Write-Host "Installed Zagan-Bet $Version to $target" - Write-Host "A Start-menu shortcut was created." -} finally { - if ($temporary -and (Test-Path -LiteralPath $temporary)) { - Remove-Item -LiteralPath $temporary -Force - } -} - -Finish 0 -- cgit v1.2.3