Normalize PS1/PS2 executable names

This commit is contained in:
Matt Nadareski
2022-02-03 22:28:14 -08:00
parent 44091981b2
commit c8a4a61028
2 changed files with 12 additions and 4 deletions

View File

@@ -79,6 +79,7 @@
- Make error clearer if something is unsupported in Check
- Ensure drive is not null for volume labels
- Check explicitly for no matches on Redump pull
- Normalize PS1/PS2 executable names
### 2.2 (2021-12-30)
- Fix Saturn header finding

View File

@@ -1176,11 +1176,18 @@ namespace MPF.Modules
if (!string.IsNullOrEmpty(bootValue))
{
var match = Regex.Match(bootValue, @"cdrom.?:\\?(.*)");
if (match != null && match.Groups.Count > 1)
if (match.Groups.Count > 1)
{
exeName = match.Groups[1].Value;
exeName = exeName.Split(';')[0];
serial = exeName.Replace('_', '-').Replace(".", string.Empty);
// EXE name may have a trailing `;` after
// EXE name should always be in all caps
exeName = match.Groups[1].Value
.Split(';')[0]
.ToUpperInvariant();
// Serial is most of the EXE name normalized
serial = exeName
.Replace('_', '-')
.Replace(".", string.Empty);
}
}