romcollectionbrowser
romcollectionbrowser copied to clipboard
emu_autoconfig detect installed emulators using Windows registry
This has been added in the XML file, but no code support exists. Possibly use something like: http://stackoverflow.com/questions/21090325/python-look-into-the-registry-to-find-install-location-of-a-program.
I have a Mac, so I can't tell whether this works, or whether there are different version issues (e.g. Win7 vs 8 vs 10).
Does not seem to work for me. I somehow managed to access the registry keys but e.g. retroarch is not listed here although it is fully installed and shown in "installed programs" in windows.
I think I will try the commonfolders implementation or maybe add a second step to the configwizard: Usually the user knows where the emulator is installed and should be able to navigate to the emulator exe. The tricky part is to set the correct parameters for every emulator. So, let the user give us the path to the emulator, then check if the path contains the name of a known emulator executable (like "retroarch.exe") and provide the correct parameters.
I implemented it like this in emu_autoconfig:
<emulator name="RetroArch (bsnes accuracy)">
<detectionMethod name="commonFolders">
<folder>%APPDATA%\RetroArch</folder>
<folder>%PROGRAMFILES%\RetroArch</folder>
<folder>%PROGRAMFILES(X86)%\RetroArch</folder>
</detectionMethod>
<configuration>
<emulatorCommand>%INSTALLDIR%\RetroArch\retroarch.exe</emulatorCommand>
<emulatorParams>"%rom%" -f -D -c "%INSTALLDIR%\RetroArch\retroarch.cfg" -L "%INSTALLDIR%\RetroArch\cores\bsnes_accuracy_libretro.dll"</emulatorParams>
</configuration>
</emulator>
Before saving config.xml %INSTALLDIR% will be replaced with the path where RCB found the emulator.
One thing that comes to my mind: When we find RetroArch we display the emulator as "Installed". But we don't know if the user really has the core available. Maybe we could check (or prompt) for cores and config files if we notice that the user wants to use RetroArch. Usually I don't like specific implementations but as retroarch is de-facto standard for most platforms it might be worth to do this.
Another option would be to use placeholders that can be used for any emulator. Something like "%BROWSE, config file%" or "%BROWSE, core%". This would open a browse dialog with "config file" or "core" in the title. Just another pragmatic approach :)