Compare commits

..

14 Commits
2.7.4 ... 2.7.5

Author SHA1 Message Date
Matt Nadareski
229db5dda2 Bump version 2023-11-06 10:14:16 -05:00
Deterous
4f2a8d354a Update to MMI 3.0.0 (#603) 2023-11-06 07:10:25 -08:00
Matt Nadareski
b886471d72 Update changelog 2023-11-05 19:03:52 -05:00
Deterous
2bab266ae2 Enable browsing for Redumper path (#602) 2023-11-05 15:54:09 -08:00
Matt Nadareski
6c5fd9bac8 Fix default layerbreak output (fixes #601) 2023-11-05 11:39:56 -05:00
Matt Nadareski
08e93d7f13 Update changelog 2023-11-03 23:35:41 -04:00
Deterous
7a510e084b Pull PS3 Firmware Version (#599)
* Attempt to read PS3 firmware version

* Improve PS3 Firmware Version parsing

* Enable PS3 Firmware Version detection for all 3 Programs

* Big endian byte location

* Contents field not Comments field
2023-11-03 20:35:24 -07:00
Matt Nadareski
da46d20ffc Fix PS3 version finding 2023-11-03 22:41:22 -04:00
Matt Nadareski
234c0bfbab Try to get PS3 data from SFB 2023-11-03 15:34:05 -04:00
Matt Nadareski
82d60dbf4a Update changelog 2023-11-03 11:23:28 -04:00
Deterous
6dffb80609 Focus main window after child window closes (#596) 2023-11-03 08:23:11 -07:00
Matt Nadareski
267c0e3184 Update Redumper to build 247 2023-11-01 13:07:36 -04:00
Matt Nadareski
033ccbbe67 Update changelog 2023-10-31 19:59:38 -04:00
Deterous
c31b3f5894 Remove psxt001z Pkg Ref in MPF.Test (#592) 2023-10-31 16:58:43 -07:00
13 changed files with 363 additions and 143 deletions

View File

@@ -1,3 +1,15 @@
### 2.7.5 (2023-11-06)
- Remove psxt001z Pkg Ref in MPF.Test (Deterous)
- Update Redumper to build 247
- Focus main window after child window closes (Deterous)
- Try to get PS3 data from SFB
- Fix PS3 version finding
- Pull PS3 Firmware Version (Deterous)
- Fix default layerbreak output
- Enable browsing for Redumper path (Deterous)
- Update to MMI 3.0.0 (Deterous)
### 2.7.4 (2023-10-31)
- Move Hash enum and simplify

View File

@@ -8,7 +8,7 @@
<Description>Validator for various dumping programs</Description>
<Authors>Matt Nadareski;ReignStumble;Jakz</Authors>
<Copyright>Copyright (c)2019-2023</Copyright>
<VersionPrefix>2.7.4</VersionPrefix>
<VersionPrefix>2.7.5</VersionPrefix>
</PropertyGroup>
<PropertyGroup Condition="'$(TargetFramework)'!='net48'">

View File

@@ -637,25 +637,45 @@ namespace MPF.Core
if (!Directory.Exists(drivePath))
return null;
// If we can't find PARAM.SFO, we don't have a PlayStation 3 disc
string paramSfoPath = Path.Combine(drivePath, "PS3_GAME", "PARAM.SFO");
if (!File.Exists(paramSfoPath))
return null;
// Let's try reading PARAM.SFO to find the serial at the end of the file
try
// Attempt to use PS3_DISC.SFB
string sfbPath = Path.Combine(drivePath, "PS3_DISC.SFB");
if (File.Exists(sfbPath))
{
using (var br = new BinaryReader(File.OpenRead(paramSfoPath)))
try
{
br.BaseStream.Seek(-0x18, SeekOrigin.End);
return new string(br.ReadChars(9));
using (var br = new BinaryReader(File.OpenRead(sfbPath)))
{
br.BaseStream.Seek(0x220, SeekOrigin.Begin);
return new string(br.ReadChars(0x10));
}
}
catch
{
// We don't care what the error was
return null;
}
}
catch
// Attempt to use PARAM.SFO
string sfoPath = Path.Combine(drivePath, "PS3_GAME", "PARAM.SFO");
if (File.Exists(sfoPath))
{
// We don't care what the error was
return null;
try
{
using (var br = new BinaryReader(File.OpenRead(sfoPath)))
{
br.BaseStream.Seek(-0x18, SeekOrigin.End);
return new string(br.ReadChars(9));
}
}
catch
{
// We don't care what the error was
return null;
}
}
return null;
}
/// <summary>
@@ -697,18 +717,104 @@ namespace MPF.Core
if (!Directory.Exists(drivePath))
return null;
// If we can't find PARAM.SFO, we don't have a PlayStation 3 disc
string paramSfoPath = Path.Combine(drivePath, "PS3_GAME", "PARAM.SFO");
if (!File.Exists(paramSfoPath))
// Attempt to use PS3_DISC.SFB
string sfbPath = Path.Combine(drivePath, "PS3_DISC.SFB");
if (File.Exists(sfbPath))
{
try
{
using (var br = new BinaryReader(File.OpenRead(sfbPath)))
{
br.BaseStream.Seek(0x230, SeekOrigin.Begin);
var discVersion = new string(br.ReadChars(0x10)).TrimEnd('\0');
if (!string.IsNullOrWhiteSpace(discVersion))
return discVersion;
}
}
catch
{
// We don't care what the error was
return null;
}
}
// Attempt to use PARAM.SFO
string sfoPath = Path.Combine(drivePath, "PS3_GAME", "PARAM.SFO");
if (File.Exists(sfoPath))
{
try
{
using (var br = new BinaryReader(File.OpenRead(sfoPath)))
{
br.BaseStream.Seek(-0x08, SeekOrigin.End);
return new string(br.ReadChars(5));
}
}
catch
{
// We don't care what the error was
return null;
}
}
return null;
}
/// <summary>
/// Get the firmware version from a PlayStation 3 disc, if possible
/// </summary>
/// <param name="driveLetter">Drive letter to use to check</param>
/// <returns>Firmware version if possible, null on error</returns>
#if NET48
internal static string GetPlayStation3FirmwareVersion(char? driveLetter)
#else
internal static string? GetPlayStation3FirmwareVersion(char? driveLetter)
#endif
{
// If there's no drive letter, we can't do this part
if (driveLetter == null)
return null;
// If the folder no longer exists, we can't do this part
string drivePath = driveLetter + ":\\";
return GetPlayStation3FirmwareVersion(drivePath);
}
/// <summary>
/// Get the firmware version from a PlayStation 3 disc, if possible
/// </summary>
/// <param name="drivePath">Drive path to use to check</param>
/// <returns>Firmware version if possible, null on error</returns>
#if NET48
internal static string GetPlayStation3FirmwareVersion(string drivePath)
#else
internal static string? GetPlayStation3FirmwareVersion(string? drivePath)
#endif
{
// If there's no drive path, we can't do this part
if (string.IsNullOrWhiteSpace(drivePath))
return null;
// If the folder no longer exists, we can't do this part
if (!Directory.Exists(drivePath))
return null;
// Attempt to read from /PS3_UPDATE/PS3UPDAT.PUP
string pupPath = Path.Combine(drivePath, "PS3_UPDATE", "PS3UPDAT.PUP");
if (!File.Exists(pupPath))
return null;
// Let's try reading PARAM.SFO to find the version at the end of the file
try
{
using (var br = new BinaryReader(File.OpenRead(paramSfoPath)))
using (var br = new BinaryReader(File.OpenRead(pupPath)))
{
br.BaseStream.Seek(-0x08, SeekOrigin.End);
return new string(br.ReadChars(5));
br.BaseStream.Seek(0x3E, SeekOrigin.Begin);
byte[] buf = new byte[2];
br.Read(buf, 0, 2);
Array.Reverse(buf);
short location = BitConverter.ToInt16(buf, 0);
br.BaseStream.Seek(location, SeekOrigin.Begin);
return new string(br.ReadChars(4));
}
}
catch
@@ -1524,7 +1630,7 @@ namespace MPF.Core
|| (info.CommonDiscInfo?.Media.ToMediaType() != MediaType.BluRay
&& info.CommonDiscInfo?.System.IsXGD() == false))
{
AddIfExists(output, Template.LayerbreakField, (info.SizeAndChecksums?.Layerbreak == default && info.SizeAndChecksums?.Layerbreak != default(long) ? null : info.SizeAndChecksums?.Layerbreak.ToString()), 1);
AddIfExists(output, Template.LayerbreakField, info.SizeAndChecksums?.Layerbreak, 1);
}
AddIfExists(output, Template.SizeField, info.SizeAndChecksums?.Size.ToString(), 1);
@@ -1874,7 +1980,7 @@ namespace MPF.Core
if (value == null)
return;
string prefix = "";
string prefix = string.Empty;
for (int i = 0; i < indent; i++)
prefix += "\t";
@@ -1935,6 +2041,26 @@ namespace MPF.Core
AddIfExists(output, key, string.Join(", ", value), indent);
}
/// <summary>
/// Add the properly formatted key and value, if possible
/// </summary>
/// <param name="output">Output list</param>
/// <param name="key">Name of the output key to write</param>
/// <param name="value">Name of the output value to write</param>
/// <param name="indent">Number of tabs to indent the line</param>
private static void AddIfExists(List<string> output, string key, long? value, int indent)
{
// If there's no valid value to write
if (value == null || value == default(long))
return;
string prefix = string.Empty;
for (int i = 0; i < indent; i++)
prefix += "\t";
output.Add(prefix + key + ": " + value);
}
/// <summary>
/// Add the properly formatted key and value, if possible
/// </summary>

View File

@@ -5,7 +5,7 @@
<RuntimeIdentifiers>win-x64;linux-x64;osx-x64</RuntimeIdentifiers>
<Authors>Matt Nadareski;ReignStumble;Jakz</Authors>
<Copyright>Copyright (c)2019-2023</Copyright>
<VersionPrefix>2.7.4</VersionPrefix>
<VersionPrefix>2.7.5</VersionPrefix>
</PropertyGroup>
<PropertyGroup Condition="'$(TargetFramework)'!='net48'">
@@ -20,7 +20,7 @@
<PackageReference Include="BurnOutSharp" PrivateAssets="build; analyzers" ExcludeAssets="contentFiles" Version="2.9.0" GeneratePathProperty="true">
<IncludeAssets>runtime; compile; build; native; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.Management.Infrastructure" Version="3.0.0-preview.4" />
<PackageReference Include="Microsoft.Management.Infrastructure" Version="3.0.0" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
<PackageReference Include="psxt001z" Version="0.21.0-beta1" />
<PackageReference Include="SabreTools.Models" Version="1.1.5" />

View File

@@ -605,9 +605,15 @@ namespace MPF.Core.Modules.Aaru
#if NET48
info.VersionAndEditions.Version = InfoTool.GetPlayStation3Version(drive?.Name) ?? string.Empty;
info.CommonDiscInfo.CommentsSpecialFields[SiteCode.InternalSerialName] = InfoTool.GetPlayStation3Serial(drive?.Name) ?? string.Empty;
string firmwareVersion = InfoTool.GetPlayStation3FirmwareVersion(drive?.Name);
if (firmwareVersion != null)
info.CommonDiscInfo.ContentsSpecialFields[SiteCode.Patches] = $"PS3 Firmware {firmwareVersion}";
#else
info.VersionAndEditions!.Version = InfoTool.GetPlayStation3Version(drive?.Name) ?? string.Empty;
info.CommonDiscInfo!.CommentsSpecialFields![SiteCode.InternalSerialName] = InfoTool.GetPlayStation3Serial(drive?.Name) ?? string.Empty;
string? firmwareVersion = InfoTool.GetPlayStation3FirmwareVersion(drive?.Name);
if (firmwareVersion != null)
info.CommonDiscInfo!.ContentsSpecialFields![SiteCode.Patches] = $"PS3 Firmware {firmwareVersion}";
#endif
break;

View File

@@ -1032,9 +1032,15 @@ namespace MPF.Core.Modules.DiscImageCreator
#if NET48
info.VersionAndEditions.Version = InfoTool.GetPlayStation3Version(drive?.Name) ?? string.Empty;
info.CommonDiscInfo.CommentsSpecialFields[SiteCode.InternalSerialName] = InfoTool.GetPlayStation3Serial(drive?.Name) ?? string.Empty;
string firmwareVersion = InfoTool.GetPlayStation3FirmwareVersion(drive?.Name);
if (firmwareVersion != null)
info.CommonDiscInfo.ContentsSpecialFields[SiteCode.Patches] = $"PS3 Firmware {firmwareVersion}";
#else
info.VersionAndEditions!.Version = InfoTool.GetPlayStation3Version(drive?.Name) ?? string.Empty;
info.CommonDiscInfo!.CommentsSpecialFields![SiteCode.InternalSerialName] = InfoTool.GetPlayStation3Serial(drive?.Name) ?? string.Empty;
string? firmwareVersion = InfoTool.GetPlayStation3FirmwareVersion(drive?.Name);
if (firmwareVersion != null)
info.CommonDiscInfo!.ContentsSpecialFields![SiteCode.Patches] = $"PS3 Firmware {firmwareVersion}";
#endif
break;

View File

@@ -325,6 +325,10 @@ namespace MPF.Core.Modules.Redumper
info.DumpingInfo.Firmware = firmware;
}
// Fill in the disc type data
if (GetDiscType($"{basePath}.log", out var discTypeOrBookType))
info.DumpingInfo.ReportedDiscType = discTypeOrBookType;
switch (this.Type)
{
case MediaType.CDROM:
@@ -408,35 +412,18 @@ namespace MPF.Core.Modules.Redumper
}
// Deal with the layerbreaks
if (this.Type == MediaType.DVD)
if (GetLayerbreaks($"{basePath}.log", out var layerbreak1, out var layerbreak2, out var layerbreak3))
{
string layerbreak = GetLayerbreak($"{basePath}.log") ?? string.Empty;
#if NET48
info.SizeAndChecksums.Layerbreak = !string.IsNullOrEmpty(layerbreak) ? Int64.Parse(layerbreak) : default;
info.SizeAndChecksums.Layerbreak = !string.IsNullOrEmpty(layerbreak1) ? Int64.Parse(layerbreak1) : default;
info.SizeAndChecksums.Layerbreak2 = !string.IsNullOrEmpty(layerbreak2) ? Int64.Parse(layerbreak2) : default;
info.SizeAndChecksums.Layerbreak3 = !string.IsNullOrEmpty(layerbreak3) ? Int64.Parse(layerbreak3) : default;
#else
info.SizeAndChecksums!.Layerbreak = !string.IsNullOrEmpty(layerbreak) ? Int64.Parse(layerbreak) : default;
info.SizeAndChecksums!.Layerbreak = !string.IsNullOrEmpty(layerbreak1) ? Int64.Parse(layerbreak1) : default;
info.SizeAndChecksums!.Layerbreak2 = !string.IsNullOrEmpty(layerbreak2) ? Int64.Parse(layerbreak2) : default;
info.SizeAndChecksums!.Layerbreak3 = !string.IsNullOrEmpty(layerbreak3) ? Int64.Parse(layerbreak3) : default;
#endif
}
else if (this.Type == MediaType.BluRay)
{
var di = InfoTool.GetDiscInformation($"{basePath}.physical");
#if NET48
info.SizeAndChecksums.PICIdentifier = InfoTool.GetPICIdentifier(di);
#else
info.SizeAndChecksums!.PICIdentifier = InfoTool.GetPICIdentifier(di);
#endif
if (InfoTool.GetLayerbreaks(di, out long? layerbreak1, out long? layerbreak2, out long? layerbreak3))
{
if (layerbreak1 != null && layerbreak1 * 2048 < info.SizeAndChecksums.Size)
info.SizeAndChecksums.Layerbreak = layerbreak1.Value;
if (layerbreak2 != null && layerbreak2 * 2048 < info.SizeAndChecksums.Size)
info.SizeAndChecksums.Layerbreak2 = layerbreak2.Value;
if (layerbreak3 != null && layerbreak3 * 2048 < info.SizeAndChecksums.Size)
info.SizeAndChecksums.Layerbreak3 = layerbreak3.Value;
}
}
// Bluray-specific options
if (this.Type == MediaType.BluRay)
@@ -618,9 +605,15 @@ namespace MPF.Core.Modules.Redumper
#if NET48
info.VersionAndEditions.Version = InfoTool.GetPlayStation3Version(drive?.Name) ?? string.Empty;
info.CommonDiscInfo.CommentsSpecialFields[SiteCode.InternalSerialName] = InfoTool.GetPlayStation3Serial(drive?.Name) ?? string.Empty;
string firmwareVersion = InfoTool.GetPlayStation3FirmwareVersion(drive?.Name);
if (firmwareVersion != null)
info.CommonDiscInfo.ContentsSpecialFields[SiteCode.Patches] = $"PS3 Firmware {firmwareVersion}";
#else
info.VersionAndEditions!.Version = InfoTool.GetPlayStation3Version(drive?.Name) ?? string.Empty;
info.CommonDiscInfo!.CommentsSpecialFields![SiteCode.InternalSerialName] = InfoTool.GetPlayStation3Serial(drive?.Name) ?? string.Empty;
string? firmwareVersion = InfoTool.GetPlayStation3FirmwareVersion(drive?.Name);
if (firmwareVersion != null)
info.CommonDiscInfo!.ContentsSpecialFields![SiteCode.Patches] = $"PS3 Firmware {firmwareVersion}";
#endif
break;
@@ -1036,7 +1029,7 @@ namespace MPF.Core.Modules.Redumper
break;
case MediaType.HDDVD: // TODO: Confirm that this information outputs
case MediaType.BluRay:
case MediaType.BluRay:
if (File.Exists($"{basePath}.log"))
logFiles.Add($"{basePath}.log");
if (File.Exists($"{basePath}.physical"))
@@ -1540,6 +1533,59 @@ namespace MPF.Core.Modules.Redumper
}
}
/// <summary>
/// Get reported disc type information, if possible
/// </summary>
/// <param name="drive">_disc.txt file location</param>
/// <returns>True if disc type info was set, false otherwise</returns>
#if NET48
private static bool GetDiscType(string drive, out string discTypeOrBookType)
#else
private static bool GetDiscType(string drive, out string? discTypeOrBookType)
#endif
{
// Set the default values
discTypeOrBookType = null;
// If the file doesn't exist, we can't get the info
if (!File.Exists(drive))
return false;
using (var sr = File.OpenText(drive))
{
try
{
var line = sr.ReadLine();
while (line != null)
{
// Trim the line for later use
line = line.Trim();
// The profile is listed in a single line
if (line.StartsWith("current profile:"))
{
// current profile: <discType>
#if NET48
discTypeOrBookType = line.Substring("current profile: ".Length);
#else
discTypeOrBookType = line["current profile: ".Length..];
#endif
}
line = sr.ReadLine();
}
return true;
}
catch
{
// We don't care what the exception is right now
discTypeOrBookType = null;
return false;
}
}
}
/// <summary>
/// Get the DVD protection information, if possible
/// </summary>
@@ -1699,36 +1745,86 @@ namespace MPF.Core.Modules.Redumper
}
/// <summary>
/// Get the layerbreak from the input file, if possible
/// Get hardware information from the input file, if possible
/// </summary>
/// <param name="log">Log file location</param>
/// <returns>Layerbreak if possible, null on error</returns>
/// <remarks>TODO: Support multiple layerbreaks when added</remarks>
/// <returns>True if hardware info was set, false otherwise</returns>
#if NET48
private static string GetLayerbreak(string log)
private static bool GetHardwareInfo(string log, out string manufacturer, out string model, out string firmware)
#else
private static string? GetLayerbreak(string log)
private static bool GetHardwareInfo(string log, out string? manufacturer, out string? model, out string? firmware)
#endif
{
// Set the default values
manufacturer = null; model = null; firmware = null;
// If the file doesn't exist, we can't get info from it
if (!File.Exists(log))
return null;
return false;
using (var sr = File.OpenText(log))
{
try
{
// Fast forward to the disc structure lines
while (!sr.EndOfStream && sr.ReadLine()?.Trim()?.StartsWith("layer 0") == false) ;
if (sr.EndOfStream)
return null;
// Fast forward to the drive information line
while (!(sr.ReadLine()?.Trim().StartsWith("drive path:") ?? true)) ;
// If we find the hardware info line, return each value
// drive: <vendor_id> - <product_id> (revision level: <product_revision_level>, vendor specific: <vendor_specific>)
var regex = new Regex(@"drive: (.+) - (.+) \(revision level: (.+), vendor specific: (.+)\)", RegexOptions.Compiled);
// Now that we're at the relevant lines, find the layerbreak
#if NET48
string layerbreak = null;
string line;
#else
string? layerbreak = null;
string? line;
#endif
while ((line = sr.ReadLine()) != null)
{
var match = regex.Match(line.Trim());
if (match.Success)
{
manufacturer = match.Groups[1].Value;
model = match.Groups[2].Value;
firmware = match.Groups[3].Value;
firmware += match.Groups[4].Value == "<empty>" ? "" : $" ({match.Groups[4].Value})";
return true;
}
}
// We couldn't detect it then
return false;
}
catch
{
// We don't care what the exception is right now
return false;
}
}
}
/// <summary>
/// Get the layerbreaks from the input file, if possible
/// </summary>
/// <param name="log">Log file location</param>
/// <returns>True if any layerbreaks were found, false otherwise</returns>
#if NET48
private static bool GetLayerbreaks(string log, out string layerbreak1, out string layerbreak2, out string layerbreak3)
#else
private static bool GetLayerbreaks(string log, out string? layerbreak1, out string? layerbreak2, out string? layerbreak3)
#endif
{
// Set the default values
layerbreak1 = null; layerbreak2 = null; layerbreak3 = null;
// If the file doesn't exist, we can't get info from it
if (!File.Exists(log))
return false;
using (var sr = File.OpenText(log))
{
try
{
// Now that we're at the relevant lines, find the layerbreak
while (!sr.EndOfStream)
{
var line = sr.ReadLine()?.Trim();
@@ -1740,18 +1836,7 @@ namespace MPF.Core.Modules.Redumper
// Single-layer discs have no layerbreak
if (line.Contains("layers count: 1"))
{
return null;
}
// Dual-layer discs have a regular layerbreak (new)
else if (line.StartsWith("layer break:"))
{
// layer break: <layerbreak>
#if NET48
layerbreak = line.Substring("layer break: ".Length).Trim();
#else
layerbreak = line["layer break: ".Length..].Trim();
#endif
return false;
}
// Dual-layer discs have a regular layerbreak (old)
@@ -1760,20 +1845,60 @@ namespace MPF.Core.Modules.Redumper
// data { LBA: <startLBA> .. <endLBA>, length: <length>, hLBA: <startLBA> .. <endLBA> }
string[] split = line.Split(' ').Where(s => !string.IsNullOrEmpty(s)).ToArray();
#if NET48
layerbreak = layerbreak ?? split[7].TrimEnd(',');
layerbreak1 = layerbreak1 ?? split[7].TrimEnd(',');
#else
layerbreak ??= split[7].TrimEnd(',');
layerbreak1 ??= split[7].TrimEnd(',');
#endif
}
// Dual-layer discs have a regular layerbreak (new)
else if (line.StartsWith("layer break:"))
{
// layer break: <layerbreak>
#if NET48
layerbreak1 = line.Substring("layer break: ".Length).Trim();
#else
layerbreak1 = line["layer break: ".Length..].Trim();
#endif
}
// Multi-layer discs have the layer in the name
else if (line.StartsWith("layer break (layer: 0):"))
{
// layer break (layer: 0): <layerbreak>
#if NET48
layerbreak1 = line.Substring("layer break (layer: 0): ".Length).Trim();
#else
layerbreak1 = line["layer break (layer: 0): ".Length..].Trim();
#endif
}
else if (line.StartsWith("layer break (layer: 1):"))
{
// layer break (layer: 1): <layerbreak>
#if NET48
layerbreak2 = line.Substring("layer break (layer: 1): ".Length).Trim();
#else
layerbreak2 = line["layer break (layer: 1): ".Length..].Trim();
#endif
}
else if (line.StartsWith("layer break (layer: 2):"))
{
// layer break (layer: 2): <layerbreak>
#if NET48
layerbreak3 = line.Substring("layer break (layer: 2): ".Length).Trim();
#else
layerbreak3 = line["layer break (layer: 2): ".Length..].Trim();
#endif
}
}
// Return the layerbreak, if possible
return layerbreak;
return true;
}
catch
{
// We don't care what the exception is right now
return null;
return false;
}
}
}
@@ -2493,64 +2618,6 @@ namespace MPF.Core.Modules.Redumper
}
}
/// <summary>
/// Get hardware information from the input file, if possible
/// </summary>
/// <param name="log">Log file location</param>
/// <returns>True if hardware info was set, false otherwise</returns>
#if NET48
private static bool GetHardwareInfo(string log, out string manufacturer, out string model, out string firmware)
#else
private static bool GetHardwareInfo(string log, out string? manufacturer, out string? model, out string? firmware)
#endif
{
// Set the default values
manufacturer = null; model = null; firmware = null;
// If the file doesn't exist, we can't get info from it
if (!File.Exists(log))
return false;
using (var sr = File.OpenText(log))
{
try
{
// Fast forward to the drive information line
while (!(sr.ReadLine()?.Trim().StartsWith("drive path:") ?? true)) ;
// If we find the hardware info line, return each value
// drive: <vendor_id> - <product_id> (revision level: <product_revision_level>, vendor specific: <vendor_specific>)
var regex = new Regex(@"drive: (.+) - (.+) \(revision level: (.+), vendor specific: (.+)\)", RegexOptions.Compiled);
#if NET48
string line;
#else
string? line;
#endif
while ((line = sr.ReadLine()) != null)
{
var match = regex.Match(line.Trim());
if (match.Success)
{
manufacturer = match.Groups[1].Value;
model = match.Groups[2].Value;
firmware = match.Groups[3].Value;
firmware += match.Groups[4].Value == "<empty>" ? "" : $" ({match.Groups[4].Value})";
return true;
}
}
// We couldn't detect it then
return false;
}
catch
{
// We don't care what the exception is right now
return false;
}
}
}
#endregion
}
}

View File

@@ -17,7 +17,6 @@
<PackageReference Include="Microsoft.CodeCoverage" Version="17.7.2" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.7.2" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
<PackageReference Include="psxt001z" Version="0.21.0-beta1" />
<PackageReference Include="SabreTools.RedumpLib" Version="1.1.1" />
<PackageReference Include="xunit" Version="2.5.3" />
<PackageReference Include="xunit.abstractions" Version="2.0.3" />

View File

@@ -7,7 +7,7 @@
<UseWPF>true</UseWPF>
<Authors>Matt Nadareski;ReignStumble;Jakz</Authors>
<Copyright>Copyright (c)2019-2023</Copyright>
<VersionPrefix>2.7.4</VersionPrefix>
<VersionPrefix>2.7.5</VersionPrefix>
</PropertyGroup>
<PropertyGroup Condition="'$(TargetFramework)'!='net48'">

View File

@@ -227,6 +227,8 @@ namespace MPF.UI.Core.Windows
ShowInTaskbar = true,
WindowStartupLocation = WindowStartupLocation.CenterOwner,
};
discInformationWindow.Closed += delegate { this.Activate(); };
bool? result = discInformationWindow.ShowDialog();
// Copy back the submission info changes, if necessary
@@ -263,6 +265,7 @@ namespace MPF.UI.Core.Windows
WindowStartupLocation = WindowStartupLocation.CenterOwner,
};
optionsWindow.Closed += delegate { this.Activate(); };
optionsWindow.Closed += OnOptionsUpdated;
optionsWindow.Show();
}

