Improvements to the installer.
This commit is contained in:
44
install.sh
44
install.sh
@@ -3,7 +3,7 @@
|
|||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
|
|
||||||
SOURCE_ROOT="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd)"
|
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]+$ ]]
|
if [[ ! "$VERSION" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]
|
||||||
then
|
then
|
||||||
printf 'Invalid launcher version: %s (expected X.Y.Z)\n' "$VERSION" >&2
|
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" \
|
if [[ ! -d "${SOURCE_ROOT}/ptlinux" \
|
||||||
|| ! -f "${SOURCE_ROOT}/ptdiag/assbin.py" \
|
|| ! -f "${SOURCE_ROOT}/ptdiag/assbin.py" \
|
||||||
|| ! -f "${SOURCE_ROOT}/ptdiag/__init__.py" \
|
|| ! -f "${SOURCE_ROOT}/ptdiag/__init__.py" \
|
||||||
|
|| ! -f "${SOURCE_ROOT}/ptdiag/logs.py" \
|
||||||
|| ! -f "${SOURCE_ROOT}/ptlinux/desktop_entry.py" \
|
|| ! -f "${SOURCE_ROOT}/ptlinux/desktop_entry.py" \
|
||||||
|| ! -f "${SOURCE_ROOT}/ptlinux/launcher_wrapper.py" \
|
|| ! -f "${SOURCE_ROOT}/ptlinux/launcher_wrapper.py" \
|
||||||
|| ! -f "${SOURCE_ROOT}/ptlinux/self_update.py" \
|
|| ! -f "${SOURCE_ROOT}/ptlinux/self_update.py" \
|
||||||
@@ -197,6 +198,7 @@ install -m 0644 \
|
|||||||
"${STAGING_RELEASE}/ptlinux/launcher-update-public.pem"
|
"${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/__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/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"
|
printf '{\n "schema": 1,\n "version": "%s"\n}\n' "$VERSION" > "${STAGING_RELEASE}/release.json"
|
||||||
chmod 0644 "${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
|
update-desktop-database "$APPLICATION_HOME" >/dev/null 2>&1 || true
|
||||||
fi
|
fi
|
||||||
|
|
||||||
printf '%s\n' "Application installed."
|
printf '%s\n' "Launcher files installed."
|
||||||
|
DOCTOR_READY=1
|
||||||
if (( RUN_DOCTOR == 1 ))
|
if (( RUN_DOCTOR == 1 ))
|
||||||
then
|
then
|
||||||
"${BIN_HOME}/pristontale-eu" doctor || true
|
if ! "${BIN_HOME}/pristontale-eu" doctor
|
||||||
|
then
|
||||||
|
DOCTOR_READY=0
|
||||||
fi
|
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."
|
||||||
|
|||||||
Reference in New Issue
Block a user