-
Notifications
You must be signed in to change notification settings - Fork 7.6k
Fix: File explorer preview didn't work with per-user installation #40314
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this 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 relocates the Image Resizer extension and its assets into the WinUI3Apps directory to restore Explorer preview support in per-user installations and match other WinUI3-based modules.
- Updates runner code to load the Resizer preview handler from the new WinUI3Apps path
- Changes all Image Resizer project outputs to emit into the WinUI3Apps folder
- Adjusts installer PowerShell script and WiX files to reference the WinUI3Apps paths
Reviewed Changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/runner/main.cpp | Point PowerToys.ImageResizerExt.dll lookup to WinUI3Apps/… |
| src/modules/imageresizer/ui/ImageResizerUI.csproj | Set <OutputPath> to include WinUI3Apps subfolder |
| src/modules/imageresizer/dll/ImageResizerExt.vcxproj | Change <OutDir> to output under WinUI3Apps |
| src/modules/imageresizer/ImageResizerLib/ImageResizerLib.vcxproj | Change <OutDir> to output under WinUI3Apps |
| src/modules/imageresizer/ImageResizerContextMenu/ImageResizerContextMenu.vcxproj | Change <OutDir> to output under WinUI3Apps |
| installer/PowerToysSetup/generateAllFileComponents.ps1 | Update depsPath to point at WinUI3Apps\Assets\ImageResizer |
| installer/PowerToysSetup/Resources.wxs | Reference resource DLLs under WinUI3Apps\$(var.Language) |
| installer/PowerToysSetup/ImageResizer.wxs | Swap to WinUI3AppsAssetsFolder and registry path |
Comments suppressed due to low confidence (3)
src/runner/main.cpp:152
- Consider adding an automated test to verify that the ImageResizerExt preview handler is correctly registered and loaded from the WinUI3Apps directory in per-user installation scenarios.
L"WinUI3Apps/PowerToys.ImageResizerExt.dll",
installer/PowerToysSetup/ImageResizer.wxs:11
- Verify that the DirectoryRef Id 'WinUI3AppsAssetsFolder' is declared in your Common.wxi or installer definitions; if it isn't, the installer build will fail due to an undefined directory reference.
<DirectoryRef Id="WinUI3AppsAssetsFolder">
installer/PowerToysSetup/generateAllFileComponents.ps1:182
- Confirm that your Image Resizer assets are actually output to 'Release\WinUI3Apps\Assets\ImageResizer'; if not, update the build or script to match the real output location or move the assets accordingly.
Generate-FileList -fileDepsJson "" -fileListName ImageResizerAssetsFiles -wxsFilePath $PSScriptRoot\ImageResizer.wxs -depsPath "$PSScriptRoot..\..\..\$platform\Release\WinUI3Apps\Assets\ImageResizer"
| L"PowerToys.FancyZonesModuleInterface.dll", | ||
| L"PowerToys.powerpreview.dll", | ||
| L"PowerToys.ImageResizerExt.dll", | ||
| L"WinUI3Apps/PowerToys.ImageResizerExt.dll", |
Copilot
AI
Jul 7, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] The literal "WinUI3Apps" is repeated across multiple projects and installer scripts; consider centralizing this folder name as a shared MSBuild property or PowerShell variable to reduce duplication and prevent typos.
…0314) <!-- Enter a brief description/summary of your PR here. What does it fix/what does it change/how was it tested (even manually, if necessary)? --> ## Summary of the Pull Request This Bug started when the Win11 context menu integration was first introduced by Image Resizer in version v0.60.0. Move Image Resizer to the WinUI3Apps folder to fix file preview issue when PowerToys is installed on a non-C:\Program Files. This aligns with the current structure used by File Locksmith and PowerRename, which are not WinUI 3 apps either, but are already located there. ### Root Cause: When registering an MSIX package, the Windows API adds certain user permissions to the installation folders. Since Image Resizer was previously placed under the main PowerToys directory, these permission changes could prevent Explorer from loading its preview handler properly in per-user scenarios.  Interestingly, this issue only affects per-user installs, not machine-wide installs (e.g., to Program Files), even though both locations receive additional permissions. The exact reason is still unclear and requires further investigation. <!-- Please review the items on the PR checklist before submitting--> ## PR Checklist - [x] **Closes:** #24384 #29644 #32113 #34139 #37866 #40345 - [ ] **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 - [ ] [JSON for signing](https://github.com/microsoft/PowerToys/blob/main/.pipelines/ESRPSigning_core.json) for new binaries - [ ] [WXS for installer](https://github.com/microsoft/PowerToys/blob/main/installer/PowerToysSetup/Product.wxs) for new binaries and localization folder - [ ] [YML for CI pipeline](https://github.com/microsoft/PowerToys/blob/main/.pipelines/ci/templates/build-powertoys-steps.yml) for new test projects - [ ] [YML for signed pipeline](https://github.com/microsoft/PowerToys/blob/main/.pipelines/release.yml) - [ ] **Documentation updated:** If checked, please file a pull request on [our docs repo](https://github.com/MicrosoftDocs/windows-uwp/tree/docs/hub/powertoys) and link it here: #xxx <!-- Provide a more detailed description of the PR, other things fixed, or any additional comments/features here --> ## Detailed Description of the Pull Request / Additional comments <!-- Describe how you validated the behavior. Add automated tests wherever possible, but list manual validation steps taken as well --> ## Validation Steps Performed
Summary of the Pull Request
This Bug started when the Win11 context menu integration was first introduced by Image Resizer in version v0.60.0.
Move Image Resizer to the WinUI3Apps folder to fix file preview issue when PowerToys is installed on a non-C:\Program Files.
This aligns with the current structure used by File Locksmith and PowerRename, which are not WinUI 3 apps either, but are already located there.
Root Cause:
When registering an MSIX package, the Windows API adds certain user permissions to the installation folders. Since Image Resizer was previously placed under the main PowerToys directory, these permission changes could prevent Explorer from loading its preview handler properly in per-user scenarios.
Interestingly, this issue only affects per-user installs, not machine-wide installs (e.g., to Program Files), even though both locations receive additional permissions. The exact reason is still unclear and requires further investigation.
PR Checklist
Detailed Description of the Pull Request / Additional comments
Validation Steps Performed