diff --git a/CHANGELIST.md b/CHANGELIST.md index 74cc6863..fa1b47c8 100644 --- a/CHANGELIST.md +++ b/CHANGELIST.md @@ -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 diff --git a/MPF.Modules/BaseParameters.cs b/MPF.Modules/BaseParameters.cs index a6057b55..f31bee88 100644 --- a/MPF.Modules/BaseParameters.cs +++ b/MPF.Modules/BaseParameters.cs @@ -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); } }