Skip to content

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

Open
chiaramooney wants to merge 8 commits intomainfrom
cm-unplated
Open

Add Assets to resources.pri + Support Qualified Names in Appxmanifest#320
chiaramooney wants to merge 8 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 update adds support for including unplated assets in the generated resources.pri file when an app is displayed in the Taskbar, ensuring that all assets from the appxmanifest are referenced. Additionally, it improves the asset packaging process by ensuring that all scaled variants of specified assets are included. Code for asset path extraction has been refactored for better efficiency. No changes to commands or flags were made.

	
		
			LIGHTUNPLATED,UNPLATED
			100
			256,16,20,24,30,32,36,40,48,56,60,64,72,80,96
		
		
			
				
					
						Assets\AppList.targetsize-96_altform-unplated.png
					
					
						Assets\AppList.targetsize-96_altform-lightunplated.png
					
...

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.66 MB 13.69 MB 📈 +31.0 KB (+0.22%)
CLI (x64) 12.96 MB 12.99 MB 📈 +29.5 KB (+0.22%)
MSIX (ARM64) 5.94 MB 5.96 MB 📈 +20.4 KB (+0.34%)
MSIX (x64) 6.17 MB 6.19 MB 📈 +17.5 KB (+0.28%)
NPM Package 12.10 MB 12.13 MB 📈 +30.2 KB (+0.24%)

Test Results

260 passed, 6 skipped out of 266 tests in 62.4s (+5 tests, +4.7s vs. baseline)

CLI Startup Time

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

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.

".svg"
};

private static async Task<HashSet<string>> GetManifestReferencedFilePathsAsync(FileInfo manifestPath, CancellationToken cancellationToken)
Copy link
Member

Choose a reason for hiding this comment

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

Could we reuse the ManifestService.ExtractAssetRefrencesFromManifest function here somehow instead or doing this work - they do a similar job, no?

@nmetulev nmetulev requested a review from azchohfi February 27, 2026 00:20
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