From d57fb16c2d54c0298006fc2542cc8f46f67fe2f2 Mon Sep 17 00:00:00 2001 From: Bruno Lopes Date: Thu, 14 Aug 2025 22:46:34 -0300 Subject: [PATCH] build/windows: Rely on output (not on error code) on 'msix_trust' check (cherry picked from commit f890c5ab68fa4105ef5c9511aae01f99c4d3fff0) --- build/windows/store/3_dist-gimp-winsdk.ps1 | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/build/windows/store/3_dist-gimp-winsdk.ps1 b/build/windows/store/3_dist-gimp-winsdk.ps1 index 8a24afc27e..ca2abc08b2 100644 --- a/build/windows/store/3_dist-gimp-winsdk.ps1 +++ b/build/windows/store/3_dist-gimp-winsdk.ps1 @@ -1,4 +1,4 @@ -#!/usr/bin/env pwsh +#!/usr/bin/env pwsh # Parameters param ($revision = "$GIMP_CI_MS_STORE", @@ -419,10 +419,10 @@ if (-not $GITLAB_CI -and $wack -eq 'WACK') if (-not $GIMP_RELEASE -or $GIMP_IS_RC_GIT) { Write-Output "$([char]27)[0Ksection_start:$(Get-Date -UFormat %s -Millisecond 0):msix_trust${msix_arch}[collapsed=true]$([char]13)$([char]27)[0KSelf-signing $MSIX_ARTIFACT (for testing purposes)" - signtool sign /debug /fd sha256 /a /f $(Resolve-Path build\windows\store\pseudo-gimp*.pfx) /p eek $MSIX_ARTIFACT - if ("$LASTEXITCODE" -gt '0' -or "$?" -eq 'False') + $sign_output = & signtool sign /debug /fd sha256 /a /f $(Resolve-Path build\windows\store\pseudo-gimp*.pfx) /p eek $MSIX_ARTIFACT + Write-Output $sign_output + if ($sign_output -like "*After expiry filter, 0 certs were left*") { - ## We need to manually check failures in pre-7.4 PS $pseudo_gimp = "pseudo-gimp_$(Get-Date -UFormat %s -Millisecond 0)" New-SelfSignedCertificate -Type Custom -Subject "$(([xml](Get-Content build\windows\store\AppxManifest.xml)).Package.Identity.Publisher)" -KeyUsage DigitalSignature -FriendlyName "$pseudo_gimp" -CertStoreLocation "Cert:\CurrentUser\My" -TextExtension @("2.5.29.37={text}1.3.6.1.5.5.7.3.3", "2.5.29.19={text}") | Out-Null Export-PfxCertificate -Cert "Cert:\CurrentUser\My\$(Get-ChildItem Cert:\CurrentUser\My | Where-Object FriendlyName -EQ "$pseudo_gimp" | Select-Object -ExpandProperty Thumbprint)" -FilePath "${pseudo_gimp}.pfx" -Password (ConvertTo-SecureString -String eek -Force -AsPlainText) | Out-Null