Skip to content

Flatten WinUI3Apps folder and shrink installer#46866

Open
LegendaryBlair wants to merge 12 commits intomainfrom
legendaryblair/shrink-installer
Open

Flatten WinUI3Apps folder and shrink installer#46866
LegendaryBlair wants to merge 12 commits intomainfrom
legendaryblair/shrink-installer

Conversation

@LegendaryBlair
Copy link
Copy Markdown
Contributor

Summary of the Pull Request

This pull request restructures the installer to simplify the asset and application directory layout, removing the legacy WinUI3Apps directory and consolidating assets under a unified Assets directory at the root. It also updates references throughout the installer scripts and custom actions to match the new structure. Additionally, it removes unused VC++ runtime DLLs from build outputs to reduce installer size and cleans up obsolete custom actions.

The most important changes are:

Installer Directory Structure Simplification:

  • All asset references in .wxs files are updated to use the new root-level Assets directory instead of WinUI3Apps\Assets, and directory references now consistently use BaseApplicationsAssetsFolder (installer/PowerToysSetupVNext/*.wxs).
  • The WinUI3AppsInstallFolder and WinUI3AppsAssetsFolder directories are removed from the installer, and their contents are relocated under the root INSTALLFOLDER and Assets directories (installer/PowerToysSetupVNext/Product.wxs).
  • Resource file and language-specific component paths are updated to reflect the new directory structure, removing references to WinUI3Apps (installer/PowerToysSetupVNext/Resources.wxs).

Custom Action and Script Path Updates:

  • Paths used in custom actions for installing, uninstalling, and upgrading modules are updated to remove WinUI3Apps from the script and package locations (installer/PowerToysSetupCustomActionsVNext/CustomAction.cpp). [1] [2] [3]

Installer Cleanup and Maintenance:

  • Obsolete custom actions related to hardlink creation and deletion are removed from the installer definition (installer/PowerToysSetupVNext/Product.wxs).
  • Uninstall folder removal steps are updated to match the new directory structure (installer/PowerToysSetupVNext/Core.wxs).

Build Output Optimization:

  • A new MSBuild target deletes unused VC++ runtime DLLs (MFC, CXXAMP, OpenMP) from output directories, reducing installer size by approximately 11MB per output location (Directory.Build.targets).

PR Checklist

  • Closes: #xxx
  • Communication: I've discussed this with core contributors already. If the work hasn't been agreed, this work might be rejected
  • Tests: Added/updated and all pass
  • Localization: All end-user-facing strings can be localized
  • Dev docs: Added/updated
  • New binaries: Added on the required places
  • Documentation updated: If checked, please file a pull request on our docs repo and link it here: #xxx

Detailed Description of the Pull Request / Additional comments

Validation Steps Performed

Comment thread Directory.Build.targets Fixed
Comment thread Directory.Build.targets Fixed
Comment thread installer/PowerToysSetupVNext/generateAllFileComponents.ps1 Fixed
Comment thread installer/PowerToysSetupVNext/generateAllFileComponents.ps1 Fixed
Comment thread installer/PowerToysSetupVNext/generateAllFileComponents.ps1 Fixed
@github-actions

This comment has been minimized.

Copy link
Copy Markdown
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 removes the legacy WinUI3Apps directory from the build + install layout by flattening WinUI3 app outputs into the main install folder and consolidating app/module assets under a root-level Assets directory, updating installer, scripts, and runtime path references accordingly. It also reduces installer size by excluding/removing unused VC runtime DLLs and cleaning up obsolete installer custom actions.

Changes:

  • Flatten WinUI3 app install/build paths (remove WinUI3Apps\... from runner/module launch code, build scripts, and project output paths).
  • Consolidate assets to INSTALLFOLDER\Assets\... and update WiX fragments + component generation scripts to reference the new asset locations.
  • Reduce output/installer size by removing unused VC runtime DLLs and pruning obsolete installer custom actions.

Reviewed changes

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

Show a summary per file
File Description
tools/Verification scripts/verify-installation-script.ps1 Update verification paths for flattened layout; adjust CmdPal/context-menu checks.
tools/build/self-sign.ps1 Update CmdPal MSIX signing search path for new build output location.
tools/build/cert-sign-package.ps1 Update default MSIX path example for new CmdPal location.
tools/build/build-installer.ps1 Update build output paths and DSC generator dependency copy logic for flattened layout.
src/settings-ui/Settings.UI/ViewModels/NewPlusViewModel.cs Update New+ template example source path to root Assets.
src/settings-ui/Settings.UI/ViewModels/KeyboardManagerViewModel.cs Update Keyboard Manager WinUI editor path to no longer include WinUI3Apps.
src/settings-ui/Settings.UI/PowerToys.Settings.csproj Change Settings output folder from WinUI3Apps to root output.
src/settings-ui/Settings.UI.Library/Utilities/Helper.cs Rename helper to root Assets folder accessor.
src/settings-ui/QuickAccess.UI/PowerToys.QuickAccess.csproj Change QuickAccess output folder to root output.
src/runner/settings_window.cpp Launch Settings from install root instead of WinUI3Apps.
src/runner/quick_access_host.cpp Launch QuickAccess from install root instead of WinUI3Apps.
src/runner/main.cpp Update ImageResizer path and known modules list to new flattened locations.
src/modules/registrypreview/RegistryPreviewUILib/Controls/MonacoEditor/MonacoHelper.cs Update Monaco assets lookup to new Assets location.
src/modules/registrypreview/RegistryPreviewExt/RegistryPreviewExt.vcxproj Output RegistryPreviewExt to root output.
src/modules/registrypreview/RegistryPreviewExt/dllmain.cpp Launch RegistryPreview from install root.
src/modules/registrypreview/RegistryPreview/RegistryPreview.csproj Output RegistryPreview app to root output.
src/modules/powerrename/unittests/PowerRenameLibUnitTests.vcxproj Update unit test link dependency path for flattened output.
src/modules/powerrename/PowerRenameUILib/PowerRenameUI.vcxproj Output PowerRenameUI to root output.
src/modules/powerrename/PowerRenameContextMenu/PowerRenameContextMenu.vcxproj Output PowerRename context menu to root output.
src/modules/powerrename/lib/PowerRenameLib.vcxproj Output PowerRenameLib to root output.
src/modules/powerrename/dll/PowerRenameExt.vcxproj Output PowerRenameExt to root output.
src/modules/powerdisplay/PowerDisplayModuleInterface/PowerDisplayProcessManager.cpp Launch PowerDisplay from install root.
src/modules/powerdisplay/PowerDisplayModuleInterface/dllmain.cpp Launch PowerDisplay from install root.
src/modules/powerdisplay/PowerDisplay/PowerDisplay.csproj Output PowerDisplay app to root output; update comment wording.
src/modules/peek/peek/peek.vcxproj Output Peek module to root output.
src/modules/peek/peek/dllmain.cpp Launch Peek UI from install root.
src/modules/peek/Peek.UI/Peek.UI.csproj Output Peek UI to root output.
src/modules/NewPlus/NewShellExtensionContextMenu/NewShellExtensionContextMenu.vcxproj Output New+ shell extension to root output.
src/modules/NewPlus/NewShellExtensionContextMenu.win10/NewPlus.ShellExtension.win10.vcxproj Output Win10 New+ shell extension to root output.
src/modules/MeasureTool/MeasureToolUI/MeasureToolUI.csproj Output MeasureTool UI to root output.
src/modules/MeasureTool/MeasureToolModuleInterface/MeasureToolModuleInterface.vcxproj Output MeasureTool module interface to root output.
src/modules/MeasureTool/MeasureToolModuleInterface/dllmain.cpp Launch MeasureTool UI from install root.
src/modules/MeasureTool/MeasureToolCore/PowerToys.MeasureToolCore.vcxproj Output MeasureTool core to root output.
src/modules/keyboardmanager/KeyboardManagerEditorUI/KeyboardManagerEditorUI.csproj Output KeyboardManagerEditorUI to root output.
src/modules/keyboardmanager/dll/dllmain.cpp Launch KeyboardManagerEditorUI from install root.
src/modules/imageresizer/ui/ImageResizerUI.csproj Output ImageResizer UI to root output.
src/modules/imageresizer/ImageResizerLib/ImageResizerLib.vcxproj Output ImageResizerLib to root output.
src/modules/imageresizer/ImageResizerContextMenu/ImageResizerContextMenu.vcxproj Output ImageResizer context menu to root output.
src/modules/imageresizer/ImageResizerCLI/ImageResizerCLI.csproj Output ImageResizer CLI to root output.
src/modules/imageresizer/dll/ImageResizerExt.vcxproj Output ImageResizerExt to root output.
src/modules/Hosts/HostsModuleInterface/HostsModuleInterface.vcxproj Output Hosts module interface to root output.
src/modules/Hosts/HostsModuleInterface/dllmain.cpp Launch Hosts from install root.
src/modules/Hosts/Hosts/Hosts.csproj Output Hosts app to root output.
src/modules/FileLocksmith/FileLocksmithUI/FileLocksmithUI.csproj Output FileLocksmith UI to root output.
src/modules/FileLocksmith/FileLocksmithLibInterop/FileLocksmithLibInterop.vcxproj Output FileLocksmith interop to root output.
src/modules/FileLocksmith/FileLocksmithExt/FileLocksmithExt.vcxproj Output FileLocksmithExt to root output.
src/modules/FileLocksmith/FileLocksmithContextMenu/FileLocksmithContextMenu.vcxproj Output FileLocksmith context menu to root output.
src/modules/EnvironmentVariables/EnvironmentVariablesModuleInterface/EnvironmentVariablesModuleInterface.vcxproj Output EnvironmentVariables module interface to root output.
src/modules/EnvironmentVariables/EnvironmentVariablesModuleInterface/dllmain.cpp Launch EnvironmentVariables from install root.
src/modules/EnvironmentVariables/EnvironmentVariables/EnvironmentVariables.csproj Output EnvironmentVariables app to root output.
src/modules/cmdpal/Tests/Microsoft.CommandPalette.Extensions.Toolkit.UnitTests/Microsoft.CommandPalette.Extensions.Toolkit.UnitTests.csproj Update CmdPal unit test output path for flattened build tree.
src/modules/cmdpal/Tests/Microsoft.CmdPal.UI.ViewModels.UnitTests/Microsoft.CmdPal.UI.ViewModels.UnitTests.csproj Update CmdPal unit test output path for flattened build tree.
src/modules/cmdpal/Tests/Microsoft.CmdPal.Ext.WindowWalker.UnitTests/Microsoft.CmdPal.Ext.WindowWalker.UnitTests.csproj Update CmdPal unit test output path for flattened build tree.
src/modules/cmdpal/Tests/Microsoft.CmdPal.Ext.WebSearch.UnitTests/Microsoft.CmdPal.Ext.WebSearch.UnitTests.csproj Update CmdPal unit test output path for flattened build tree.
src/modules/cmdpal/Tests/Microsoft.CmdPal.Ext.TimeDate.UnitTests/Microsoft.CmdPal.Ext.TimeDate.UnitTests.csproj Update CmdPal unit test output path for flattened build tree.
src/modules/cmdpal/Tests/Microsoft.CmdPal.Ext.System.UnitTests/Microsoft.CmdPal.Ext.System.UnitTests.csproj Update CmdPal unit test output path for flattened build tree.
src/modules/cmdpal/Tests/Microsoft.CmdPal.Ext.Shell.UnitTests/Microsoft.CmdPal.Ext.Shell.UnitTests.csproj Update CmdPal unit test output path for flattened build tree.
src/modules/cmdpal/Tests/Microsoft.CmdPal.Ext.RemoteDesktop.UnitTests/Microsoft.CmdPal.Ext.RemoteDesktop.UnitTests.csproj Update CmdPal unit test output path for flattened build tree.
src/modules/cmdpal/Tests/Microsoft.CmdPal.Ext.Registry.UnitTests/Microsoft.CmdPal.Ext.Registry.UnitTests.csproj Update CmdPal unit test output path for flattened build tree.
src/modules/cmdpal/Tests/Microsoft.CmdPal.Ext.Bookmarks.UnitTests/Microsoft.CmdPal.Ext.Bookmarks.UnitTests.csproj Update CmdPal unit test output path for flattened build tree.
src/modules/cmdpal/Tests/Microsoft.CmdPal.Ext.Apps.UnitTests/Microsoft.CmdPal.Ext.Apps.UnitTests.csproj Update CmdPal unit test output path for flattened build tree.
src/modules/cmdpal/Tests/Microsoft.CmdPal.Common.UnitTests/Microsoft.CmdPal.Common.UnitTests.csproj Update CmdPal unit test output path for flattened build tree.
src/modules/cmdpal/Microsoft.Terminal.UI/Microsoft.Terminal.UI.vcxproj Output CmdPal terminal UI component to new CmdPal folder.
src/modules/cmdpal/Microsoft.CmdPal.UI/CmdPal.pre.props Update CmdPal output path to new CmdPal folder.
src/modules/cmdpal/Microsoft.CmdPal.UI.ViewModels/Microsoft.CmdPal.UI.ViewModels.csproj Update CmdPal viewmodels output path to new CmdPal folder.
src/modules/cmdpal/Microsoft.CmdPal.Common/Microsoft.CmdPal.Common.csproj Update CmdPal common output path to new CmdPal folder.
src/modules/cmdpal/ext/SamplePagesExtension/SamplePagesExtension.csproj Update CmdPal extension output path to new extension root folder.
src/modules/cmdpal/ext/ProcessMonitorExtension/ProcessMonitorExtension.csproj Update CmdPal extension output path to new extension root folder.
src/modules/cmdpal/ext/Microsoft.CmdPal.Ext.WinGet/Microsoft.CmdPal.Ext.WinGet.csproj Update CmdPal extension output path to new CmdPal folder.
src/modules/cmdpal/ext/Microsoft.CmdPal.Ext.WindowWalker/Microsoft.CmdPal.Ext.WindowWalker.csproj Update CmdPal extension output path to new CmdPal folder.
src/modules/cmdpal/ext/Microsoft.CmdPal.Ext.WindowsTerminal/Microsoft.CmdPal.Ext.WindowsTerminal.csproj Update commented output path reference.
src/modules/cmdpal/ext/Microsoft.CmdPal.Ext.WindowsSettings/Microsoft.CmdPal.Ext.WindowsSettings.csproj Update CmdPal extension output path to new CmdPal folder.
src/modules/cmdpal/ext/Microsoft.CmdPal.Ext.WindowsServices/Microsoft.CmdPal.Ext.WindowsServices.csproj Update CmdPal extension output path to new CmdPal folder.
src/modules/cmdpal/ext/Microsoft.CmdPal.Ext.WebSearch/Microsoft.CmdPal.Ext.WebSearch.csproj Update CmdPal extension output path to new CmdPal folder.
src/modules/cmdpal/ext/Microsoft.CmdPal.Ext.TimeDate/Microsoft.CmdPal.Ext.TimeDate.csproj Update CmdPal extension output path to new CmdPal folder.
src/modules/cmdpal/ext/Microsoft.CmdPal.Ext.System/Microsoft.CmdPal.Ext.System.csproj Update CmdPal extension output path to new CmdPal folder.
src/modules/cmdpal/ext/Microsoft.CmdPal.Ext.Shell/Microsoft.CmdPal.Ext.Shell.csproj Update CmdPal extension output path to new CmdPal folder.
src/modules/cmdpal/ext/Microsoft.CmdPal.Ext.RemoteDesktop/Microsoft.CmdPal.Ext.RemoteDesktop.csproj Update CmdPal extension output path to new CmdPal folder.
src/modules/cmdpal/ext/Microsoft.CmdPal.Ext.Registry/Microsoft.CmdPal.Ext.Registry.csproj Update CmdPal extension output path to new CmdPal folder.
src/modules/cmdpal/ext/Microsoft.CmdPal.Ext.PowerToys/Microsoft.CmdPal.Ext.PowerToys.csproj Update linked content path to new Assets root.
src/modules/cmdpal/ext/Microsoft.CmdPal.Ext.PowerToys/Helpers/PowerToysResourcesHelper.cs Update settings icon root path to new Assets root.
src/modules/cmdpal/ext/Microsoft.CmdPal.Ext.PerformanceMonitor/Microsoft.CmdPal.Ext.PerformanceMonitor.csproj Update CmdPal extension output path to new CmdPal folder.
src/modules/cmdpal/ext/Microsoft.CmdPal.Ext.Indexer/Microsoft.CmdPal.Ext.Indexer.csproj Update CmdPal extension output path to new CmdPal folder.
src/modules/cmdpal/ext/Microsoft.CmdPal.Ext.Indexer/Commands/PeekFileCommand.cs Update Peek executable path to flattened install root.
src/modules/cmdpal/ext/Microsoft.CmdPal.Ext.ClipboardHistory/Microsoft.CmdPal.Ext.ClipboardHistory.csproj Update CmdPal extension output path to new CmdPal folder.
src/modules/cmdpal/ext/Microsoft.CmdPal.Ext.Calc/Microsoft.CmdPal.Ext.Calc.csproj Update CmdPal extension output path to new CmdPal folder.
src/modules/cmdpal/ext/Microsoft.CmdPal.Ext.Bookmark/Microsoft.CmdPal.Ext.Bookmarks.csproj Update CmdPal extension output path to new CmdPal folder.
src/modules/cmdpal/ext/Microsoft.CmdPal.Ext.Apps/Microsoft.CmdPal.Ext.Apps.csproj Update CmdPal extension output path to new CmdPal folder.
src/modules/cmdpal/CmdPalModuleInterface/dllmain.cpp Update CmdPal MSIX discovery paths to new install layout.
src/modules/cmdpal/check-extensions.ps1 Update CmdPal extension check script paths.
src/modules/cmdNotFound/CmdNotFoundModuleInterface/dllmain.cpp Update enable/disable script paths to new Assets root.
src/modules/AdvancedPaste/AdvancedPasteModuleInterface/AdvancedPasteProcessManager.cpp Launch AdvancedPaste from install root.
src/modules/AdvancedPaste/AdvancedPaste/AdvancedPaste.csproj Output AdvancedPaste app to root output.
src/dsc/PowerToys.Settings.DSC.Schema.Generator/PowerToys.Settings.DSC.Schema.Generator.csproj Update generator post-build path to Settings UI lib in new location.
src/dsc/PowerToys.Settings.DSC.Schema.Generator/DSCGeneration.cs Update DSC Settings EXE path resolution to flattened install root.
src/common/utils/modulesRegistry.h Update RegistryPreview exe/icon paths to new flattened layout.
src/common/UITestAutomation/ModuleConfigData.cs Update UI test module paths/subdirectories for new layout.
src/common/FilePreviewCommon/MonacoHelper.cs Remove WinUI3Apps-specific path adjustment for Monaco assets.
installer/PowerToysSetupVNext/WinUI3Applications.wxs Point WinUI3 app file harvesting to root bin dir and INSTALLFOLDER.
installer/PowerToysSetupVNext/WinAppSDK.wxs Update WinAppSDK/MUI paths and directory refs for flattened layout.
installer/PowerToysSetupVNext/Settings.wxs Move Settings assets references to root Assets folder.
installer/PowerToysSetupVNext/Resources.wxs Update resource paths/directories for flattened layout.
installer/PowerToysSetupVNext/RegistryPreview.wxs Move RegistryPreview assets references to root Assets folder.
installer/PowerToysSetupVNext/Product.wxs Remove WinUI3Apps directory tree; introduce root Assets and new Xaml directory tree; remove obsolete hardlink CAs.
installer/PowerToysSetupVNext/PowerRename.wxs Move PowerRename assets references to root Assets folder.
installer/PowerToysSetupVNext/PowerDisplay.wxs Move PowerDisplay assets references to root Assets folder.
installer/PowerToysSetupVNext/Peek.wxs Move Peek assets references to root Assets folder.
installer/PowerToysSetupVNext/NewPlus.wxs Move New+ assets/templates references to root Assets folder.
installer/PowerToysSetupVNext/KeyboardManager.wxs Move KeyboardManagerEditor assets to root Assets folder and adjust directory refs.
installer/PowerToysSetupVNext/ImageResizer.wxs Move ImageResizer assets references to root Assets folder.
installer/PowerToysSetupVNext/Hosts.wxs Move Hosts assets references to root Assets folder.
installer/PowerToysSetupVNext/generateAllFileComponents.ps1 Update harvesting paths to flattened output and exclude unused MFC DLLs.
installer/PowerToysSetupVNext/FileLocksmith.wxs Move FileLocksmith assets references to root Assets folder.
installer/PowerToysSetupVNext/EnvironmentVariables.wxs Move EnvironmentVariables assets references to root Assets folder.
installer/PowerToysSetupVNext/Core.wxs Update uninstall folder cleanup to new directory structure.
installer/PowerToysSetupVNext/CmdPal.wxs Update CmdPal build dir and directory ref to INSTALLFOLDER.
installer/PowerToysSetupVNext/AdvancedPaste.wxs Move AdvancedPaste assets references to root Assets folder.
installer/PowerToysSetupCustomActionsVNext/CustomAction.cpp Update script/MSIX paths in custom actions to new layout.
Directory.Build.targets Add target to delete unused VC runtime DLLs from outputs after runtime copy.

Comment thread installer/PowerToysSetupVNext/Resources.wxs Outdated
Comment thread src/modules/cmdpal/CmdPalModuleInterface/dllmain.cpp Outdated
Comment thread tools/Verification scripts/verify-installation-script.ps1 Outdated
Comment thread tools/Verification scripts/verify-installation-script.ps1 Outdated
Comment thread src/settings-ui/Settings.UI.Library/Utilities/Helper.cs
Comment thread installer/PowerToysSetupVNext/generateAllFileComponents.ps1 Outdated
Comment thread installer/PowerToysSetupVNext/Product.wxs
LegendaryBlair and others added 2 commits April 10, 2026 16:07
Flatten build output by removing WinUI3Apps intermediate folder.
WinUI3 projects now output to the root build folder, eliminating
~435 duplicate DLLs (~316 MB).

- Update OutputPath in 47 csproj/props and OutDir in 20 vcxproj files
- Fix ~50 hardcoded WinUI3Apps path references in source
- Update build scripts (build-installer, cert-sign, self-sign, verify)
- Remove WinUI3Apps workarounds in MonacoHelper
- Rename GetPowerToysInstallationWinUI3AppsAssetsFolder

CmdPal retains its CmdPal\ subfolder for MSIX packaging.
Installer WiX files not updated yet (separate phase).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Flatten the installer layout to match the flattened build output.
WinUI3Apps directory is removed from the installation tree.

WiX changes:
- Product.wxs: Remove WinUI3AppsInstallFolder directory hierarchy,
  move Microsoft.UI.Xaml under INSTALLFOLDER directly
- Core.wxs: Update RemoveFolder entries for new directory IDs
- 16 .wxs files: Redirect DirectoryRef and source paths from
  WinUI3Apps\ to root, WinUI3AppsAssetsFolder to BaseApplicationsAssetsFolder
- WinUI3Applications.wxs: Source from root instead of WinUI3Apps\
- CmdPal.wxs: CmdPal directory now directly under INSTALLFOLDER
- Remove dead hardlink custom action stubs from Product.wxs

Other changes:
- generateAllFileComponents.ps1: Update 16 -depsPath parameters
- CustomAction.cpp: Update 5 hardcoded runtime paths for
  Settings scripts and CmdPal MSIX package location

WiX component IDs (WinUI3AppsMicrosoftUIXamlAssets_*, etc.) are
preserved for upgrade compatibility with existing installations.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@LegendaryBlair LegendaryBlair force-pushed the legendaryblair/shrink-installer branch from ca38d80 to 91a1003 Compare April 10, 2026 08:28
@github-actions

This comment has been minimized.

@LegendaryBlair LegendaryBlair force-pushed the legendaryblair/shrink-installer branch from 91a1003 to 5d954ba Compare April 10, 2026 08:50
@LegendaryBlair LegendaryBlair requested a review from Copilot April 10, 2026 08:55
@github-actions

This comment has been minimized.

Copy link
Copy Markdown
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 119 out of 119 changed files in this pull request and generated 3 comments.

Comment thread tools/Verification scripts/verify-installation-script.ps1 Outdated
Comment thread src/modules/cmdpal/CmdPalModuleInterface/dllmain.cpp Outdated
Comment thread installer/PowerToysSetupVNext/generateAllFileComponents.ps1 Outdated
@LegendaryBlair LegendaryBlair force-pushed the legendaryblair/shrink-installer branch from 5d954ba to 292d13d Compare April 10, 2026 09:26
@github-actions

This comment has been minimized.

@LegendaryBlair LegendaryBlair force-pushed the legendaryblair/shrink-installer branch from 292d13d to 113297a Compare April 10, 2026 09:42
@github-actions

This comment has been minimized.

@LegendaryBlair LegendaryBlair force-pushed the legendaryblair/shrink-installer branch 2 times, most recently from 5ed7c61 to aadbec7 Compare April 10, 2026 10:20
@github-actions

This comment has been minimized.

VC++ Redistributable copies MFC, C++ AMP, and OpenMP DLLs into the
build output via CopyCppRuntimeToOutputDir, but no PowerToys binary
imports them (verified with dumpbin /dependents).

- Add RemoveUnusedVCRuntimeDlls target in Directory.Build.targets to
  delete mfc140*.dll, mfcm140*.dll, vcamp140*.dll, vcomp140*.dll
  from OutDir after CopyCppRuntimeToOutputDir copies them.
- Add MFC DLLs to exclusion list in generateAllFileComponents.ps1
  to prevent them from being packaged in the installer.

Saves ~11 MB per output location.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@LegendaryBlair LegendaryBlair force-pushed the legendaryblair/shrink-installer branch from aadbec7 to 733d3c7 Compare April 10, 2026 12:03
@github-actions

This comment has been minimized.

@LegendaryBlair
Copy link
Copy Markdown
Contributor Author

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

When multiple CppWinRT component projects share the same OutDir,
mdmerge's metadata-dir scan finds a stale copy of the project's own
WinMD from a previous build, causing 'Duplicate type' errors and
empty merge output. This prevents cppwinrt.exe from generating the
required .g.h and module.g.cpp files.

Add a CleanStaleProjectWinMD target that deletes the project's own
WinMD from OutDir before mdmerge runs.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Comment thread Directory.Build.targets Fixed
Comment thread Directory.Build.targets Fixed
@LegendaryBlair LegendaryBlair force-pushed the legendaryblair/shrink-installer branch from c0fc764 to fab3c09 Compare April 12, 2026 13:42
With the flattened layout, all files are covered by BaseApplications.
MajorUpgrade handles cleanup independently — the new MSI does not
need the old component group definitions.

- Delete WinUI3Applications.wxs
- Remove ComponentGroupRef from Product.wxs
- Remove Compile and PostBuildEvent entries from wixproj
- Clean up stale comments in generateAllFileComponents.ps1

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copy link
Copy Markdown
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 123 out of 123 changed files in this pull request and generated no new comments.

Comments suppressed due to low confidence (1)

installer/PowerToysSetupVNext/generateAllFileComponents.ps1:154

  • generateAllFileComponents.ps1 still strips PowerToys.ImageResizer.exe/.deps.json/.runtimeconfig.json out of BaseApplications.wxs, but WinUI3Applications.wxs (which previously carried the ImageResizer UI binaries) has been removed in this PR. As a result, the installer will no longer include the Image Resizer UI executable/config at all unless it’s added via another component group. Please ensure the correct ImageResizer UI outputs are included somewhere (and only the incomplete leaked artifacts are excluded).
#BaseApplications
# WORKAROUND: Exclude ImageResizer files that leak into the root output directory.
# ImageResizerCLI (Exe, SelfContained) has a ProjectReference to ImageResizerUI (WinExe, SelfContained).
# MSBuild copies the referenced WinExe's apphost (.exe, .deps.json, .runtimeconfig.json) to the root
# output directory as a side effect. These files are incomplete (missing the managed .dll) and should
# not be included in the installer. TODO: Refactor ImageResizer to use a shared Library project instead.
Generate-FileList -fileDepsJson "" -fileListName BaseApplicationsFiles -wxsFilePath $PSScriptRoot\BaseApplications.wxs -depsPath "$PSScriptRoot..\..\..\$platform\Release"

# Remove leaked ImageResizer artifacts from BaseApplications
$baseAppWxsPath = "$PSScriptRoot\BaseApplications.wxs"
$baseAppWxs = Get-Content $baseAppWxsPath -Raw
$baseAppWxs = $baseAppWxs -replace 'PowerToys\.ImageResizer\.exe;?', ''
$baseAppWxs = $baseAppWxs -replace 'PowerToys\.ImageResizer\.deps\.json;?', ''
$baseAppWxs = $baseAppWxs -replace 'PowerToys\.ImageResizer\.runtimeconfig\.json;?', ''
# Clean up trailing/double semicolons left after removal
$baseAppWxs = $baseAppWxs -replace ';;+', ';'
$baseAppWxs = $baseAppWxs -replace '=;', '='
$baseAppWxs = $baseAppWxs -replace ';"', '"'

@niels9001 niels9001 added the 0.99 label Apr 13, 2026
@LegendaryBlair LegendaryBlair force-pushed the legendaryblair/shrink-installer branch from 3482db4 to fa3e4b5 Compare April 14, 2026 03:07
Comment thread src/modules/previewpane/PatchWebView2Deps.ps1 Fixed
@github-actions

This comment has been minimized.

@LegendaryBlair LegendaryBlair force-pushed the legendaryblair/shrink-installer branch from fa3e4b5 to f078584 Compare April 14, 2026 06:17
@github-actions

This comment has been minimized.

@LegendaryBlair LegendaryBlair force-pushed the legendaryblair/shrink-installer branch from f078584 to 2247211 Compare April 14, 2026 09:14
@github-actions

This comment has been minimized.

@LegendaryBlair LegendaryBlair force-pushed the legendaryblair/shrink-installer branch 2 times, most recently from 86cba3c to 813b7d0 Compare April 14, 2026 15:30
Comment thread src/modules/previewpane/PreviewHandler.WebView2.targets Fixed
@github-actions

This comment has been minimized.

@LegendaryBlair LegendaryBlair force-pushed the legendaryblair/shrink-installer branch from 813b7d0 to 84b0e25 Compare April 15, 2026 04:39
LegendaryBlair and others added 2 commits April 15, 2026 13:03
After PR #45288 migrated ImageResizer to WinUI3, PowerToys.ImageResizer.exe
is the actual WinUI3 UI app (not a leaked apphost artifact). The workaround
that stripped it from BaseApplications was causing the context menu to fail
with 'cannot find exe'.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
After flattening WinUI3Apps, the native Microsoft.Web.WebView2.Core.dll (WinRT
component for WinUI3/Peek) overwrites the managed version (needed by WPF/WinForms
preview handlers), causing FileNotFoundException at runtime.

Fix: Ship both variants side by side:
- Native DLL stays as Microsoft.Web.WebView2.Core.dll (for WinUI3 apps)
- Managed copy added as Microsoft.Web.WebView2.Core.Managed.dll (for preview handlers)
- WebView2Resolver assembly handler loads the managed copy at runtime
- WebView2.Core.dll removed from deps.json inputs before generation

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@LegendaryBlair LegendaryBlair force-pushed the legendaryblair/shrink-installer branch from 84b0e25 to 8a9fd33 Compare April 15, 2026 05:04
<!-- Remove Microsoft.Web.WebView2.Core.dll from assembly references to prevent:
1. The managed DLL from being copied to the output folder (where it would conflict
with the native DLL that WinUI3 projects place there)
2. The DLL from appearing in deps.json TPA list (so WebView2Resolver can fire)
@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@LegendaryBlair LegendaryBlair force-pushed the legendaryblair/shrink-installer branch from 66279d5 to ccbb508 Compare April 17, 2026 06:51
@github-actions

This comment has been minimized.

…amination

MSIX sparse package registration adds AppContainer SIDs to the ExternalLocation
folder DACL on Windows 23H2. When ExternalLocation pointed to the root install
folder, prevhost.exe (LOW integrity) got ACCESS_DENIED loading preview handler
DLLs. This isolates the 4 context menu COM DLLs and .msix packages into a
ContextMenu\ subfolder so DACL changes don't affect the root folder.

Changes:
- Set OutDir to ContextMenu\ in all 4 context menu vcxproj files
- Update ExternalLocation path in 3 module DLLs (ImageResizer, PowerRename,
  FileLocksmith) and NewPlus MSIX registration
- Add ..\\ prefix to icon/EXE paths in 4 context menu DLLs
- Update runner to load NewPlus from ContextMenu\ subfolder
- Add ContextMenu.wxs installer fragment and update Product.wxs/wixproj
- Use CopyFileToFolders for MSIX assets to ensure they copy to root Assets\
- Add empty-filename guard in generateAllFileComponents.ps1
- Update verification script paths

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@LegendaryBlair LegendaryBlair force-pushed the legendaryblair/shrink-installer branch from ccbb508 to 8cfc9bd Compare April 17, 2026 16:52
@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 (2)

pngs
TPA

These words are not needed and should be removed apphost diu IPREVIEW ITHUMBNAIL LPCFHOOKPROC LUMA MAXDWORD MRT suntimes timespan traies udit VSync

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 legendaryblair/shrink-installer 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/24576640805/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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants