You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Fix user mode fonts to install & add repair support - #6619
Align user-scope font installation with the machine-scope model to address fonts missing from Windows discovery after sign-out or restart.
Install user fonts directly into %LOCALAPPDATA%\Microsoft\Windows\Fonts and register their absolute paths under HKCU\Software\Microsoft\Windows NT\CurrentVersion\Fonts.
Track original filenames separately from collision-renamed installed files using the same package inventory mapping strategy for both scopes.
Add font repair using installed package metadata. Repair migrates existing nested user installations to the flat layout and restores discovery registrations without downloading fonts.
Update validation, inventory, and uninstall to handle both layouts. Remove only mapped files and matching registrations, preserving unrelated files and the shared Fonts directory.
Machine-scope discovery registrations retain their relative filename values. Migration rollback is per-file and best effort.
AppInstallerCLITests.exe '[fonts],[FontHelper],[RepairFlow]' Passed: 334 assertions in 29 test cases. wingetdev font list --details --disable-interactivity: passed against the locally deployed dev build with fonts enabled.
Preserve font and pre-indexed source test hooks.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: a9e21d38-9ab1-4358-963d-9aadad897ad0
Add a regression for volatile shared test keys and acknowledge fontlayout in the spelling dictionary.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: a9e21d38-9ab1-4358-963d-9aadad897ad0
The reason will be displayed to describe this comment to others. Learn more.
🟡 Changes recommended
Unresolved font-path collisions and overly restrictive filename validation can block valid installs, repairs, and uninstalls, while malformed inventory mappings can truncate font listings.
This PR addresses user fonts disappearing after sign-out or restart by aligning their installation layout with machine-scope fonts. It also adds repair support using installed metadata, without downloading fonts.
Changes:
Install user fonts directly in the shared Fonts directory with absolute-path discovery registrations.
Add repair to migrate legacy nested installations and restore registrations.
Update inventory, validation, uninstall, and tests for both layouts and filename collisions.
The reason will be displayed to describe this comment to others. Learn more.
🔵 Needs a closer look
Font filename collisions can block installation or repair at the 255-character boundary, while repeated per-font mapping scans introduce quadratic overhead in font listings and installed-source population.
No open issues 🎉
2 previously missed issues
In code that hasn't changed since last review
Suffix collisions can exceed the filesystem filename limit
src/AppInstallerCommonCore/Fonts.cpp:241
When a 255-character ASCII font filename collides, appending the first numeric suffix produces a 256-character name that exceeds the filesystem component limit and fails IsFontFileNameSafe. This prevents a second user-scope package with that filename from installing, and prevents legacy repair when the destination name is occupied. Reserve space for the suffix and extension using a Unicode-safe truncation or hashing strategy, and add a collision test at the 255-character boundary.
Repeated mapping scans make package font enumeration quadratic
src/AppInstallerCommonCore/Fonts.cpp:621
GetRegisteredFontInstallPath now reads and validates every package mapping for each font, so enumerating a package with N fonts performs N² mapping reads and validations. This affects both detailed font listings and installed-source population through FontHelper::PopulateIndex, where installed paths previously bypassed the mapping scan. Load and validate the mappings once per package version and reuse them across its files in both inventory paths.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
📖 Description
Align user-scope font installation with the machine-scope model to address fonts missing from Windows discovery after sign-out or restart.
%LOCALAPPDATA%\Microsoft\Windows\Fontsand register their absolute paths underHKCU\Software\Microsoft\Windows NT\CurrentVersion\Fonts.Machine-scope discovery registrations retain their relative filename values. Migration rollback is per-file and best effort.
🔗 References
Addresses #6535.
🔍 Validation
Automated coverage checks exact inventory filenames, flat installation paths, REG_SZ discovery values, scope isolation, filename collisions, repair migration, failure handling, and uninstall cleanup.
AppInstallerCLITests.exe '[fonts],[FontHelper],[RepairFlow]'
Passed: 334 assertions in 29 test cases.
wingetdev font list --details --disable-interactivity: passed against the locally deployed dev build with fonts enabled.✅ Checklist
🤖 AI Assistance
📋 Issue Type
Microsoft Reviewers: Open in CodeFlow