2022-06-30 22:10:14 +02:00
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets= "Build" ToolsVersion= "15.0" xmlns= "http://schemas.microsoft.com/developer/msbuild/2003" >
2024-02-13 13:55:14 +00:00
<Import Project= "..\..\..\..\packages\Microsoft.Windows.CppWinRT.2.0.240111.5\build\native\Microsoft.Windows.CppWinRT.props" Condition= "Exists('..\..\..\..\packages\Microsoft.Windows.CppWinRT.2.0.240111.5\build\native\Microsoft.Windows.CppWinRT.props')" />
2022-06-30 22:10:14 +02:00
<Target Name= "GenerateResourceFiles" BeforeTargets= "PrepareForBuild" >
<Exec Command= "powershell -NonInteractive -executionpolicy Unrestricted $(SolutionDir)tools\build\convert-resx-to-rc.ps1 $(MSBuildThisFileDirectory) resource.base.h resource.h ImageResizerContextMenu.base.rc ImageResizerContextMenu.rc" />
</Target>
<PropertyGroup Label= "Globals" >
<Keyword > Win32Proj</Keyword>
<ProjectGuid > {93b72a06-c8bd-484f-a6f7-c9f280b150bf}</ProjectGuid>
<RootNamespace > ImageResizerContextMenu</RootNamespace>
</PropertyGroup>
<Import Project= "$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition= "'$(Configuration)'=='Debug'" Label= "Configuration" >
<ConfigurationType > DynamicLibrary</ConfigurationType>
<UseDebugLibraries > true</UseDebugLibraries>
[Dev][Build] VS 2026 Support (#44304)
<!-- 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 PR updates the PowerToys solution to support **Visual Studio 2026
(PlatformToolset v145)**. It centralizes the build configuration,
updates the C++ language standards, and fixes an issue with a MouseJump
unit test that appears while using the VS 2026 supported build agent.
<!-- Please review the items on the PR checklist before submitting-->
## PR Checklist
- [ ] Closes: #xxx
- [x] **Communication:** I've discussed this with core contributors
already. If the work hasn't been agreed, this work might be rejected
- [x] **Tests:** Added/updated and all pass
- [ ] **Localization:** All end-user-facing strings can be localized
- [x] **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
**Build System & Configuration:**
- Updated `Cpp.Build.props` to use `v145` (VS 2026) as the default
`PlatformToolset`, with fall back to `v143` for VS 2022.
- Configured C++ Language Standard:
- `stdcpplatest` for production projects.
- Removed explicit `<PlatformToolset>` definitions from individual
project files (approx. 37 modules) to inherit correctly from the central
`Cpp.Build.props`.
**Code Refactoring & Fixes:**
- Updated `DrawingHelperTests.cs` in MouseJump Unit Test to ease the
pixel difference tolerance. This became an issue after switching to the
new VS2026 build agent.
<!-- Describe how you validated the behavior. Add automated tests
wherever possible, but list manual validation steps taken as well -->
## Validation Steps Performed
- Validated successful compilation of the entire solution. Similar
updates have been made to the .NET 10 branch, but these are much cleaner
and will be merged into that branch once fully confirmed working.
---------
Co-authored-by: Kai Tao (from Dev Box) <kaitao@microsoft.com>
Co-authored-by: Gordon Lam (SH) <yeelam@microsoft.com>
2026-01-28 18:46:34 -05:00
2022-06-30 22:10:14 +02:00
</PropertyGroup>
<PropertyGroup Condition= "'$(Configuration)'=='Release'" Label= "Configuration" >
<ConfigurationType > DynamicLibrary</ConfigurationType>
<UseDebugLibraries > false</UseDebugLibraries>
[Dev][Build] VS 2026 Support (#44304)
<!-- 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 PR updates the PowerToys solution to support **Visual Studio 2026
(PlatformToolset v145)**. It centralizes the build configuration,
updates the C++ language standards, and fixes an issue with a MouseJump
unit test that appears while using the VS 2026 supported build agent.
<!-- Please review the items on the PR checklist before submitting-->
## PR Checklist
- [ ] Closes: #xxx
- [x] **Communication:** I've discussed this with core contributors
already. If the work hasn't been agreed, this work might be rejected
- [x] **Tests:** Added/updated and all pass
- [ ] **Localization:** All end-user-facing strings can be localized
- [x] **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
**Build System & Configuration:**
- Updated `Cpp.Build.props` to use `v145` (VS 2026) as the default
`PlatformToolset`, with fall back to `v143` for VS 2022.
- Configured C++ Language Standard:
- `stdcpplatest` for production projects.
- Removed explicit `<PlatformToolset>` definitions from individual
project files (approx. 37 modules) to inherit correctly from the central
`Cpp.Build.props`.
**Code Refactoring & Fixes:**
- Updated `DrawingHelperTests.cs` in MouseJump Unit Test to ease the
pixel difference tolerance. This became an issue after switching to the
new VS2026 build agent.
<!-- Describe how you validated the behavior. Add automated tests
wherever possible, but list manual validation steps taken as well -->
## Validation Steps Performed
- Validated successful compilation of the entire solution. Similar
updates have been made to the .NET 10 branch, but these are much cleaner
and will be merged into that branch once fully confirmed working.
---------
Co-authored-by: Kai Tao (from Dev Box) <kaitao@microsoft.com>
Co-authored-by: Gordon Lam (SH) <yeelam@microsoft.com>
2026-01-28 18:46:34 -05:00
2022-06-30 22:10:14 +02:00
<WholeProgramOptimization > true</WholeProgramOptimization>
</PropertyGroup>
<Import Project= "$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label= "ExtensionSettings" >
</ImportGroup>
<ImportGroup Label= "Shared" >
</ImportGroup>
<ImportGroup Label= "PropertySheets" >
<Import Project= "$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition= "exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label= "LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label= "UserMacros" />
<PropertyGroup >
<TargetName > PowerToys.ImageResizerContextMenu</TargetName>
2023-07-20 00:12:46 +01:00
<!-- Needs a different int dir to avoid conflicts in msix creation. -->
<IntDir > $(SolutionDir)$(Platform)\$(Configuration)\TemporaryBuild\obj\$(ProjectName)\</IntDir>
Fix: File explorer preview didn't work with per-user installation (#40314)
<!-- 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
2025-07-07 09:41:19 +08:00
<OutDir > ..\..\..\..\$(Platform)\$(Configuration)\WinUI3Apps\</OutDir>
2022-06-30 22:10:14 +02:00
</PropertyGroup>
<ItemDefinitionGroup Condition= "'$(Configuration)'=='Debug'" >
<ClCompile >
<WarningLevel > Level3</WarningLevel>
<SDLCheck > true</SDLCheck>
<PreprocessorDefinitions > _DEBUG;IMAGERESIZERCONTEXTMENU_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode > true</ConformanceMode>
<AdditionalIncludeDirectories > ..\ImageResizerLib;..\..\..\common\inc;..\..\..\common\Telemetry;..\..\;..\..\..\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile>
<Link >
<SubSystem > Windows</SubSystem>
<GenerateDebugInformation > true</GenerateDebugInformation>
<EnableUAC > false</EnableUAC>
<ModuleDefinitionFile > Source.def</ModuleDefinitionFile>
</Link>
<PreBuildEvent >
2023-07-20 00:12:46 +01:00
<Command > del $(OutDir)\ImageResizerContextMenuPackage.msix /q
2022-06-30 22:10:14 +02:00
MakeAppx.exe pack /d . /p $(OutDir)ImageResizerContextMenuPackage.msix /nv</Command>
</PreBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition= "'$(Configuration)'=='Release'" >
<ClCompile >
<WarningLevel > Level3</WarningLevel>
<FunctionLevelLinking > true</FunctionLevelLinking>
<IntrinsicFunctions > true</IntrinsicFunctions>
<SDLCheck > true</SDLCheck>
<PreprocessorDefinitions > NDEBUG;IMAGERESIZERCONTEXTMENU_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode > true</ConformanceMode>
<AdditionalIncludeDirectories > ..\ImageResizerLib;..\..\..\common\inc;..\..\..\common\Telemetry;..\..\;..\..\..\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile>
<Link >
<SubSystem > Windows</SubSystem>
<EnableCOMDATFolding > true</EnableCOMDATFolding>
<OptimizeReferences > true</OptimizeReferences>
<GenerateDebugInformation > true</GenerateDebugInformation>
<EnableUAC > false</EnableUAC>
<ModuleDefinitionFile > Source.def</ModuleDefinitionFile>
</Link>
<PreBuildEvent >
2023-07-20 00:12:46 +01:00
<Command > del $(OutDir)\ImageResizerContextMenuPackage.msix /q
2022-06-30 22:10:14 +02:00
MakeAppx.exe pack /d . /p $(OutDir)ImageResizerContextMenuPackage.msix /nv</Command>
</PreBuildEvent>
</ItemDefinitionGroup>
<ItemGroup >
<ClInclude Include= "framework.h" />
<ClInclude Include= "pch.h" />
<None Include= "resource.base.h" />
<ClInclude Include= "Generated Files/resource.h" />
<ClInclude Include= "targetver.h" />
</ItemGroup>
<ItemGroup >
<ClCompile Include= "dllmain.cpp" />
<ClCompile Include= "pch.cpp" >
2024-03-22 03:29:14 -07:00
<PrecompiledHeader Condition= "'$(UsePrecompiledHeaders)' != 'false'" > Create</PrecompiledHeader>
2022-06-30 22:10:14 +02:00
</ClCompile>
</ItemGroup>
<ItemGroup >
<ResourceCompile Include= "Generated Files/ImageResizerContextMenu.rc" />
<None Include= "ImageResizerContextMenu.base.rc" />
</ItemGroup>
<ItemGroup >
<None Include= "packages.config" />
</ItemGroup>
<ItemGroup >
2024-07-18 15:48:46 +02:00
<None Include= "Assets\ImageResizer\ImageResizer.ico" >
<CopyToOutputDirectory > PreserveNewest</CopyToOutputDirectory>
</None>
<None Include= "Assets\ImageResizer\LargeTile.png" >
<CopyToOutputDirectory > PreserveNewest</CopyToOutputDirectory>
</None>
<None Include= "Assets\ImageResizer\SmallTile.png" >
<CopyToOutputDirectory > PreserveNewest</CopyToOutputDirectory>
</None>
<None Include= "Assets\ImageResizer\SplashScreen.png" >
<CopyToOutputDirectory > PreserveNewest</CopyToOutputDirectory>
</None>
<None Include= "Assets\ImageResizer\Square150x150Logo.png" >
<CopyToOutputDirectory > PreserveNewest</CopyToOutputDirectory>
</None>
<None Include= "Assets\ImageResizer\Square44x44Logo.png" >
<CopyToOutputDirectory > PreserveNewest</CopyToOutputDirectory>
</None>
<None Include= "Assets\ImageResizer\storelogo.png" >
<CopyToOutputDirectory > PreserveNewest</CopyToOutputDirectory>
</None>
<None Include= "Assets\ImageResizer\Wide310x150Logo.png" >
<CopyToOutputDirectory > PreserveNewest</CopyToOutputDirectory>
</None>
2022-06-30 22:10:14 +02:00
</ItemGroup>
<ItemGroup >
<ProjectReference Include= "..\..\..\common\logger\logger.vcxproj" >
<Project > {d9b8fc84-322a-4f9f-bbb9-20915c47ddfd}</Project>
</ProjectReference>
<ProjectReference Include= "..\..\..\common\SettingsAPI\SettingsAPI.vcxproj" >
<Project > {6955446d-23f7-4023-9bb3-8657f904af99}</Project>
</ProjectReference>
2024-10-24 22:04:32 +02:00
<ProjectReference Include= "..\..\..\common\Telemetry\EtwTrace\EtwTrace.vcxproj" >
<Project > {8f021b46-362b-485c-bfba-ccf83e820cbd}</Project>
</ProjectReference>
2022-06-30 22:10:14 +02:00
<ProjectReference Include= "..\ImageResizerLib\ImageResizerLib.vcxproj" >
<Project > {18b3db45-4ffe-4d01-97d6-5223feee1853}</Project>
</ProjectReference>
</ItemGroup>
<ItemGroup >
<None Include= "Resources.resx" />
</ItemGroup>
<Import Project= "$(VCTargetsPath)\Microsoft.Cpp.targets" />
<Import Project= "..\..\..\..\deps\spdlog.props" />
<ImportGroup Label= "ExtensionTargets" >
2024-02-13 13:55:14 +00:00
<Import Project= "..\..\..\..\packages\Microsoft.Windows.CppWinRT.2.0.240111.5\build\native\Microsoft.Windows.CppWinRT.targets" Condition= "Exists('..\..\..\..\packages\Microsoft.Windows.CppWinRT.2.0.240111.5\build\native\Microsoft.Windows.CppWinRT.targets')" />
2024-01-16 02:51:45 -08:00
<Import Project= "..\..\..\..\packages\Microsoft.Windows.ImplementationLibrary.1.0.231216.1\build\native\Microsoft.Windows.ImplementationLibrary.targets" Condition= "Exists('..\..\..\..\packages\Microsoft.Windows.ImplementationLibrary.1.0.231216.1\build\native\Microsoft.Windows.ImplementationLibrary.targets')" />
2022-06-30 22:10:14 +02:00
</ImportGroup>
<Target Name= "EnsureNuGetPackageBuildImports" BeforeTargets= "PrepareForBuild" >
<PropertyGroup >
<ErrorText > This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup>
2024-02-13 13:55:14 +00:00
<Error Condition= "!Exists('..\..\..\..\packages\Microsoft.Windows.CppWinRT.2.0.240111.5\build\native\Microsoft.Windows.CppWinRT.props')" Text= "$([System.String]::Format('$(ErrorText)', '..\..\..\..\packages\Microsoft.Windows.CppWinRT.2.0.240111.5\build\native\Microsoft.Windows.CppWinRT.props'))" />
<Error Condition= "!Exists('..\..\..\..\packages\Microsoft.Windows.CppWinRT.2.0.240111.5\build\native\Microsoft.Windows.CppWinRT.targets')" Text= "$([System.String]::Format('$(ErrorText)', '..\..\..\..\packages\Microsoft.Windows.CppWinRT.2.0.240111.5\build\native\Microsoft.Windows.CppWinRT.targets'))" />
2024-01-16 02:51:45 -08:00
<Error Condition= "!Exists('..\..\..\..\packages\Microsoft.Windows.ImplementationLibrary.1.0.231216.1\build\native\Microsoft.Windows.ImplementationLibrary.targets')" Text= "$([System.String]::Format('$(ErrorText)', '..\..\..\..\packages\Microsoft.Windows.ImplementationLibrary.1.0.231216.1\build\native\Microsoft.Windows.ImplementationLibrary.targets'))" />
2022-06-30 22:10:14 +02:00
</Target>
</Project>