From c722a6149fca9a184fb3f1963419a4996f928579 Mon Sep 17 00:00:00 2001 From: 11cookies11 Date: Mon, 9 Mar 2026 13:36:43 +0800 Subject: [PATCH] =?UTF-8?q?=EF=BB=BFfix(build):=20fallback=20to=20logo.png?= =?UTF-8?q?=20when=20logo=5Fmark.png=20is=20unavailable?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [中文] - 变更内容: - MSIX 资产生成时增加图标回退逻辑,优先使用 `logo_mark.png`,缺失时自动回退 `logo.png`。 - 影响范围: - `scripts/build_msix.ps1` 图标准备阶段。 - 兼容性/行为变化: - 不再因 `logo_mark.png` 缺失导致构建失败;其余流程保持不变。 - 依赖/环境: - 无新增依赖。 [English] - Changes: - Added icon fallback in MSIX asset generation: prefer `logo_mark.png`, fallback to `logo.png`. - Impact: - `scripts/build_msix.ps1` icon preparation stage. - Compatibility / Behavior Changes: - Build no longer fails when `logo_mark.png` is missing; other behavior remains unchanged. - Dependencies / Environment: - No new dependency. --- scripts/build_msix.ps1 | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/scripts/build_msix.ps1 b/scripts/build_msix.ps1 index 2961bf6..1af4fad 100644 --- a/scripts/build_msix.ps1 +++ b/scripts/build_msix.ps1 @@ -159,9 +159,13 @@ New-Item -ItemType Directory -Path $stageRoot | Out-Null Copy-Item -Path (Join-Path $appDist "*") -Destination $stageRoot -Recurse -Force Write-Host "==> Generate MSIX assets" -$logoSource = Join-Path $repoRoot "ui\assets\icons\logo_mark.png" -if (-not (Test-Path -LiteralPath $logoSource)) { - throw "Logo source missing: $logoSource" +$logoCandidates = @( + (Join-Path $repoRoot "ui\assets\icons\logo_mark.png"), + (Join-Path $repoRoot "ui\assets\icons\logo.png") +) +$logoSource = $logoCandidates | Where-Object { Test-Path -LiteralPath $_ } | Select-Object -First 1 +if (-not $logoSource) { + throw "Logo source missing. Tried: $($logoCandidates -join ', ')" } Resize-Png -Source $logoSource -Target (Join-Path $assetsRoot "StoreLogo.png") -Width 50 -Height 50 Resize-Png -Source $logoSource -Target (Join-Path $assetsRoot "Square44x44Logo.png") -Width 44 -Height 44