From f48e68c5e91dbc7ac9ed229b9ca334cdb9bb00f7 Mon Sep 17 00:00:00 2001
From: Leon Styhre <leon@leonstyhre.com>
Date: Sat, 7 Sep 2024 10:58:08 +0200
Subject: [PATCH] Added support for the new Lime3DS binary names on Linux,
 macOS and Windows

---
 es-app/assets/Windows_Portable_README.txt   | 2 +-
 resources/systems/linux/es_find_rules.xml   | 9 +++++++++
 resources/systems/macos/es_find_rules.xml   | 1 +
 resources/systems/windows/es_find_rules.xml | 3 +++
 4 files changed, 14 insertions(+), 1 deletion(-)

diff --git a/es-app/assets/Windows_Portable_README.txt b/es-app/assets/Windows_Portable_README.txt
index 1294f0fa4..663099c4d 100644
--- a/es-app/assets/Windows_Portable_README.txt
+++ b/es-app/assets/Windows_Portable_README.txt
@@ -82,7 +82,7 @@ Emulators\gopher2600\gopher2600_windows_amd64.exe
 Emulators\hatari\hatari.exe
 Emulators\Hypseus Singe\hypseus.exe
 Emulators\KEmulator\KEmulator.exe
-Emulators\lime3ds\lime3ds-gui.exe
+Emulators\lime3ds\lime3ds.exe
 Emulators\m2emulator\EMULATOR.EXE
 Emulators\mame\mame.exe
 Emulators\mednafen\mednafen.exe
diff --git a/resources/systems/linux/es_find_rules.xml b/resources/systems/linux/es_find_rules.xml
index 300e1be74..0cf2c978e 100644
--- a/resources/systems/linux/es_find_rules.xml
+++ b/resources/systems/linux/es_find_rules.xml
@@ -484,10 +484,15 @@
     <emulator name="LIME3DS">
         <!-- Nintendo 3DS emulator Lime3DS -->
         <rule type="systempath">
+            <entry>lime3ds</entry>
             <entry>lime3ds-gui</entry>
             <entry>lime-qt</entry>
         </rule>
         <rule type="staticpath">
+            <entry>~/Applications/lime3ds.AppImage</entry>
+            <entry>~/.local/share/applications/lime3ds.AppImage</entry>
+            <entry>~/.local/bin/lime3ds.AppImage</entry>
+            <entry>~/bin/lime3ds.AppImage</entry>
             <entry>~/Applications/lime3ds-gui*.AppImage</entry>
             <entry>~/.local/share/applications/lime3ds-gui*.AppImage</entry>
             <entry>~/.local/bin/lime3ds-gui*.AppImage</entry>
@@ -496,6 +501,10 @@
             <entry>~/.local/share/applications/lime-qt*.AppImage</entry>
             <entry>~/.local/bin/lime-qt*.AppImage</entry>
             <entry>~/bin/lime-qt*.AppImage</entry>
+            <entry>~/Applications/lime3ds*.AppImage</entry>
+            <entry>~/.local/share/applications/lime3ds*.AppImage</entry>
+            <entry>~/.local/bin/lime3ds*.AppImage</entry>
+            <entry>~/bin/lime3ds*.AppImage</entry>
             <entry>/var/lib/flatpak/exports/bin/io.github.lime3ds.Lime3DS</entry>
             <entry>~/.local/share/flatpak/exports/bin/io.github.lime3ds.Lime3DS</entry>
         </rule>
diff --git a/resources/systems/macos/es_find_rules.xml b/resources/systems/macos/es_find_rules.xml
index 485fa4a71..4033348e8 100644
--- a/resources/systems/macos/es_find_rules.xml
+++ b/resources/systems/macos/es_find_rules.xml
@@ -169,6 +169,7 @@
     <emulator name="LIME3DS">
         <!-- Nintendo 3DS emulator Lime3DS -->
         <rule type="staticpath">
+            <entry>/Applications/lime3ds.app/Contents/MacOS/lime3ds</entry>
             <entry>/Applications/lime3ds-gui.app/Contents/MacOS/lime3ds-gui</entry>
             <entry>/Applications/lime-qt.app/Contents/MacOS/lime-qt</entry>
         </rule>
diff --git a/resources/systems/windows/es_find_rules.xml b/resources/systems/windows/es_find_rules.xml
index e8b56b3e7..171377a3a 100644
--- a/resources/systems/windows/es_find_rules.xml
+++ b/resources/systems/windows/es_find_rules.xml
@@ -425,10 +425,13 @@
     <emulator name="LIME3DS">
         <!-- Nintendo 3DS emulator Lime3DS -->
         <rule type="systempath">
+            <entry>lime3ds.exe</entry>
             <entry>lime3ds-gui.exe</entry>
             <entry>lime-qt.exe</entry>
         </rule>
         <rule type="staticpath">
+            <entry>%ESPATH%\Emulators\lime3ds\lime3ds.exe</entry>
+            <entry>%ESPATH%\..\Emulators\lime3ds\lime3ds.exe</entry>
             <entry>%ESPATH%\Emulators\lime3ds\lime3ds-gui.exe</entry>
             <entry>%ESPATH%\..\Emulators\lime3ds\lime3ds-gui.exe</entry>
             <entry>%ESPATH%\Emulators\lime-qt\lime-qt.exe</entry>