CI: fix msix

This commit is contained in:
aleksey-hoffman committed 2026-07-17 23:41:54 +03:00
1 parent 5ee320512a
commit ce4829f303
1 file changed
+20 -4
+20 -4
View File
@@ -38,19 +38,35 @@ $makeappx = Resolve-MakeAppxPath
$temporaryDirectory = Join-Path ([IO.Path]::GetTempPath()) "sigma-file-manager-msix-$([Guid]::NewGuid())"
$bundleDirectory = Join-Path $temporaryDirectory "bundle"
function Invoke-MakeAppx {
param(
[Parameter(Mandatory = $true)]
[string[]]$Arguments
)
& $makeappx @Arguments
if ($LASTEXITCODE -ne 0) {
throw "makeappx.exe $($Arguments -join ' ') failed with exit code $LASTEXITCODE."
}
}
try {
New-Item -ItemType Directory -Path $bundleDirectory | Out-Null
& $makeappx unpack /p $bundle /d $bundleDirectory /o | Out-Null
Invoke-MakeAppx -Arguments @("unbundle", "/p", "$bundle", "/d", $bundleDirectory, "/o")
$packages = Get-ChildItem $bundleDirectory -Filter "*.msix"
$packages = @(Get-ChildItem $bundleDirectory -Filter "*.msix")
if ($packages.Count -eq 0) {
throw "The MSIX bundle does not contain architecture packages."
$packages = @(Get-ChildItem $bundleDirectory -Filter "*.appx")
}
if ($packages.Count -eq 0) {
$bundleContents = Get-ChildItem $bundleDirectory -Recurse -File | ForEach-Object { $_.FullName.Substring($bundleDirectory.Length + 1) }
throw "The MSIX bundle does not contain architecture packages. Contents: $($bundleContents -join ', ')"
}
foreach ($package in $packages) {
$packageDirectory = Join-Path $temporaryDirectory $package.BaseName
New-Item -ItemType Directory -Path $packageDirectory | Out-Null
& $makeappx unpack /p $package.FullName /d $packageDirectory /o | Out-Null
Invoke-MakeAppx -Arguments @("unpack", "/p", $package.FullName, "/d", $packageDirectory, "/o")
[xml]$manifest = Get-Content (Join-Path $packageDirectory "AppxManifest.xml") -Raw
$namespaces = [Xml.XmlNamespaceManager]::new($manifest.NameTable)