libretro / RetroArch

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

Windows Explorer File Association #9718

Open xmha97 opened 4 years ago

xmha97 commented 4 years ago

Hello, Please add Windows Explorer File Association. For example: smd.zip Windows Explorer

RobLoach commented 4 years ago

The problem I see here is determining what the intended core to load is. There was also this discussion to have retroarch.exe work without passing the -L core option: https://github.com/libretro/RetroArch/issues/746

xmha97 commented 4 years ago

Cores should be loaded based on ROMs file extension. For example, all .smd files (Sega Mega Drive) loaded with Genesis Plus GX.

C:\Users\Amir\AppData\Roaming\RetroArch\retroarch.exe -L C:\Users\Amir\AppData\Roaming\RetroArch\cores\genesis_plus_gx_libretro.dll "%1"

3E0F8EA2-2664-4781-B56D-B150BDFE6F17

boomercore commented 4 years ago

Seconding this. The only solution for now is for the end user to painstakingly make a series of custom association strings in the 3rd party Default Programs Editor. What's worse is that if you associate a lot of filetypes with "retroarch.exe" and then edit the association in DPE, I notice there's some sort of overlap and associations are lost as you add more. One way to get around this is to associate the filetypes with dummy executables from Explorer, and then edit them to face retroarch.exe in Default Programs Editor with the right core via -L and "%1". It's a HUGE pain.

Retroarch loading the only core capable of running the ROM file type, or in the case of multiple cores asking you which one you'd like to launch, on association would be EXTREMELY convenient. Thanks in advance.

andres-asm commented 4 years ago

It's not possible. The extension is not enough because SEVERAL CORES may support the same extension.

boomercore commented 4 years ago

It's not possible. The extension is not enough because SEVERAL CORES may support the same extension.

Could it not just ask which one you want to use in that case? This is exactly what it does when you pick an extension from the file browser. The thing is, the file browser is not nearly as good as Windows is at quickly reaching a particular file. It would be preferable to cut the middle man, if possible.

boomercore commented 4 years ago

Alternatively, a search-within-subdirectories function would suffice. Either within the Desktop Menu or the Retroarch File Browser. That way one could search for Mario and get results for several systems, for instance. Better still, would be a random selection option, but I know that's a bit of a fluffy extra. Regardless, these things can be done easily within Windows Explorer, and an easier way to associate files to Retroarch would be nice. Thanks for the consideration.

boomercore commented 4 years ago

For those wanting this functionality in the likely event this gets closed:

Make a dummy exe file for EACH file extension you want to run. Otherwise things will get overwritten and won't stick. Like nes.exe for .nes, etc. Associate the filetype with it in explorer so the filetype is in the registry. Then use Default Programs Editor https://defaultprogramseditor.com and open the filetype, then edit the Open command with the following program: "C:\retroarch\retroarch.exe" -L "C:\retroarch\cores\core.dll" "%1" replacing the directory/drive with whatever applies to your machine. It's annoying, but possible to do.

Hopefully a simple association to Retroarch will be possible some day.

boomercore commented 3 years ago

Another alternative these days: you can just drag files into an open RA session and it'll ask which core to use or load the only one capable of playing it automatically. Simply associating files to RA and having them open the right core automatically, or with a prompt, would still be nicer.

Maingron commented 1 year ago

For me, I've now settled with creating a bunch of bat-files in a folder which then access a .lnk shortcut to Retroarch.
Not beautiful, but at least it's fairly maintainable, I guess.

Example Retroarch - NES.bat

start retroarch.lnk -L "mesen" %1
exit

Example Retroarch - SNES.bat

start retroarch.lnk -L "snes9x" %1
exit

And then just set Open With accordingly

I'm not very good with batch scripts, but I think this can be brought into one single file using if-statements. Maybe someone can share such a script?

Maingron commented 1 year ago

So, in addition to my previous comment, I've now created a script for that: https://github.com/Maingron/Open-with-Retroarch/tree/main

BenMcLean commented 1 year ago

I do not believe that this isn't possible. I'd want to hear a pretty compelling technical reason why it couldn't be done and done fairly easily and simply before I'd believe that. We just need someone to actually do it or accept a PR that does. It is just part of what supporting Windows as a platform means and the Windows side of this hasn't changed significantly in over 20 years.

If multiple cores support a file extension, show a dialog to choose a core, just like the file browser within RetroArch does. It is not a big ask to let Windows users have this and does not involve any secret proprietary Microsoft functionality.

This has always been an annoyance for Windows RetroArch users since RetroArch was first created.

RobLoach commented 1 year ago

This Pull Request will really help. Would love some eyes on it: https://github.com/libretro/RetroArch/pull/15458

BenMcLean commented 1 year ago

Related issue #9275

BenMcLean commented 1 year ago

Might be nice to add a feature to automatically register all those file associations as something that could be selected in the RetroArch menu. (which is separate from being able to load ROMs without additional command line parameters)