Skip to content

Commit

Permalink
Extend regex for determining arch from URL (#445)
Browse files Browse the repository at this point in the history
  • Loading branch information
mdanish-kh authored Sep 11, 2023
1 parent 004b6ce commit e4d79b3
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/WingetCreateCore/Common/PackageParser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -555,7 +555,6 @@ private static bool ParsePackageAndGenerateInstallerNodes(InstallerMetadata inst
if (!parseMsixResult)
{
var urlArchitecture = installerMetadata.UrlArchitecture = GetArchFromUrl(baseInstaller.InstallerUrl);
installerMetadata.UrlArchitecture = GetArchFromUrl(baseInstaller.InstallerUrl);
installerMetadata.BinaryArchitecture = baseInstaller.Architecture;

var overrideArch = installerMetadata.OverrideArchitecture;
Expand Down Expand Up @@ -587,17 +586,17 @@ private static bool ParsePackageAndGenerateInstallerNodes(InstallerMetadata inst
{
archMatches.Add(Architecture.Arm64);
}
else if (Regex.Match(url, @"\barm\b", RegexOptions.IgnoreCase).Success)
else if (Regex.Match(url, @"\barm\b|armv[567]", RegexOptions.IgnoreCase).Success)
{
archMatches.Add(Architecture.Arm);
}

if (Regex.Match(url, "x64|win64|_64|64-bit", RegexOptions.IgnoreCase).Success)
if (Regex.Match(url, "x64|win64|_64|64-bit|amd64", RegexOptions.IgnoreCase).Success)
{
archMatches.Add(Architecture.X64);
}

if (Regex.Match(url, "x86|win32|ia32|_86|32-bit", RegexOptions.IgnoreCase).Success)
if (Regex.Match(url, @"x86|win32|ia32|_86|32-bit|i386|\b386\b", RegexOptions.IgnoreCase).Success)
{
archMatches.Add(Architecture.X86);
}
Expand Down

0 comments on commit e4d79b3

Please sign in to comment.