#!/bin/sh
set -eu
APP_DIR=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd)
if [ -x /usr/local/share/dotnet/dotnet ]; then
    exec /usr/local/share/dotnet/dotnet "$APP_DIR/MyDeskViewerBSD.dll" "$@"
fi
if command -v dotnet >/dev/null 2>&1; then
    exec dotnet "$APP_DIR/MyDeskViewerBSD.dll" "$@"
fi
printf 'ERROR: Official FreeBSD .NET 8 runtime is required.\n' >&2
exit 127
