Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 23 additions & 3 deletions src/WingetCreateCore/Common/PackageParser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -814,12 +814,11 @@ private static bool ParseExeInstallerType(string path, Installer baseInstaller,
{
try
{
ManifestResource rc = new ManifestResource();
XmlDocument manifest = GetManifest(path);
InstallerType? installerTypeEnum;
try
{
rc.LoadFrom(path);
string installerType = rc.Manifest.DocumentElement
string installerType = manifest?.DocumentElement?
.GetElementsByTagName("description")
.Cast<XmlNode>()
.FirstOrDefault()?
Expand Down Expand Up @@ -1109,5 +1108,26 @@ private static string RemoveInvalidCharsFromString(string value)
{
return Regex.Replace(value, InvalidCharacters, string.Empty);
}

/// <summary>
/// Gets the manifest from the specified path.</summary>
/// <param name="path">The path to the manifest.</param>
/// <returns>XmlDocument of the manifest.</returns>
private static XmlDocument GetManifest(string path)
{
var rc = new ManifestResource();
var manifest = new XmlDocument();

try
{
rc.LoadFrom(path);
manifest = rc.Manifest;
}
catch (Exception ex)
{
}

return manifest;
}
}
}