Add kiosk launcher downloads and player URL resolution

This commit is contained in:
2026-08-06 18:51:33 +01:00
parent 59730837ad
commit a4f8a807ff
23 changed files with 621 additions and 71 deletions
+61
View File
@@ -0,0 +1,61 @@
@echo off
setlocal EnableExtensions EnableDelayedExpansion
set "TARGET_URL=%~1"
if not defined TARGET_URL set "TARGET_URL=http://localhost:8081"
set "BROWSER_PATH="
set "BROWSER_KIND="
for %%B in (chrome.exe msedge.exe firefox.exe) do if not defined BROWSER_PATH (
for /f "delims=" %%I in ('where %%B 2^>nul') do if not defined BROWSER_PATH (
set "BROWSER_PATH=%%I"
set "BROWSER_KIND=%%~nB"
)
)
if not defined BROWSER_PATH if not defined BROWSER_KIND (
for %%P in (
"%ProgramFiles%\Google\Chrome\Application\chrome.exe"
"%ProgramFiles(x86)%\Google\Chrome\Application\chrome.exe"
"%LocalAppData%\Google\Chrome\Application\chrome.exe"
) do if not defined BROWSER_PATH if exist "%%~fP" (
set "BROWSER_PATH=%%~fP"
set "BROWSER_KIND=chrome"
)
)
if not defined BROWSER_PATH if not defined BROWSER_KIND (
for %%P in (
"%ProgramFiles%\Microsoft\Edge\Application\msedge.exe"
"%ProgramFiles(x86)%\Microsoft\Edge\Application\msedge.exe"
"%LocalAppData%\Microsoft\Edge\Application\msedge.exe"
) do if not defined BROWSER_PATH if exist "%%~fP" (
set "BROWSER_PATH=%%~fP"
set "BROWSER_KIND=edge"
)
)
if not defined BROWSER_PATH if not defined BROWSER_KIND (
for %%P in (
"%ProgramFiles%\Mozilla Firefox\firefox.exe"
"%ProgramFiles(x86)%\Mozilla Firefox\firefox.exe"
"%LocalAppData%\Mozilla Firefox\firefox.exe"
) do if not defined BROWSER_PATH if exist "%%~fP" (
set "BROWSER_PATH=%%~fP"
set "BROWSER_KIND=firefox"
)
)
if not defined BROWSER_PATH (
echo No supported browser was found.
echo Tried Chrome, Edge, and Firefox in PATH and common install locations.
exit /b 1
)
echo Launching !BROWSER_KIND! in kiosk mode: !TARGET_URL!
if /I "!BROWSER_KIND!"=="firefox" (
start "" "!BROWSER_PATH!" -kiosk "!TARGET_URL!"
) else (
start "" "!BROWSER_PATH!" --disable-notifications --kiosk "!TARGET_URL!"
)
+47
View File
@@ -0,0 +1,47 @@
#!/usr/bin/env bash
set -euo pipefail
target_url="${1:-http://localhost:8081}"
find_browser() {
local candidate
for candidate in "$@"; do
if command -v "$candidate" >/dev/null 2>&1; then
printf '%s' "$candidate"
return 0
fi
done
return 1
}
browser=""
browser_kind=""
if browser="$(find_browser google-chrome-stable google-chrome chromium chromium-browser msedge microsoft-edge firefox)"; then
case "$browser" in
firefox)
browser_kind="firefox"
;;
msedge|microsoft-edge)
browser_kind="edge"
;;
*)
browser_kind="chrome"
;;
esac
else
echo "No supported browser was found."
echo "Tried Chrome, Chromium, Edge, and Firefox in PATH."
exit 1
fi
echo "Launching ${browser_kind} in kiosk mode: ${target_url}"
case "$browser_kind" in
firefox)
exec "$browser" -kiosk "$target_url"
;;
edge|chrome)
exec "$browser" --disable-notifications --kiosk "$target_url"
;;
esac