libretro / RetroArch

Cross-platform, sophisticated frontend for the libretro API. Licensed GPLv3.
http://www.libretro.com
GNU General Public License v3.0
10.09k stars 1.81k forks source link

How to detect presents in Windows system #14411

Open Maclay74 opened 2 years ago

Maclay74 commented 2 years ago

Hey, I'm working on a tool that interacts with RetroArch and I'm wondering about it's location on user's pc.

As far as I understand, there are three ways it can be installed: from Steam, by installer or just downloaded as an archive.

Steam is obvious, installer adds a registry key Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\RetroArch. Although, i use DisplayIcon property, it doesn't seem reliable.

So, is my method okay or you can think of something better? Is it possible to detect portable version of RetroArch? Maybe it adds something to AppData (or somewhere else)? Eventually, I'm interested in retroarch.exe path and playlists.

Thanks!

hizzlekizzle commented 2 years ago

AFAIK, the "portable" non-installer version doesn't write anything outside of its directory.

Maclay74 commented 2 years ago

Got it, thanks, then I'll keep it out of the scope.

ghost commented 2 years ago

If the registry key can't be found or the path it points to doesn't exist, just ask the user to select the path to RetroArch and then save that path in a config file or something. That's pretty much how most tools on Windows work when they require a path for another program.

ghost commented 2 years ago

I use an ini file for my netplay lobby script, which requires the path to retroarch.exe, cores and playlists dir; I don't even bother checking the registry because this is intended to work with any other platform that supports RetroArch and Python.

[RetroArch]
Program = D:\RetroArch-Win64\retroarch.exe
Playlists = D:\RetroArch-Win64\playlists
Cores = D:\RetroArch-Win64\cores

[Ping]
MAX = 250

[Platforms]
FinalBurn Neo v1 = fbneo_libretro.dll|FBNeo - Arcade Games|Arcade
Snes9x 1 = snes9x_libretro.dll|Nintendo - Super Nintendo Entertainment System|SNES
Snes9x 2010 = snes9x2010_libretro.dll|Nintendo - Super Nintendo Entertainment System|SNES
Supafaust 1 = mednafen_supafaust_libretro.dll|Nintendo - Super Nintendo Entertainment System|SNES
Genesis Plus GX v1 = genesis_plus_gx_libretro.dll|Sega - Mega Drive - Genesis|Mega Drive
PicoDrive 1 = picodrive_libretro.dll|Sega - Mega Drive - Genesis|Mega Drive

It's important to note that the path to cores and playlists may not be the same path as retroarch.exe, as you can customize those through RetroArch's configuration.

gouchi commented 2 years ago

If I may, just a reminder from the issue template

Only RetroArch bugs should be filed here. Not core bugs or game bugs This is not a forum or a help section, this is strictly developer oriented

It would have been better to ask your technical question on our forums.

Thank you.