From 6bf661ff4a60ec22c0aa1b852c20c4554589bdce Mon Sep 17 00:00:00 2001 From: Omar Date: Sat, 7 Nov 2026 19:58:02 +0530 Subject: [PATCH] Find Cemu on Windows, and stamp the Deck plugin with the release tag Cemu keeps its data in %APPDATA%\Cemu by default. The preset looked in Documents\Cemu, a folder Cemu never picks, so a default Windows install was not found. Cemu also has a Linux build and paths, so it is no longer listed as Windows-only in the preset test, and its Linux path is checked against a real folder. The Deck plugin zip carried whatever version its files said, so v2.4.1 shipped a plugin saying 2.4.0, and plugin managers offered the same update again and again. A release now writes the tag's version into the zip's plugin.json and package.json. A manual run has no tag and keeps the files' version. --- .github/workflows/release.yml | 11 +++++++++++ internal/presets/presets.go | 2 +- internal/presets/retro_emulators_test.go | 20 ++++++++++++++++++-- 3 files changed, 30 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 8f9ced8f..b7a9d4ec 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -235,6 +235,17 @@ jobs: cp opensave-decky-plugin/package.json decky-pkg/OpenSave/ cp opensave-decky-plugin/main.py decky-pkg/OpenSave/ cp opensave-decky-plugin/dist/index.js decky-pkg/OpenSave/dist/ + # The zip says the version of the tag it is released under. Plugin + # managers compare the two, and a mismatch offers the same update + # again and again (#149). A manual run has no tag: it keeps the files'. + if [ "$GITHUB_REF_TYPE" = "tag" ]; then + V="${GITHUB_REF_NAME#v}" + for f in plugin.json package.json; do + jq --arg v "$V" '.version = $v' "decky-pkg/OpenSave/$f" > "$f.stamped" + mv "$f.stamped" "decky-pkg/OpenSave/$f" + test "$(jq -r .version "decky-pkg/OpenSave/$f")" = "$V" + done + fi (cd decky-pkg && zip -r ../OpenSave-decky-plugin.zip OpenSave) unzip -l OpenSave-decky-plugin.zip diff --git a/internal/presets/presets.go b/internal/presets/presets.go index b11f6d50..93729a6e 100644 --- a/internal/presets/presets.go +++ b/internal/presets/presets.go @@ -87,7 +87,7 @@ var presetDefs = []preset{ LinuxPath: []string{"~/.config/PCSX2/memcards", "~/.var/app/net.pcsx2.PCSX2/config/PCSX2/memcards"}}, {ID: "rpcs3", Name: "RPCS3 PS3 Emulator", Type: "emulator", Path: "%APPDATA%/rpcs3/dev_hdd0/home/00000001/savedata", LinuxPath: []string{"~/.config/rpcs3/dev_hdd0/home/00000001/savedata", "~/.var/app/net.rpcs3.RPCS3/config/rpcs3/dev_hdd0/home/00000001/savedata"}}, - {ID: "cemu", Name: "Cemu Wii U Emulator", Type: "emulator", Path: "%USERPROFILE%/Documents/Cemu/mlc01/usr/save", + {ID: "cemu", Name: "Cemu Wii U Emulator", Type: "emulator", Path: "%APPDATA%/Cemu/mlc01/usr/save", LinuxPath: []string{"~/.local/share/Cemu/mlc01/usr/save", "~/.var/app/info.cemu.Cemu/data/Cemu/mlc01/usr/save"}}, {ID: "ppsspp", Name: "PPSSPP PSP Emulator", Type: "emulator", Path: "%USERPROFILE%/Documents/PPSSPP/PSP/SAVEDATA", LinuxPath: []string{"~/.config/ppsspp/PSP/SAVEDATA", "~/.var/app/org.ppsspp.PPSSPP/config/ppsspp/PSP/SAVEDATA"}}, diff --git a/internal/presets/retro_emulators_test.go b/internal/presets/retro_emulators_test.go index 0ad6e0f1..a45ba35d 100644 --- a/internal/presets/retro_emulators_test.go +++ b/internal/presets/retro_emulators_test.go @@ -30,6 +30,7 @@ func TestRetroEmulatorPresetsResolveOnLinux(t *testing.T) { "fceux": ".fceux/sav", "mesen": ".local/share/Mesen2/Saves", "blastem": ".local/share/blastem", + "cemu": ".local/share/Cemu/mlc01/usr/save", } for id, rel := range cases { @@ -54,14 +55,29 @@ func TestRetroEmulatorPresetsResolveOnLinux(t *testing.T) { } } +// Cemu's own default on Windows is %APPDATA%\Cemu\mlc01 (CemuApp::DeterminePaths, +// ActiveSettings::GetDefaultMLCPath). The preset named Documents\Cemu, a folder +// Cemu never picks, so a default install was not found at all. +func TestCemuWindowsPathIsCemusDefault(t *testing.T) { + for _, p := range presetDefs { + if p.ID == "cemu" { + if want := "%APPDATA%/Cemu/mlc01/usr/save"; p.Path != want { + t.Errorf("cemu Windows path = %q, want %q", p.Path, want) + } + return + } + } + t.Fatal("no cemu preset") +} + // Every preset must carry a Linux path unless the emulator genuinely is -// Windows-only. A Windows-only entry is a real choice (Cemu, Xenia, Project64); +// Windows-only. A Windows-only entry is a real choice (Xenia, Project64); // an accidentally Windows-only one silently excludes every Deck user, which is // the audience most likely to be running these. func TestRetroEmulatorPresetsCoverLinuxExceptWindowsOnlyOnes(t *testing.T) { // Emulators with no Linux build worth detecting. windowsOnly := map[string]bool{ - "xenia": true, "cemu": true, "project64": true, + "xenia": true, "project64": true, } for _, p := range presetDefs {