Skip to content

Instantly share code, notes, and snippets.

@cchulo
Created November 6, 2023 01:43
Show Gist options
  • Save cchulo/c0cc185e48a0c21ba5e292cfca28222a to your computer and use it in GitHub Desktop.
Save cchulo/c0cc185e48a0c21ba5e292cfca28222a to your computer and use it in GitHub Desktop.
self installer for non-steam games
#!/usr/bin/env bash
script_name=$0
script_full_path="$(cd "$(dirname "$0")" && pwd)"
dirname=$(basename "${script_full_path}")
target="${HOME}/Games"
echo "installing ${script_full_path} to ${target}"
rsync \
-a \
--progress \
--prune-empty-dirs \
--exclude="install.sh" \
--exclude="*.manifest.json" \
--delete-excluded \
"${script_full_path}" \
"${target}"
echo "ensuring steam tinker launch is installed"
if [[ ! -f "$HOME/source/utilities/steamtinkerlaunch/steamtinkerlaunch" ]]; then
(
mkdir -p "$HOME/source/utilities"
cd "$HOME/source/utilities"
git clone git@github.com:sonic2kk/steamtinkerlaunch.git
)
fi
manifests=$(ls *.manifest.json)
for manifest in ${manifests}
do
echo "Installing ${manifest}..."
json="$(cat ${manifest})"
root="${target}/${dirname}"
label=$(echo "${json}" | jq -r ".label")
exe=$(echo "${json}" | jq -r ".exe")
launchoptions=$(echo "${json}" | jq -r ".launchoptions")
icon="${root}/$(echo "${json}" | jq -r ".icon")"
hero="${root}/$(echo "${json}" | jq -r ".hero")"
logo="${root}/$(echo "${json}" | jq -r ".logo")"
boxart="${root}/$(echo "${json}" | jq -r ".boxart")"
tenfoot="${root}/$(echo "${json}" | jq -r ".tenfoot")"
echo "Install path: ${root}"
echo "Label: ${label}"
echo "Exe: ${exe}"
echo "Launch Options: ${launchoptions}"
# Assets
echo "Icon: ${icon}"
echo "Hero: ${hero}"
echo "Logo: ${logo}"
echo "Boxart: ${boxart}"
echo "Tenfoot: ${tenfoot}"
$HOME/source/utilities/steamtinkerlaunch/steamtinkerlaunch ansg \
--appname="${label}" \
--exepath="${root}/${exe}" \
--startdir="${root}" \
--launchoptions="${launchoptions}" \
--iconpath="${icon}" \
--hero="${hero}" \
--logo="${logo}" \
--boxart="${boxart}" \
--tenfoot="${tenfoot}"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment