Remove unused dependencies and add WinUI3Apps hard-link deduplication#46745
Draft
yeelam-gordon wants to merge 2 commits intomicrosoft:mainfrom
Draft
Remove unused dependencies and add WinUI3Apps hard-link deduplication#46745yeelam-gordon wants to merge 2 commits intomicrosoft:mainfrom
yeelam-gordon wants to merge 2 commits intomicrosoft:mainfrom
Conversation
- Remove System.Data.SqlClient PackageReference from MouseWithoutBorders, MouseWithoutBordersHelper, and MouseWithoutBordersService .csproj files. It was pinned as a transitive dependency of Microsoft.Windows.Compatibility but PowerToys has zero SQL database usage. - Remove central PackageVersion pin for System.Data.SqlClient from Directory.Packages.props. - Remove unused 'using System.ServiceModel.Channels' import from MouseWithoutBorders Program.cs (no WCF usage in the codebase). - Exclude MFC DLLs (mfc140.dll, mfc140u.dll, mfcm140.dll, mfcm140u.dll) from installer file collection in generateAllFileComponents.ps1. - Add RemoveUnusedVCRuntimeDlls target in Directory.Build.targets to clean up MFC, C++ AMP, and OpenMP DLLs from build output after CopyCppRuntimeToOutputDir copies them. These leak from the VC++ Redistributable tree (Microsoft.VC14x.MFC, .CXXAMP) but no PowerToys binary imports them — verified with dumpbin /dependents across all 2176 installed binaries. Saves ~11 MB per output location. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Build-time: generateAllFileComponents.ps1 now computes the SHA256 intersection of root and WinUI3Apps files, removes duplicates from the WinUI3Apps WXS component list, and writes a hardlinks.txt manifest. This reduces both installer size and installed size by ~318 MB. Install-time: CreateWinAppSDKHardlinksCA reads hardlinks.txt after InstallFiles and creates hard-links from root files into WinUI3Apps. Falls back to file copy if hard-linking fails (e.g. cross-volume). DeleteWinAppSDKHardlinksCA removes them before RemoveFiles on uninstall. Edge cases handled: - Empty duplicate list: hardlinks.txt always written, CA handles empty - All files duplicated: Generate-FileComponents returns early for empty list - Cross-volume install: CreateHardLinkW failure falls back to copy - Missing source: logged and skipped, install continues - Upgrade: CA runs on both fresh install and upgrade Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Member
|
❤️❤️❤️ |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary of the Pull Request
Two related changes to reduce PowerToys installer and installed size by eliminating unused dependencies and deduplicating shared WinAppSDK files.
1. Remove unused dependencies (~11 MB savings per output location)
Directory.Packages.propspin. It was a transitive dependency ofMicrosoft.Windows.Compatibilitybut PowerToys has zero SQL database usage.usingimport: Removedusing System.ServiceModel.Channelsfrom MouseWithoutBordersProgram.cs(no WCF usage).RemoveUnusedVCRuntimeDllstarget inDirectory.Build.targetsto clean up MFC, C++ AMP, and OpenMP DLLs that leak from the VC++ Redistributable tree but are not imported by any PowerToys binary (verified withdumpbin /dependentsacross all 2176 installed binaries). Also excluded MFC DLLs from installer file collection.2. WinUI3Apps hard-link deduplication (~318 MB savings)
Build-time:
generateAllFileComponents.ps1now computes the SHA256 intersection of root and WinUI3Apps files, removes duplicates from the WinUI3Apps WXS component list, and writes ahardlinks.txtmanifest.Install-time:
CreateWinAppSDKHardlinksCAcustom action readshardlinks.txtafterInstallFilesand creates hard-links from root files into the WinUI3Apps directory. Falls back to file copy if hard-linking fails (e.g. cross-volume).DeleteWinAppSDKHardlinksCAremoves them beforeRemoveFileson uninstall.Edge cases handled:
hardlinks.txtalways written, CA handles emptyGenerate-FileComponentsreturns early for empty listCreateHardLinkWfailure falls back to copyDetailed Description of the Pull Request / Additional comments
These changes are purely build/installer infrastructure — no runtime behavior changes to any PowerToys module.
Validation Steps Performed
dumpbin /dependentsSystem.Data.SqlClienthas no usages in PowerToys code