guard prefix and wine edits while their apps run

This commit is contained in:
olcxja 2026-10-02 14:46:21 +02:00
commit 38eea05789
9 changed files with 170 additions and 39 deletions

View file

@ -14,7 +14,8 @@ src/ main process (Node/Electron backend)
games.js games service: run/stop state, wine resolution, open-with handoff
lansync.js LAN sync handlers (identity, devices, re-roll, sync + progress)
runner.js spawns wine/proton (env, prefix, playtime, logs)
library.js apps registry (apps.json) + settings + playtime files
library.js apps registry (apps.json) + settings + playtime files, plus
the "which prefix does this app use" / in-use guards
wines.js wine/proton build scan, registry, portable symlink healing
prefixes.js prefix registry (files/wineprefixes)
symlinks.js relative symlink rewiring + executable-bit restoration
@ -37,7 +38,8 @@ renderer/ UI (plain HTML/CSS/JS, no framework)
style.css the whole look; CSS variables at the top
files/ portable data the launcher ships/creates at runtime
translations/ en-us.json, pl.json (copied to the data dir on start)
test/ plain node scripts, run them with `node test/<name>.test.js`
test/ plain node scripts, run them with `node test/<name>.test.js`;
electron test/<name>.test.js for ones that need the real IPC/Electron
tools/ install.sh / createshortcut.sh / build helpers
```
@ -66,6 +68,11 @@ handlers in src/ipc/. Keep new APIs in that pattern.
try/catch-and-ignore with a comment saying why it is safe to ignore.
- Windows apps run through runGame()/buildEnv() - never spawn wine directly
somewhere else (prefix handling, Proton env and playtime live there).
- A prefix or wine build that a running app uses cannot be renamed/deleted
(wine holds its registry and user files open in that folder): the guards sit
next to the handlers in src/ipc/, use the games service's running list plus
the helpers in library.js (prefixNameForGame/gamesUsingPrefix/is*InUse) and
answer { ok:false, error:'inUse'|'hasApps', apps:[names] } for the toast.
- CSS: reuse the existing variables/classes (.button, .field-label,
.custom-select, form-card); spacing rhythm comes from --button-margin and
the flex gap of the container, not per-element magic numbers.