No-Intro Love Pack PowerShell Clean-Up Script

General No-Intro related discussions.
Post Reply
Pr3tty F1y
Posts: 56
Joined: 19 Jul 2014 21:24

No-Intro Love Pack PowerShell Clean-Up Script

Post by Pr3tty F1y »

Prefer to have your dats include homebrew, aftermarket and pirate dumps but sick of clicking so many check boxes and radio buttons?
Just don't have time to keep up downloading individual dats daily, but dealing with all the dats in the Love Pack is too onerous?

Well, if any of that sounds like you, I've created a PowerShell script that will:
  1. Search your current ROM manager's dat directory (and will recurse sub-directories if configured to do so)
  2. Identify the No-Intro dats that you currently have
  3. Then will extract the Love Pack zip that you downloaded and only keep the dats that you are already tracking in your ROM manager
Just download the No-Intro daily Love Pack zip and make sure you click to include Pirate, Homebrew, Aftermarket dumps if you're interested in those sets.

To configure the script, download the attachment and either "right-click -> Edit" it or open the script in your preferred text editor (e.g., Notepad, Notepad++, UltraEdit, etc.).

There are 4 variables that need to be configured at the top of the script:
  1. Set your ROM manager's dat directory
  2. Choose whether or not to recursively search sub-directories in that ROM manger dat directory
  3. Set your download path for the No-Intro Love Pack zip
  4. Choose whether to only retain NEWER versions of dats you already have or keep ALL versions (new + current) of dats you have (in case you want to refresh all of your dats)
After you run the script (right-click -> Run with PowerShell), you can then drag'n drop (at least in CLRMamePro) the extracted No-Intro Love Pack directory and it will only add the dats that you're already tracking and all of the other dats will be eliminated.

To be able to execute as a PowerShell script rename the extension of the attached text file from .txt to .ps1 (the forums, for your safety, won't allow a .ps1 extension as PowerShell scripts can potentially be dangerous if they are coded to be malicious).

I created this script myself and have had no issues with it, but I can't make an guarantees its bug free. If there are any bugs that are experienced, please reply here and I'll try to address them.
You do not have the required permissions to view the files attached to this post.
Pr3tty F1y
Posts: 56
Joined: 19 Jul 2014 21:24

Re: No-Intro Love Pack PowerShell Clean-Up Script

Post by Pr3tty F1y »

New revision attached. Thanks to Pandor for testing.

This version should be MUCH faster as it only extracts out the dats you are already tracking, rather than the previous implementation that extracted the entire zip and deleted out what you didn't need.

Please hit me up with a PM if you run into any issues. And, same as last time, rename the *.txt extension to *.ps1 due to board security not allowing upload of a *.ps1 file.
You do not have the required permissions to view the files attached to this post.
Pandor
Posts: 6
Joined: 29 Apr 2023 08:38

Re: No-Intro Love Pack PowerShell Clean-Up Script

Post by Pandor »

Excellent script that really helps automate the process of updating DAT files. Glad to have been of service in bug reporting and testing.

Now, as i've mentioned in PM, for my use case (RomVault), a additional variable "$ReplaceInPlace = $true" Would make this the ultimate script.

RomVault uses a DAT root folder, where it monitors for its DAT files. To update a DAT, you just remove the old, and replace with the new, and RomVault automagically merges the new entries into its cache (and keeps already verified and unchanged roms as 'known good').

Since the script already keeps a array of current DAT filenames and has filename comparison functionality, I was thinking, of maybe repurposing the unzipping code to instead of just extracting to a subfolder in the $LovePackPath, "If ($ReplaceInPlace)" is set, delete the old DAT, and extract/replace with the new DAT in the $RomManagerDatPath (recursively). This saves another manual step of moving the extracted DAT files to RomVault's DATroot folder.

Something like'... idiotic pseudocode follows:

Code: Select all

when $RomManagerDatPath\snes(old).dat is found, look for snes(new).dat in $LovePackPath\[zip]. if found, remove $RomManagerDatPath\snes(old).dat, and unzip $LovePackPath\[zip]\snes(new).dat to $RomManagerDatPath
This way, one could download the DoM.zip, run the script, and just click renew DAT in RomVault, and be done. This would save a lot of manual labor.
If I find some spare time, I might look into this and maybe try to expand the script, with your permission "Pr3tty F1y". unless you beat me to it. ;)
User avatar
cgar
Posts: 1
Joined: 29 Apr 2023 06:42

Re: No-Intro Love Pack PowerShell Clean-Up Script

Post by cgar »

Pr3tty F1y wrote: 16 Jan 2023 17:13 [...] sick of clicking so many check boxes and radio buttons? [...]
Absolutely!
Pr3tty F1y wrote: 16 Jan 2023 17:13 [...] download the No-Intro daily Love Pack zip and make sure you click [...]
Aww, I wanted zero clicking involved :lol:
Would be great if it also automated the downloading.

Still handy though, thanks.
Post Reply