Skip to content

Advanced Paste additional customizations and PhiSilica provider#46727

Open
khmyznikov wants to merge 73 commits into
mainfrom
gleb/advanced-paste
Open

Advanced Paste additional customizations and PhiSilica provider#46727
khmyznikov wants to merge 73 commits into
mainfrom
gleb/advanced-paste

Conversation

@khmyznikov
Copy link
Copy Markdown
Contributor

This pull request introduces significant improvements to the Advanced Paste module’s packaging, signing, and installation process. The most important changes are the migration of Advanced Paste to a self-contained MSIX package (with package identity), robust CI/CD signing and installer integration, and updated documentation and build configurations to support these changes.

Advanced Paste MSIX packaging and installer integration:

  • Migrated Advanced Paste to a self-contained MSIX package, including its dependencies, and ensured the MSIX is built and output to WinUI3Apps/AdvancedPaste/. The WiX installer now deploys and registers the MSIX package and its dependencies, with custom actions to install and uninstall the package during setup/uninstall.

  • Added a new ESRP signing policy and CI pipeline steps to locate, unpack, sign, and re-pack the Advanced Paste MSIX and its contents. This ensures the MSIX and its DLLs/EXEs are properly signed before distribution.
    Build and configuration updates:

  • Updated build templates and props to support Advanced Paste versioning and new MSIX output location. This includes adding versioning steps, updating launch configurations, and importing new build properties for Phi Silica support.

  • Upgraded Windows App SDK NuGet package versions for Advanced Paste and related projects.

Documentation improvements:

  • Expanded developer documentation to explain the new MSIX packaging, debugging, and Phi Silica (Windows AI) integration, including how the installer and runtime registration work, and how the Settings UI queries Advanced Paste for AI model availability.

These changes together enable Advanced Paste to use Windows AI APIs (Phi Silica) via native package identity, simplify deployment and signing, and improve maintainability and developer experience.

@khmyznikov khmyznikov requested a review from a team as a code owner May 12, 2026 04:13
@khmyznikov
Copy link
Copy Markdown
Contributor Author

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

AP was the only WinUI3 module shipping into a WinUI3Apps\AdvancedPaste subfolder, which forced a separate heat-based harvest in the installer. Move output to WinUI3Apps\ alongside Settings/Hosts/Peek so the existing WinUI3ApplicationsFiles harvester + dedup/CreateWinAppSDKHardlinksCA path covers AP for free. Reverts the installer scaffolding (heat script, Product.wxs/wixproj edits, generateAllFileComponents.ps1 churn, CustomAction.cpp + WinUI3Applications.wxs hardlinks rollback) so the diff is back to what main does for every other unpackaged WinUI3 app. Also drops the stale subfolder reference in verify-installation-script.ps1 and the sparse AppxManifest Executable path.
@github-actions

This comment has been minimized.

After flattening AP into WinUI3Apps\, its 'resources.pri' collided with the WinUI3Apps root convention and tripped verifyPossibleAssetConflicts.ps1. Use the same per-module naming pattern as Settings/Peek/FileLocksmith/etc. The stale comment about sparse XAML needing 'resources.pri' was wrong -- Settings already runs sparse with PowerToys.Settings.pri.
@github-actions

This comment has been minimized.

AP binaries now live flat in WinUI3Apps\, matching every other unpackaged WinUI3 module.
@github-actions

This comment has been minimized.

CmdPal.wxs references these preprocessor vars; reverting the wixproj to main dropped them. Restore the two CmdPal-only defines (without re-introducing the AdvancedPaste heat scaffolding).
@github-actions

This comment has been minimized.

… fix

Flattening AP into WinUI3Apps\ broke the installed build because the existing flat WinUI3ApplicationsFiles harvester doesn't recurse into subdirectories. AP's XBF files (AdvancedPasteXAML\), locale satellites, and arm64\ native DLLs were missing from the MSI. Restore the WinUI3Apps\AdvancedPaste\ subfolder layout with heat-based recursive harvest (like Monaco). Three CI fixes: 1) Language='0' on all heat File entries to prevent ICE03 on gd-GB/mi-NZ/ug-CN .mui files 2) ESRPSigning paths 3) Unique PRI name (PowerToys.AdvancedPaste.pri) passes audit.
AP on main already outputs flat to WinUI3Apps\ and is harvested by WinUI3ApplicationsFiles. Adding sparse identity (like ImageResizer) requires zero installer changes. Reverts the heat script, Product.wxs changes, and generateAllFileComponents.ps1 churn. Only non-main installer change is CmdPal.wxs fix (unrelated) and CmdPalPackagePath/Dir wixproj defines.
@github-actions

This comment has been minimized.

Under sparse identity, ResourceLoader() defaults to 'resources.pri' which doesn't exist (our PRI is PowerToys.AdvancedPaste.pri). This caused ERROR_MRM_MAP_NOT_FOUND (0x80073B01) crashing XAML's MeasureOverride. Match ImageResizer's pattern: new ResourceLoader('PowerToys.AdvancedPaste.pri').
@github-actions

This comment has been minimized.

WinUI's Application.LoadComponent hard-codes 'resources.pri' lookup under sparse identity (WinAppSDK 2.0.1). Custom PRI names work for ResourceLoader (explicit path) but not for the XAML framework's built-in ms-appx:/// URI resolution. Reverts ProjectPriFileName to resources.pri and downgrades the audit check from error to warning.
@github-actions
Copy link
Copy Markdown

@check-spelling-bot Report

🔴 Please review

See the 📂 files view, the 📜action log, 👼 SARIF report, or 📝 job summary for details.

Unrecognized words (10)

CLASSNOTREG
djwsxzxb
dumpbin
hostfxr
ksa
Kxx
mfcm
REGDB
scom
sreg

These words are not needed and should be removed DEFAULTTONEAREST

To accept these unrecognized words as correct and remove the previously acknowledged and now absent words, you could run the following commands

... in a clone of the git@github.com:microsoft/PowerToys.git repository
on the gleb/advanced-paste branch (ℹ️ how do I use this?):

curl -s -S -L 'https://raw.githubusercontent.com/check-spelling/check-spelling/cfb6f7e75bbfc89c71eaa30366d0c166f1bd9c8c/apply.pl' |
perl - 'https://github.com/microsoft/PowerToys/actions/runs/26192996649/attempts/1' &&
git commit -m 'Update check-spelling metadata'

OR

To have the bot accept them for you, comment in the PR quoting the following line:
@check-spelling-bot apply updates.

If the flagged items are 🤯 false positives

If items relate to a ...

  • binary file (or some other file you wouldn't want to check at all).

    Please add a file path to the excludes.txt file matching the containing file.

    File paths are Perl 5 Regular Expressions - you can test yours before committing to verify it will match your files.

    ^ refers to the file's path from the root of the repository, so ^README\.md$ would exclude README.md (on whichever branch you're using).

  • well-formed pattern.

    If you can write a pattern that would match it,
    try adding it to the patterns.txt file.

    Patterns are Perl 5 Regular Expressions - you can test yours before committing to verify it will match your lines.

    Note that patterns can't match multiline strings.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Product-Advanced Paste Refers to the Advanced Paste module

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants