mirror of
https://github.com/SabreTools/BinaryObjectScanner.git
synced 2026-10-01 11:12:02 +00:00
Refactor Setup Factory detection (#115)
* Refactor Setup Factory detection * Address Setup Factory PR comments * Fix whitespace
This commit is contained in:
@@ -237,9 +237,9 @@ namespace BurnOutSharp.Tools
|
||||
if (!string.IsNullOrWhiteSpace(version))
|
||||
return version.Replace(", ", ".");
|
||||
|
||||
version = GetResourceString(pex, "ProductVersion");
|
||||
version = GetProductVersion(pex);
|
||||
if (!string.IsNullOrWhiteSpace(version))
|
||||
return version.Replace(", ", ".");
|
||||
return version;
|
||||
|
||||
return null;
|
||||
}
|
||||
@@ -366,6 +366,13 @@ namespace BurnOutSharp.Tools
|
||||
/// <returns>Product name string, null on error</returns>
|
||||
public static string GetProductName(PortableExecutable pex) => GetResourceString(pex, "ProductName");
|
||||
|
||||
/// <summary>
|
||||
/// Get the product name as reported by the filesystem
|
||||
/// </summary>
|
||||
/// <param name="pex">PortableExecutable representing the file contents</param>
|
||||
/// <returns>Product version string, null on error</returns>
|
||||
public static string GetProductVersion(PortableExecutable pex) => GetResourceString(pex, "ProductVersion")?.Replace(", ", ".");
|
||||
|
||||
/// <summary>
|
||||
/// Find resource data in a ResourceSection, if possible
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user