Give the store home its own name per engine

The desktop engine shares this store root, and both keyed their home by the store
id alone — so installing both from the same publisher meant one config.json and
one state.json between them, and the second install silently adopted the first
one's state. Caught by installing the two side by side.

The home is now `<id>-retroarch`. The installer moves an existing `<id>` home on
its way past, so an install from yesterday keeps its state and its games; the
uninstaller accepts either name. The launcher was already `<id>-retroarch-store`,
so nothing the user types changes.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-08-18 10:00:09 +02:00
co-authored by Claude Opus 5
parent 51493c13f0
commit 72ff17fff6
3 changed files with 23 additions and 6 deletions
+7 -3
View File
@@ -51,8 +51,10 @@ if [ -z "$STORE_ID" ]; then
FOUND=""
COUNT=0
for d in "$STORE_ROOT"/*/; do
if [ -f "$d/config.json" ]; then
FOUND="$FOUND $(basename "$d")"
if [ -f "$d/retroarch_store.py" ]; then
# `<id>-retroarch` is the home; the store id is what the user types.
name="$(basename "$d")"
FOUND="$FOUND ${name%-retroarch}"
COUNT=$((COUNT + 1))
fi
done
@@ -63,7 +65,9 @@ if [ -z "$STORE_ID" ]; then
esac
fi
STORE_HOME="$STORE_ROOT/$STORE_ID"
STORE_HOME="$STORE_ROOT/$STORE_ID-retroarch"
# Installs from before the rename kept the home under the bare store id.
[ -d "$STORE_HOME" ] || [ ! -f "$STORE_ROOT/$STORE_ID/retroarch_store.py" ] || STORE_HOME="$STORE_ROOT/$STORE_ID"
LAUNCHER="$BIN_DIR/$STORE_ID-retroarch-store"
[ -d "$STORE_HOME" ] || die "no store '$STORE_ID' in $STORE_ROOT"