Script to add roms mixed from multiple external storages at the same time
3 posters
Page 1 of 1
Script to add roms mixed from multiple external storages at the same time
Hey everyone, when I started using RetroBat, I got into the same point of when I used EmuELEC: I wanted to read roms from both the internal drive and external drives, so instead of making symbolic links rom by rom or folder by folder, I decided to make a (very "ugly") script to do so. I used to have a Bash Script for EmuELEC (I won't post it here because that's not the intention, but it's easy to find online if you need), and I kinda transformed it into two Python scripts where I can use it on my Windows PC.
Besides having some .py files, what I do (and recommend) is using py2exe and creating an executable file so any PC can run it (even without Python installed); however I won't post the executables because you wouldn't be able to (easily) verify what's in it.
Scripts:
https://github.com/Hozerino/rom-linker
How to use them:
1) Add all 3 files on the RetroBat root folder (the script needs to be 1 folder away of the /roms/)
2) Have one (or more) external drives with a folder called "roms" on the ROOT of it
3) Run clear_and_create_links.py to create the links
4) Restart RetroBat or update Game Lists
5) [Optional] Run clear.py to remove the links and make it all like before
How does it work:
Basically what it does is:
For every external drive, it will look for the roms/ folder, inside of it, if there are any folders, it will create a symbolic link on RetroBat/roms/that_folder pointing to external_drive/roms/that_folder, that way, when RetroBat accesses "that_folder", it will look into the folder inside external_drive.
Also, the folder that already existed inside RetroBat/roms will be renamed to "that_folder_bkp", which the "clear" part of the script returns to normal.
Problems:
- If you have the SAME console folder on more than one external drive, it may behave in a weird way. I only tested it by using 1 external storage
- There's no (known) way to run it from inside RetroBat's UI. I added the exe I created as a Windows game, but as it needs to be executed as Admin, I couldn't make it run.
EDIT: Forgot to mention. My original idea was to take the bash script I used on EmuELEC and transform it into a Batch script, but I realized that my batch knowledge was far from ideal (my Python knowledge isn't ideal as well, but it gets the job done sometimes). So if there is already some script that does that natively for Windows, I'll appreciate it.
Besides having some .py files, what I do (and recommend) is using py2exe and creating an executable file so any PC can run it (even without Python installed); however I won't post the executables because you wouldn't be able to (easily) verify what's in it.
Scripts:
https://github.com/Hozerino/rom-linker
How to use them:
1) Add all 3 files on the RetroBat root folder (the script needs to be 1 folder away of the /roms/)
2) Have one (or more) external drives with a folder called "roms" on the ROOT of it
3) Run clear_and_create_links.py to create the links
4) Restart RetroBat or update Game Lists
5) [Optional] Run clear.py to remove the links and make it all like before
How does it work:
Basically what it does is:
For every external drive, it will look for the roms/ folder, inside of it, if there are any folders, it will create a symbolic link on RetroBat/roms/that_folder pointing to external_drive/roms/that_folder, that way, when RetroBat accesses "that_folder", it will look into the folder inside external_drive.
Also, the folder that already existed inside RetroBat/roms will be renamed to "that_folder_bkp", which the "clear" part of the script returns to normal.
Problems:
- If you have the SAME console folder on more than one external drive, it may behave in a weird way. I only tested it by using 1 external storage
- There's no (known) way to run it from inside RetroBat's UI. I added the exe I created as a Windows game, but as it needs to be executed as Admin, I couldn't make it run.
EDIT: Forgot to mention. My original idea was to take the bash script I used on EmuELEC and transform it into a Batch script, but I realized that my batch knowledge was far from ideal (my Python knowledge isn't ideal as well, but it gets the job done sometimes). So if there is already some script that does that natively for Windows, I'll appreciate it.
Last edited by hozerino on 26/09/23, 08:54 pm; edited 2 times in total (Reason for editing : Mentioning a bit of background for the script origin)
hozerino- Messages : 50
Date d'inscription : 2022-11-17
Aynshe likes this post
Re: Script to add roms mixed from multiple external storages at the same time
Hi, thanks for sharing.
If the opportunity arises I will give it a try.
If the opportunity arises I will give it a try.
Aynshe- Messages : 432
Date d'inscription : 2022-03-18
Re: Script to add roms mixed from multiple external storages at the same time
hi, does this work to link another internal drive? What happens is that a disk is already full, and I have another one connected, but I don't know how to configure retrobat so that it reads ROMs in different folders or SSDs
aleeat- Messages : 1
Date d'inscription : 2022-11-21
Re: Script to add roms mixed from multiple external storages at the same time
aleeat wrote:hi, does this work to link another internal drive? What happens is that a disk is already full, and I have another one connected, but I don't know how to configure retrobat so that it reads ROMs in different folders or SSDs
As long as the other internal drive has a letter assigned to it (example: your roms are in F: drive) and has a folder on the path "F:/roms/*" (where * is the console location, like F:/roms/nds, F:/roms/megadrive etc), it will work.
What it does is:
Say your RetroBat is in C:/RetroBat, so your roms folder is C:/RetroBat/roms, right?
You'll put the scripts in C:/RetroBat/script_here.py, when you run it, it will look for EVERY drive letter, trying to find the "X:/roms" folder, if it does find it, the script will do as follows:
- Check every console folder inside "X:/roms", let's say it finds a "X:/roms/n64"
- If there is a console, make a backup of "C:/RetroBat/n64" -> "C:/RetroBat/n64_bkp"
- Create a symbolic link from "C:/RetroBat/n64" to "X:/roms/n64"
So everytime RetroBat looks for roms inside N64, it will see the games from the X: drive.
Does that make sense?
hozerino- Messages : 50
Date d'inscription : 2022-11-17
Similar topics
» [RESOLVED] roms on external disk usb
» Install on external HDD
» Support possible des roms compressées au format zip pour les roms Saturn ?
» [RESOLVED] Possible bug, external hard disc
» [OBSOLETE] My solution (Autohotkey) : Close external emulators with xbox one controller
» Install on external HDD
» Support possible des roms compressées au format zip pour les roms Saturn ?
» [RESOLVED] Possible bug, external hard disc
» [OBSOLETE] My solution (Autohotkey) : Close external emulators with xbox one controller
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum