diff --git a/install.sh b/install.sh index 8c9db8b..38cb81c 100755 --- a/install.sh +++ b/install.sh @@ -3,7 +3,7 @@ set -euo pipefail SOURCE_ROOT="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd)" -VERSION="${PTLINUX_VERSION:-0.5.2}" +VERSION="${PTLINUX_VERSION:-0.5.8}" if [[ ! "$VERSION" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]] then printf 'Invalid launcher version: %s (expected X.Y.Z)\n' "$VERSION" >&2 @@ -133,6 +133,7 @@ RELEASE_ROOT="${RELEASES_ROOT}/${VERSION}" if [[ ! -d "${SOURCE_ROOT}/ptlinux" \ || ! -f "${SOURCE_ROOT}/ptdiag/assbin.py" \ || ! -f "${SOURCE_ROOT}/ptdiag/__init__.py" \ + || ! -f "${SOURCE_ROOT}/ptdiag/logs.py" \ || ! -f "${SOURCE_ROOT}/ptlinux/desktop_entry.py" \ || ! -f "${SOURCE_ROOT}/ptlinux/launcher_wrapper.py" \ || ! -f "${SOURCE_ROOT}/ptlinux/self_update.py" \ @@ -197,6 +198,7 @@ install -m 0644 \ "${STAGING_RELEASE}/ptlinux/launcher-update-public.pem" install -m 0644 "${SOURCE_ROOT}/ptdiag/__init__.py" "${STAGING_RELEASE}/ptdiag/__init__.py" install -m 0644 "${SOURCE_ROOT}/ptdiag/assbin.py" "${STAGING_RELEASE}/ptdiag/assbin.py" +install -m 0644 "${SOURCE_ROOT}/ptdiag/logs.py" "${STAGING_RELEASE}/ptdiag/logs.py" printf '{\n "schema": 1,\n "version": "%s"\n}\n' "$VERSION" > "${STAGING_RELEASE}/release.json" chmod 0644 "${STAGING_RELEASE}/release.json" @@ -301,8 +303,44 @@ then update-desktop-database "$APPLICATION_HOME" >/dev/null 2>&1 || true fi -printf '%s\n' "Application installed." +printf '%s\n' "Launcher files installed." +DOCTOR_READY=1 if (( RUN_DOCTOR == 1 )) then - "${BIN_HOME}/pristontale-eu" doctor || true + if ! "${BIN_HOME}/pristontale-eu" doctor + then + DOCTOR_READY=0 + fi +else + printf '%s\n' "Host readiness check skipped." fi + +printf '%s\n' "Start PristonTale EU with:" +printf ' %q gui\n' "${BIN_HOME}/pristontale-eu" +case ":${PATH:-}:" in + *":${BIN_HOME}:"*) + ;; + *) + printf '%s\n' \ + "Note: ${BIN_HOME} is not in PATH for this shell." \ + "The application-menu shortcut already uses the full path." + if [[ "${SHELL##*/}" == "fish" ]] + then + printf '%s\n' "Enable the short command in Fish with:" + printf ' fish_add_path %q\n' "$BIN_HOME" + else + printf '%s\n' "Enable the short command in this Bash/Zsh session with:" + printf ' export PATH=%q:"$PATH"\n' "$BIN_HOME" + fi + ;; +esac + +if (( DOCTOR_READY == 0 )) +then + printf '%s\n' \ + "Launcher files were installed, but this host is not ready to run the game." \ + "Resolve the diagnostics above, then run the launcher command again." >&2 + exit 1 +fi + +printf '%s\n' "Installation ready."