View File

@@ -33,6 +33,7 @@ namespace MPF.UI.Core.Windows
// Add handlers
AaruPathButton.Click += BrowseForPathClick;
DiscImageCreatorPathButton.Click += BrowseForPathClick;
RedumperPathButton.Click += BrowseForPathClick;
DefaultOutputPathButton.Click += BrowseForPathClick;
AcceptButton.Click += OnAcceptClick;

View File

@@ -11,7 +11,7 @@
<Description>Frontend for various dumping programs</Description>
<Authors>Matt Nadareski;ReignStumble;Jakz</Authors>
<Copyright>Copyright (c)2019-2023</Copyright>
<VersionPrefix>2.7.4</VersionPrefix>
<VersionPrefix>2.7.5</VersionPrefix>
<InternalsVisibleTo>MPF.Test</InternalsVisibleTo>
</PropertyGroup>

View File

@@ -1,5 +1,5 @@
# version format
version: 2.7.4-{build}
version: 2.7.5-{build}
# pull request template
pull_requests:
@@ -56,8 +56,8 @@ after_build:
- 7z e DiscImageCreator_20230606.zip -oMPF\bin\Debug\net6.0-windows\win-x64\publish\Programs\Creator Release_ANSI\*
# Redumper
- ps: appveyor DownloadFile https://github.com/superg/redumper/releases/download/build_246/redumper-2023.10.31_build246-win64.zip
- 7z e redumper-2023.10.31_build246-win64.zip -oMPF\bin\Debug\net6.0-windows\win-x64\publish\Programs\Redumper redumper-2023.10.31_build246-win64\bin\*
- ps: appveyor DownloadFile https://github.com/superg/redumper/releases/download/build_247/redumper-2023.11.01_build247-win64.zip
- 7z e redumper-2023.11.01_build247-win64.zip -oMPF\bin\Debug\net6.0-windows\win-x64\publish\Programs\Redumper redumper-2023.11.01_build247-win64\bin\*
# Create MPF Debug archives
- cd %APPVEYOR_BUILD_FOLDER%\MPF\bin\Debug\net6.0-windows\win-x64\publish\