From ce4829f3032fc4f21d6fe32934f50d9164fc1df4 Mon Sep 17 00:00:00 2001 From: aleksey-hoffman Date: Fri, 17 Jul 2026 23:41:54 +0300 Subject: [PATCH] CI: fix msix --- scripts/verify-msix-default-file-manager.ps1 | 24 ++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/scripts/verify-msix-default-file-manager.ps1 b/scripts/verify-msix-default-file-manager.ps1 index 752efe93..75795ff2 100644 --- a/scripts/verify-msix-default-file-manager.ps1 +++ b/scripts/verify-msix-default-file-manager.ps1 @@ -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)