Skip to content

Commit cf2a6c0

Browse files
committed
Update Create-MsixBundle.ps1
1 parent 0050b19 commit cf2a6c0

File tree

1 file changed

+4
-9
lines changed

1 file changed

+4
-9
lines changed

.github/scripts/Create-MsixBundle.ps1

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -119,22 +119,17 @@ if ($AppInstallerUri -ne "" -and ($BuildMode -eq "Sideload" -or $BuildMode -eq "
119119
}
120120

121121
# Determine architecture from the manifest Identity
122-
$ns = @{ pkg = "http://schemas.microsoft.com/appx/manifest/foundation/windows10" }
123-
$identity = $msixManifest.SelectSingleNode("/pkg:Package/pkg:Identity", (New-Object System.Xml.XmlNamespaceManager($msixManifest.NameTable)))
122+
$nsmgr = New-Object System.Xml.XmlNamespaceManager($msixManifest.NameTable)
123+
$nsmgr.AddNamespace("pkg", "http://schemas.microsoft.com/appx/manifest/foundation/windows10")
124+
$identity = $msixManifest.SelectSingleNode("/pkg:Package/pkg:Identity", $nsmgr)
124125
if ($null -eq $identity) {
125-
# Try without namespace
126126
$arch = "x64"
127127
} else {
128-
$nsmgr = New-Object System.Xml.XmlNamespaceManager($msixManifest.NameTable)
129-
$nsmgr.AddNamespace("pkg", "http://schemas.microsoft.com/appx/manifest/foundation/windows10")
130-
$identityNode = $msixManifest.SelectSingleNode("/pkg:Package/pkg:Identity", $nsmgr)
131-
$arch = $identityNode.GetAttribute("ProcessorArchitecture")
128+
$arch = $identity.GetAttribute("ProcessorArchitecture")
132129
if ([string]::IsNullOrEmpty($arch)) { $arch = "x64" }
133130
}
134131

135132
# Parse PackageDependency entries
136-
$nsmgr = New-Object System.Xml.XmlNamespaceManager($msixManifest.NameTable)
137-
$nsmgr.AddNamespace("pkg", "http://schemas.microsoft.com/appx/manifest/foundation/windows10")
138133
$deps = $msixManifest.SelectNodes("/pkg:Package/pkg:Dependencies/pkg:PackageDependency", $nsmgr)
139134

140135
foreach ($dep in $deps) {

0 commit comments

Comments
 (0)