Skip to content

Add Assets to resources.pri + Support Qualified Names in Appxmanifest#320

Merged
nmetulev merged 10 commits intomainfrom
cm-unplated
Feb 27, 2026
Merged

Add Assets to resources.pri + Support Qualified Names in Appxmanifest#320
nmetulev merged 10 commits intomainfrom
cm-unplated

Conversation

@chiaramooney
Copy link
Contributor

@chiaramooney chiaramooney commented Feb 25, 2026

Closes #298

Description

  • Adding assets to resources.pri to allow for unplated assets to be used when an app appears in the Taskbar. resources.pri now includes mentions of all assets mentioned in appxmanifest.
  • CopyAllAssetsAsync and PRI generation both required the asset paths in appxmanifest to be enumerated. Extracted that code from CopyAllAssetsAsync so code can be shared for both functions and only run once per pack command.
  • Removes blue background from app icon in the taskbar.
  • When scaled asset was specified in appxmanifest, the other scaled assets of the same name were not included in the Assets folder during packaging. Now if Logo.scaled-100.png is specified in appxmanifest, Logo.scaled-200.png, etc is added to the Assets folder during packaging. The also works for unplated, light/dark, etc variations.
  • Note: If a scaled asset like Logo.scaled-100.png is specified in appxmanifest, MRT will not substitute in the right scaled, unplated, etc asset at run time. It will always use the specified asset. For MRT to sub in the most relevant scaled, unplated, etc asset, the developer must specify the base version of the asset (i.e. Logo.png) in the appxmanifest.
  • Replaces using Regex-based XML parsing for XmlDocument parser (better for edge cases/more consistent with poor formatted xml)

Usage Example

No commands change.

Type of Change

  • 🐛 Bug fix

Checklist

  • Tested locally on Windows

Screenshots / Demo

PRI XAML Example:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<PriInfo>
	<ResourceMap name="electron-gallery" version="1.0" primary="true">
		<Qualifiers>
			<AlternateForm>LIGHTUNPLATED,UNPLATED</AlternateForm>
			<Scale>100</Scale>
			<TargetSize>256,16,20,24,30,32,36,40,48,56,60,64,72,80,96</TargetSize>
		</Qualifiers>
		<ResourceMapSubtree name="Files">
			<ResourceMapSubtree name="Assets">
				<NamedResource name="AppList.png" uri="ms-resource://electron-gallery/Files/Assets/AppList.png">
					<Candidate qualifiers="TargetSize-96, AlternateForm-UNPLATED" type="Path">
						<Value>Assets\AppList.targetsize-96_altform-unplated.png</Value>
					</Candidate>
					<Candidate qualifiers="TargetSize-96, AlternateForm-LIGHTUNPLATED" type="Path">
						<Value>Assets\AppList.targetsize-96_altform-lightunplated.png</Value>
					</Candidate>
...
// More asset information and closing tags

Before this change the pri XAML was very simply. Its main entry was just <ResourceMap name="electron-gallery" version="1.0" primary="true">.

Additional Notes

AI Description

This pull request enhances the resource management in the WinApp CLI by adding support for including various asset types in the resources.pri file, enabling unplated assets to appear correctly in the Taskbar. Additionally, it refactors asset handling in the appxmanifest to ensure that scaled assets are included in the packaging process when specified. The XML parsing approach has also been improved for better reliability.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR enhances MSIX packaging by properly including all asset variants in the resources.pri file and fixing asset discovery when qualified MRT names (e.g., "Logo.scale-100.png") are specified in the manifest. This enables proper display of unplated icons in the Windows taskbar and ensures all scaled/themed variants are bundled even when the manifest references a specific qualified asset.

Changes:

  • Modified PRI generation to enumerate and index all image assets in the Assets folder instead of just .pri files
  • Added support for parsing qualified MRT asset names to extract the base name (e.g., "Logo.scale-100" → "Logo")
  • Updated asset file discovery to find all variants of a given asset family regardless of which specific qualified name is referenced in the manifest

@github-actions
Copy link

github-actions bot commented Feb 25, 2026

Build Metrics Report

Binary Sizes

Artifact Baseline Current Delta
CLI (ARM64) 13.69 MB 13.70 MB 📈 +18.5 KB (+0.13%)
CLI (x64) 12.99 MB 13.01 MB 📈 +18.0 KB (+0.14%)
MSIX (ARM64) 5.95 MB 5.96 MB 📈 +17.4 KB (+0.29%)
MSIX (x64) 6.18 MB 6.20 MB 📈 +16.3 KB (+0.26%)
NPM Package 12.12 MB 12.14 MB 📈 +20.5 KB (+0.17%)

Test Results

299 passed, 6 skipped out of 305 tests in 54.4s (+5 tests, +9.1s vs. baseline)

CLI Startup Time

31ms median (x64, winapp --version) · ✅ no change vs. baseline


Updated 2026-02-27 19:22:56 UTC · commit c611445 · workflow run

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 6 comments.

@nmetulev nmetulev requested a review from azchohfi February 27, 2026 00:20
@nmetulev nmetulev enabled auto-merge (squash) February 27, 2026 19:17
@nmetulev nmetulev merged commit 4044684 into main Feb 27, 2026
10 checks passed
@nmetulev nmetulev deleted the cm-unplated branch February 27, 2026 19:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: winapp manifest update-assets only produces one unplated asset

3 participants