Compare commits

..

82 Commits

Author SHA1 Message Date
Shawn Yuan (from Dev Box)
12e9832dd0 update
Signed-off-by: Shawn Yuan (from Dev Box) <shuaiyuan@microsoft.com>
2025-11-12 11:55:00 +08:00
Shawn Yuan (from Dev Box)
da176a6fc8 remove debug launching
Signed-off-by: Shawn Yuan (from Dev Box) <shuaiyuan@microsoft.com>
2025-11-12 11:13:23 +08:00
Kai Tao
5e3e0660e7 Revert hybrid crt to make powertoys quit safely (#43484)
<!-- 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
After enabling Hybrid CRT, the PowerToys process failed to properly
unload some module interface DLLs when quit application. The root cause
is still unclear, but this change reverts the behavior to ensure safe
unloading.

<!-- Please review the items on the PR checklist before submitting-->
## PR Checklist

- [ ] Closes: #43413
- [ ] **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
Can unload dll safely when quit powertoys
2025-11-12 10:39:21 +08:00
Jaylyn Barbee
29688cea0e [Light Switch] Enter latitude and longitude manually in Sunrise to sunset mode (#43276)
<!-- 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 introduces new UI to allow the users to manually enter their
lat/long.

<!-- Please review the items on the PR checklist before submitting-->
## PR Checklist

- [x] Closes: #42429
- [x] **Communication:** I've discussed this with core contributors
already. If the work hasn't been agreed, this work might be rejected
- [x] **Localization:** All end-user-facing strings can be localized
- [x] **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:
#[5979](https://github.com/MicrosoftDocs/windows-dev-docs-pr/pull/5979)

---------

Co-authored-by: Niels Laute <niels.laute@live.nl>
2025-11-11 16:18:18 -05:00
Alex Mihaiuc
a0f33c8af1 Make zooming animation smooth for ZoomIt on mouse move (#42339)
This change coalesces the `WM_MOUSEMOVE` events with the `WM_TIMER`
events in the cases 1, 2 (telescope animation for zoom in, respectively,
out). I factored into a new lambda the `WM_TIMER` code and I made it
save the "now" amount of ticks into the new `g_TelescopingZoomLastTick`.

During `WM_MOUSEMOVE` processing, if the current tick count (rather
imprecise, but good enough) is larger than the animation step,
`ZOOM_LEVEL_STEP_TIME`, then I call that lambda. It's convenient that
the code in there already handles the "end of telescope zooming
animation" case.

## Validation Steps Performed

The choppy zooming animation was evident while moving the mouse during a
telescope zoom. It was also [reported on the Sysinternals
blog](https://techcommunity.microsoft.com/blog/sysinternals-blog/zoomit-v9-10-procdump-3-5-for-linux-and-jcd-1-0-1/4461244/replies/4461281).
2025-11-11 09:42:59 -06:00
leileizhang
e1edcc13b7 Fix the issue where the InstallLocation is missing after upgrading (#43462)
<!-- 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
**Root Cause**

The issue occurs because the Installed property in MSI indicates whether
the current product code has been installed on the machine.
During a Major Upgrade (where the old and new versions have different
ProductCode values), the installation sequence is:
1. Burn schedules uninstall of the old MSI (the old version might not
have this custom action).
2. Then installs the new MSI.
> - At this point, the current product has not yet been installed, so
the Installed property is empty.
> - The condition NOT Installed evaluates to true, and
SetBundleInstallLocationData / SetBundleInstallLocation executes
normally, writing the InstallLocation registry key.

This means upgrading from an older version without this function to a
newer version with it works correctly.
However, issues appear in subsequent upgrades (from “newer” → “newer”)
because both versions include the same custom action.
The previous condition restricted the action to run only on first
install, preventing it from running during upgrades.

**Fix**

Added `OR WIX_UPGRADE_DETECTED` to the condition of
SetBundleInstallLocationData / SetBundleInstallLocation custom actions,
so they also execute during upgrade scenarios, ensuring the
InstallLocation registry value is correctly updated after version
upgrades.

<!-- Please review the items on the PR checklist before submitting-->
## PR Checklist

- [x] Closes: #43451
- [ ] **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-11-11 20:07:58 +08:00
leileizhang
756feb9f8c Clean up unused providers for AdvancedPaste (#43433)
<!-- 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
Clean up unused providers for AdvancedPaste

<!-- Please review the items on the PR checklist before submitting-->
## PR Checklist

- [x] Closes: #43429
- [ ] **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-11-11 20:07:41 +08:00
leileizhang
2fff688c6f [CI] Fix Win10 New+ build: add local Generated Files include path (#43461)
<!-- 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 (#43361) tries to fix the CI failure, and the root cause is
correct. However, using ;$(MSBuildThisFileDirectory)Generated Files
causes the include path to become \Generated Files\Generated
Files\resource.h. Removing Generated Files fixes the issue so that cl
can find the correct file.

<!-- Please review the items on the PR checklist before submitting-->
## 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
- [ ] [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-11-11 20:07:26 +08:00
Kai Tao
24d7ae54ce Find my mouse: Fix the issue find my mouse xaml island could not be run in x64 environment (#43420)
<!-- 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 pull request introduces a configuration update to the
`src/runner/runner.vcxproj` project file. The change enables undocked,
registration-free WinRT initialization for the Windows App SDK, which
can improve compatibility and reduce dependency issues in certain
deployment scenarios.

Windows App SDK configuration:

* Enabled `WindowsAppSdkUndockedRegFreeWinRTInitialize` to allow
registration-free WinRT initialization in the project file
`runner.vcxproj`.

<!-- Please review the items on the PR checklist before submitting-->
## 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
- [ ] [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
Validate in x64 environment, and it can be run without problem, no
errors any more
2025-11-11 09:34:50 +08:00
Mario Hewardt
a271a2f8af Enable GIF support for ZoomIt (#43266)
Closes #43265
2025-11-10 13:57:13 -06:00
Michael Jolley
a33c484c93 CmdPal: Removing app tag from apps (#43439)
The "App" tag is pretty redundant and is adding a lot of visual noise.
Closes #38968

New:

![image](https://github.com/user-attachments/assets/5eff195c-5aaf-477a-b988-4b3b14583569)
2025-11-10 20:03:36 +01:00
Niels Laute
f20c3b832b Asset updates (#43431)
title
2025-11-10 19:04:16 +01:00
Mike Griese
9c2884ab41 CmdPal: Bump version to 0.7 (#43428)
title
2025-11-10 10:38:55 -06:00
Jiří Polášek
076828f592 CmdPal: Remove duplicate HideWindow call in MainWindow .ctor (#43360)
## Summary of the Pull Request

Refer to the title. Calling this here will just log an error. Another
HideWindow is at the end of the constructor, so the behavior remains
unchanged.

<!-- Please review the items on the PR checklist before submitting-->
## 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
- [ ] [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-11-10 10:38:22 -06:00
Niels Laute
301d504db1 • instead of . in README (#43353)
<!-- 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

<!-- Please review the items on the PR checklist before submitting-->
## 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
- [ ] [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-11-10 06:18:27 -06:00
moooyo
e4a8488a2a [PowerRename] Fix FuzzTest project configuration issue (#43299)
<!-- 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 add the missing configuration for FuzzTest to avoid build issue
in local env.

<!-- Please review the items on the PR checklist before submitting-->
## 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
- [ ] [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

Co-authored-by: Yu Leng <yuleng@microsoft.com>
2025-11-10 11:40:39 +08:00
leileizhang
93bf653f9c [CI] Fix Win10 New+ build: add local Generated Files include path (#43361)
<!-- 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
**The CI frequently fails due to this issue**
<img width="1094" height="139" alt="image"
src="https://github.com/user-attachments/assets/b69aa417-b25c-4396-a863-32e8a31415e9"
/>
<img width="1249" height="183" alt="image"
src="https://github.com/user-attachments/assets/14f57ada-4b3c-4a70-9e6b-17d7162cece4"
/>

**Fix**
make NewPlus.ShellExtension.win10.vcxproj include its own Generated
Files folder so autogenerated resource.h is always found
prevents CI failures when the Win10 module builds before the shared
NewPlus project has produced headers

<!-- Please review the items on the PR checklist before submitting-->
## 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
- [ ] [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-11-08 01:06:48 +08:00
Jiří Polášek
b7eed480ba Spellchecking: Update spell-checking dictionary (#42294)
## Summary of the Pull Request

This PR updates the spell-checking dictionaries to fix outstanding
errors, and also clears up accumulated warnings.

- Cleans up duplicate or ignored entries in expect.txt:
    - `Authenticode` (favoring existing `authenticode`)
    - `DTo` (favoring existing `dto`)
    - `ekus` (favoring existing `eku`)
    - `nullrefs` (favoring existing `nullref`)
- Removes `CursorWrap` (invalid entry since camel case is treated as
separate words and is not allowed)
- Updates the pattern for `amazon.com` URLs to allow them within C#
strings
- Explicitly excludes the CmdPal sample page for images in Markdown with
Base64 encoded data from spell-checking (was previously auto-excluded)
- Suppresses spell-checking on lines with URLs containing encoded data

<!-- Please review the items on the PR checklist before submitting-->
## 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
- [ ] [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-11-07 13:55:51 +01:00
Leon Zandman
dce61bcb9d Fix Awake's popup context menu positioning (#41009)
<!-- 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
Fix for issue #37457. The Awake popup context menu would show at the
wrong position, especially after adding additional displays. The reason
this happened was that the mouse cursor position was unnecessarily
converted from screen to to client-area coordinates.

<!-- Please review the items on the PR checklist before submitting-->
## PR Checklist

- [x] Closes: #37457
- [ ] **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
Ran Awake and its context menu seemed to display properly and at the
correct position.

---------

Co-authored-by: Leon Zandman <lzandman@rdw.nl>
2025-11-07 12:50:45 +08:00
Dustin L. Howett
056328823f build: remove SHINE pool image override (to enable Server 2022) (#43287)
I am changing the default build pool image from Windows Server 2019 to
Server 2022, as the 2019 images are deprecated and their use will become
a permanent error soon.

However, I cannot do that while PowerToys contains build image
overrides. These overrides prevent it from choosing the Server 2022
images.

As a drive-by, I fixed the following issues:

- `NUGET_PACKAGES` was being read from the ambient environment. It was
used in the package cache _and_ in the WIX projects directly (!). To
make the build more predictable, we now set it during build time.
- We _still_ had build step conditions that resulted in extra work being
done during build failure.
- The release builds now produce numbered failure log artifacts just
like the CI builds do.
- I have adjusted the default disk configuration to give enough space to
`C:\`, so we no longer need the work directory override or custom data
disk.

The screenshot below is from a test run where I overrode the pool image
to be `SHINE-VS17-Latest-2022`. We do not want to do that in the final
configuration, so I had to revert that change.

<img width="1205" height="452" alt="image"
src="https://github.com/user-attachments/assets/fcf03e8c-d2a1-47af-9240-64c183c43644"
/>
2025-11-07 09:05:24 +08:00
Niels Laute
73f789b062 Settings fix (#43348)
<!-- 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

<!-- Please review the items on the PR checklist before submitting-->
## 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
- [ ] [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-11-06 12:48:27 -05:00
Jiří Polášek
57f0b4b342 CmdPal: Improve crash error message (#43340)
## Summary of the Pull Request

This PR localizes the message displayed when an unhandled exception
causes CmdPal to crash. It also resolves a regression from commit
a991a118dc, which disabled storing to the desktop but failed to
update the corresponding message.

<!-- Please review the items on the PR checklist before submitting-->
## PR Checklist

- [x] Related to: #41392
- [ ] **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-11-06 11:32:56 -06:00
Dave Rayment
0e922a4dcb [ImageResizer] Fix issue where settings could be changed during a batch resize (#42163)
<!-- 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 fixes an issue where the Image Resizer settings were reloaded for
every resize operation in a multi-file batch. This could result in
inconsistent resize results if the Settings application or the user
interacted with the settings and the properties were changed, even
temporarily.

<!-- Please review the items on the PR checklist before submitting-->
## PR Checklist

- [x] Closes: #42116, #35114
- [ ] **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
- [ ] **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
Corrects an issue in `ResizeBatch.Execute()` where `Settings.Default`
was used:

```csharp
    protected virtual void Execute(string file)
        => new ResizeOperation(file, DestinationDirectory, Settings.Default).Execute();
```

Unfortunately, `Settings.Default` is poorly named, and is not a constant
property. Instead it actually calls `Reload()`, which loads the settings
JSON file and re-processes it fully:

```csharp
        [JsonIgnore]
        public static Settings Default
        {
            get
            {
                defaultInstance.Reload();
                return defaultInstance;
            }
        }
```

If the settings are changed part-way through a resize batch operation
(even scrolling through the presets will set `selectedIndex` and save it
back to disk), the batch resize operation may switch to a different
resize behaviour, giving inconsistent results. The chances of this
occurring increase with the length of the batch operation.

### Solution
The solution is to set the `Settings` outside of the main loop and use
that for every resize operation, which is what this PR does.

`Process` is altered to load the `Settings` at the start and pass that
to `Execute` on each iteration of the batch loop:

```csharp
        public IEnumerable<ResizeError> Process(Action<int, double> reportProgress, CancellationToken cancellationToken)
        {
            double total = Files.Count;
            int completed = 0;
            var errors = new ConcurrentBag<ResizeError>();
            var settings = Settings.Default;

            ...

                        Execute(file, settings);
```

`Execute` is updated to accept a `Settings` object instead of using
`Settings.Default`:

```csharp
    protected virtual void Execute(string file, Settings settings)
        => new ResizeOperation(file, DestinationDirectory, settings).Execute();
```

### Additional changes
The batch-related unit tests failed after the above change. I updated
the Mock `Execute` to reflect the use of the `Settings` parameter. Also,
the `Settings` class was unfortunately bound to the WPF UI, and could
not be instantiated during unit testing. I've refactored this so it can
be instantiated with or without an `App.Current.Dispatcher`. Ther's a
new `ReloadCore()` method which just contains the extracted property
setting code.

None of the unit tests currently use the settings themselves, but at
least the capability is now there.

I also removed the setting of the `MaxDegreeOfParallelism` option in the
`Parallel.For()`. When left at its default, the runtime will use the
appropriate number of threads, and the heuristic it uses may not
necessarily equal the number of processor cores in the system.

<!-- Describe how you validated the behavior. Add automated tests
wherever possible, but list manual validation steps taken as well -->
## Validation Steps Performed
- Ensured all existing unit tests passed.
- Tested with multiple runs of resizing 200 image files while browsing
and changing the settings. This was no longer able to alter the ongoing
resize operations.
- Checked that the settings could still be amended via the Settings app.

---------

Co-authored-by: Gordon Lam (SH) <yeelam@microsoft.com>
2025-11-06 19:55:47 +08:00
Juju Anselum J
d7785977d8 feat(quick-accent): add diameter ⌀ symbol for Shift+O #41954 (#42963)
## Summary of the Pull Request
- Adds support for the diameter symbol (⌀, U+2300) in Quick Accent. 
- When holding Shift+O with the Special Characters language enabled.

## Implementation
- Updated GetDefaultLetterKeySPECIAL(LetterKey.VK_O) to include ⌀.
- No impact on other existing functionalities.

## Issue
Closes  #41954
2025-11-06 19:55:30 +08:00
Copilot
bb604d87ca Fix accessibility: Associate controls with labels for screen readers (#42439)
## Problem

Input controls (ComboBoxes, ToggleSwitches, NumberBoxes) within
SettingsCards throughout the PowerToys Settings UI were not
programmatically associated with their visible labels. This caused
screen readers to announce only the control type (e.g., "combo box",
"toggle switch") without any context about the control's purpose, making
the settings inaccessible to screen reader users.

This violates WCAG 2.2 Success Criterion 1.3.1 (Info and Relationships)
- Level A requirement.

**User Impact**: Screen reader users navigating PowerToys settings would
hear only "edit text" or "combo box" with no description, making it
difficult or impossible to configure settings independently.

## Solution

Added `AutomationProperties.Name` bindings to controls, linking them to
their parent SettingsCard's `Header` property. This establishes the
programmatic relationship between labels and controls required by
assistive technologies.

### Pattern Applied

For controls inside SettingsCards with a `Name` attribute:

```xaml
<tkcontrols:SettingsCard Name="LanguageHeader" x:Uid="LanguageHeader">
    <ComboBox
        MinWidth="{StaticResource SettingActionControlMinWidth}"
        AutomationProperties.Name="{Binding ElementName=LanguageHeader, Path=Header}"
        DisplayMemberPath="Language"
        ItemsSource="{Binding Languages, Mode=TwoWay}"
        SelectedIndex="{Binding LanguagesIndex, Mode=TwoWay}" />
</tkcontrols:SettingsCard>
```

For data templates where headers are data-bound:

```xaml
<DataTemplate x:Key="ComboBoxTemplate" x:DataType="viewModels:PluginAdditionalOptionViewModel">
    <tkcontrols:SettingsCard Header="{x:Bind Path=DisplayLabel}">
        <ComboBox
            AutomationProperties.Name="{x:Bind Path=DisplayLabel}"
            ItemsSource="{x:Bind Path=ComboBoxItems}" />
    </tkcontrols:SettingsCard>
</DataTemplate>
```

## Changes Made

### GeneralPage.xaml (7 controls)
- Language selection ComboBox
- Color mode/theme ComboBox
- Run at startup ToggleSwitch
- Show system tray icon ToggleSwitch
- Enable experimentation ToggleSwitch
- Enable data diagnostics ToggleSwitch
- Enable view diagnostic data ToggleSwitch

### PowerLauncherPage.xaml (4 data templates)
- ComboBoxTemplate - for plugin settings
- NumberBoxTemplate - for plugin numeric settings
- CheckBoxComboBoxTemplate - for conditional ComboBox settings
- CheckBoxNumberBoxTemplate - for conditional NumberBox settings

### PowerRenamePage.xaml (6 controls)
- Enable PowerRename ToggleSwitch
- Context menu mode ComboBox
- Enable auto-complete ToggleSwitch
- Max display list number NumberBox
- Restore flags on launch ToggleSwitch
- Use Boost library ToggleSwitch

### NewPlusPage.xaml (4 controls)
- Enable New+ ToggleSwitch
- Hide file extension ToggleSwitch
- Hide starting digits ToggleSwitch
- Replace variables ToggleSwitch

## Testing

Screen readers (Windows Narrator) now properly announce controls with
context:
- **Before**: "Combo box"
- **After**: "Language, Combo box"

No functional changes to application behavior. The fix only affects how
controls are announced to assistive technologies.

## Notes

This fix follows the existing pattern already used in
ColorPickerPage.xaml. Similar issues exist in approximately 23 other
Settings pages which can be addressed in future PRs using this
established pattern. The pages fixed in this PR represent
commonly-accessed settings and demonstrate the solution approach for
comprehensive coverage.

Closes #<issue_number>

## References
- WCAG 2.2 SC 1.3.1:
https://www.w3.org/WAI/WCAG22/Understanding/info-and-relationships
- UIA Name Property:
https://learn.microsoft.com/en-us/windows/apps/design/accessibility/accessible-text-requirements#name_property_alternative_and_description

<!-- START COPILOT CODING AGENT SUFFIX -->



<details>

<summary>Original prompt</summary>

> 
> ----
> 
> *This section details on the original issue you should resolve*
> 
> <issue_title>Controls Inside Sections Are Not Associated with Their
Labels.</issue_title>
> <issue_description>### Microsoft PowerToys version
> 
> v0.94.2
> 
> ### Installation method
> 
> PowerToys auto-update
> 
> ### Area(s) with issue?
> 
> New+
> 
> ### Steps to reproduce
> 
> **Repro Steps:**
> 
> 1. Open the Power Toys.
> 2. Now navigate to the home present in the left navigation pane.
> 3. Now turn on the narrator using CTRL + Win + Enter.
> 4. Now navigate to the controls present inside the different sections.
> 5. Observe the issue.
> 
> ### ✔️ Expected Behavior
> 
> Each control should be programmatically associated with its
corresponding label so screen readers can accurately convey the purpose
of the control to users.
> 
> ###  Actual Behavior
> 
> Input controls (e.g., checkboxes, text fields, dropdowns) located
within different sections of the UI are not programmatically associated
with their visible labels.
> 
> ### Additional Information
> 
> **User Impact:**
> Screen reader users may hear only the control type (e.g., “edit text”)
with no context or description of what it is for. This makes it
difficult or impossible for them to fill out forms or interact with the
UI correctly, leading to confusion and frustration.
> 
> **WCAG Reference:**
> https://www.w3.org/WAI/WCAG22/Understanding/info-and-relationships
> 
> **Attachments:**
> 
>
https://github.com/user-attachments/assets/d25b9237-bee7-41d5-b564-df15df19b0d4
> 
> ### Other Software
> 
> _No response_</issue_description>
> 
> ## Comments on the Issue (you are @copilot in this section)
> 
> <comments>
> </comments>
> 


</details>

Fixes microsoft/PowerToys#42419

<!-- START COPILOT CODING AGENT TIPS -->
---

 Let Copilot coding agent [set things up for
you](https://github.com/microsoft/PowerToys/issues/new?title=+Set+up+Copilot+instructions&body=Configure%20instructions%20for%20this%20repository%20as%20documented%20in%20%5BBest%20practices%20for%20Copilot%20coding%20agent%20in%20your%20repository%5D%28https://gh.io/copilot-coding-agent-tips%29%2E%0A%0A%3COnboard%20this%20repo%3E&assignees=copilot)
— coding agent works faster and does higher quality work when set up for
your repo.

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: niels9001 <9866362+niels9001@users.noreply.github.com>
Co-authored-by: Gordon Lam (SH) <yeelam@microsoft.com>
2025-11-06 19:50:49 +08:00
Gleb Khmyznikov
ccaa876af2 [UI Tests] Peek - fix UI tests via setting hotkeys back to Ctrl+Space combo for tests only (#43168)
This pull request introduces a static initialization step to the
`PeekFilePreviewTests` class to ensure the correct test settings are
present before tests run. The main change is the addition of a static
constructor that creates or updates the `settings.json` file with
predefined settings, including setting the activation shortcut to
Ctrl+Space.

Test setup improvements:

* Added a static constructor to `PeekFilePreviewTests` that calls a new
`FixSettingsFileBeforeTests` method, ensuring the necessary settings
file exists and is properly configured before any tests execute.
* Implemented `FixSettingsFileBeforeTests` to create the required
directory and write a `settings.json` file with specific test
configuration, including setting the activation shortcut to Ctrl+Space
and other test-relevant properties.
2025-11-06 19:32:28 +08:00
Copilot
4a5e476a4e Fix: Add accessible name to Shortcut Conflicts button for screen readers (#42441)
## Summary
Fixes the accessibility issue where the "Shortcut Conflicts" button in
the Dashboard page has no accessible name defined, causing screen
readers to announce it as just "button" instead of providing context
about its purpose.

## Problem
The button in `ShortcutConflictControl.xaml` lacked an
`AutomationProperties.Name` attribute, violating WCAG 2.2 guidelines
(4.1.2 - Name, Role, Value). This prevented users who rely on screen
readers from determining the function of the button, making it
impossible to resolve or view shortcut conflicts.

**Before fix:**
- Screen reader announces: "button" 

**After fix:**
- Screen reader announces: "Shortcut conflicts, No conflicts found,
button" 
- Or: "Shortcut conflicts, 1 conflict found, button" 
- Or: "Shortcut conflicts, 3 conflicts found, button" 

## Solution
Added a new `AccessibleName` property to
`ShortcutConflictControl.xaml.cs` that combines:
- The static localized title: "Shortcut conflicts"
- The dynamic status text: "No conflicts found", "1 conflict found", or
"X conflicts found"

The button's `AutomationProperties.Name` is now bound to this property
using `{x:Bind AccessibleName, Mode=OneWay}`, ensuring it updates
dynamically as conflict data changes.

## Changes
- **ShortcutConflictControl.xaml**: Added `AutomationProperties.Name`
binding to the button
- **ShortcutConflictControl.xaml.cs**: Added `AccessibleName` property
and property change notification

## Impact
- Provides full context to assistive technology users about the button's
purpose and current state
- Complies with WCAG 2.2 accessibility standards
- Follows existing patterns in the codebase for accessible controls
- Minimal changes (2 files, 14 lines added)

## Related Issue
Closes #issue_number

## Testing
- [x] Code review completed with no issues
- [x] Follows existing accessibility patterns used in DashboardPage.xaml
- [x] Uses existing localized resource strings
- [x] Property updates dynamically via INotifyPropertyChanged

<!-- START COPILOT CODING AGENT SUFFIX -->



<details>

<summary>Original prompt</summary>

> 
> ----
> 
> *This section details on the original issue you should resolve*
> 
> <issue_title>No Accessible Name Defined for "Shortcut Conflicts"
Button.</issue_title>
> <issue_description>### Microsoft PowerToys version
> 
> v0.94.2
> 
> ### Installation method
> 
> PowerToys auto-update
> 
> ### Area(s) with issue?
> 
> New+
> 
> ### Steps to reproduce
> 
> **Repro Steps:**
> 
> 1. Open power toys.
> 2. Now navigate to the home section and select.
> 3. Now turn on narrator using CTRL + Win + Enter.
> 4. Now navigate to the Shortcut conflicts button.
> 5. Observe the narrator's announcement.
> 
> ### ✔️ Expected Behavior
> 
> The button should have an accessible name — either via a visible
label, aria-label, or aria-labelledby — so that assistive technology
users understand its purpose.
> 
> ###  Actual Behavior
> 
> The "Shortcut Conflicts" button has no accessible name defined. Screen
readers announce it as “button”.
> 
> ### Additional Information
> 
> **User Impact:**
> Users who rely on screen readers cannot determine the function of the
button, making it inaccessible. This prevents users from resolving or
viewing shortcut conflicts, which could impact usability and task
completion.
> 
> **WCAG Reference:**
> https://www.w3.org/WAI/WCAG22/Understanding/name-role-value
> 
> **Attachments:**
> 
>
https://github.com/user-attachments/assets/ca0f51d3-f736-4eb9-b355-e55f2cfd5bbd
> 
> ### Other Software
> 
> _No response_</issue_description>
> 
> ## Comments on the Issue (you are @copilot in this section)
> 
> <comments>
> </comments>
> 


</details>

Fixes microsoft/PowerToys#42418

<!-- START COPILOT CODING AGENT TIPS -->
---

 Let Copilot coding agent [set things up for
you](https://github.com/microsoft/PowerToys/issues/new?title=+Set+up+Copilot+instructions&body=Configure%20instructions%20for%20this%20repository%20as%20documented%20in%20%5BBest%20practices%20for%20Copilot%20coding%20agent%20in%20your%20repository%5D%28https://gh.io/copilot-coding-agent-tips%29%2E%0A%0A%3COnboard%20this%20repo%3E&assignees=copilot)
— coding agent works faster and does higher quality work when set up for
your repo.

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: niels9001 <9866362+niels9001@users.noreply.github.com>
Co-authored-by: Niels Laute <niels.laute@live.nl>
2025-11-06 18:07:48 +08:00
Dave Rayment
5c96cea31f [Peek] Fix media sources remaining locked when Peek window is closed (#42055)
<!-- 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

Fixes an issue where audio and video files would remain locked by Peek
after the user closed the preview window. This could prevent the
ejecting of removable storage.

<!-- Please review the items on the PR checklist before submitting-->
## PR Checklist

- [x] Closes: #41883
- [ ] **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

When the Peek window is closed, it is hiden rather than destroyed,
allowing for quick reactivation. The cleanup process is triggered by
`MainWindowViewModel.Uninitialize()`, which eventually causes the active
`Previewer` instance in `FilePreviewer.xaml.cs` to be disposed of (via
`OnItemPropertyChanged()`).

The root cause of the bug is that neither `VideoPreviewer` nor
`AudioPreviewer` implemented `IDisposable` sufficiently to cover clean
up of the media file. The result was that the `MediaSource` object,
which holds the handle to the open media file, was not disposed
deterministically. This left the file locked until the GC eventually
finalised it.

### Solution
To fix this, I've implemented `IDisposable` on `AudioPreviewer` where it
was absent, and expanded `Dispose()` on `VideoPreviewer` to clean up the
media object. A new `Unload()` method on each previewer handles explicit
clean up of the media sources. The `Dispose()` method calls `Unload()`
to ensure the resources are released reliably when the previewer is
destroyed.

`Unload()` is deliberately public, as I'd like to expand upon its use in
a future refactoring of the previewer switching logic, allowing for
reusing an active previewer instead of creating a new one every time the
user navigates to a new file.

### AudioPreviewer refinements
I made a few updates to `AudioPreviewer` to make the lifecycle of the
media source more predictable and improve the error handling:
- The `Preview` observable property is now a nullable
`AudioPreviewData?`. This more accurately represents the state (data is
either present or not), and allows for the removal of the creation of an
empty object in the constructor.
- `thumbnailTask`'s success is no longer regarded as an error condition
in `LoadPreviewAsync`. It is reasonable to let the user play their audio
file even if the thumbnail cannot be shown.
- An error when loading the source data or metadata results in the new
`Unload()` method being called, correctly releasing the file, protecting
against the file lock issue even if the media file was corrupt and could
only be partially constructed.
- Null checks for `Preview`, obvs.

### Scope
I could repro the original issue on audio and video files, so this PR is
focused on improvements to `AudioPreviewer` and `VideoPreviewer`. I
wasn't able to reproduce the file locking problem with the
`WebBrowserPreviewer` for its built-in supported types (HTML, Markdown
and PDF). I found some additional issues with the previewer, however,
but they will be covered in a future PR.

<!-- Describe how you validated the behavior. Add automated tests
wherever possible, but list manual validation steps taken as well -->
## Validation Steps Performed
Tests were performed with the following steps:

1. Place the audio/video file to test on a USB stick.
2. Open the file with Peek and play some of the media.
3. While previewing the media, close the Peek window.
4. Attempt to eject the USB stick via the systray.
- Before: the eject fails and Windows pops up the "File in use" dialog.
    - After: the drive is successfully removed.

I tested an MP4 video file and an MP3 audio track to confirm the fix.

I confirmed that other previewers were unaffected by previewing: JPEG
image files, a PDF, a TXT file, a Markdown file, an HTML file and a
folder. All items were successfully previewed.
2025-11-06 17:31:48 +08:00
Copilot
e7de5c7b8d Make update notification InfoBar clickable in Flyout (#42064)
## Summary

Resolves #38854 by making the "Update available" InfoBar in the tray
icon flyout clickable, providing direct navigation to the General
settings page where users can manage updates.

## Problem

When PowerToys has an available update, users experience unnecessary
navigation friction:

1. Click PowerToys tray icon → flyout opens with "Update available"
InfoBar
2. InfoBar is not clickable, only the settings wheel is interactive
3. Click settings wheel → opens Dashboard page (not where updates are
managed)
4. Navigate to General page → finally access update controls

Users requested making the "Update available" text itself a hyperlink
for direct access to update functionality.

## Solution

Made the InfoBar interactive by adding a `Tapped` event handler that:
- Hides the flyout (consistent with other flyout actions)
- Opens Settings window directly to the General page using
`App.OpenSettingsWindow(typeof(GeneralPage))`

## Changes

**Files Modified:**
- `src/settings-ui/Settings.UI/SettingsXAML/Flyout/LaunchPage.xaml`:
Added `Tapped="UpdateInfoBar_Tapped"` event
- `src/settings-ui/Settings.UI/SettingsXAML/Flyout/LaunchPage.xaml.cs`:
Added event handler and navigation logic

## User Experience

**Before:** Tray Icon → Flyout → Settings Wheel → Dashboard → Navigate
to General → Update Controls
**After:** Tray Icon → Flyout → **Click "Update available"** → General
Page → Update Controls

The InfoBar now behaves as a clickable hyperlink as requested, while
preserving all existing functionality. Users can still use the settings
wheel if preferred, but now have a more direct path to update
management.

## Testing

The implementation follows existing patterns in the codebase and uses
established APIs. The InfoBar only appears when updates are in
`ReadyToInstall` or `ReadyToDownload` states, ensuring the navigation is
contextually appropriate.

> [!WARNING]
>
> <details>
> <summary>Firewall rules blocked me from connecting to one or more
addresses (expand for details)</summary>
>
> #### I tried to connect to the following addresses, but was blocked by
firewall rules:
>
> - `i1qvsblobprodcus353.vsblob.vsassets.io`
>   - Triggering command: `dotnet build` (dns block)
>
> If you need me to access, download, or install something from one of
these locations, you can either:
>
> - Configure [Actions setup
steps](https://gh.io/copilot/actions-setup-steps) to set up my
environment, which run before the firewall is enabled
> - Add the appropriate URLs or hosts to the custom allowlist in this
repository's [Copilot coding agent
settings](https://github.com/microsoft/PowerToys/settings/copilot/coding_agent)
(admins only)
>
> </details>

<!-- START COPILOT CODING AGENT SUFFIX -->



<details>

<summary>Original prompt</summary>

> 
> ----
> 
> *This section details on the original issue you should resolve*
> 
> <issue_title>Taskbar icon should provide link directly to update
page</issue_title>
> <issue_description>### Description of the new feature / enhancement
> 
> Right now when there is an update the following message appears when
you click on the PT icon in the taskbar:
> 
>
![Image](https://github.com/user-attachments/assets/18641e1c-d80b-4f7e-b206-8c9a36f2de36)
> 
> When you click on the settings wheel you go to the dashboard page:
> 
>
![Image](https://github.com/user-attachments/assets/e951b988-79ab-48b3-8714-a26999223153)
> 
> Then you need to click on the Learn more button before you finally get
to the page where you can install the update:
> 
>
![Image](https://github.com/user-attachments/assets/914c9c00-a642-40da-bfb5-439c1fd930c0)
> 
> Can't you make the **_Update available_** a hyperlink or add another
button that would link directly to the General page (or wherever the
update button is) so we can quickly install the update instead of going
a roundabout way every time?
> 
>
![Image](https://github.com/user-attachments/assets/5c065eed-84ad-47be-9432-607155065a17)
> 
> ### Scenario when this would be used?
> 
> When there is an update. It's a usability annoyance more than
anything.
> 
> ### Supporting information
> 
> _No response_</issue_description>
> 
> ## Comments on the Issue (you are @copilot in this section)
> 
> <comments>
> </comments>
> 


</details>
Fixes microsoft/PowerToys#38854

<!-- START COPILOT CODING AGENT TIPS -->
---

 Let Copilot coding agent [set things up for
you](https://github.com/microsoft/PowerToys/issues/new?title=+Set+up+Copilot+instructions&body=Configure%20instructions%20for%20this%20repository%20as%20documented%20in%20%5BBest%20practices%20for%20Copilot%20coding%20agent%20in%20your%20repository%5D%28https://gh.io/copilot-coding-agent-tips%29%2E%0A%0A%3COnboard%20this%20repo%3E&assignees=copilot)
— coding agent works faster and does higher quality work when set up for
your repo.

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: niels9001 <9866362+niels9001@users.noreply.github.com>
Co-authored-by: Niels Laute <niels.laute@live.nl>
2025-11-06 16:53:32 +08:00
Shawn Yuan
d737e22d16 fixed terms & privacy link issue (#43327)
<!-- 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 pull request updates the way legal links (Terms of Use and Privacy
Policy) are displayed for different AI providers in the AdvancedPaste
module, making them dynamic based on the currently selected provider. It
also updates the URLs for several providers to ensure accuracy and
relevance.

## 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
- [ ] [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

---------

Signed-off-by: Shawn Yuan (from Dev Box) <shuaiyuan@microsoft.com>
2025-11-06 15:04:16 +08:00
leileizhang
fabf60d18f Add DSC v3 resource discovery support in PowerToys with subfolder structure and PATH configuration (#43253)
<!-- 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

- Use DSCModules subfolder for JSON manifest files
- Use relative path "..\PowerToys.DSC.exe" in JSON manifests
- Configure PATH environment variable to point to DSCModules subfolder

<!-- Please review the items on the PR checklist before submitting-->
## 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
- [ ] [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-11-06 12:08:41 +08:00
Jeremy Sinclair
1604b7b555 [Deps] Update .NET packages from 9.0.8 to 9.0.10 (#43295)
<!-- 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
Updates .NET 9 Runtime / Library packages to the latest 9.0.10 servicing
release for security fixes.

<!-- Please review the items on the PR checklist before submitting-->
## 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
- [ ] [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-11-06 11:33:48 +08:00
leileizhang
7fb1cdd1ea Remove PowerToys installer path from PATH to prevent some other apps crashe (#43157)
<!-- 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
To support DSCv3, we previously added the PowerToys installer path to
the environment PATH. However, this change may cause some other
applications to crash.

This PR removes the installer path temporarily until we find a better
way to support DSCv3.

<!-- Please review the items on the PR checklist before submitting-->
## PR Checklist

- [x] Closes: #42919
- [ ] **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-11-06 10:14:23 +08:00
leileizhang
05ae163eea Add back NuGet config file accidentally deleted by AdvancedPaste PR (#43312)
<!-- 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
Deleted by this https://github.com/microsoft/PowerToys/pull/42374
<!-- Please review the items on the PR checklist before submitting-->
## 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
- [ ] [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-11-06 10:13:23 +08:00
Niels Laute
e19520e675 [CmdPal] Extension string updates (#43269)
<!-- 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

Feedback from the design team:
- Reduce any redundant or long text strings for better readability and
localization
- `Verb + noun` for most extensions
- Sentence casing according to the Windows Writing Guidelines


<!-- Please review the items on the PR checklist before submitting-->
## 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
- [ ] [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

---------

Co-authored-by: Michael Jolley <mike@baldbeardedbuilder.com>
Co-authored-by: Jiří Polášek <me@jiripolasek.com>
2025-11-05 19:29:04 -06:00
Jiří Polášek
e2591250be CmdPal: Treat System command provider as special (#43321)
## Summary of the Pull Request

This change marks the System command provider as special, ensuring
fallback items are surfaced at the top of the list.

Additionally, the SystemCommandExtensionProvider ID has been updated to
comply with the new naming convention.

As a small cleanup, SystemCommandExtensionProvider is now sealed.

<!-- Please review the items on the PR checklist before submitting-->
## PR Checklist

- [x] Related to: #42524
- [ ] **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-11-05 18:34:16 -06:00
Jaylyn Barbee
e448d731f8 [Light Switch] Refactor + cleaner behavior (#43159)
<!-- 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 also includes a refactor to the light switch service. The
refactor will help me make cleaner updates in the future and makes the
"state" easier to track through the service.

## Validation
Completed the following steps as testing for normal behavior and edge
cases:

1. Start up
- Check defaults (delete settings.json files)
- Ensure PowerToys properly starts/does not start the module
- Ensure turning the module on and off starts/terminates the service
- Ensure the settings in the settings file are reflected in the front
end
2. Manual Override Activation
- Ensure that pressing the shortcut key triggers an update
- Ensure that pressing the shortcut key triggers a block in the schedule
(Should see logs Skipping schedule due to manual override)
- Ensure that changing windows settings triggers a manual override (at
the next minute)
- Ensure in both scenarios that the schedule is ignored until a boundary
is met
- Ensure that the schedule resumes following the boundary clearance.
4. New Day Detection / Sun Time Recalculation
- Keep service running past midnight (or simulate date change)
- Verify the last updated day is updated
- Verify new sun times are accurate and set in settings.
5. Coordinates / Mode Change
- Ensure that updates occur when the coordinates or mode changes. These
updates should reflect the new settings.
6. Schedule Mode OFF
- Turn the schedule off, check logs for notice
- Ensure the shortcut still works
- Ensure the schedule resumes as expected once turned back on.
8. Sleep / Hibernate Resume
- Set your schedule to change themes in the next 2 minutes.
- Send your machine to hibernate shutdown /h 
- Wake your machine after your theme should have changed and ensure
Light Switch catches itself up
- Repeat steps above but with a manual override triggered prior to the
theme change.Ensure manual override is flushed and schedule resumes.
9. Stop and Restart behavior
- Stop and restart the module. Ensure it behaves as expected. No reset
settings, etc.
2025-11-05 13:34:26 -05:00
Jiří Polášek
47c779e0a0 Run: handle DWM issues more gracefully (#42588)
## Summary of the Pull Request

This PR expands the scenarios where Run handles exceptions silently,
reducing the number of exception dialogs displayed to users and creating
a smoother experience. The premise remains unchanged: most exceptions
occur when Run is in the background, and the app can recover as the DWM
recovers.

This should cover most of the reports commonly encountered in the wild.

- Extended silent handling of DWM exceptions to include
`DWM_E_COMPOSITIONDISABLED` (0x80263001).
- Added silent handling for `STATUS_MESSAGE_LOST` error (NTSTATUS
0xC0000701, HR 0xD0000701).
- Implemented exception handling and retry logic for failures during
manual app theme changes (triggered by
`PowerLauncher.Helper.ThemeManager`).

I can't reproduce the error on its own; it only occurs alongside a fatal
render thread failure (`UCEERR_RENDERTHREADFAILURE`), which is
unrecoverable. Even if caught, the UI stops rendering, leaving the
end-user unable to proceed.

<!-- Please review the items on the PR checklist before submitting-->
## PR Checklist

- [x] Related to: #31226
- [x] Related to: #30769
- [ ] **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-11-05 18:51:58 +01:00
Niels Laute
b7b6ae6485 Tweaking the focus state for AP (#43306)
Adding the AI underline to the inputbox

<img width="656" height="583" alt="image"
src="https://github.com/user-attachments/assets/998a4203-61d7-4228-a682-391c6d78b3a5"
/>
2025-11-05 21:23:17 +08:00
Dave Rayment
b5b7361855 [General] Include high-volume bugs in Issue Template header (#43134)
<!-- 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
Adds references to 3 bugs which are logged by those who are unfamiliar
with the issue search function. It is hoped that this will help ease the
amount of triaging.

<!-- Please review the items on the PR checklist before submitting-->
## 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
- [ ] [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
- Checked the YML preview on my own fork.
2025-11-05 13:26:55 +01:00
Mike Hall
cd988b798b Add Cursor Wrap functionality to Powertoys Mouse Utils (#41826)
## Summary of the Pull Request

Cursor Wrap makes it simple to move the mouse from one edge of a display
(or set of displays) to the opposite edge of the display stack - on a
single display Cursor Wrap will wrap top/bottom and left/right edges.


https://github.com/user-attachments/assets/3feb606c-142b-4dab-9824-7597833d3ba4


## PR Checklist

- [x] Closes: CursorWrap #41759
- [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
- [x] **Localization:** All end-user-facing strings can be localized
- [ ] **Dev docs:** Added/updated
- [x] **New binaries:** Added on the required places
- [x] [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

## Detailed Description of the Pull Request / Additional comments
PR adds a new mouse utils module, this is 'Cursor Wrap' - Cursor Wrap
works with 1-9 monitors based on the logical monitor layout of the PC -
for a single monitor device the cursor is wrapped for the top/bottom and
left/right edges of the display - for a multi-monitor setup the cursor
is wrapped on the top/bottom left/right of the displays in the logical
display layout.

## Validation Steps Performed
Validation has been performed on a Surface Laptop 7 Pro (Intel) with a
single display and with an HDMI USB-C second display configured to be a
second monitor in top/left/right/bottom configuration - there are also
tests that run as part of the build to validate logical monitor layout
and cursor positioning.

---------

Co-authored-by: Niels Laute <niels.laute@live.nl>
Co-authored-by: Kai Tao (from Dev Box) <kaitao@microsoft.com>
Co-authored-by: Gordon Lam (SH) <yeelam@microsoft.com>
2025-11-05 19:28:25 +08:00
Niels Laute
1ad468641b [UX] Dashboard utilities sorting (#42065)
## Summary of the Pull Request

This PR adds a sorting button to the module list so it can be sorted
alphabetically (default) or by status.

Fixes: #41837

<img width="760" height="933" alt="image"
src="https://github.com/user-attachments/assets/69c831a9-ae9e-4849-b630-772d03e4a4b1"
/>


@yeelam-gordon When running the runner, I do see the settings value is
being updated. But when running the runner again the setting doesn't
seem to be saved? Is that because of a bug in my implementation, or am I
testing it wrong :)?

<img width="286" height="86" alt="image"
src="https://github.com/user-attachments/assets/3a90997f-c40c-4f50-8361-b1ae3aa02052"
/>



<!-- Please review the items on the PR checklist before submitting-->
## PR Checklist

- [x] 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
- [ ] [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

---------

Signed-off-by: Shawn Yuan (from Dev Box) <shuaiyuan@microsoft.com>
Co-authored-by: Shawn Yuan (from Dev Box) <shuaiyuan@microsoft.com>
2025-11-05 17:42:24 +08:00
Davide Giacometti
3176eb94a9 [Hosts] Backup Settings (#37778)
<!-- 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

Add backup settings for the Hosts File Editor to allow users to
customize the existing hardcoded logic.

<!-- Please review the items on the PR checklist before submitting-->
## PR Checklist

- [x] **Closes:** #37666
- [ ] **Communication:** I've discussed this with core contributors
already. If 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
- [ ] **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)
- [x] **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:
https://github.com/MicrosoftDocs/windows-dev-docs/pull/5342

<!-- 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

<img width="707" alt="image"
src="https://github.com/user-attachments/assets/e114431e-60e0-4b8c-bba7-df23f7af0182"
/>

<img width="707" alt="image"
src="https://github.com/user-attachments/assets/a02b591e-eb46-4964-bee7-548ec175b3aa"
/>

<img width="707" alt="image"
src="https://github.com/user-attachments/assets/6eb0ff21-74fa-4229-8832-df2df877b5cd"
/>

<!-- Describe how you validated the behavior. Add automated tests
wherever possible, but list manual validation steps taken as well -->
## Validation Steps Performed

- Backup on: verified that backup isn't executed
- Backups off: Verified that only one backup is executed
- Verified that backup is located in the expected path
- Auto delete is set to "never": verified that no backups are deleted
- Auto delete is set to "based on count": verified that backups are
deleted according to count value
- Auto delete is set to "based on age and count": verified that backups
are deleted according to days and count values
- Verified that files without the backup pattern aren't deleted
- There is also adequate test coverage for these scenarios 🚀

---------

Co-authored-by: Gordon Lam (SH) <yeelam@microsoft.com>
2025-11-05 16:42:31 +08:00
Antonín Procházka
31a0deee35 Peek a file using command line and named pipe. (#26422) (#38754)
This is a PoC. It adds the ability to peek a file using a named pipe and
a command line.

Usage/testing before this gets merged and released:

1. Build release configuration of Peek.UI and Peek.CLI.
2. Terminate PowerToys.Peek.UI.exe if running.
3. Back up and replace PowerToys.Peek.UI[.dll;.exe;.pdb;.pri]. Use
[Everything](https://www.voidtools.com/downloads/) to find the source
and destination folders.
4. Call `PowerToys.Peek.CLI.exe <path>` or send the path to peek to the
`PeekPipe` named pipe.

If this solution is OK, documentation and installer need to be updated
and a follow-up issue needs to be filed to support navigation.

---------

Co-authored-by: Clint Rutkas <clint@rutkas.com>
Co-authored-by: Leilei Zhang <leilzh@microsoft.com>
Co-authored-by: Gordon Lam (SH) <yeelam@microsoft.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-11-05 16:38:07 +08:00
Kai Tao
20b5ca79a3 light switch: Remove newinfobadge for light switch (#43300)
<!-- 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
Remove new tag for light switch

<!-- Please review the items on the PR checklist before submitting-->
## 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
- [ ] [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

<img width="773" height="332" alt="image"
src="https://github.com/user-attachments/assets/79f89994-8b6e-431e-a5f1-30909940e996"
/>
2025-11-05 16:36:46 +08:00
Shawn Yuan
a3b8dc6cb8 Advanced Paste: AI pasting enhancement (#42374)
<!-- 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
* Add multiple endpoint support for paste with AI
* Add Local AI support for paste AI
* Advanced AI implementation

<!-- Please review the items on the PR checklist before submitting-->
## PR Checklist

- [x] Closes: #32960
- [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
- [x] **Localization:** All end-user-facing strings can be localized
- [x] **Dev docs:** Added/updated
- [x] **New binaries:** Added on the required places
- [x] [JSON for
signing](https://github.com/microsoft/PowerToys/blob/main/.pipelines/ESRPSigning_core.json)
for new binaries
- [x] [WXS for
installer](https://github.com/microsoft/PowerToys/blob/main/installer/PowerToysSetup/Product.wxs)
for new binaries and localization folder
- [x] [YML for CI
pipeline](https://github.com/microsoft/PowerToys/blob/main/.pipelines/ci/templates/build-powertoys-steps.yml)
for new test projects
- [x] [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

### GPO
- [x] Paste with AI should not be available if the original GPO for
paste AI is set to false
   - [x] Paste with AI should be controlled within endpoint granularity
- [x] Advanced Paste UI should disable AI ability if GPO is set to
disable for any llm
### Paste AI
   - [x] Every AI endpoint should work as expected
   - [x] Default prompt should be able to give a reasonable result
   - [x] Local AI should work as expected
### Advanced AI
- [x] Open AI and Azure OPENAI should be able to configure as advanced
AI endpoint
- [x] Advanced AI should be able to pick up functions correctly to do
the transformation and give reasonable result

---------

Signed-off-by: Shawn Yuan <shuaiyuan@microsoft.com>
Signed-off-by: Shuai Yuan <shuai.yuan.zju@gmail.com>
Signed-off-by: Shawn Yuan (from Dev Box) <shuaiyuan@microsoft.com>
Co-authored-by: Leilei Zhang <leilzh@microsoft.com>
Co-authored-by: Niels Laute <niels.laute@live.nl>
Co-authored-by: Kai Tao <kaitao@microsoft.com>
Co-authored-by: Kai Tao <69313318+vanzue@users.noreply.github.com>
Co-authored-by: vanzue <vanzue@outlook.com>
Co-authored-by: Gordon Lam (SH) <yeelam@microsoft.com>
2025-11-05 16:13:55 +08:00
Kai Tao
c364aa7c70 Cmdpal: Bring vcruntime in cmdpal (#43255)
<!-- 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
Cmdpal has dependency on vcruntime appx package due to adaptive card,
bring that dependency in

<!-- Please review the items on the PR checklist before submitting-->
## PR Checklist

- [x] Closes: #42497
- [ ] **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
<img width="1873" height="1183" alt="image"
src="https://github.com/user-attachments/assets/d416d09f-f4d6-456c-a625-ca724a69b5ee"
/>

---------

Co-authored-by: Jiří Polášek <me@jiripolasek.com>
2025-11-05 09:51:25 +08:00
leileizhang
229bedd09f [UI Tests] Add complete OCR UI test coverage (#41947)
<!-- 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
* Enable Text Extractor. Then:
   - [x] Press the activation shortcut and verify the overlay appears.
   - [x] Press Escape and verify the overlay disappears.
   - [x] Press the activation shortcut and verify the overlay appears.
   - [x] Right-click and select Cancel. Verify the overlay disappears.
- [x] Disable Text Extractor and verify that the activation shortuct no
longer activates the utility.
 * With Text Extractor enabled and activated:
   - [x] Try to select text and verify it is copied to the clipboard.
- [x] Try to select a different OCR language by right-clicking and
verify the change is applied.
 * Test the different settings and verify they are applied:
   - [x] Activation shortcut
   - [x] OCR Language
 
<!-- Please review the items on the PR checklist before submitting-->
## 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
- [ ] [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-11-04 11:59:10 +08:00
moooyo
70e1177a6a [PowerRename] Support using photo metadata to replace in the PowerRename (#41728)
<!-- 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
1. Introduce WIC for power rename and add new class WICMetadataExtractor
to use WIC to extract metadata.
2. Add some patterns for metadata extract.
3. Support XMP and EXIF metadata extract.
4. Add test data for xmp and exif extractor
5. Add attribution for the test data uploader.

UI:
<img width="2052" height="1415" alt="image"
src="https://github.com/user-attachments/assets/9051b12e-4e66-4fdc-a4d4-3bada661c235"
/>
<img width="284" height="170" alt="image"
src="https://github.com/user-attachments/assets/2fd67193-77a7-48f0-a5ac-08a69fe64e55"
/>
<img width="715" height="1160" alt="image"
src="https://github.com/user-attachments/assets/5fa68a8c-d129-44dd-b747-099dfbcded12"
/>

demo:


https://github.com/user-attachments/assets/e90bc206-62e5-4101-ada2-3187ee7e2039



<!-- Please review the items on the PR checklist before submitting-->
## PR Checklist

- [x] Closes: #5612
- [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
- [x] **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

---------

Co-authored-by: Yu Leng <yuleng@microsoft.com>
2025-11-04 09:27:16 +08:00
Jiří Polášek
957b653210 CmdPal: Add a micro global error handler (#41392)
## Summary of the Pull Request

This PR introduces a scaled-down version of the global error handler
from #41061.

- Catches and logs virtually all unhandled exceptions.
- For UI thread exceptions, generates an additional error report:
    - One copy is saved in app's log folder for the Bug Report Tool.
- Another copy can be placed to the user’s desktop to increase
visibility and encourage report submission (disabled for now).
- Displays a message box that tells the user where to find the saved
report.

This PR is intentionally minimal and focused. The complete, more
polished solution is still planned in #41061, which should replace this
implementation in a follow-up.

<details><summary>Report example</summary>
<pre>

This is an error report generated by Windows Command Palette.
If you are seeing this message, it means the application has encountered
an unexpected issue.
You can help us fix it by filing a report at
https://aka.ms/powerToysReportBug.
============================================================
😢 An unexpected error occurred in the application.

Summary:
  Message:    NamedResource Not Found.

NamedResource Not Found.

  Type:       System.Runtime.InteropServices.COMException
  Source:     WinRT.Runtime
  Time:       2025-08-26 20:22:53.5752505
  HRESULT:    0x80073B17 (-2147009769)

Stack Trace:
at WinRT.ExceptionHelpers.<ThrowExceptionForHR>g__Throw|38_0(Int32 hr)
at
ABI.Microsoft.Windows.ApplicationModel.Resources.IResourceLoaderMethods.GetString(IObjectReference
_obj, String resourceId)
at
Microsoft.Windows.ApplicationModel.Resources.ResourceLoader.GetString(String
resourceId)
at Microsoft.CmdPal.UI.Helpers.ResourceLoaderInstance.GetString(String
resourceId)
at
Microsoft.CmdPal.UI.Settings.SettingsWindow.AnnounceNavigationPaneStateChanged(DependencyObject
sender, DependencyProperty dp)
at
ABI.Microsoft.UI.Xaml.DependencyPropertyChangedCallback.Do_Abi_Invoke(IntPtr
thisPtr, IntPtr sender, IntPtr dp)

------------------ Full Exception Details ------------------
System.Runtime.InteropServices.COMException (0x80073B17): NamedResource
Not Found.

NamedResource Not Found.

at WinRT.ExceptionHelpers.<ThrowExceptionForHR>g__Throw|38_0(Int32 hr)
at
ABI.Microsoft.Windows.ApplicationModel.Resources.IResourceLoaderMethods.GetString(IObjectReference
_obj, String resourceId)
at
Microsoft.Windows.ApplicationModel.Resources.ResourceLoader.GetString(String
resourceId)
at Microsoft.CmdPal.UI.Helpers.ResourceLoaderInstance.GetString(String
resourceId)
at
Microsoft.CmdPal.UI.Settings.SettingsWindow.AnnounceNavigationPaneStateChanged(DependencyObject
sender, DependencyProperty dp)
at
ABI.Microsoft.UI.Xaml.DependencyPropertyChangedCallback.Do_Abi_Invoke(IntPtr
thisPtr, IntPtr sender, IntPtr dp)

ℹ️ If you need further assistance, please include this information in
your support request.
ℹ️ Before sending, take a quick look to make sure it doesn't contain any
personal or sensitive information.
============================================================


</pre>
</details> 

Message:
<img width="2309" height="1341" alt="image"
src="https://github.com/user-attachments/assets/3ec20054-402f-421d-bebd-bf848a8eb504"
/>

<!-- Please review the items on the PR checklist before submitting-->
## PR Checklist

- [x] Partially handles: #41606
- [ ] **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-10-31 12:35:37 -05:00
Dustin L. Howett
0b0ad68b60 build: build the Machine and User installers at the same time (#42888) 2025-10-31 00:28:12 -05:00
Dustin L. Howett
b87be7263d Tests: do not use *relative drive letter* (#43135)
Since we switched to running the build on C:\, this test started
failing. C: means "current directory on the C drive"!
2025-10-31 11:33:44 +08:00
Jaylyn Barbee
1783812f1f Light Switch is not clearing manual override if the boundary happens while offline (#43072)
Bug: If light switch is transitioning while the computer is offline,
Light Switch will not clear the manual override at the boundary.
Fix: Ensure the "Clear override" logic checks if we are at or past a
boundary point.
2025-10-29 09:23:43 -07:00
Shawn Yuan
94b5bc62de Fix title bar overlapping issue (#43022)
<!-- 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 pull request introduces a small UI improvement to the
`ShellPage.xaml` file. The change sets a breakpoint for the compact
state of the title bar, which will help the interface adapt better to
different window sizes.

* UI responsiveness: Added `CompactStateBreakpoint="900"` to the
`AppTitleBar` control in `ShellPage.xaml` to improve layout adaptation
for smaller window widths.

**Before:**


https://github.com/user-attachments/assets/5ec424f4-b441-4eff-967f-a97cc92e180a


**After:**


https://github.com/user-attachments/assets/a1487c39-dce7-4055-90e9-aa6ed95e4beb



<!-- Please review the items on the PR checklist before submitting-->
## 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
- [x] **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

---------

Signed-off-by: Shawn Yuan <shuaiyuan@microsoft.com>
2025-10-29 10:32:09 +08:00
Shawn Yuan
0d18727e81 [CmdPal] Added recenter window support. (#38943)
<!-- 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

Added a new setting option to Command Palette that allows users to
choose whether the window should be recentered on every launch or
remember its last position. This enhancement improves user experience by
maintaining window positioning preferences across sessions.

<!-- Please review the items on the PR checklist before submitting-->
## PR Checklist

- [x] **Closes:** #38310
- [x] **Communication:** I've discussed this with core contributors
already. If 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

This PR adds a "Recenter window on launch" setting to Command Palette
with the following changes:

1. Added a new `RecenterWindow` property to `SettingsModel` (default is
true for backward compatibility)
2. Added corresponding property to `SettingsViewModel` for binding
3. Created a new `WindowPosition` class to track window position and
size
4. Modified `MainWindow.xaml.cs` to:
    - Track window position and size changes
    - Update position memory when window is modified or dismissed
    - Respect the recenter setting when showing the window
5. Added UI controls in the settings page with proper localization
strings

![image](https://github.com/user-attachments/assets/1c1db9f6-b23e-47c0-9a03-93906d4c9a42)



This feature allows users who prefer to have the Command Palette appear
in a specific screen location to maintain that preference, while others
can continue using the centered window behavior.

<!-- Describe how you validated the behavior. Add automated tests
wherever possible, but list manual validation steps taken as well -->
## Validation Steps Performed
1. Manually verified that with the setting enabled (default), the window
centers on launch
2. Verified that with the setting disabled, the window appears at its
last position

---------

Signed-off-by: Shawn Yuan <shuai.yuan.zju@gmail.com>
Signed-off-by: Shawn Yuan <shuaiyuan@microsoft.com>
2025-10-28 14:37:45 -05:00
Jiří Polášek
1e40d6b15b CmdPal: Extension list search (#41453)
## Summary of the Pull Request

Adds a rough implementation that appears to work, but it hasn’t been
tested. Don’t rely on it yet—I’m too tired to test properly or write a
polished commit message.

Pictures? Pictures!

<img width="2720" height="1624" alt="image"
src="https://github.com/user-attachments/assets/4f9c3360-8d08-4a34-888f-c6890afd0159"
/>

<img width="2647" height="1558" alt="image"
src="https://github.com/user-attachments/assets/3d6c23bc-f26d-4e31-ae09-d91efd304048"
/>

<img width="2683" height="1536" alt="image"
src="https://github.com/user-attachments/assets/6017b2d4-ccd9-4555-b81f-e2b1f78c48e5"
/>

<img width="577" height="334" alt="image"
src="https://github.com/user-attachments/assets/987fea99-05b2-4d31-b90c-327122daa241"
/>


https://github.com/user-attachments/assets/65a8f8ce-ae09-4272-881d-0b6f56cecfae

<!-- Please review the items on the PR checklist before submitting-->
## PR Checklist

- [x] Closes: #41451
- [x] Closes: #42031
- [x] Closes: #41800
- [ ] **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

---------

Co-authored-by: Niels Laute <niels.laute@live.nl>
Co-authored-by: Michael Jolley <mike@baldbeardedbuilder.com>
2025-10-28 14:36:42 -05:00
Guilherme
de00cbf20a [CmdPal] Fix filters visibility on non-ListPage (#42828)
<!-- 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 aims to fix the issue where filters from a ListPage remain
visible when navigating to other pages.
<!-- Please review the items on the PR checklist before submitting-->
## PR Checklist

- [x] Closes: #42827 
- [ ] **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
### Before:

![FiltersIssue](https://github.com/user-attachments/assets/b0ad6059-9a11-4e12-821d-7202358e25bb)

### After:

![FiltersFix](https://github.com/user-attachments/assets/b9ee71ee-cb5d-4ef9-b9fc-bc2e2a710b5c)

<!-- Describe how you validated the behavior. Add automated tests
wherever possible, but list manual validation steps taken as well -->
## Validation Steps Performed

---------

Co-authored-by: Jiří Polášek <me@jiripolasek.com>
2025-10-28 14:32:09 -05:00
Jiří Polášek
c4e96c7ee9 CmdPal: Add hints about bookmark placeholders to the Add/Edit Bookmark form (#42793)
## Summary of the Pull Request

This PR adds a short explanation to the Add/Edit Bookmark form,
describing how to use placeholders in bookmark URLs or paths

<img width="823" height="525" alt="image"
src="https://github.com/user-attachments/assets/b66adfc4-2dbc-4934-8796-9d4ad46d9f5f"
/>

<!-- Please review the items on the PR checklist before submitting-->
## PR Checklist

- [x] Closes: #42265 
- [ ] **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-10-28 14:28:46 -05:00
Jiří Polášek
103429b4d7 CmdPal: Add hidden window as owner for tool windows (#42902)
## Summary of the Pull Request

This PR changes the method used to hide tool windows from the taskbar
and Alt+Tab to a more reliable approach.
Previously, this was achieved by adding `WS_EX_TOOLWINDOW` to an unowned
top-level window, which proved unreliable in several scenarios.

The new implementation assigns a hidden window as the owner of each tool
window.
This ensures that the window does not appear on the taskbar even when
the Windows setting
**Settings → System → Multitasking → On the taskbar, show all opened
windows** is set to **On all desktops**.

## Change log one-liner

Fixes Command Palette windows occasionally appearing on the taskbar
under certain system settings.

<!-- Please review the items on the PR checklist before submitting-->
## PR Checklist

- [x] Closes: #42395
- [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
- [x] **Localization:** All end-user-facing strings can be localized
- [x] **Dev docs:** Added/updated
- [x] **New binaries:** none
- [x] **Documentation updated:** no need

<!-- 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

Tested alongside the stable CmdPal on a system with
2025-10-28 14:26:01 -05:00
Jaylyn Barbee
01fb831e4e [Light Switch] Light Switch should detect changes in Windows Settings and treat as manual override (same as using shortcut) (#42882)
<!-- 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 ensures that Light Switch detects changes to app/system theme
from Windows Settings. This PR also introduces new behavior where
switching the schedule will cause an instant update to the theme if
necessary.

<!-- Please review the items on the PR checklist before submitting-->
## PR Checklist

- [x] Closes: #42878
- [x] **Communication:** I've discussed this with core contributors
already. If the work hasn't been agreed, this work might be rejected
- [ ] **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
2025-10-28 12:00:38 -07:00
Sam Rueby
d197af3da9 CmdPal's search bar now accepts page up/down keyboard strokes. (#41886)
<!-- 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
The page up/down keys now function while the search box is focused.

<!-- Please review the items on the PR checklist before submitting-->
## PR Checklist

- [ X ] Closes: #41877
- [ ] **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
Previously, the page up/down keys only performed any action while an
item in the list was focused. The page up/down keys did not have any
effect while the search box was focused, however the up/down arrows do
have effect. This PR enables the page up/down keys while the search box
is focused.

There is a caveat here. The page up/down behavior is not consistent. I
do not see a way to tell the ListView to perform its native page up/down
function. Instead, I manually calculate roughly which item to scroll-to.
Because of this, the amount of scroll between when the search box is
focused and when an item in the ListView is focused is not consistent.

<!-- Describe how you validated the behavior. Add automated tests
wherever possible, but list manual validation steps taken as well -->
## Validation Steps Performed


![pageupdown](https://github.com/user-attachments/assets/b30f6e4e-03de-45bd-8570-0b06850bef24)
In this GIF:
1. CmdPal appears
2. SearchBar focused, down/up arrow keys.
3. SearchBar focused, page down/up keys.
4. Tab to item in ListView
5. ListView item focused down/up arrow keys.
6. ListView item focused page down/up keys.
7. SearchBar focused
8. Filter "abc"
9. SearchBar focused page down/up keys.
2025-10-28 12:56:17 -05:00
Jiří Polášek
a4791cc493 CmdPal: Ensure CommandItemViewModel reacts to changes of replaced Command (#42982)
## Summary of the Pull Request

This PR resolves the issue with CommandItemViewModel's subscription to
changes in the associated Command when it gets replaced by another
Command. The current implementation removes the handler from the old
command but fails to attach a new one.

## Change log one-liner


<!-- Please review the items on the PR checklist before submitting-->
## PR Checklist

- [x] Closes: #42981 
- [ ] **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-10-28 11:22:09 -05:00
leileizhang
1a1894472a Fix package identity build issue (#43019)
<!-- 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
<img width="1988" height="360" alt="image"
src="https://github.com/user-attachments/assets/85d994a9-3799-4f16-a836-85ca264b873c"
/>

Add an EntryPoint to the AppxManifest to fix the issue.
<!-- Please review the items on the PR checklist before submitting-->
## 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
- [ ] [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-10-28 17:16:03 +08:00
Jiří Polášek
5d6f96559c Multiple toys: Exclude TitleBars from tab navigation (#42030)
## Summary of the Pull Request

This PR removes title bar controls from tab navigation, solving one of
hidden tab stops (the other being #40637).

Affected apps:
- Command Palette - Settings
- Environment Variables
- File Locksmith
- Hosts File Editor
- Registry Preview
- Settings (the search box in the title bar is still tab navigable)

<!-- Please review the items on the PR checklist before submitting-->
## PR Checklist

- [x] Closes: #41944 
- [ ] **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

All apps were manually tests, by pressing tab and shift + tab.

---------

Co-authored-by: Niels Laute <niels.laute@live.nl>
2025-10-28 09:40:20 +08:00
Kai Tao
b774e13176 Fix the foreground style for find my mouse (#42865)
<!-- 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

Find my mouse should use full transparent window

<!-- Please review the items on the PR checklist before submitting-->
## PR Checklist

- [X] Closes: #42758
- [ ] **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


https://github.com/user-attachments/assets/75c73eb3-04bb-438c-8823-3c9f18923cc6
2025-10-27 09:33:26 +08:00
Jiří Polášek
e256e79685 CmdPal: Fix search box text selection in ShellPage.GoHome (#42937)
## Summary of the Pull Request

This PR fixes an issue where `ShellPage.GoHome` wouldn’t select the
search box text when the current page was already the home page.

In that case, the navigation stack was empty, and no code was executed
because focusing the text had been delegated to the `GoBack` operation.

## Change log one-liner

Ensured search text is selected when Go home when activated and
Highlight search on activate are both enabled.

<!-- Please review the items on the PR checklist before submitting-->
## PR Checklist

- [x] Closes: #42443
- [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
- [x] **Localization:** All end-user-facing strings can be localized
- [x] **Dev docs:** Added/updated
- [x] **New binaries:** Added on the required places
- [x] **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-10-25 19:51:53 -05:00
Jiří Polášek
623c804093 ManagedCommon: Log correct HRESULT for the inner exception (#42178)
## Summary of the Pull Request

This PR fixes incorrect HRESULT for inner exception when an error is
logged.

<!-- Please review the items on the PR checklist before submitting-->
## 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
- [ ] [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-10-25 19:50:07 -05:00
Michael Jolley
20188bda9b File search now has filters (#42141)
Closes #39260

Search for all files & folders, folders only, or files only.

Enjoy.


https://github.com/user-attachments/assets/43ba93f5-dfc5-4e73-8414-547cf99dcfcf
2025-10-24 19:16:21 -05:00
Jiří Polášek
6e5ad11bc3 CmdpPal: SearchBox visibility and async loading race (#42783)
## Summary of the Pull Request

This PR introduces two related fixes to improve the stability and
reliability of navigation and search UI behavior in the shell:

- **Ensure search box visibility is correctly updated**  
- `ShellViewModel` previously set `IsSearchBoxVisible` after navigation
to the page, but didn’t update it when the value changed. While the
value isn’t expected to change dynamically, the property initialization
is asynchronous, which could cause a race condition.
- As a defensive measure, this also changes the default value of
uninitialized property to make it visible by default.

- **Cancel asynchronous focus placement if navigation changes**  
- Ensures that any pending asynchronous focus operation is cancelled
when another navigation occurs before it completes.


<!-- Please review the items on the PR checklist before submitting-->
## PR Checklist

- [x] Closes: #42782
- [ ] **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-10-24 19:15:34 -05:00
Jiří Polášek
0e36e7e7a7 CmdPal: Add keyboard shortcut (Ctrl+,) to open Settings (#42787)
## Summary of the Pull Request

This PR introduces a new keyboard shortcut `Ctrl + ,` that opens the
Settings window directly.


<!-- Please review the items on the PR checklist before submitting-->
## PR Checklist

- [x] Closes: #42785 
- [ ] **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-10-24 19:12:59 -05:00
moooyo
82dc4cdc18 [CmdPal] Replace complex cancellation token mechanism with a simple task queue. (#42356)
<!-- 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
Just consider user are trying to search a long name such as "Visual
Studio Code"
The old mechanism:
User input: V
Task: V
Then input: i
Task cancel for V and start task i
etc...

The problem is:
1. I don't think we can really cancel the most time-cost part (Find
packages from WinGet).
2. User cannot see anything before they really end the input and the
last task complete. UX exp is so bad.
3. It's so complex to maintain. Hard to understand for the new
contributor.

New mechanism:
User input: V
Task: V
Then input: i 
Prev Task is still running but mark the next task is i
Input: s
Prev Task is still running but override the next task to s
etc...

We can get:
1. User can see some results if prev task complete.
2. It's simple to understand
3. The extra time cost I think will not too much. Because we ignored the
middle input.

Compare:


https://github.com/user-attachments/assets/f45f4073-efab-4f43-87f0-f47b727f36dc



<!-- Please review the items on the PR checklist before submitting-->
## 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
- [ ] [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

Co-authored-by: Yu Leng <yuleng@microsoft.com>
2025-10-24 14:28:30 -05:00
Kai Tao
c71fdca277 Hybrid CRT for powertys (#42073)
<!-- 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
<!-- Please review the items on the PR checklist before submitting-->
Hybrid CRT across powertoys for better bundle size

## 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
- [ ] [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
Bundle Size comparasion:

| bundle        | Before Hybrid CRT | After Hybrid CRT | diff |
|---------------|-------------------|------------------|------|
| x64-user      | 317M              | 310M             | 7M   |
| x64-machine   | 317M              |310M             | 7M   |
| arm64-user    | 305M              | 299M             | 6M   |
| arm64-machine | 305M              | 299M             | 6M   |


Did verification on a sandbox machine, every module launches as
expected, no dependency issue
2025-10-24 10:24:39 +08:00
Jiří Polášek
a69f7fa806 CmdPal: Update top-level item view model to reflect change of the associated command (#42806)
## Summary of the Pull Request

This PR implements a fix that ensures the top-level command's alias,
hotkey, and tags are automatically updated whenever the associated
command is modified, as the command defines the actual identity of the
item.

<!-- Please review the items on the PR checklist before submitting-->
## PR Checklist

- [x] Closes: #42796
- [x] Related to: #42807
- [ ] **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-10-23 16:57:12 -05:00
Jiří Polášek
cd5f753140 CmdPal: Migrate bookmarks manually (#42814)
<!-- 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 fixes the migration of bookmarks from versions prior to 0.95,
resolving an issue where hotkeys and aliases wouldn’t persist on
bookmarks created with Command Palette 0.94 or earlier.

It removes ID auto-fixing from `BookmarkData` in favor of an explicit
migration step handled by `BookmarkManager`.

<!-- Please review the items on the PR checklist before submitting-->
## PR Checklist

- [x] Closes: #42796
- [ ] **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-10-23 16:53:06 -05:00
Clint Rutkas
c628b4901d Added open tag to default expand open (#42824)
By default, none of the 4 methods are expanded. this will expand the top
item by default for users.

<img width="974" height="414" alt="image"
src="https://github.com/user-attachments/assets/f328dee6-9206-47a1-b45f-1f951142eef4"
/>
2025-10-23 22:07:16 +02:00
Jaylyn Barbee
c6c7bfb861 Updated installer hashes for 0.95.1 (#42820)
Title, updating installer links for next release.
2025-10-23 12:18:45 -04:00
Mike Hall
d64f06906c Enable switching to and from MousePointerCrosshairs and Gliding Cursor (#42105)
## Summary of the Pull Request
This PR enables a user to switch between Mouse Pointer Crosshairs and
Gliding Cursor (or the other way round!). The primary change is to the
underlying state machine that's shared between Mouse Pointer Crosshairs
and Gliding Cursor, both are implemented in the same Mouse Module.

## 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
- [ ] **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

## Detailed Description of the Pull Request / Additional comments
See above - this is primarily a change to the shared state machine
between Mouse Pointer Crosshairs and Gliding Cursor - this change
enables transition between Mouse Pointer Crosshairs and Gliding Cursor,
the underlying state is reset when a user transitions from Gliding to
Mouse Pointer and back again.

## Validation Steps Performed
Validation on a Windows Surface Laptop 7 Pro for the following states.
- Mouse Pointer Crosshairs and Gliding Cursor NOT active -
enable/disable Mouse Pointer Crosshairs
- Mouse Pointer Crosshairs and Gliding Cursor NOT active - enable/step
states for Gliding Cursor
- Activate and disable Mouse Pointer Crosshairs
- Activate and step through Gliding Cursor
- Mouse Pointer Crosshairs Active - Switch to Gliding Cursor
- Gliding Cursor Active - Switch to Mouse Pointer Crosshairs
2025-10-23 18:21:01 +08:00
Kai Tao
c26dfef81b Find My Mouse: Cursor should not go busy & window should not be active (#42795)
<!-- 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
Fix two issue in find my mouse:
 #42758  #42765 
<!-- Please review the items on the PR checklist before submitting-->
## PR Checklist

- [x] Closes: #42758 and #42765
- [ ] **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
| Problem | Before | After this fix |
|----------|---------|----------------|
| Mouse Loading status | html<br><video
src="https://github.com/user-attachments/assets/a07b3fe7-a9e1-4176-a33f-4836bf7f7e0a"
controls width="300"></video> | html<br><video
src="https://github.com/user-attachments/assets/a78848b0-6f34-4d68-b470-a4a3adbd8a5e"
controls width="300"></video> |
| Current window lose focus | html<br><video
src="https://github.com/user-attachments/assets/5122262c-6c98-4fe5-a107-5db2d96a6341"
controls width="300"></video> | html<br><video
src="https://github.com/user-attachments/assets/b12391c8-d148-4498-b37f-c8c1bc9e381a"
controls width="300"></video> |


The window lose focus test: Currently after activate the find my mouse,
the window lose focus, after the fix, foreground window is still the
focused window, And my keystroke will directly apply in the foreground
window.
Maybe hard to see in the video.
2025-10-23 16:20:40 +08:00
Mason Bergstrom
dd420509ab [Mouse Without Borders] Adding Horizontal Scrolling Support (#42179)
## Summary of the Pull Request
Added support for horizontal scrolling to Mouse Without Borders, instead
of being a no-op.

## PR Checklist

- [x] Closes: #37037
- [x] **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

## Detailed Description of the Pull Request / Additional comments
Works in a backward compatible fashion, continuing to be a no-op when
forwarded to an older version, but works once both devices are updated.

## Validation Steps Performed
Built on two separate devices that are paired with each other. First
tested with one device updated and one on the old code, confirming
backwards compatibility support. Second tested both devices updated,
confirming horizontal scroll is now working on remote device.

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-10-23 12:06:33 +08:00
Jaylyn Barbee
2c4aab9d87 Light Switch Hotfixes v2 (#42774)
Should fix: #42627
Issue: Suntimes not updating within the day if the mode changes to
SunsetToSunrise
Fix: Update suntimes in the service if the mode is changed to Sun mode.

Other: small bug fixes (brackets, etc)
2025-10-22 11:59:36 -07:00
Dustin L. Howett
52ce33d438 build: run all builds out of a new (huge) P:\ drive (#42739)
The new agents have much smaller temporary disks (which I verified with
another test run to clock in at about 87GB). For right now, let's move
our release builds to a larger drive while we troubleshoot.
2025-10-21 18:32:34 -05:00
Gordon Lam
fc1307418e Update Copilot guidance and PR prompt workflow (This PR summary and commit are generated accordingly) (#42634)
## Summary of the Pull Request
- Added new Copilot agent prompts in
`.github/prompts/create-commit-title.prompt.md`,
`.github/prompts/create-pr.prompt.md`, and
`.github/prompts/fix-spelling.prompt.md` to streamline contributor
workflows.
- Refreshed `.github/copilot-instructions.md` with front matter and
clarified build/test guidance.
And added a new section titled `Language Style Rules` to help reduce
style issues in auto-generated code.

## Screenshot
a. For the new prompts, in VSCode, just type "/" and its name
<img width="477" height="124" alt="image"
src="https://github.com/user-attachments/assets/37c7330d-6fdc-45b4-9030-95920920c964"
/>
<img width="446" height="105" alt="image"
src="https://github.com/user-attachments/assets/55d3bb49-46cc-4441-9fb5-fed3a22983d9"
/>
b. All the spelling check problem, PR description, Commit title, are
generated and fixed by above prompts as demonstration (Except this
section)

## PR Checklist
- [x] **Communication:** I've discussed this with core contributors
already. If the work hasn't been agreed, this work might be rejected
- [x] **Tests:** N/A on doc updates.
- [x] **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 (N/A)

## Detailed Description of the Pull Request / Additional comments
- Introduced prompt definitions so local tooling can generate commit
titles, PR descriptions, and resolve spell-check alerts using consistent
instructions.
- Added GitHub CLI prerequisites inside
`.github/prompts/fix-spelling.prompt.md` to ensure `gh` commands succeed
for new contributors.
- Converted `.github/copilot-instructions.md` to YAML-front-matter
format while aligning headings and terminology with current contributor
guidance.

## Validation Steps Performed
- No automated tests were run; changes are documentation and
configuration only.
2025-10-21 16:05:16 +08:00
414 changed files with 15875 additions and 6878 deletions

View File

@@ -7,6 +7,13 @@ body:
- type: markdown
attributes:
value: Please make sure to [search for existing issues](https://github.com/microsoft/PowerToys/issues) before filing a new one!
- type: markdown
attributes:
value: |
We are aware of the following high-volume issues and are actively working on them. Please check if your issue is one of these before filing a new bug report:
* **PowerToys Run crash related to "Desktop composition is disabled"**: This may appear as `COMException: 0x80263001`. For more details, see issue [#31226](https://github.com/microsoft/PowerToys/issues/31226).
* **PowerToys Run crash with `COMException (0xD0000701)`**: For more details, see issue [#30769](https://github.com/microsoft/PowerToys/issues/30769).
* **PowerToys Run crash with a "Cyclic reference" error**: This `System.InvalidOperationException` is detailed in issue [#36451](https://github.com/microsoft/PowerToys/issues/36451).
- id: version
type: input
attributes:

View File

@@ -321,3 +321,10 @@ REGSTR
# Misc Win32 APIs and PInvokes
INVOKEIDLIST
# PowerRename metadata pattern abbreviations (used in tests and regex patterns)
DDDD
FFF
HHH
riday
YYY

View File

@@ -105,6 +105,7 @@
^src/common/notifications/BackgroundActivatorDLL/cpp\.hint$
^src/common/sysinternals/Eula/
^src/modules/cmdpal/doc/initial-sdk-spec/list-elements-mock-002\.pdn$
^src/modules/cmdpal/ext/SamplePagesExtension/Pages/SampleMarkdownImagesPage\.cs$
^src/modules/colorPicker/ColorPickerUI/Shaders/GridShader\.cso$
^src/modules/launcher/Plugins/Microsoft\.PowerToys\.Run\.Plugin\.TimeDate/Properties/
^src/modules/MouseUtils/MouseJumpUI/MainForm\.resx$

View File

@@ -22,6 +22,7 @@ ADate
ADDSTRING
ADDUNDORECORD
ADifferent
adjacents
ADMINS
adml
admx
@@ -34,6 +35,7 @@ AFX
AGGREGATABLE
AHK
AHybrid
AIUI
akv
ALarger
ALIGNRIGHT
@@ -63,6 +65,7 @@ APIIs
Apm
APPBARDATA
APPEXECLINK
appext
APPLICATIONFRAMEHOST
appmanifest
APPMODEL
@@ -94,9 +97,10 @@ ASSOCSTR
ASYNCWINDOWPLACEMENT
ASYNCWINDOWPOS
atl
ATX
ATRIOX
aumid
Authenticode
authenticode
AUTOBUDDY
AUTOCHECKBOX
AUTOHIDE
@@ -110,9 +114,13 @@ AValid
AWAYMODE
azcliversion
azman
azureaiinference
azureinference
azureopenai
bbwe
BCIE
bck
backticks
BESTEFFORT
bezelled
bhid
@@ -140,6 +148,7 @@ bmi
BNumber
BODGY
BOklab
Bootstrappers
BOOTSTRAPPERINSTALLFOLDER
BOTTOMALIGN
boxmodel
@@ -167,14 +176,18 @@ BYPOSITION
CALCRECT
CALG
callbackptr
cabstr
calpwstr
caub
Cangjie
CANRENAME
Carlseibert
Canvascustomlayout
CAPTUREBLT
CAPTURECHANGED
CARETBLINKING
CAtl
CBN
cch
CCHDEVICENAME
CCHFORMNAME
@@ -197,6 +210,7 @@ CIBUILD
cidl
CIELCh
cim
claude
CImage
cla
CLASSDC
@@ -229,6 +243,7 @@ CODENAME
codereview
Codespaces
Coen
cognitiveservices
COINIT
colid
colorconv
@@ -243,6 +258,7 @@ cominterop
commandnotfound
commandpalette
compmgmt
COMPOSITIONDISABLED
COMPOSITIONFULL
CONFIGW
CONFLICTINGMODIFIERKEY
@@ -268,12 +284,14 @@ countof
covrun
cpcontrols
cph
cppcoreguidelines
cplusplus
CPower
cpptools
cppvsdbg
cppwinrt
createdump
creativecommons
CREATEPROCESS
CREATESCHEDULEDTASK
CREATESTRUCT
@@ -297,6 +315,7 @@ CURRENTDIR
CURSORINFO
cursorpos
CURSORSHOWING
CURSORWRAP
customaction
CUSTOMACTIONTEST
CUSTOMFORMATPLACEHOLDER
@@ -336,6 +355,7 @@ Deact
debugbreak
decryptor
Dedup
dfx
Deduplicator
Deeplink
DEFAULTBOOTSTRAPPERINSTALLFOLDER
@@ -395,6 +415,9 @@ DNLEN
DONOTROUND
DONTVALIDATEPATH
dotnet
downsampled
downsampling
Downsampled
downscale
DPICHANGED
DPIs
@@ -410,7 +433,7 @@ DROPFILES
DSTINVERT
DString
DSVG
DTo
dto
DUMMYUNIONNAME
dutil
DVASPECT
@@ -444,7 +467,6 @@ EDITKEYBOARD
EDITSHORTCUTS
EDITTEXT
EFile
ekus
eku
emojis
ENABLEDELAYEDEXPANSION
@@ -509,10 +531,12 @@ EXTRINSICPROPERTIES
eyetracker
FANCYZONESDRAWLAYOUTTEST
FANCYZONESEDITOR
FNumber
FARPROC
fdx
fesf
FFFF
Figma
FILEEXPLORER
fileexploreraddons
fileexplorerpreview
@@ -539,6 +563,7 @@ FIXEDSYS
flac
flyouts
FMask
foundrylocal
fmtid
FOF
FOFX
@@ -577,6 +602,7 @@ getfilesiginforedist
geolocator
GETHOTKEY
GETICON
GETLBTEXT
GETMINMAXINFO
GETNONCLIENTMETRICS
GETPROPERTYSTOREFLAGS
@@ -584,6 +610,7 @@ GETSCREENSAVERRUNNING
GETSECKEY
GETSTICKYKEYS
GETTEXTLENGTH
GIFs
gitmodules
GHND
GMEM
@@ -594,6 +621,7 @@ GPOCA
gpp
gpu
gradians
grctlext
Gridcustomlayout
GSM
gtm
@@ -603,6 +631,8 @@ GValue
gwl
GWLP
GWLSTYLE
googleai
googlegemini
hangeul
Hanzi
Hardlines
@@ -691,6 +721,7 @@ HTCLIENT
hthumbnail
HTOUCHINPUT
HTTRANSPARENT
hutchinsoniana
HVal
HValue
Hvci
@@ -712,7 +743,9 @@ IDCANCEL
IDD
idk
idl
IIM
idlist
ifd
IDOK
IDOn
IDR
@@ -729,6 +762,7 @@ Ijwhost
ILD
IMAGEHLP
IMAGERESIZERCONTEXTMENU
IPTC
IMAGERESIZEREXT
imageresizerinput
imageresizersettings
@@ -747,7 +781,7 @@ INITDIALOG
INITGUID
INITTOLOGFONTSTRUCT
INLINEPREFIX
Inlines
inlines
INPC
inproc
INPUTHARDWARE
@@ -868,6 +902,7 @@ LOCKTYPE
LOGFONT
LOGFONTW
logon
lon
LOGMSG
LOGPIXELSX
LOGPIXELSY
@@ -947,7 +982,6 @@ maxversiontested
mber
MBM
MBR
mcp
MDICHILD
MDL
mdtext
@@ -960,6 +994,7 @@ MENUITEMINFOW
MERGECOPY
MERGEPAINT
Metadatas
metadatamatters
metafile
mfc
Mgmt
@@ -1027,6 +1062,7 @@ msiexec
MSIFASTINSTALL
MSIHANDLE
MSIRESTARTMANAGERCONTROL
MSIs
msixbundle
MSIXCA
MSLLHOOKSTRUCT
@@ -1121,6 +1157,7 @@ nonstd
NOOWNERZORDER
NOPARENTNOTIFY
NOPREFIX
NPU
NOREDIRECTIONBITMAP
NOREDRAW
NOREMOVE
@@ -1156,8 +1193,8 @@ ntfs
NTSTATUS
NTSYSAPI
NULLCURSOR
nullref
nullonfailure
nullref
numberbox
nwc
ocr
@@ -1180,6 +1217,9 @@ opencode
OPENFILENAME
opensource
openxmlformats
ollama
Olllama
onnx
OPTIMIZEFORINVOKE
ORPHANEDDIALOGTITLE
ORSCANS
@@ -1274,6 +1314,7 @@ pnid
PNMLINK
Poc
Podcasts
Photoshop
POINTERID
POINTERUPDATE
Pokedex
@@ -1368,6 +1409,8 @@ pwsz
pwtd
QDC
qit
QNN
Qualcomm
QITAB
QITABENT
qoi
@@ -1476,6 +1519,7 @@ sacl
safeprojectname
SAMEKEYPREVIOUSLYMAPPED
SAMESHORTCUTPREVIOUSLYMAPPED
samsung
sancov
SAVEFAILED
scanled
@@ -1838,6 +1882,7 @@ USEINSTALLERFORTEST
USESHOWWINDOW
USESTDHANDLES
USRDLL
utm
UType
uuidv
uwp
@@ -1914,6 +1959,7 @@ wcsicmp
wcsncpy
wcsnicmp
WCT
WCRAPI
WDA
wdm
wdp
@@ -1927,6 +1973,7 @@ wgpocpl
WHEREID
wic
wifi
wikimedia
wikipedia
WIL
winapi
@@ -1956,6 +2003,8 @@ WINL
winlogon
winmd
WINNT
windowsml
winml
winres
winrt
winsdk
@@ -2021,7 +2070,9 @@ XAxis
XButton
xclip
xcopy
xap
XDeployment
XDimension
xdf
XDocument
XElement
@@ -2039,6 +2090,7 @@ xsi
XSpeed
XStr
xstyler
xmp
XTimer
XUP
XVIRTUALSCREEN
@@ -2046,6 +2098,7 @@ xxxxxx
YAxis
ycombinator
YIncrement
YDimension
yinle
yinyue
YPels

View File

@@ -253,7 +253,7 @@ _SILENCE_STDEXT_ARR_ITERS_DEPRECATION_WARNING
# hit-count: 1 file-count: 1
# Amazon
\bamazon\.com/[-\w]+/(?:dp/[0-9A-Z]+|)[^"'\s]+
\bamazon\.com/[-\w]+/(?:dp/[0-9A-Z]+|)
# hit-count: 3 file-count: 3
# imgur

View File

@@ -1,43 +1,59 @@
# PowerToys Copilot guide (concise)
---
description: PowerToys AI contributor guidance.
applyTo: pullRequests
---
# PowerToys - Copilot guide (concise)
This is the top-level guide for AI changes. Keep edits small, follow existing patterns, and cite exact paths in PRs.
Repo map (1line per area)
# Repo map (1-line per area)
- Core apps: `src/runner/**` (tray/loader), `src/settings-ui/**` (Settings app)
- Shared libs: `src/common/**`
- Modules: `src/modules/*` (one per utility; Command Palette in `src/modules/cmdpal/**`)
- Build tools/docs: `tools/**`, `doc/devdocs/**`
Build and test (defaults)
# Build and test (defaults)
- Prerequisites: Visual Studio 2022 17.4+, minimal Windows 10 1803+.
- Build discipline:
- One terminal per operation (build test). Dont switch/open new ones mid-flow.
- One terminal per operation (build -> test). Do not switch or open new ones mid-flow.
- After making changes, `cd` to the project folder that changed (`.csproj`/`.vcxproj`).
- Use script(s) to build, synchronously block and wait in foreground for it to finish: `tools/build/build.ps1|.cmd` (current folder), `build-essentials.*` (once per brand new build for missing nuget packages)
- Treat build **exit code 0** as success; any non-zero exit code is a failure, have Copilot read the errors log in the build folder (e.g., `build.*.*.errors.log`) and surface problems.
- Dont start tests or launch Runner until the previous step succeeded.
- Tests (fast + targeted):
- Find the test project by product code prefix (e.g., FancyZones, AdvancedPaste). Look for a sibling folder or 12 levels up named like `<Product>*UnitTests` or `<Product>*UITests`.
- Build the test project, wait for **exit**, then run only those tests via VS Test Explorer or `vstest.console.exe` with filters. Avoid `dotnet test` in this repo.
- Add/adjust tests when changing behavior; if skipped, state why (e.g., comment-only, string rename).
- Use scripts to build, synchronously block and wait in foreground for completion: `tools/build/build.ps1|.cmd` (current folder), `build-essentials.*` (once per brand new build for missing nuget packages).
- Treat build exit code 0 as success; any non-zero exit code is a failure. Read the errors log in the build folder (such as `build.*.*.errors.log`) and surface problems.
- Do not start tests or launch Runner until the previous step succeeded.
- Tests (fast and targeted):
- Find the test project by product code prefix (for example FancyZones, AdvancedPaste). Look for a sibling folder or one to two levels up named like `<Product>*UnitTests` or `<Product>*UITests`.
- Build the test project, wait for exit, then run only those tests via VS Test Explorer or `vstest.console.exe` with filters. Avoid `dotnet test` in this repo.
- Add or adjust tests when changing behavior; if skipped, state why (for example comment-only or string rename).
Pull requests (expectations)
- Atomic: one logical change; no driveby refactors.
- Describe: problem / approach / risk / test evidence.
# Pull requests (expectations)
- Atomic: one logical change; no drive-by refactors.
- Describe: problem, approach, risk, test evidence.
- List: touched paths if not obvious.
When to ask for clarification
# When to ask for clarification
- Ambiguous spec after scanning relevant docs (see below).
- Cross-module impact (shared enum/struct) not clear.
- Security / elevation / installer changes.
- Cross-module impact (shared enum or struct) not clear.
- Security, elevation, or installer changes.
Logging (use existing stacks)
- C++: `src/common/logger/**` (`Logger::info|warn|error|debug`). Keep hot paths quiet (hooks, tight loops).
- C#: `ManagedCommon.Logger` (`LogInfo|LogWarning|LogError|LogDebug|LogTrace`). Some UIs use injected `ILogger` via `LoggerInstance.Logger`.
# Logging (use existing stacks)
- C++ logging lives in `src/common/logger/**` (`Logger::info`, `Logger::warn`, `Logger::error`, `Logger::debug`). Keep hot paths quiet (hooks, tight loops).
- C# logging goes through `ManagedCommon.Logger` (`LogInfo`, `LogWarning`, `LogError`, `LogDebug`, `LogTrace`). Some UIs use injected `ILogger` via `LoggerInstance.Logger`.
Docs to consult
# Docs to consult
- `tools/build/BUILD-GUIDELINES.md`
- `doc/devdocs/core/architecture.md`, `doc/devdocs/core/runner.md`, `doc/devdocs/core/settings/readme.md`, `doc/devdocs/modules/readme.md`
- `doc/devdocs/core/architecture.md`
- `doc/devdocs/core/runner.md`
- `doc/devdocs/core/settings/readme.md`
- `doc/devdocs/modules/readme.md`
Done checklist (self review before finishing)
- Build clean? Tests updated/passed? No unintended formatting? Any new dependency? Documented skips?
# Language style rules
- Always enforce repo analyzers: root `.editorconfig` plus any `stylecop.json`.
- C# code follows StyleCop.Analyzers and Microsoft.CodeAnalysis.NetAnalyzers.
- C++ code honors `.clang-format` plus `.clang-tidy` (modernize/cppcoreguidelines/readability).
- Markdown files wrap at 80 characters and use ATX headers with fenced code blocks that include language tags.
- YAML files indent two spaces and add comments for complex settings while keeping keys clear.
- PowerShell scripts use Verb-Noun names and prefer single-quoted literals while documenting parameters and satisfying PSScriptAnalyzer.
# Done checklist (self review before finishing)
- Build clean? Tests updated or passed? No unintended formatting? Any new dependency? Documented skips?

View File

@@ -0,0 +1,16 @@
---
mode: 'agent'
model: GPT-5-Codex (Preview)
description: 'Generate an 80-character git commit title for the local diff.'
---
**Goal:** Provide a ready-to-paste git commit title (<= 80 characters) that captures the most important local changes since `HEAD`.
**Workflow:**
1. Run a single command to view the local diff since the last commit:
```@terminal
git diff HEAD
```
2. From that diff, identify the dominant area (reference key paths like `src/modules/*`, `doc/devdocs/**`, etc.), the type of change (bug fix, docs update, config tweak), and any notable impact.
3. Draft a concise, imperative commit title summarizing the dominant change. Keep it plain ASCII, <= 80 characters, and avoid trailing punctuation. Mention the primary component when obvious (for example `FancyZones:` or `Docs:`).
4. Respond with only the final commit title on a single line so it can be pasted directly into `git commit`.

View File

@@ -0,0 +1,22 @@
---
mode: 'agent'
model: GPT-5-Codex (Preview)
description: 'Generate a PowerToys-ready pull request description from the local diff.'
---
**Goal:** Produce a ready-to-paste PR title and description that follows PowerToys conventions by comparing the current branch against a user-selected target branch.
**Repo guardrails:**
- Treat `.github/pull_request_template.md` as the single source of truth; load it at runtime instead of embedding hardcoded content in this prompt.
- Preserve section order from the template but only surface checklist lines that are relevant for the detected changes, filling them with `[x]`/`[ ]` as appropriate.
- Cite touched paths with inline backticks, matching the guidance in `.github/copilot-instructions.md`.
- Call out test coverage explicitly: list automated tests run (unit/UI) or state why they are not applicable.
**Workflow:**
1. Determine the target branch from user context; default to `main` when no branch is supplied.
2. Run `git status --short` once to surface uncommitted files that may influence the summary.
3. Run `git diff <target-branch>...HEAD` a single time to review the detailed changes. Only when confidence stays low dig deeper with focused calls such as `git diff <target-branch>...HEAD -- <path>`.
4. From the diff, capture impacted areas, key file changes, behavioral risks, migrations, and noteworthy edge cases.
5. Confirm validation: list tests executed with results or state why tests were skipped in line with repo guidance.
6. Load `.github/pull_request_template.md`, mirror its section order, and populate it with the gathered facts. Include only relevant checklist entries, marking them `[x]/[ ]` and noting any intentional omissions as "N/A".
7. Present the filled template inside a fenced ```markdown code block with no extra commentary so it is ready to paste into a PR, clearly flagging any placeholders that still need user input.

22
.github/prompts/fix-spelling.prompt.md vendored Normal file
View File

@@ -0,0 +1,22 @@
---
mode: 'agent'
model: GPT-5-Codex (Preview)
description: 'Resolve Code scanning / check-spelling comments on the active PR.'
---
**Goal:** Clear every outstanding GitHub pull request comment created by the `Code scanning / check-spelling` workflow by explicitly allowing intentional terms.
**Guardrails:**
- Update only discussion threads authored by `github-actions` or `github-actions[bot]` that mention `Code scanning results / check-spelling`.
- Resolve findings solely by editing `.github/actions/spell-check/expect.txt`; reuse existing entries.
- Leave all other files and topics untouched.
**Prerequisites:**
- Install GitHub CLI if it is not present: `winget install GitHub.cli`.
- Run `gh auth login` once before the first CLI use.
**Workflow:**
1. Determine the active pull request with a single `gh pr view --json number` call (default to the current branch).
2. Fetch all PR discussion data once via `gh pr view --json comments,reviews` and filter to check-spelling comments authored by `github-actions` or `github-actions[bot]` that are not minimized; when several remain, process only the most recent comment body.
3. For each flagged token, review `.github/actions/spell-check/expect.txt` for an equivalent term (for example an existing lowercase variant); when found, reuse that normalized term rather than adding a new entry, even if the flagged token differs only by casing. Only add a new entry after confirming no equivalent already exists.
4. Add any remaining missing token to `.github/actions/spell-check/expect.txt`, keeping surrounding formatting intact.

3
.gitignore vendored
View File

@@ -349,10 +349,7 @@ src/common/Telemetry/*.etl
/src/modules/powerrename/ui/RCb24464
# Generated installer file for Monaco source files.
/installer/PowerToysSetup/MonacoSRC.wxs
/installer/PowerToysSetup/DscResources.wxs
/installer/PowerToysSetupVNext/MonacoSRC.wxs
/installer/PowerToysSetupVNext/DscResources.wxs
# MSBuildCache
/MSBuildCacheLogs/

View File

@@ -5,7 +5,6 @@
{
"MatchedPath": [
"*.resources.dll",
"WinUI3Apps\\Assets\\Settings\\Scripts\\*.ps1",
"PowerToys.ActionRunner.exe",
@@ -27,6 +26,7 @@
"PowerToys.GPOWrapper.dll",
"PowerToys.GPOWrapperProjection.dll",
"PowerToys.AllExperiments.dll",
"LanguageModelProvider.dll",
"Common.Search.dll",
@@ -181,6 +181,7 @@
"PowerToys.MousePointerCrosshairs.dll",
"PowerToys.MouseJumpUI.dll",
"PowerToys.MouseJumpUI.exe",
"PowerToys.CursorWrap.dll",
"PowerToys.MouseWithoutBorders.dll",
"PowerToys.MouseWithoutBorders.exe",
@@ -237,9 +238,7 @@
"PowerToys.DSC.dll",
"PowerToys.DSC.exe",
"PowerToysSparse.msix",
"PowerToys.McpServer.dll",
"PowerToys.McpServer.exe"
"PowerToysSparse.msix"
],
"SigningInfo": {
"Operations": [
@@ -348,6 +347,8 @@
"Testably.Abstractions.FileSystem.Interface.dll",
"WinUI3Apps\\Testably.Abstractions.FileSystem.Interface.dll",
"ColorCode.Core.dll",
"Microsoft.SemanticKernel.Connectors.Ollama.dll",
"OllamaSharp.dll",
"UnitsNet.dll",
"UtfUnknown.dll",

View File

@@ -1,53 +0,0 @@
{
"Version": "1.0.0",
"UseMinimatch": false,
"SignBatches": [
{
"MatchedPath": [
"PowerToysSetupCustomActionsVNext.dll",
"SilentFilesInUseBAFunction.dll",
"PowerToys*Setup-*.exe",
"PowerToys*Setup-*.msi"
],
"SigningInfo": {
"Operations": [
{
"KeyCode": "CP-230012",
"OperationSetCode": "SigntoolSign",
"Parameters": [
{
"parameterName": "OpusName",
"parameterValue": "Microsoft"
},
{
"parameterName": "OpusInfo",
"parameterValue": "http://www.microsoft.com"
},
{
"parameterName": "FileDigest",
"parameterValue": "/fd \"SHA256\""
},
{
"parameterName": "PageHash",
"parameterValue": "/NPH"
},
{
"parameterName": "TimeStamp",
"parameterValue": "/tr \"http://rfc3161.gtm.corp.microsoft.com/TSS/HttpTspServer\" /td sha256"
}
],
"ToolName": "sign",
"ToolVersion": "1.0"
},
{
"KeyCode": "CP-230012",
"OperationSetCode": "SigntoolVerify",
"Parameters": [],
"ToolName": "sign",
"ToolVersion": "1.0"
}
]
}
}
]
}

View File

@@ -65,21 +65,28 @@ if (-not (Test-Path $outputDir)) {
New-Item -Path $outputDir -ItemType Directory -Force | Out-Null
}
Write-Host "DSC manifests will be generated to: '$outputDir'"
# DSC v3 manifests go to DSCModules subfolder
$dscOutputDir = Join-Path $outputDir 'DSCModules'
if (-not (Test-Path $dscOutputDir)) {
Write-Host "Creating DSCModules subfolder at '$dscOutputDir'."
New-Item -Path $dscOutputDir -ItemType Directory -Force | Out-Null
}
Write-Host "Cleaning previously generated DSC manifest files from '$outputDir'."
Get-ChildItem -Path $outputDir -Filter 'microsoft.powertoys.*.settings.dsc.resource.json' -ErrorAction SilentlyContinue | Remove-Item -Force
Write-Host "DSC manifests will be generated to: '$dscOutputDir'"
$arguments = @('manifest', '--resource', 'settings', '--outputDir', $outputDir)
Write-Host "Cleaning previously generated DSC manifest files from '$dscOutputDir'."
Get-ChildItem -Path $dscOutputDir -Filter 'microsoft.powertoys.*.settings.dsc.resource.json' -ErrorAction SilentlyContinue | Remove-Item -Force
$arguments = @('manifest', '--resource', 'settings', '--outputDir', $dscOutputDir)
Write-Host "Invoking DSC manifest generator: '$exePath' $($arguments -join ' ')"
& $exePath @arguments
if ($LASTEXITCODE -ne 0) {
throw "PowerToys.DSC.exe exited with code $LASTEXITCODE"
}
$generatedFiles = Get-ChildItem -Path $outputDir -Filter 'microsoft.powertoys.*.settings.dsc.resource.json' -ErrorAction Stop
$generatedFiles = Get-ChildItem -Path $dscOutputDir -Filter 'microsoft.powertoys.*.settings.dsc.resource.json' -ErrorAction Stop
if ($generatedFiles.Count -eq 0) {
throw "No DSC manifest files were generated in '$outputDir'."
throw "No DSC manifest files were generated in '$dscOutputDir'."
}
Write-Host "Generated $($generatedFiles.Count) DSC manifest file(s):"

View File

@@ -32,7 +32,7 @@ parameters:
- name: enableMsBuildCaching
type: boolean
displayName: "Enable MSBuild Caching"
default: true
default: false
- name: runTests
type: boolean
displayName: "Run Tests"

View File

@@ -52,8 +52,6 @@ extends:
name: SHINE-INT-S
${{ if eq(parameters.useVSPreview, true) }}:
demands: ImageOverride -equals SHINE-VS17-Preview
${{ else }}:
image: SHINE-VS17-Latest
os: windows
sdl:
tsa:
@@ -73,10 +71,10 @@ extends:
parameters:
pool:
name: SHINE-INT-L
${{ if eq(parameters.useVSPreview, true) }}:
demands: ImageOverride -equals SHINE-VS17-Preview
${{ else }}:
image: SHINE-VS17-Latest
demands:
# Our INT agents have a large disk mounted at P:\
- ${{ if eq(parameters.useVSPreview, true) }}:
- ImageOverride -equals SHINE-VS17-Preview
os: windows
variables:
IsPipeline: 1 # The installer uses this to detect whether it should pick up localizations
@@ -125,7 +123,6 @@ extends:
parameters:
pool:
name: SHINE-INT-L
image: SHINE-VS17-Latest
os: windows
official: true
codeSign: true

View File

@@ -111,6 +111,7 @@ jobs:
${{ else }}:
OutputBuildPlatform: ${{ platform }}
variables:
NUGET_PACKAGES: 'C:\NuGetPackages' # Some of our build steps cache these here... and it was apparently part of the global environment
MakeAppxPath: 'C:\Program Files (x86)\Windows Kits\10\bin\10.0.26100.0\x86\MakeAppx.exe'
# Azure DevOps abhors a vacuum
# If these are blank, expansion will fail later on... which will result in direct substitution of the variable *names*
@@ -139,6 +140,10 @@ jobs:
- output: pipelineArtifact
artifactName: $(JobOutputArtifactName)
targetPath: $(Build.ArtifactStagingDirectory)
- output: pipelineArtifact
artifactName: $(JobOutputArtifactName)-failure-$(System.JobAttempt)
targetPath: $(LogOutputDirectory)
condition: or(failed(), canceled())
steps:
- checkout: self
clean: true
@@ -266,6 +271,26 @@ jobs:
env:
SYSTEM_ACCESSTOKEN: $(System.AccessToken)
- task: VSBuild@1
displayName: Generate DSC artifacts for ARM64
condition: and(succeeded(), eq(variables['BuildPlatform'], 'arm64'))
inputs:
solution: PowerToys.sln
vsVersion: 17.0
msbuildArgs: >-
-restore
/p:Configuration=$(BuildConfiguration)
/p:Platform=x64
/t:DSC\PowerToys_Settings_DSC_Schema_Generator
/bl:$(LogOutputDirectory)\build-dsc-generator.binlog
${{ parameters.additionalBuildOptions }}
$(MSBuildCacheParameters)
$(RestoreAdditionalProjectSourcesArg)
platform: x64
configuration: $(BuildConfiguration)
msbuildArchitecture: x64
maximumCpuCount: true
# Build PowerToys.DSC.exe for ARM64 (x64 uses existing binary from previous build)
- task: VSBuild@1
displayName: Build PowerToys.DSC.exe (x64 for generating manifests)
@@ -375,7 +400,7 @@ jobs:
### HACK: On ARM64 builds, building an app with Windows App SDK copies the x64 WebView2 dll instead of the ARM64 one. This task makes sure the right dll is used.
- task: CopyFiles@2
displayName: HACK Copy core WebView2 ARM64 dll to output directory
condition: eq(variables['BuildPlatform'],'arm64')
condition: and(succeeded(), eq(variables['BuildPlatform'], 'arm64'))
inputs:
contents: packages/Microsoft.Web.WebView2.1.0.2903.40/runtimes/win-ARM64/native_uap/Microsoft.Web.WebView2.Core.dll
targetFolder: $(Build.SourcesDirectory)/ARM64/Release/WinUI3Apps/
@@ -414,11 +439,11 @@ jobs:
inputs:
testResultsFormat: VSTest
testResultsFiles: '**/*.trx'
condition: ne(variables['BuildPlatform'],'arm64')
condition: and(succeeded(), ne(variables['BuildPlatform'], 'arm64'))
# Native dlls
- task: VSTest@2
condition: ne(variables['BuildPlatform'],'arm64') # No arm64 agents to run the tests.
condition: and(succeeded(), ne(variables['BuildPlatform'], 'arm64')) # No arm64 agents to run the tests.
displayName: 'Native Tests'
inputs:
platform: '$(BuildPlatform)'
@@ -512,14 +537,6 @@ jobs:
versionNumber: ${{ parameters.versionNumber }}
additionalBuildOptions: ${{ parameters.additionalBuildOptions }}
- template: steps-build-installer-vnext.yml
parameters:
codeSign: ${{ parameters.codeSign }}
signingIdentity: ${{ parameters.signingIdentity }}
versionNumber: ${{ parameters.versionNumber }}
additionalBuildOptions: ${{ parameters.additionalBuildOptions }}
buildUserInstaller: true # NOTE: This is the distinction between the above and below rules
# This saves ~1GiB per architecture. We won't need these later.
# Removes:
# - All .pdb files from any static libs .libs (which were only used during linking)

View File

@@ -2,9 +2,6 @@ parameters:
- name: versionNumber
type: string
default: "0.0.1"
- name: buildUserInstaller
type: boolean
default: false
- name: codeSign
type: boolean
default: false
@@ -25,43 +22,26 @@ steps:
arguments: 'install --global wix --version 5.0.2'
- pwsh: |-
& git clean -xfd -e *exe -- .\installer\
displayName: ${{replace(replace(parameters.buildUserInstaller,'True','👤'),'False','💻')}} Clean installer to reduce cross-contamination
- pwsh: |-
# Determine whether this is a per-user build
$IsPerUser = $${{ parameters.buildUserInstaller }}
# Build slug used to locate the artifacts
$InstallerBuildSlug = if ($IsPerUser) { 'UserSetup' } else { 'MachineSetup' }
# VNext bundle folder; base name intentionally omits the VNext suffix
$InstallerFolder = 'PowerToysSetupVNext'
if ($IsPerUser) {
$InstallerBasename = "PowerToysUserSetup-${{ parameters.versionNumber }}-$(BuildPlatform)"
}
else {
$InstallerBasename = "PowerToysSetup-${{ parameters.versionNumber }}-$(BuildPlatform)"
}
# Export variables for downstream steps
Write-Host "##vso[task.setvariable variable=InstallerBuildSlug]$InstallerBuildSlug"
Write-Host "##vso[task.setvariable variable=InstallerRelativePath]$(BuildPlatform)\$(BuildConfiguration)\$InstallerBuildSlug"
Write-Host "##vso[task.setvariable variable=InstallerBasename]$InstallerBasename"
Write-Host "##vso[task.setvariable variable=InstallerFolder]$InstallerFolder"
displayName: ${{replace(replace(parameters.buildUserInstaller,'True','👤'),'False','💻')}} Prepare Installer variables
Write-Host "##vso[task.setvariable variable=InstallerMachineRoot]installer\PowerToysSetupVNext\$(BuildPlatform)\$(BuildConfiguration)\MachineSetup"
Write-Host "##vso[task.setvariable variable=InstallerUserRoot]installer\PowerToysSetupVNext\$(BuildPlatform)\$(BuildConfiguration)\UserSetup"
Write-Host "##vso[task.setvariable variable=InstallerMachineBasename]PowerToysSetup-${{ parameters.versionNumber }}-$(BuildPlatform)"
Write-Host "##vso[task.setvariable variable=InstallerUserBasename]PowerToysUserSetup-${{ parameters.versionNumber }}-$(BuildPlatform)"
displayName: Prepare Installer variables
# This dll needs to be built and signed before building the MSI.
# The Custom Actions project contains a pre-build event that prepares the .wxs files
# by filling them out with all our components. We pass RunBuildEvents=true to force
# that logic to run.
- task: VSBuild@1
displayName: ${{replace(replace(parameters.buildUserInstaller,'True','👤'),'False','💻')}} Build PowerToysSetupCustomActionsVNext
displayName: Build Shared Support DLLs
inputs:
solution: "**/installer/PowerToysSetup.sln"
vsVersion: 17.0
msbuildArgs: >-
/t:PowerToysSetupCustomActionsVNext
/p:RunBuildEvents=true;PerUser=${{parameters.buildUserInstaller}};RestorePackagesConfig=true;CIBuild=true
/t:PowerToysSetupCustomActionsVNext;SilentFilesInUseBAFunction
/p:RunBuildEvents=true;RestorePackagesConfig=true;CIBuild=true
-restore -graph
/bl:$(LogOutputDirectory)\installer-$(InstallerBuildSlug)-actions.binlog
/bl:$(LogOutputDirectory)\installer-actions.binlog
${{ parameters.additionalBuildOptions }}
platform: $(BuildPlatform)
configuration: $(BuildConfiguration)
@@ -70,28 +50,53 @@ steps:
maximumCpuCount: true
- ${{ if eq(parameters.codeSign, true) }}:
- template: steps-esrp-signing.yml
- template: steps-esrp-sign-files-authenticode.yml
parameters:
displayName: ${{replace(replace(parameters.buildUserInstaller,'True','👤'),'False','💻')}} Sign PowerToysSetupCustomActionsVNext
displayName: Sign Shared Support DLLs
signingIdentity: ${{ parameters.signingIdentity }}
inputs:
FolderPath: 'installer/PowerToysSetupCustomActionsVNext/$(InstallerRelativePath)'
signType: batchSigning
batchSignPolicyFile: '$(build.sourcesdirectory)\.pipelines\ESRPSigning_installer.json'
ciPolicyFile: '$(build.sourcesdirectory)\.pipelines\CIPolicy.xml'
folder: 'installer'
pattern: |-
**/PowerToysSetupCustomActionsVNext.dll
**/SilentFilesInUseBAFunction.dll
## INSTALLER START
#### MSI BUILDING AND SIGNING
#
# The MSI build contains code that reverts the .wxs files to their in-tree versions.
# This is only supposed to happen during local builds. Since this build system is
# supposed to run side by side--machine and then user--we do NOT want to destroy
# the .wxs files. Therefore, we pass RunBuildEvents=false to suppress all of that
# logic.
#
# We pass BuildProjectReferences=false so that it does not recompile the DLLs we just built.
# We only pass -restore on the first one because the second run should already have all
# of the dependencies.
- task: VSBuild@1
displayName: ${{replace(replace(parameters.buildUserInstaller,'True','👤'),'False','💻')}} Build VNext MSI
displayName: 💻 Build VNext MSI
inputs:
solution: "**/installer/PowerToysSetup.sln"
vsVersion: 17.0
msbuildArgs: >-
-restore
/t:PowerToysInstallerVNext
/p:RunBuildEvents=false;PerUser=${{parameters.buildUserInstaller}};BuildProjectReferences=false;CIBuild=true
/bl:$(LogOutputDirectory)\installer-$(InstallerBuildSlug)-msi.binlog
/p:RunBuildEvents=false;PerUser=false;BuildProjectReferences=false;CIBuild=true
/bl:$(LogOutputDirectory)\installer-machine-msi.binlog
${{ parameters.additionalBuildOptions }}
platform: $(BuildPlatform)
configuration: $(BuildConfiguration)
clean: false # don't undo our hard work above by deleting the CustomActions dll
msbuildArchitecture: x64
maximumCpuCount: true
- task: VSBuild@1
displayName: 👤 Build VNext MSI
inputs:
solution: "**/installer/PowerToysSetup.sln"
vsVersion: 17.0
msbuildArgs: >-
/t:PowerToysInstallerVNext
/p:RunBuildEvents=false;PerUser=true;BuildProjectReferences=false;CIBuild=true
/bl:$(LogOutputDirectory)\installer-user-msi.binlog
${{ parameters.additionalBuildOptions }}
platform: $(BuildPlatform)
configuration: $(BuildConfiguration)
@@ -100,77 +105,66 @@ steps:
maximumCpuCount: true
- script: |-
wix msi decompile installer\$(InstallerFolder)\$(InstallerRelativePath)\$(InstallerBasename).msi -x $(build.sourcesdirectory)\extractedMsi
dir $(build.sourcesdirectory)\extractedMsi
displayName: "${{replace(replace(parameters.buildUserInstaller,'True','👤'),'False','💻')}} WiX5: Extract and verify MSI"
wix msi decompile $(InstallerMachineRoot)\$(InstallerMachineBasename).msi -x $(build.sourcesdirectory)\extractedMachineMsi
wix msi decompile $(InstallerUserRoot)\$(InstallerUserBasename).msi -x $(build.sourcesdirectory)\extractedUserMsi
dir $(build.sourcesdirectory)\extractedMachineMsi
dir $(build.sourcesdirectory)\extractedUserMsi
displayName: "WiX5: Extract and verify MSIs"
# Check if deps.json files don't reference different dll versions.
- pwsh: |-
& '.pipelines/verifyDepsJsonLibraryVersions.ps1' -targetDir '$(build.sourcesdirectory)\extractedMsi\File'
displayName: ${{replace(replace(parameters.buildUserInstaller,'True','👤'),'False','💻')}} Audit deps.json in MSI extracted files
& '.pipelines/verifyDepsJsonLibraryVersions.ps1' -targetDir '$(build.sourcesdirectory)\extractedMachineMsi\File'
& '.pipelines/verifyDepsJsonLibraryVersions.ps1' -targetDir '$(build.sourcesdirectory)\extractedUserMsi\File'
displayName: Audit deps.json in MSI extracted files
- ${{ if eq(parameters.codeSign, true) }}:
- pwsh: |-
& .pipelines/versionAndSignCheck.ps1 -targetDir '$(build.sourcesdirectory)\extractedMsi\File'
& .pipelines/versionAndSignCheck.ps1 -targetDir '$(build.sourcesdirectory)\extractedMsi\Binary'
git clean -xfd ./extractedMsi
displayName: ${{replace(replace(parameters.buildUserInstaller,'True','👤'),'False','💻')}} Verify all binaries are signed and versioned
& .pipelines/versionAndSignCheck.ps1 -targetDir '$(build.sourcesdirectory)\extractedMachineMsi\File'
& .pipelines/versionAndSignCheck.ps1 -targetDir '$(build.sourcesdirectory)\extractedMachineMsi\Binary'
& .pipelines/versionAndSignCheck.ps1 -targetDir '$(build.sourcesdirectory)\extractedUserMsi\File'
& .pipelines/versionAndSignCheck.ps1 -targetDir '$(build.sourcesdirectory)\extractedUserMsi\Binary'
git clean -xfd ./extractedMachineMsi ./extractedUserMsi
displayName: Verify all binaries are signed and versioned
- template: steps-esrp-signing.yml
- template: steps-esrp-sign-files-authenticode.yml
parameters:
displayName: ${{replace(replace(parameters.buildUserInstaller,'True','👤'),'False','💻')}} Sign VNext MSI
displayName: Sign VNext MSIs
signingIdentity: ${{ parameters.signingIdentity }}
inputs:
FolderPath: 'installer/$(InstallerFolder)/$(InstallerRelativePath)'
signType: batchSigning
batchSignPolicyFile: '$(build.sourcesdirectory)\.pipelines\ESRPSigning_installer.json'
ciPolicyFile: '$(build.sourcesdirectory)\.pipelines\CIPolicy.xml'
folder: 'installer'
pattern: '**/PowerToys*Setup-*.msi'
#### END MSI
#### BUILDING AND SIGNING SilentFilesInUseBAFunction DLL
- task: VSBuild@1
displayName: ${{replace(replace(parameters.buildUserInstaller,'True','👤'),'False','💻')}} Build SilentFilesInUseBAFunction
inputs:
solution: "**/installer/PowerToysSetup.sln"
vsVersion: 17.0
msbuildArgs: >-
/t:SilentFilesInUseBAFunction
/p:RunBuildEvents=true;PerUser=${{parameters.buildUserInstaller}};RestorePackagesConfig=true;CIBuild=true
-restore -graph
/bl:$(LogOutputDirectory)\installer-$(InstallerBuildSlug)-SilentFilesInUseBAFunction.binlog
${{ parameters.additionalBuildOptions }}
platform: $(BuildPlatform)
configuration: $(BuildConfiguration)
clean: false # don't undo our hard work above by deleting the msi
msbuildArchitecture: x64
maximumCpuCount: true
- ${{ if eq(parameters.codeSign, true) }}:
- template: steps-esrp-signing.yml
parameters:
displayName: ${{replace(replace(parameters.buildUserInstaller,'True','👤'),'False','💻')}} Sign SilentFilesInUseBAFunction
signingIdentity: ${{ parameters.signingIdentity }}
inputs:
FolderPath: 'installer/$(BuildPlatform)/$(BuildConfiguration)'
signType: batchSigning
batchSignPolicyFile: '$(build.sourcesdirectory)\.pipelines\ESRPSigning_installer.json'
ciPolicyFile: '$(build.sourcesdirectory)\.pipelines\CIPolicy.xml'
#### END BUILDING AND SIGNING SilentFilesInUseBAFunction DLL
#### BOOTSTRAP BUILDING AND SIGNING
# We pass BuildProjectReferences=false so that it does not recompile the DLLs we just built.
# We only pass -restore on the first one because the second run should already have all
# of the dependencies.
- task: VSBuild@1
displayName: ${{replace(replace(parameters.buildUserInstaller,'True','👤'),'False','💻')}} Build VNext Bootstrapper
displayName: 💻 Build VNext Bootstrapper
inputs:
solution: "**/installer/PowerToysSetup.sln"
vsVersion: 17.0
msbuildArgs: >-
-restore
/t:PowerToysBootstrapperVNext
/p:PerUser=${{parameters.buildUserInstaller}};CIBuild=true
/bl:$(LogOutputDirectory)\installer-$(InstallerBuildSlug)-bootstrapper.binlog
-restore -graph
/p:PerUser=false;BuildProjectReferences=false;CIBuild=true
/bl:$(LogOutputDirectory)\installer-machine-bootstrapper.binlog
${{ parameters.additionalBuildOptions }}
platform: $(BuildPlatform)
configuration: $(BuildConfiguration)
clean: false # don't undo our hard work above by deleting the MSI nor SilentFilesInUseBAFunction
msbuildArchitecture: x64
maximumCpuCount: true
- task: VSBuild@1
displayName: 👤 Build VNext Bootstrapper
inputs:
solution: "**/installer/PowerToysSetup.sln"
vsVersion: 17.0
msbuildArgs: >-
/t:PowerToysBootstrapperVNext
/p:PerUser=true;BuildProjectReferences=false;CIBuild=true
/bl:$(LogOutputDirectory)\installer-user-bootstrapper.binlog
${{ parameters.additionalBuildOptions }}
platform: $(BuildPlatform)
configuration: $(BuildConfiguration)
@@ -181,54 +175,41 @@ steps:
# The entirety of bundle unpacking/re-packing is unnecessary if we are not code signing it.
- ${{ if eq(parameters.codeSign, true) }}:
- script: |-
wix burn detach installer\$(InstallerFolder)\$(InstallerRelativePath)\$(InstallerBasename).exe -engine installer\engine.exe
displayName: "${{replace(replace(parameters.buildUserInstaller,'True','👤'),'False','💻')}} WiX5: Extract Engine from Bundle"
wix burn detach $(InstallerMachineRoot)\$(InstallerMachineBasename).exe -engine installer\machine-engine.exe
wix burn detach $(InstallerUserRoot)\$(InstallerUserBasename).exe -engine installer\user-engine.exe
displayName: "WiX5: Extract Engines from Bundles"
- template: steps-esrp-signing.yml
- template: steps-esrp-sign-files-authenticode.yml
parameters:
displayName: ${{replace(replace(parameters.buildUserInstaller,'True','👤'),'False','💻')}} Sign WiX Engine
displayName: Sign WiX Engines
signingIdentity: ${{ parameters.signingIdentity }}
inputs:
FolderPath: "installer"
Pattern: engine.exe
signConfigType: inlineSignParams
inlineOperation: |
[
{
"KeyCode": "CP-230012",
"OperationCode": "SigntoolSign",
"Parameters": {
"OpusName": "Microsoft",
"OpusInfo": "http://www.microsoft.com",
"FileDigest": "/fd \"SHA256\"",
"PageHash": "/NPH",
"TimeStamp": "/tr \"http://rfc3161.gtm.corp.microsoft.com/TSS/HttpTspServer\" /td sha256"
},
"ToolName": "sign",
"ToolVersion": "1.0"
},
{
"KeyCode": "CP-230012",
"OperationCode": "SigntoolVerify",
"Parameters": {},
"ToolName": "sign",
"ToolVersion": "1.0"
}
]
folder: "installer"
pattern: '*-engine.exe'
- script: |-
wix burn reattach installer\$(InstallerFolder)\$(InstallerRelativePath)\$(InstallerBasename).exe -engine installer\engine.exe -o installer\$(InstallerFolder)\$(InstallerRelativePath)\$(InstallerBasename).exe
displayName: "${{replace(replace(parameters.buildUserInstaller,'True','👤'),'False','💻')}} WiX5: Reattach Engine to Bundle"
wix burn reattach $(InstallerMachineRoot)\$(InstallerMachineBasename).exe -engine installer\machine-engine.exe -o $(InstallerMachineRoot)\$(InstallerMachineBasename).exe
wix burn reattach $(InstallerUserRoot)\$(InstallerUserBasename).exe -engine installer\user-engine.exe -o $(InstallerUserRoot)\$(InstallerUserBasename).exe
displayName: "WiX5: Reattach Engines to Bundles"
- template: steps-esrp-signing.yml
- pwsh: |-
& wix burn extract -oba installer\ba\m "$(InstallerMachineRoot)\$(InstallerMachineBasename).exe"
& wix burn extract -oba installer\ba\u "$(InstallerUserRoot)\$(InstallerUserBasename).exe"
Get-ChildItem installer\ba -Recurse -Include *.exe,*.dll | Get-AuthenticodeSignature | ForEach-Object {
If ($_.Status -Ne "Valid") {
Write-Error $_.StatusMessage
} Else {
Write-Host $_.StatusMessage
}
}
& git clean -fdx installer\ba
displayName: "WiX5: Verify Bootstrapper content is signed"
- template: steps-esrp-sign-files-authenticode.yml
parameters:
displayName: ${{replace(replace(parameters.buildUserInstaller,'True','👤'),'False','💻')}} Sign Final Bootstrapper
displayName: Sign Final Bootstrappers
signingIdentity: ${{ parameters.signingIdentity }}
inputs:
FolderPath: 'installer/$(InstallerFolder)/$(InstallerRelativePath)'
signType: batchSigning
batchSignPolicyFile: '$(build.sourcesdirectory)\.pipelines\ESRPSigning_installer.json'
ciPolicyFile: '$(build.sourcesdirectory)\.pipelines\CIPolicy.xml'
folder: 'installer'
pattern: '**/PowerToys*Setup-*.exe'
#### END BOOTSTRAP
## END INSTALLER

View File

@@ -0,0 +1,45 @@
parameters:
- name: displayName
type: string
default: Sign Specific Files
- name: folder
type: string
- name: pattern
type: string
- name: signingIdentity
type: object
default: {}
steps:
- template: steps-esrp-signing.yml
parameters:
displayName: ${{ parameters.displayName }}
signingIdentity: ${{ parameters.signingIdentity }}
inputs:
FolderPath: ${{ parameters.folder }}
Pattern: ${{ parameters.pattern }}
UseMinimatch: true
signConfigType: inlineSignParams
inlineOperation: |-
[
{
"KeyCode": "CP-230012",
"OperationCode": "SigntoolSign",
"Parameters": {
"OpusName": "Microsoft",
"OpusInfo": "http://www.microsoft.com",
"FileDigest": "/fd \"SHA256\"",
"PageHash": "/NPH",
"TimeStamp": "/tr \"http://rfc3161.gtm.corp.microsoft.com/TSS/HttpTspServer\" /td sha256"
},
"ToolName": "sign",
"ToolVersion": "1.0"
},
{
"KeyCode": "CP-230012",
"OperationCode": "SigntoolVerify",
"Parameters": {},
"ToolName": "sign",
"ToolVersion": "1.0"
}
]

13
.vscode/launch.json vendored
View File

@@ -38,6 +38,17 @@
"env": {},
"console": "internalConsole",
"stopAtEntry": false
}
},
{
"name": "Run AdvancedPaste (managed, no build, ARCH configurable)",
"type": "coreclr",
"request": "launch",
"program": "${workspaceFolder}\\${input:arch}\\Debug\\WinUI3Apps\\PowerToys.AdvancedPaste.exe",
"args": [],
"cwd": "${workspaceFolder}",
"env": {},
"console": "internalConsole",
"stopAtEntry": false
},
]
}

View File

@@ -34,32 +34,33 @@
<!-- Including MessagePack to force version, since it's used by StreamJsonRpc but contains vulnerabilities. After StreamJsonRpc updates the version of MessagePack, we can upgrade StreamJsonRpc instead. -->
<PackageVersion Include="MessagePack" Version="3.1.3" />
<PackageVersion Include="Microsoft.CodeAnalysis.NetAnalyzers" Version="9.0.0" />
<PackageVersion Include="Microsoft.Data.Sqlite" Version="9.0.8" />
<PackageVersion Include="Microsoft.Data.Sqlite" Version="9.0.10" />
<!-- Including Microsoft.Bcl.AsyncInterfaces to force version, since it's used by Microsoft.SemanticKernel. -->
<PackageVersion Include="Microsoft.Bcl.AsyncInterfaces" Version="9.0.8" />
<PackageVersion Include="Microsoft.Bcl.AsyncInterfaces" Version="9.0.10" />
<PackageVersion Include="Microsoft.Windows.CppWinRT" Version="2.0.240111.5" />
<PackageVersion Include="Microsoft.Diagnostics.Tracing.TraceEvent" Version="3.1.16" />
<PackageVersion Include="Microsoft.Extensions.AI" Version="9.9.1" />
<PackageVersion Include="Microsoft.Extensions.AI.OpenAI" Version="9.9.1-preview.1.25474.6" />
<PackageVersion Include="Microsoft.Extensions.DependencyInjection" Version="9.0.9" />
<PackageVersion Include="Microsoft.Extensions.Logging" Version="9.0.9" />
<PackageVersion Include="Microsoft.Extensions.Logging.Abstractions" Version="9.0.9" />
<PackageVersion Include="Microsoft.Extensions.Hosting" Version="9.0.8" />
<PackageVersion Include="Microsoft.Extensions.Hosting.WindowsServices" Version="9.0.8" />
<PackageVersion Include="Microsoft.Extensions.Caching.Abstractions" Version="9.0.10" />
<PackageVersion Include="Microsoft.Extensions.Caching.Memory" Version="9.0.10" />
<PackageVersion Include="Microsoft.Extensions.DependencyInjection" Version="9.0.10" />
<PackageVersion Include="Microsoft.Extensions.Logging" Version="9.0.10" />
<PackageVersion Include="Microsoft.Extensions.Logging.Abstractions" Version="9.0.10" />
<PackageVersion Include="Microsoft.Extensions.Hosting" Version="9.0.10" />
<PackageVersion Include="Microsoft.Extensions.Hosting.WindowsServices" Version="9.0.10" />
<PackageVersion Include="Microsoft.AI.Foundry.Local" Version="0.3.0" />
<PackageVersion Include="Microsoft.SemanticKernel" Version="1.66.0" />
<PackageVersion Include="Microsoft.SemanticKernel.Connectors.OpenAI" Version="1.66.0" />
<PackageVersion Include="Microsoft.SemanticKernel.Connectors.Amazon" Version="1.66.0-alpha" />
<PackageVersion Include="Microsoft.SemanticKernel.Connectors.AzureAIInference" Version="1.66.0-beta" />
<PackageVersion Include="Microsoft.SemanticKernel.Connectors.Google" Version="1.66.0-alpha" />
<PackageVersion Include="Microsoft.SemanticKernel.Connectors.HuggingFace" Version="1.66.0-preview" />
<PackageVersion Include="Microsoft.SemanticKernel.Connectors.MistralAI" Version="1.66.0-alpha" />
<PackageVersion Include="Microsoft.SemanticKernel.Connectors.Ollama" Version="1.66.0-alpha" />
<PackageVersion Include="Microsoft.Toolkit.Uwp.Notifications" Version="7.1.2" />
<PackageVersion Include="Microsoft.Web.WebView2" Version="1.0.3179.45" />
<!-- Package Microsoft.Win32.SystemEvents added as a hack for being able to exclude the runtime assets so they don't conflict with 8.0.1. This is a dependency of System.Drawing.Common but the 8.0.1 version wasn't published to nuget. -->
<PackageVersion Include="Microsoft.Win32.SystemEvents" Version="9.0.8" />
<PackageVersion Include="Microsoft.Win32.SystemEvents" Version="9.0.10" />
<PackageVersion Include="Microsoft.WindowsPackageManager.ComInterop" Version="1.10.340" />
<PackageVersion Include="Microsoft.Windows.Compatibility" Version="9.0.8" />
<PackageVersion Include="Microsoft.Windows.Compatibility" Version="9.0.10" />
<PackageVersion Include="Microsoft.Windows.CsWin32" Version="0.3.183" />
<!-- CsWinRT version needs to be set to have a WinRT.Runtime.dll at the same version contained inside the NET SDK we're currently building on CI. -->
<!--
@@ -73,7 +74,6 @@
<PackageVersion Include="Microsoft.WindowsAppSDK.Runtime" Version="1.8.250907003" />
<PackageVersion Include="Microsoft.Xaml.Behaviors.WinUI.Managed" Version="2.0.9" />
<PackageVersion Include="Microsoft.Xaml.Behaviors.Wpf" Version="1.1.39" />
<PackageVersion Include="ModelContextProtocol" Version="0.4.0-preview.2" />
<PackageVersion Include="ModernWpfUI" Version="0.9.4" />
<!-- Moq to stay below v4.20 due to behavior change. need to be sure fixed -->
<PackageVersion Include="Moq" Version="4.18.4" />
@@ -93,29 +93,29 @@
<PackageVersion Include="StreamJsonRpc" Version="2.21.69" />
<PackageVersion Include="StyleCop.Analyzers" Version="1.2.0-beta.556" />
<!-- Package System.CodeDom added as a hack for being able to exclude the runtime assets so they don't conflict with 8.0.1. This is a dependency of System.Management but the 8.0.1 version wasn't published to nuget. -->
<PackageVersion Include="System.CodeDom" Version="9.0.8" />
<PackageVersion Include="System.CodeDom" Version="9.0.10" />
<PackageVersion Include="System.CommandLine" Version="2.0.0-beta4.22272.1" />
<PackageVersion Include="System.ComponentModel.Composition" Version="9.0.8" />
<PackageVersion Include="System.Configuration.ConfigurationManager" Version="9.0.8" />
<PackageVersion Include="System.Data.OleDb" Version="9.0.8" />
<PackageVersion Include="System.ComponentModel.Composition" Version="9.0.10" />
<PackageVersion Include="System.Configuration.ConfigurationManager" Version="9.0.10" />
<PackageVersion Include="System.Data.OleDb" Version="9.0.10" />
<!-- Package System.Data.SqlClient added to force it as a dependency of Microsoft.Windows.Compatibility to the latest version available at this time. -->
<PackageVersion Include="System.Data.SqlClient" Version="4.9.0" />
<!-- Package System.Diagnostics.EventLog added as a hack for being able to exclude the runtime assets so they don't conflict with 8.0.1. This is a dependency of System.Data.OleDb but the 8.0.1 version wasn't published to nuget. -->
<PackageVersion Include="System.Diagnostics.EventLog" Version="9.0.8" />
<PackageVersion Include="System.Diagnostics.EventLog" Version="9.0.10" />
<!-- Package System.Diagnostics.PerformanceCounter added as a hack for being able to exclude the runtime assets so they don't conflict with 8.0.11. -->
<PackageVersion Include="System.Diagnostics.PerformanceCounter" Version="9.0.8" />
<PackageVersion Include="System.ClientModel" Version="1.7.0" />
<PackageVersion Include="System.Drawing.Common" Version="9.0.8" />
<PackageVersion Include="System.Diagnostics.PerformanceCounter" Version="9.0.10" />
<PackageVersion Include="System.ClientModel" Version="1.7.0" />
<PackageVersion Include="System.Drawing.Common" Version="9.0.10" />
<PackageVersion Include="System.IO.Abstractions" Version="22.0.13" />
<PackageVersion Include="System.IO.Abstractions.TestingHelpers" Version="22.0.13" />
<PackageVersion Include="System.Management" Version="9.0.8" />
<PackageVersion Include="System.Management" Version="9.0.10" />
<PackageVersion Include="System.Net.Http" Version="4.3.4" />
<PackageVersion Include="System.Private.Uri" Version="4.3.2" />
<PackageVersion Include="System.Reactive" Version="6.0.1" />
<PackageVersion Include="System.Runtime.Caching" Version="9.0.8" />
<PackageVersion Include="System.ServiceProcess.ServiceController" Version="9.0.8" />
<PackageVersion Include="System.Text.Encoding.CodePages" Version="9.0.8" />
<PackageVersion Include="System.Text.Json" Version="9.0.8" />
<PackageVersion Include="System.Runtime.Caching" Version="9.0.10" />
<PackageVersion Include="System.ServiceProcess.ServiceController" Version="9.0.10" />
<PackageVersion Include="System.Text.Encoding.CodePages" Version="9.0.10" />
<PackageVersion Include="System.Text.Json" Version="9.0.10" />
<PackageVersion Include="System.Text.RegularExpressions" Version="4.3.1" />
<PackageVersion Include="UnicodeInformation" Version="2.6.0" />
<PackageVersion Include="UnitsNet" Version="5.56.0" />
@@ -137,4 +137,4 @@
<PackageVersion Include="Microsoft.VariantAssignment.Client" Version="2.4.17140001" />
<PackageVersion Include="Microsoft.VariantAssignment.Contract" Version="3.0.16990001" />
</ItemGroup>
</Project>
</Project>

View File

@@ -330,8 +330,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "AwakeModuleInterface", "src
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Awake", "src\modules\awake\Awake\Awake.csproj", "{D940E07F-532C-4FF3-883F-790DA014F19A}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "PowerToys.McpServer", "src\McpServer\PowerToys.McpServer.csproj", "{8A6F5D3B-F59E-4F34-A1D3-3F69D3FDBD9D}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Community.PowerToys.Run.Plugin.UnitConverter", "src\modules\launcher\Plugins\Community.PowerToys.Run.Plugin.UnitConverter\Community.PowerToys.Run.Plugin.UnitConverter.csproj", "{BB23A474-5058-4F75-8FA3-5FE3DE53CDF4}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Community.PowerToys.Run.Plugin.UnitConverter.UnitTest", "src\modules\launcher\Plugins\Community.PowerToys.Run.Plugin.UnitConverter.UnitTest\Community.PowerToys.Run.Plugin.UnitConverter.UnitTest.csproj", "{3E424AD2-19E5-4AE6-B833-F53963EB5FC1}"
@@ -824,6 +822,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.CmdPal.Ext.WebSea
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.CmdPal.Ext.Shell.UnitTests", "src\modules\cmdpal\Tests\Microsoft.CmdPal.Ext.Shell.UnitTests\Microsoft.CmdPal.Ext.Shell.UnitTests.csproj", "{E816D7B4-4688-4ECB-97CC-3D8E798F3833}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CursorWrap", "src\modules\MouseUtils\CursorWrap\CursorWrap.vcxproj", "{48A1DB8C-5DF8-4FB3-9E14-2B67F3F2D8B5}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tests", "Tests", "{3DCCD936-D085-4869-A1DE-CA6A64152C94}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LightSwitch.UITests", "src\modules\LightSwitch\Tests\LightSwitch.UITests\LightSwitch.UITests.csproj", "{F5333ED7-06D8-4AB3-953A-36D63F08CB6F}"
@@ -1458,14 +1458,6 @@ Global
{D940E07F-532C-4FF3-883F-790DA014F19A}.Release|ARM64.Build.0 = Release|ARM64
{D940E07F-532C-4FF3-883F-790DA014F19A}.Release|x64.ActiveCfg = Release|x64
{D940E07F-532C-4FF3-883F-790DA014F19A}.Release|x64.Build.0 = Release|x64
{8A6F5D3B-F59E-4F34-A1D3-3F69D3FDBD9D}.Debug|ARM64.ActiveCfg = Debug|ARM64
{8A6F5D3B-F59E-4F34-A1D3-3F69D3FDBD9D}.Debug|ARM64.Build.0 = Debug|ARM64
{8A6F5D3B-F59E-4F34-A1D3-3F69D3FDBD9D}.Debug|x64.ActiveCfg = Debug|x64
{8A6F5D3B-F59E-4F34-A1D3-3F69D3FDBD9D}.Debug|x64.Build.0 = Debug|x64
{8A6F5D3B-F59E-4F34-A1D3-3F69D3FDBD9D}.Release|ARM64.ActiveCfg = Release|ARM64
{8A6F5D3B-F59E-4F34-A1D3-3F69D3FDBD9D}.Release|ARM64.Build.0 = Release|ARM64
{8A6F5D3B-F59E-4F34-A1D3-3F69D3FDBD9D}.Release|x64.ActiveCfg = Release|x64
{8A6F5D3B-F59E-4F34-A1D3-3F69D3FDBD9D}.Release|x64.Build.0 = Release|x64
{BB23A474-5058-4F75-8FA3-5FE3DE53CDF4}.Debug|ARM64.ActiveCfg = Debug|ARM64
{BB23A474-5058-4F75-8FA3-5FE3DE53CDF4}.Debug|ARM64.Build.0 = Debug|ARM64
{BB23A474-5058-4F75-8FA3-5FE3DE53CDF4}.Debug|x64.ActiveCfg = Debug|x64
@@ -3000,6 +2992,14 @@ Global
{E816D7B4-4688-4ECB-97CC-3D8E798F3833}.Release|ARM64.Build.0 = Release|ARM64
{E816D7B4-4688-4ECB-97CC-3D8E798F3833}.Release|x64.ActiveCfg = Release|x64
{E816D7B4-4688-4ECB-97CC-3D8E798F3833}.Release|x64.Build.0 = Release|x64
{48A1DB8C-5DF8-4FB3-9E14-2B67F3F2D8B5}.Debug|ARM64.ActiveCfg = Debug|ARM64
{48A1DB8C-5DF8-4FB3-9E14-2B67F3F2D8B5}.Debug|ARM64.Build.0 = Debug|ARM64
{48A1DB8C-5DF8-4FB3-9E14-2B67F3F2D8B5}.Debug|x64.ActiveCfg = Debug|x64
{48A1DB8C-5DF8-4FB3-9E14-2B67F3F2D8B5}.Debug|x64.Build.0 = Debug|x64
{48A1DB8C-5DF8-4FB3-9E14-2B67F3F2D8B5}.Release|ARM64.ActiveCfg = Release|ARM64
{48A1DB8C-5DF8-4FB3-9E14-2B67F3F2D8B5}.Release|ARM64.Build.0 = Release|ARM64
{48A1DB8C-5DF8-4FB3-9E14-2B67F3F2D8B5}.Release|x64.ActiveCfg = Release|x64
{48A1DB8C-5DF8-4FB3-9E14-2B67F3F2D8B5}.Release|x64.Build.0 = Release|x64
{F5333ED7-06D8-4AB3-953A-36D63F08CB6F}.Debug|ARM64.ActiveCfg = Debug|ARM64
{F5333ED7-06D8-4AB3-953A-36D63F08CB6F}.Debug|ARM64.Build.0 = Debug|ARM64
{F5333ED7-06D8-4AB3-953A-36D63F08CB6F}.Debug|ARM64.Deploy.0 = Debug|ARM64
@@ -3361,12 +3361,12 @@ Global
{E816D7B3-4688-4ECB-97CC-3D8E798F3832} = {8EF25507-2575-4ADE-BF7E-D23376903AB8}
{E816D7B2-4688-4ECB-97CC-3D8E798F3831} = {8EF25507-2575-4ADE-BF7E-D23376903AB8}
{E816D7B4-4688-4ECB-97CC-3D8E798F3833} = {8EF25507-2575-4ADE-BF7E-D23376903AB8}
{48A1DB8C-5DF8-4FB3-9E14-2B67F3F2D8B5} = {322566EF-20DC-43A6-B9F8-616AF942579A}
{3DCCD936-D085-4869-A1DE-CA6A64152C94} = {5B201255-53C8-490B-A34F-01F05D48A477}
{F5333ED7-06D8-4AB3-953A-36D63F08CB6F} = {3DCCD936-D085-4869-A1DE-CA6A64152C94}
{4E0FCF69-B06B-D272-76BF-ED3A559B4EDA} = {8EF25507-2575-4ADE-BF7E-D23376903AB8}
{45354F4F-1414-45CE-B600-51CD1209FD19} = {1AFB6476-670D-4E80-A464-657E01DFF482}
{A66E9270-5D93-EC9C-F06E-CE7295BB9A6C} = {8EF25507-2575-4ADE-BF7E-D23376903AB8}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {C3A2F9D1-7930-4EF4-A6FC-7EE0A99821D0}

View File

@@ -10,11 +10,11 @@
<h3 align="center">
<a href="#-installation">Installation</a>
<span> . </span>
<span> · </span>
<a href="https://aka.ms/powertoys-docs">Documentation</a>
<span> . </span>
<span> · </span>
<a href="https://aka.ms/powertoys-releaseblog">Blog</a>
<span> . </span>
<span> · </span>
<a href="#-whats-new">Release notes</a>
</h3>
<br/><br/>
@@ -48,7 +48,7 @@ Before you begin, make sure your device meets the system requirements:
Choose one of the installation methods below:
<details>
<details open>
<summary>Download .exe from GitHub</summary>
Go to the [PowerToys GitHub releases][github-release-link], click Assets to reveal the downloads, and choose the installer that matches your architecture and install scope. For most devices, that's the x64 per-user installer.
@@ -56,17 +56,17 @@ Go to the [PowerToys GitHub releases][github-release-link], click Assets to reve
<!-- items that need to be updated release to release -->
[github-next-release-work]: https://github.com/microsoft/PowerToys/issues?q=is%3Aissue+milestone%3A%22PowerToys+0.96%22
[github-current-release-work]: https://github.com/microsoft/PowerToys/issues?q=is%3Aissue+milestone%3A%22PowerToys+0.95%22
[ptUserX64]: https://github.com/microsoft/PowerToys/releases/download/v0.95.0/PowerToysUserSetup-0.95.0-x64.exe
[ptUserArm64]: https://github.com/microsoft/PowerToys/releases/download/v0.95.0/PowerToysUserSetup-0.95.0-arm64.exe
[ptMachineX64]: https://github.com/microsoft/PowerToys/releases/download/v0.95.0/PowerToysSetup-0.95.0-x64.exe
[ptMachineArm64]: https://github.com/microsoft/PowerToys/releases/download/v0.95.0/PowerToysSetup-0.95.0-arm64.exe
[ptUserX64]: https://github.com/microsoft/PowerToys/releases/download/v0.95.1/PowerToysUserSetup-0.95.1-x64.exe
[ptUserArm64]: https://github.com/microsoft/PowerToys/releases/download/v0.95.1/PowerToysUserSetup-0.95.1-arm64.exe
[ptMachineX64]: https://github.com/microsoft/PowerToys/releases/download/v0.95.1/PowerToysSetup-0.95.1-x64.exe
[ptMachineArm64]: https://github.com/microsoft/PowerToys/releases/download/v0.95.1/PowerToysSetup-0.95.1-arm64.exe
| Description | Filename |
|----------------|----------|
| Per user - x64 | [PowerToysUserSetup-0.95.0-x64.exe][ptUserX64] |
| Per user - ARM64 | [PowerToysUserSetup-0.95.0-arm64.exe][ptUserArm64] |
| Machine wide - x64 | [PowerToysSetup-0.95.0-x64.exe][ptMachineX64] |
| Machine wide - ARM64 | [PowerToysSetup-0.95.0-arm64.exe][ptMachineArm64] |
| Per user - x64 | [PowerToysUserSetup-0.95.1-x64.exe][ptUserX64] |
| Per user - ARM64 | [PowerToysUserSetup-0.95.1-arm64.exe][ptUserArm64] |
| Machine wide - x64 | [PowerToysSetup-0.95.1-x64.exe][ptMachineX64] |
| Machine wide - ARM64 | [PowerToysSetup-0.95.1-arm64.exe][ptMachineArm64] |
</details>
@@ -281,4 +281,4 @@ The application logs basic diagnostic data (telemetry). For more privacy informa
[roadmap]: https://github.com/microsoft/PowerToys/wiki/Roadmap
[privacy-link]: http://go.microsoft.com/fwlink/?LinkId=521839
[loc-bug]: https://github.com/microsoft/PowerToys/issues/new?assignees=&labels=&template=translation_issue.md&title=
[usingPowerToys-docs-link]: https://aka.ms/powertoys-docs
[usingPowerToys-docs-link]: https://aka.ms/powertoys-docs

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.6 KiB

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 24 KiB

After

Width:  |  Height:  |  Size: 22 KiB

View File

@@ -1,87 +0,0 @@
[CmdletBinding()]
Param(
[Parameter(Mandatory = $True)]
[string]$dscWxsFile,
[Parameter(Mandatory = $True)]
[string]$Platform,
[Parameter(Mandatory = $True)]
[string]$Configuration
)
$ErrorActionPreference = 'Stop'
$scriptDir = Split-Path -Parent $MyInvocation.MyCommand.Path
$buildOutputDir = Join-Path $scriptDir "..\..\$Platform\$Configuration"
if (-not (Test-Path $buildOutputDir)) {
Write-Error "Build output directory not found: '$buildOutputDir'"
exit 1
}
$dscFiles = Get-ChildItem -Path $buildOutputDir -Filter "microsoft.powertoys.*.settings.dsc.resource.json" -File
if (-not $dscFiles) {
Write-Warning "No DSC manifest files found in '$buildOutputDir'"
$wxsContent = @"
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<?include `$(sys.CURRENTDIR)\Common.wxi?>
<Fragment>
<ComponentGroup Id="DscResourcesComponentGroup">
</ComponentGroup>
</Fragment>
</Wix>
"@
Set-Content -Path $dscWxsFile -Value $wxsContent
exit 0
}
Write-Host "Found $($dscFiles.Count) DSC manifest file(s)"
$wxsContent = @"
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<?include `$(sys.CURRENTDIR)\Common.wxi?>
<Fragment>
<DirectoryRef Id="DSCModulesReferenceFolder">
"@
$componentRefs = @()
foreach ($file in $dscFiles) {
$componentId = "DscResource_" + ($file.BaseName -replace '[^A-Za-z0-9_]', '_')
$fileId = $componentId + "_File"
$guid = [System.Guid]::NewGuid().ToString().ToUpper()
$componentRefs += $componentId
$wxsContent += @"
<Component Id="$componentId" Guid="{$guid}">
<RegistryKey Root="`$(var.RegistryScope)" Key="Software\Classes\powertoys\components">
<RegistryValue Type="string" Name="$componentId" Value="" KeyPath="yes"/>
</RegistryKey>
<File Id="$fileId" Source="`$(var.BinDir)$($file.Name)" Vital="no"/>
</Component>
"@
}
$wxsContent += @"
</DirectoryRef>
</Fragment>
<Fragment>
<ComponentGroup Id="DscResourcesComponentGroup">
"@
foreach ($componentId in $componentRefs) {
$wxsContent += @"
<ComponentRef Id="$componentId"/>
"@
}
$wxsContent += @"
</ComponentGroup>
</Fragment>
</Wix>
"@
Set-Content -Path $dscWxsFile -Value $wxsContent
Write-Host "Generated DSC resources WiX fragment: '$dscWxsFile'"

View File

@@ -1493,12 +1493,11 @@ UINT __stdcall TerminateProcessesCA(MSIHANDLE hInstall)
}
processes.resize(bytes / sizeof(processes[0]));
std::array<std::wstring_view, 43> processesToTerminate = {
std::array<std::wstring_view, 42> processesToTerminate = {
L"PowerToys.PowerLauncher.exe",
L"PowerToys.Settings.exe",
L"PowerToys.AdvancedPaste.exe",
L"PowerToys.Awake.exe",
L"PowerToys.McpServer.exe",
L"PowerToys.FancyZones.exe",
L"PowerToys.FancyZonesEditor.exe",
L"PowerToys.FileLocksmithUI.exe",

View File

@@ -34,13 +34,8 @@
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup>
<OutDir Condition=" '$(PerUser)' != 'true' ">$(Platform)\$(Configuration)\MachineSetup\</OutDir>
<OutDir Condition=" '$(PerUser)' == 'true' ">$(Platform)\$(Configuration)\UserSetup\</OutDir>
<IntDir Condition=" '$(PerUser)' != 'true' ">$(SolutionDir)$(ProjectName)\$(Platform)\$(Configuration)\MachineSetup\obj\</IntDir>
<IntDir Condition=" '$(PerUser)' == 'true' ">$(SolutionDir)$(ProjectName)\$(Platform)\$(Configuration)\UserSetup\obj\</IntDir>
<!-- The CMD script below checks this value, and it is **CASE SENSITIVE** -->
<NormalizedPerUserValue>false</NormalizedPerUserValue>
<NormalizedPerUserValue Condition=" '$(PerUser)' == 'true' ">true</NormalizedPerUserValue>
<OutDir>$(Platform)\$(Configuration)\SetupShared\</OutDir>
<IntDir>$(SolutionDir)$(ProjectName)\$(Platform)\$(Configuration)\SetupShared\obj\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)'=='Debug'">
<LinkIncremental>true</LinkIncremental>
@@ -59,6 +54,7 @@
call cmd /C "copy ""$(ProjectDir)..\PowerToysSetupVNext\CmdPal.wxs"" ""$(ProjectDir)..\PowerToysSetupVNext\CmdPal.wxs.bk""""
call cmd /C "copy ""$(ProjectDir)..\PowerToysSetupVNext\ColorPicker.wxs"" ""$(ProjectDir)..\PowerToysSetupVNext\ColorPicker.wxs.bk""""
call cmd /C "copy ""$(ProjectDir)..\PowerToysSetupVNext\Core.wxs"" ""$(ProjectDir)..\PowerToysSetupVNext\Core.wxs.bk""""
call cmd /C "copy ""$(ProjectDir)..\PowerToysSetupVNext\DscResources.wxs"" ""$(ProjectDir)..\PowerToysSetupVNext\DscResources.wxs.bk""""
call cmd /C "copy ""$(ProjectDir)..\PowerToysSetupVNext\EnvironmentVariables.wxs"" ""$(ProjectDir)..\PowerToysSetupVNext\EnvironmentVariables.wxs.bk""""
call cmd /C "copy ""$(ProjectDir)..\PowerToysSetupVNext\FileExplorerPreview.wxs"" ""$(ProjectDir)..\PowerToysSetupVNext\FileExplorerPreview.wxs.bk""""
call cmd /C "copy ""$(ProjectDir)..\PowerToysSetupVNext\FileLocksmith.wxs"" ""$(ProjectDir)..\PowerToysSetupVNext\FileLocksmith.wxs.bk""""
@@ -80,8 +76,7 @@
call cmd /C "copy ""$(ProjectDir)..\PowerToysSetupVNext\WinAppSDK.wxs"" ""$(ProjectDir)..\PowerToysSetupVNext\WinAppSDK.wxs.bk""""
call cmd /C "copy ""$(ProjectDir)..\PowerToysSetupVNext\WinUI3Applications.wxs"" ""$(ProjectDir)..\PowerToysSetupVNext\WinUI3Applications.wxs.bk""""
call cmd /C "copy ""$(ProjectDir)..\PowerToysSetupVNext\Workspaces.wxs"" ""$(ProjectDir)..\PowerToysSetupVNext\Workspaces.wxs.bk""""
if not "$(NormalizedPerUserValue)" == "true" call powershell.exe -NonInteractive -executionpolicy Unrestricted -File ..\PowerToysSetupVNext\generateAllFileComponents.ps1 -platform $(Platform)
if "$(NormalizedPerUserValue)" == "true" call powershell.exe -NonInteractive -executionpolicy Unrestricted -File ..\PowerToysSetupVNext\generateAllFileComponents.ps1 -platform $(Platform) -installscopeperuser $(NormalizedPerUserValue)
call powershell.exe -NonInteractive -executionpolicy Unrestricted -File ..\PowerToysSetupVNext\generateAllFileComponents.ps1 -platform $(Platform)
</Command>
<Message>Backing up original files and populating .NET and WPF Runtime dependencies for WiX3 based installer</Message>
</PreBuildEvent>
@@ -181,4 +176,4 @@
<Error Condition="!Exists('..\packages\WixToolset.DUtil.5.0.2\build\WixToolset.DUtil.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\WixToolset.DUtil.5.0.2\build\WixToolset.DUtil.props'))" />
<Error Condition="!Exists('..\packages\WixToolset.WcaUtil.5.0.2\build\WixToolset.WcaUtil.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\WixToolset.WcaUtil.5.0.2\build\WixToolset.WcaUtil.props'))" />
</Target>
</Project>
</Project>

View File

@@ -4,6 +4,13 @@
<Fragment>
<DirectoryRef Id="WinUI3AppsInstallFolder">
<Directory Id="CmdPalInstallFolder" Name="CmdPal">
<Directory Id="CmdPalDepsInstallFolder" Name="Dependencies">
<?if $(sys.BUILDARCH) = x64 ?>
<Directory Id="CmdPalDepsX64InstallFolder" Name="x64" />
<?else?>
<Directory Id="CmdPalDepsArm64InstallFolder" Name="arm64" />
<?endif?>
</Directory>
</Directory>
</DirectoryRef>
<DirectoryRef Id="CmdPalInstallFolder" FileSource="$(var.CmdPalBuildDir)AppPackages\Microsoft.CmdPal.UI_$(var.CmdPalVersion)_Test">
@@ -18,14 +25,40 @@
<?endif?>
</Component>
</DirectoryRef>
<?if $(sys.BUILDARCH) = x64 ?>
<DirectoryRef Id="CmdPalDepsX64InstallFolder" FileSource="$(var.CmdPalBuildDir)AppPackages\Microsoft.CmdPal.UI_$(var.CmdPalVersion)_Test\Dependencies\x64">
<Component Id="Module_CmdPal_Deps" Guid="C2790FC4-0665-4462-947A-D942A2AABFF0" Bitness="always64">
<RegistryKey Root="$(var.RegistryScope)" Key="Software\Classes\powertoys\components">
<RegistryValue Type="string" Name="Module_CmdPal_Deps" Value="" KeyPath="yes" />
</RegistryKey>
<File Id="Microsoft.VCLibs.x64.14.00.Desktop.appx" Source="$(var.CmdPalBuildDir)AppPackages\Microsoft.CmdPal.UI_$(var.CmdPalVersion)_Test\Dependencies\x64\Microsoft.VCLibs.x64.14.00.Desktop.appx" />
</Component>
</DirectoryRef>
<?else?>
<DirectoryRef Id="CmdPalDepsArm64InstallFolder" FileSource="$(var.CmdPalBuildDir)AppPackages\Microsoft.CmdPal.UI_$(var.CmdPalVersion)_Test\Dependencies\arm64">
<Component Id="Module_CmdPal_Deps" Guid="C2790FC4-0665-4462-947A-D942A2AABFF0" Bitness="always64">
<RegistryKey Root="$(var.RegistryScope)" Key="Software\Classes\powertoys\components">
<RegistryValue Type="string" Name="Module_CmdPal_Deps" Value="" KeyPath="yes" />
</RegistryKey>
<File Id="Microsoft.VCLibs.ARM64.14.00.Desktop.appx" Source="$(var.CmdPalBuildDir)AppPackages\Microsoft.CmdPal.UI_$(var.CmdPalVersion)_Test\Dependencies\arm64\Microsoft.VCLibs.ARM64.14.00.Desktop.appx" />
</Component>
</DirectoryRef>
<?endif?>
<ComponentGroup Id="CmdPalComponentGroup">
<Component Id="RemoveCmdPalFolder" Guid="2DF90C08-CC75-4245-A14E-B82904636C53" Directory="INSTALLFOLDER">
<RegistryKey Root="$(var.RegistryScope)" Key="Software\Classes\powertoys\components">
<RegistryValue Type="string" Name="RemoveCmdPalFolder" Value="" KeyPath="yes" />
</RegistryKey>
<RemoveFolder Id="RemoveCmdPalInstallDirFolder" Directory="CmdPalInstallFolder" On="uninstall" />
<RemoveFolder Id="RemoveCmdPalDepsInstallDirFolder" Directory="CmdPalDepsInstallFolder" On="uninstall" />
<?if $(sys.BUILDARCH) = x64 ?>
<RemoveFolder Id="RemoveCmdPalDepsX64InstallDirFolder" Directory="CmdPalDepsX64InstallFolder" On="uninstall" />
<?else?>
<RemoveFolder Id="RemoveCmdPalDepsArm64InstallDirFolder" Directory="CmdPalDepsArm64InstallFolder" On="uninstall" />
<?endif?>
</Component>
<ComponentRef Id="Module_CmdPal" />
<ComponentRef Id="Module_CmdPal_Deps" />
</ComponentGroup>
</Fragment>
</Wix>

View File

@@ -15,8 +15,8 @@
<RegistryKey Root="$(var.RegistryScope)" Key="Software\Classes\powertoys\components">
<RegistryValue Type="string" Name="powertoys_env_path_user" Value="" KeyPath="yes" />
</RegistryKey>
<!-- Append install folder to current user's PATH -->
<Environment Id="AddPowerToysToUserPath" Name="PATH" Action="set" Part="last" System="no" Value="[INSTALLFOLDER]" />
<!-- Append DSCModules folder to current user's PATH for DSC v3 usage -->
<Environment Id="AddPowerToysToUserPath" Name="PATH" Action="set" Part="last" System="no" Value="[DSCModulesReferenceFolder]" />
</Component>
<?else?>
<Component Id="powertoys_env_path_machine" Bitness="always64">
@@ -24,8 +24,8 @@
<RegistryKey Root="$(var.RegistryScope)" Key="Software\Classes\powertoys\components">
<RegistryValue Type="string" Name="powertoys_env_path_machine" Value="" KeyPath="yes" />
</RegistryKey>
<!-- Append install folder to machine PATH -->
<Environment Id="AddPowerToysToMachinePath" Name="PATH" Action="set" Part="last" System="yes" Value="[INSTALLFOLDER]" />
<!-- Append DSCModules folder to machine PATH for DSC v3 usage -->
<Environment Id="AddPowerToysToMachinePath" Name="PATH" Action="set" Part="last" System="yes" Value="[DSCModulesReferenceFolder]" />
</Component>
<?endif?>
<Component Id="powertoys_toast_clsid" Bitness="always64">
@@ -63,16 +63,6 @@
</Component>
</DirectoryRef>
<DirectoryRef Id="DSCModulesReferenceFolder">
<Component Id="PowerToysDSCReference" Guid="40869ACB-0BEB-4911-AE41-5E73BC1586A9" Bitness="always64">
<RegistryKey Root="$(var.RegistryScope)" Key="Software\Classes\powertoys\components">
<RegistryValue Type="string" Name="DSCModulesReference" Value="" KeyPath="yes" />
</RegistryKey>
<File Source="$(var.RepoDir)\src\dsc\Microsoft.PowerToys.Configure\Generated\Microsoft.PowerToys.Configure\$(var.Version).0\Microsoft.PowerToys.Configure.psd1" Id="PTConfReference.psd1" />
<File Source="$(var.RepoDir)\src\dsc\Microsoft.PowerToys.Configure\Generated\Microsoft.PowerToys.Configure\$(var.Version).0\Microsoft.PowerToys.Configure.psm1" Id="PTConfReference.psm1" />
</Component>
</DirectoryRef>
<?if $(var.PerUser) = "true" ?>
<!-- DSC module files for PerUser handled in InstallDSCModule custom action. -->
<?else?>
@@ -120,7 +110,6 @@
<RegistryValue Type="string" Name="RemoveCoreFolder" Value="" KeyPath="yes" />
</RegistryKey>
<RemoveFolder Id="RemoveBaseApplicationsAssetsFolder" Directory="BaseApplicationsAssetsFolder" On="uninstall" />
<RemoveFolder Id="RemoveDSCModulesReferenceFolder" Directory="DSCModulesReferenceFolder" On="uninstall" />
<RemoveFolder Id="RemoveWinUI3AppsInstallFolder" Directory="WinUI3AppsInstallFolder" On="uninstall" />
<RemoveFolder Id="RemoveWinUI3AppsAssetsFolder" Directory="WinUI3AppsAssetsFolder" On="uninstall" />
<RemoveFolder Id="RemoveINSTALLFOLDER" Directory="INSTALLFOLDER" On="uninstall" />
@@ -128,16 +117,15 @@
<ComponentRef Id="powertoys_exe" />
<ComponentRef Id="PowerToysStartMenuShortcut" />
<ComponentRef Id="powertoys_per_machine_comp" />
<?if $(var.PerUser) = "true" ?>
<ComponentRef Id="powertoys_env_path_user" />
<?else?>
<ComponentRef Id="powertoys_env_path_machine" />
<?endif?>
<ComponentRef Id="powertoys_toast_clsid" />
<ComponentRef Id="License_rtf" />
<ComponentRef Id="Notice_md" />
<ComponentRef Id="DesktopShortcut" />
<ComponentRef Id="PowerToysDSCReference" />
<?if $(var.PerUser) = "true" ?>
<ComponentRef Id="powertoys_env_path_user" />
<?else?>
<ComponentRef Id="powertoys_env_path_machine" />
<?endif?>
<?if $(var.PerUser) = "false" ?>
<ComponentRef Id="PowerToysDSC" />
<?endif?>

View File

@@ -0,0 +1,33 @@
<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs">
<?include $(sys.CURRENTDIR)\Common.wxi?>
<?define DscJsonFiles=?>
<?define DscJsonFilesPath=$(var.BinDir)\DSCModules?>
<Fragment>
<DirectoryRef Id="DSCModulesReferenceFolder" FileSource="$(var.DscJsonFilesPath)">
<!-- DSC v2 PowerShell module files -->
<Component Id="PowerToysDSCReference" Guid="40869ACB-0BEB-4911-AE41-5E73BC1586A9" Bitness="always64">
<RegistryKey Root="$(var.RegistryScope)" Key="Software\Classes\powertoys\components">
<RegistryValue Type="string" Name="DSCModulesReference" Value="" KeyPath="yes" />
</RegistryKey>
<File Source="$(var.RepoDir)\src\dsc\Microsoft.PowerToys.Configure\Generated\Microsoft.PowerToys.Configure\$(var.Version).0\Microsoft.PowerToys.Configure.psd1" Id="PTConfReference.psd1" />
<File Source="$(var.RepoDir)\src\dsc\Microsoft.PowerToys.Configure\Generated\Microsoft.PowerToys.Configure\$(var.Version).0\Microsoft.PowerToys.Configure.psm1" Id="PTConfReference.psm1" />
</Component>
<!-- DSC v3 JSON manifest files - Generated by generateAllFileComponents.ps1 -->
<!--DscJsonFiles_Component_Def-->
</DirectoryRef>
<ComponentGroup Id="DscResourcesComponentGroup">
<ComponentRef Id="PowerToysDSCReference" />
<Component Id="RemoveDSCModulesFolder" Guid="A3C77D92-4E97-4C1A-9F2E-8B3C5D6E7F80" Directory="DSCModulesReferenceFolder">
<RegistryKey Root="$(var.RegistryScope)" Key="Software\Classes\powertoys\components">
<RegistryValue Type="string" Name="RemoveDSCModulesFolder" Value="" KeyPath="yes" />
</RegistryKey>
<RemoveFolder Id="RemoveDSCModulesReferenceFolder" Directory="DSCModulesReferenceFolder" On="uninstall" />
</Component>
</ComponentGroup>
</Fragment>
</Wix>

View File

@@ -14,7 +14,6 @@ SET PTRoot=$(SolutionDir)\..
call "..\..\..\publish.cmd" x64
)
call powershell.exe -NonInteractive -executionpolicy Unrestricted -File $(MSBuildThisFileDirectory)\generateMonacoWxs.ps1 -monacoWxsFile "$(MSBuildThisFileDirectory)\MonacoSRC.wxs" -Platform "$(Platform)" -nugetHeatPath "$(NUGET_PACKAGES)\wixtoolset.heat\5.0.2"
call powershell.exe -NonInteractive -executionpolicy Unrestricted -File $(MSBuildThisFileDirectory)\generateDscResourcesWxs.ps1 -dscWxsFile "$(MSBuildThisFileDirectory)\DscResources.wxs" -Platform "$(Platform)" -Configuration "$(Configuration)"
</PreBuildEvent>
</PropertyGroup>
<PropertyGroup Condition="'$(Platform)' != 'x64'">
@@ -25,7 +24,6 @@ SET PTRoot=$(SolutionDir)\..
call "..\..\..\publish.cmd" arm64
)
call powershell.exe -NonInteractive -executionpolicy Unrestricted -File $(MSBuildThisFileDirectory)\generateMonacoWxs.ps1 -monacoWxsFile "$(MSBuildThisFileDirectory)\MonacoSRC.wxs" -Platform "$(Platform)" -nugetHeatPath "$(NUGET_PACKAGES)\wixtoolset.heat\5.0.2"
call powershell.exe -NonInteractive -executionpolicy Unrestricted -File $(MSBuildThisFileDirectory)\generateDscResourcesWxs.ps1 -dscWxsFile "$(MSBuildThisFileDirectory)\DscResources.wxs" -Platform "$(Platform)" -Configuration "$(Configuration)"
</PreBuildEvent>
</PropertyGroup>
<PropertyGroup>
@@ -37,6 +35,7 @@ call powershell.exe -NonInteractive -executionpolicy Unrestricted -File $(MSBuil
call move /Y ..\..\..\CmdPal.wxs.bk ..\..\..\CmdPal.wxs
call move /Y ..\..\..\ColorPicker.wxs.bk ..\..\..\ColorPicker.wxs
call move /Y ..\..\..\Core.wxs.bk ..\..\..\Core.wxs
call move /Y ..\..\..\DscResources.wxs.bk ..\..\..\DscResources.wxs
call move /Y ..\..\..\EnvironmentVariables.wxs.bk ..\..\..\EnvironmentVariables.wxs
call move /Y ..\..\..\FileExplorerPreview.wxs.bk ..\..\..\FileExplorerPreview.wxs
call move /Y ..\..\..\FileLocksmith.wxs.bk ..\..\..\FileLocksmith.wxs
@@ -60,6 +59,12 @@ call powershell.exe -NonInteractive -executionpolicy Unrestricted -File $(MSBuil
call move /Y ..\..\..\Workspaces.wxs.bk ..\..\..\Workspaces.wxs
</PostBuildEvent>
</PropertyGroup>
<PropertyGroup Condition="'$(RunBuildEvents)'=='false'">
<PostBuildEvent></PostBuildEvent>
<RunPostBuildEvent></RunPostBuildEvent>
<PreBuildEventUseInBuild>false</PreBuildEventUseInBuild>
<PostBuildEventUseInBuild>false</PostBuildEventUseInBuild>
</PropertyGroup>
<PropertyGroup Label="UserMacros" Condition=" '$(PerUser)' == 'true' ">
<DefineConstants>$(DefineConstants);PerUser=true</DefineConstants>
</PropertyGroup>

View File

@@ -120,8 +120,8 @@
<Custom Action="SetUnApplyModulesRegistryChangeSetsParam" Before="UnApplyModulesRegistryChangeSets" />
<Custom Action="CheckGPO" After="InstallInitialize" Condition="NOT Installed" />
<Custom Action="SetBundleInstallLocationData" Before="SetBundleInstallLocation" Condition="NOT Installed" />
<Custom Action="SetBundleInstallLocation" After="InstallFiles" Condition="NOT Installed" />
<Custom Action="SetBundleInstallLocationData" Before="SetBundleInstallLocation" Condition="NOT Installed OR WIX_UPGRADE_DETECTED" />
<Custom Action="SetBundleInstallLocation" After="InstallFiles" Condition="NOT Installed OR WIX_UPGRADE_DETECTED" />
<Custom Action="ApplyModulesRegistryChangeSets" After="InstallFiles" Condition="NOT Installed" />
<Custom Action="InstallCmdPalPackage" After="InstallFiles" Condition="NOT Installed" />
<Custom Action="InstallPackageIdentityMSIX" After="InstallFiles" Condition="NOT Installed" />

View File

@@ -14,11 +14,16 @@
<?define SettingsV2OOBEAssetsFluentIconsFiles=?>
<?define SettingsV2OOBEAssetsFluentIconsFilesPath=$(var.BinDir)WinUI3Apps\Assets\Settings\Icons\?>
<?define SettingsV2IconsModelsFiles=?>
<?define SettingsV2IconsModelsFilesPath=$(var.BinDir)WinUI3Apps\Assets\Settings\Icons\Models\?>
<Fragment>
<DirectoryRef Id="WinUI3AppsAssetsFolder">
<Directory Id="SettingsV2AssetsInstallFolder" Name="Settings">
<Directory Id="SettingsAppAssetsScriptsFolder" Name="Scripts" />
<Directory Id="SettingsV2OOBEAssetsFluentIconsInstallFolder" Name="Icons" />
<Directory Id="SettingsV2OOBEAssetsFluentIconsInstallFolder" Name="Icons">
<Directory Id="SettingsV2IconsModelsInstallFolder" Name="Models" />
</Directory>
<Directory Id="SettingsV2AssetsModulesInstallFolder" Name="Modules">
<Directory Id="SettingsV2OOBEAssetsModulesInstallFolder" Name="OOBE" />
</Directory>
@@ -45,6 +50,11 @@
<!--SettingsV2OOBEAssetsFluentIconsFiles_Component_Def-->
</DirectoryRef>
<DirectoryRef Id="SettingsV2IconsModelsInstallFolder" FileSource="$(var.SettingsV2IconsModelsFilesPath)">
<!-- Generated by generateFileComponents.ps1 -->
<!--SettingsV2IconsModelsFiles_Component_Def-->
</DirectoryRef>
<DirectoryRef Id="SettingsAppAssetsScriptsFolder" FileSource="$(var.SettingsV2AssetsFilesPath)\Scripts\">
<Component Id="CommandNotFound_Scripts" Guid="898EFA1E-EDD3-4F4B-8C7F-4A14B0D05B02" Bitness="always64">
<RegistryKey Root="$(var.RegistryScope)" Key="Software\Classes\powertoys\components">
@@ -67,6 +77,7 @@
</RegistryKey>
<RemoveFolder Id="RemoveFolderSettingsV2AssetsInstallFolder" Directory="SettingsV2AssetsInstallFolder" On="uninstall" />
<RemoveFolder Id="RemoveFolderSettingsV2OOBEAssetsFluentIconsInstallFolder" Directory="SettingsV2OOBEAssetsFluentIconsInstallFolder" On="uninstall" />
<RemoveFolder Id="RemoveFolderSettingsV2IconsModelsInstallFolder" Directory="SettingsV2IconsModelsInstallFolder" On="uninstall" />
<RemoveFolder Id="RemoveFolderSettingsV2AssetsModulesInstallFolder" Directory="SettingsV2AssetsModulesInstallFolder" On="uninstall" />
<RemoveFolder Id="RemoveFolderSettingsV2OOBEAssetsModulesInstallFolder" Directory="SettingsV2OOBEAssetsModulesInstallFolder" On="uninstall" />
<RemoveFolder Id="RemoveFolderSettingsAppAssetsScriptsFolder" Directory="SettingsAppAssetsScriptsFolder" On="uninstall" />

View File

@@ -1,9 +1,7 @@
[CmdletBinding()]
Param(
[Parameter(Mandatory = $True, Position = 1)]
[string]$platform,
[Parameter(Mandatory = $False, Position = 2)]
[string]$installscopeperuser = "false"
[string]$platform
)
Function Generate-FileList() {
@@ -77,9 +75,7 @@ Function Generate-FileComponents() {
[Parameter(Mandatory = $True, Position = 1)]
[string]$fileListName,
[Parameter(Mandatory = $True, Position = 2)]
[string]$wxsFilePath,
[Parameter(Mandatory = $True, Position = 3)]
[string]$regroot
[string]$wxsFilePath
)
$wxsFile = Get-Content $wxsFilePath;
@@ -100,7 +96,7 @@ Function Generate-FileComponents() {
$componentDefs +=
@"
<Component Id="$($componentId)" Guid="$((New-Guid).ToString().ToUpper())">
<RegistryKey Root="$($regroot)" Key="Software\Classes\powertoys\components">
<RegistryKey Root="`$(var.RegistryScope)" Key="Software\Classes\powertoys\components">
<RegistryValue Type="string" Name="$($componentId)" Value="" KeyPath="yes"/>
</RegistryKey>`r`n
"@
@@ -134,194 +130,194 @@ if ($platform -ceq "arm64") {
$platform = "ARM64"
}
if ($installscopeperuser -eq "true") {
$registryroot = "HKCU"
} else {
$registryroot = "HKLM"
}
#BaseApplications
Generate-FileList -fileDepsJson "" -fileListName BaseApplicationsFiles -wxsFilePath $PSScriptRoot\BaseApplications.wxs -depsPath "$PSScriptRoot..\..\..\$platform\Release"
Generate-FileComponents -fileListName "BaseApplicationsFiles" -wxsFilePath $PSScriptRoot\BaseApplications.wxs -regroot $registryroot
Generate-FileComponents -fileListName "BaseApplicationsFiles" -wxsFilePath $PSScriptRoot\BaseApplications.wxs
#WinUI3Applications
Generate-FileList -fileDepsJson "" -fileListName WinUI3ApplicationsFiles -wxsFilePath $PSScriptRoot\WinUI3Applications.wxs -depsPath "$PSScriptRoot..\..\..\$platform\Release\WinUI3Apps"
Generate-FileComponents -fileListName "WinUI3ApplicationsFiles" -wxsFilePath $PSScriptRoot\WinUI3Applications.wxs -regroot $registryroot
Generate-FileComponents -fileListName "WinUI3ApplicationsFiles" -wxsFilePath $PSScriptRoot\WinUI3Applications.wxs
#AdvancedPaste
Generate-FileList -fileDepsJson "" -fileListName AdvancedPasteAssetsFiles -wxsFilePath $PSScriptRoot\AdvancedPaste.wxs -depsPath "$PSScriptRoot..\..\..\$platform\Release\WinUI3Apps\Assets\AdvancedPaste"
Generate-FileComponents -fileListName "AdvancedPasteAssetsFiles" -wxsFilePath $PSScriptRoot\AdvancedPaste.wxs -regroot $registryroot
Generate-FileComponents -fileListName "AdvancedPasteAssetsFiles" -wxsFilePath $PSScriptRoot\AdvancedPaste.wxs
#AwakeFiles
Generate-FileList -fileDepsJson "" -fileListName AwakeImagesFiles -wxsFilePath $PSScriptRoot\Awake.wxs -depsPath "$PSScriptRoot..\..\..\$platform\Release\Assets\Awake"
Generate-FileComponents -fileListName "AwakeImagesFiles" -wxsFilePath $PSScriptRoot\Awake.wxs -regroot $registryroot
Generate-FileComponents -fileListName "AwakeImagesFiles" -wxsFilePath $PSScriptRoot\Awake.wxs
#ColorPicker
Generate-FileList -fileDepsJson "" -fileListName ColorPickerAssetsFiles -wxsFilePath $PSScriptRoot\ColorPicker.wxs -depsPath "$PSScriptRoot..\..\..\$platform\Release\Assets\ColorPicker"
Generate-FileComponents -fileListName "ColorPickerAssetsFiles" -wxsFilePath $PSScriptRoot\ColorPicker.wxs -regroot $registryroot
Generate-FileComponents -fileListName "ColorPickerAssetsFiles" -wxsFilePath $PSScriptRoot\ColorPicker.wxs
#Environment Variables
Generate-FileList -fileDepsJson "" -fileListName EnvironmentVariablesAssetsFiles -wxsFilePath $PSScriptRoot\EnvironmentVariables.wxs -depsPath "$PSScriptRoot..\..\..\$platform\Release\WinUI3Apps\Assets\EnvironmentVariables"
Generate-FileComponents -fileListName "EnvironmentVariablesAssetsFiles" -wxsFilePath $PSScriptRoot\EnvironmentVariables.wxs -regroot $registryroot
Generate-FileComponents -fileListName "EnvironmentVariablesAssetsFiles" -wxsFilePath $PSScriptRoot\EnvironmentVariables.wxs
#FileExplorerAdd-ons
Generate-FileList -fileDepsJson "" -fileListName MonacoPreviewHandlerMonacoAssetsFiles -wxsFilePath $PSScriptRoot\FileExplorerPreview.wxs -depsPath "$PSScriptRoot..\..\..\$platform\Release\Assets\Monaco"
Generate-FileList -fileDepsJson "" -fileListName MonacoPreviewHandlerCustomLanguagesFiles -wxsFilePath $PSScriptRoot\FileExplorerPreview.wxs -depsPath "$PSScriptRoot..\..\..\$platform\Release\Assets\Monaco\customLanguages"
Generate-FileComponents -fileListName "MonacoPreviewHandlerMonacoAssetsFiles" -wxsFilePath $PSScriptRoot\FileExplorerPreview.wxs -regroot $registryroot
Generate-FileComponents -fileListName "MonacoPreviewHandlerCustomLanguagesFiles" -wxsFilePath $PSScriptRoot\FileExplorerPreview.wxs -regroot $registryroot
Generate-FileComponents -fileListName "MonacoPreviewHandlerMonacoAssetsFiles" -wxsFilePath $PSScriptRoot\FileExplorerPreview.wxs
Generate-FileComponents -fileListName "MonacoPreviewHandlerCustomLanguagesFiles" -wxsFilePath $PSScriptRoot\FileExplorerPreview.wxs
#FileLocksmith
Generate-FileList -fileDepsJson "" -fileListName FileLocksmithAssetsFiles -wxsFilePath $PSScriptRoot\FileLocksmith.wxs -depsPath "$PSScriptRoot..\..\..\$platform\Release\WinUI3Apps\Assets\FileLocksmith"
Generate-FileComponents -fileListName "FileLocksmithAssetsFiles" -wxsFilePath $PSScriptRoot\FileLocksmith.wxs -regroot $registryroot
Generate-FileComponents -fileListName "FileLocksmithAssetsFiles" -wxsFilePath $PSScriptRoot\FileLocksmith.wxs
#Hosts
Generate-FileList -fileDepsJson "" -fileListName HostsAssetsFiles -wxsFilePath $PSScriptRoot\Hosts.wxs -depsPath "$PSScriptRoot..\..\..\$platform\Release\WinUI3Apps\Assets\Hosts"
Generate-FileComponents -fileListName "HostsAssetsFiles" -wxsFilePath $PSScriptRoot\Hosts.wxs -regroot $registryroot
Generate-FileComponents -fileListName "HostsAssetsFiles" -wxsFilePath $PSScriptRoot\Hosts.wxs
#ImageResizer
Generate-FileList -fileDepsJson "" -fileListName ImageResizerAssetsFiles -wxsFilePath $PSScriptRoot\ImageResizer.wxs -depsPath "$PSScriptRoot..\..\..\$platform\Release\WinUI3Apps\Assets\ImageResizer"
Generate-FileComponents -fileListName "ImageResizerAssetsFiles" -wxsFilePath $PSScriptRoot\ImageResizer.wxs -regroot $registryroot
Generate-FileComponents -fileListName "ImageResizerAssetsFiles" -wxsFilePath $PSScriptRoot\ImageResizer.wxs
# Light Switch Service
Generate-FileList -fileDepsJson "" -fileListName LightSwitchFiles -wxsFilePath $PSScriptRoot\LightSwitch.wxs -depsPath "$PSScriptRoot..\..\..\$platform\Release\LightSwitchService"
Generate-FileComponents -fileListName "LightSwitchFiles" -wxsFilePath $PSScriptRoot\LightSwitch.wxs -regroot $registryroot
Generate-FileComponents -fileListName "LightSwitchFiles" -wxsFilePath $PSScriptRoot\LightSwitch.wxs
#New+
Generate-FileList -fileDepsJson "" -fileListName NewPlusAssetsFiles -wxsFilePath $PSScriptRoot\NewPlus.wxs -depsPath "$PSScriptRoot..\..\..\$platform\Release\WinUI3Apps\Assets\NewPlus"
Generate-FileComponents -fileListName "NewPlusAssetsFiles" -wxsFilePath $PSScriptRoot\NewPlus.wxs -regroot $registryroot
Generate-FileComponents -fileListName "NewPlusAssetsFiles" -wxsFilePath $PSScriptRoot\NewPlus.wxs
#Peek
Generate-FileList -fileDepsJson "" -fileListName PeekAssetsFiles -wxsFilePath $PSScriptRoot\Peek.wxs -depsPath "$PSScriptRoot..\..\..\$platform\Release\WinUI3Apps\Assets\Peek\"
Generate-FileComponents -fileListName "PeekAssetsFiles" -wxsFilePath $PSScriptRoot\Peek.wxs -regroot $registryroot
Generate-FileComponents -fileListName "PeekAssetsFiles" -wxsFilePath $PSScriptRoot\Peek.wxs
#PowerRename
Generate-FileList -fileDepsJson "" -fileListName PowerRenameAssetsFiles -wxsFilePath $PSScriptRoot\PowerRename.wxs -depsPath "$PSScriptRoot..\..\..\$platform\Release\WinUI3Apps\Assets\PowerRename\"
Generate-FileComponents -fileListName "PowerRenameAssetsFiles" -wxsFilePath $PSScriptRoot\PowerRename.wxs -regroot $registryroot
Generate-FileComponents -fileListName "PowerRenameAssetsFiles" -wxsFilePath $PSScriptRoot\PowerRename.wxs
#RegistryPreview
Generate-FileList -fileDepsJson "" -fileListName RegistryPreviewAssetsFiles -wxsFilePath $PSScriptRoot\RegistryPreview.wxs -depsPath "$PSScriptRoot..\..\..\$platform\Release\WinUI3Apps\Assets\RegistryPreview\"
Generate-FileComponents -fileListName "RegistryPreviewAssetsFiles" -wxsFilePath $PSScriptRoot\RegistryPreview.wxs -regroot $registryroot
Generate-FileComponents -fileListName "RegistryPreviewAssetsFiles" -wxsFilePath $PSScriptRoot\RegistryPreview.wxs
#Run
Generate-FileList -fileDepsJson "" -fileListName launcherImagesComponentFiles -wxsFilePath $PSScriptRoot\Run.wxs -depsPath "$PSScriptRoot..\..\..\$platform\Release\Assets\PowerLauncher"
Generate-FileComponents -fileListName "launcherImagesComponentFiles" -wxsFilePath $PSScriptRoot\Run.wxs -regroot $registryroot
Generate-FileComponents -fileListName "launcherImagesComponentFiles" -wxsFilePath $PSScriptRoot\Run.wxs
## Plugins
###Calculator
Generate-FileList -fileDepsJson "$PSScriptRoot..\..\..\$platform\Release\RunPlugins\Calculator\Microsoft.PowerToys.Run.Plugin.Calculator.deps.json" -fileListName calcComponentFiles -wxsFilePath $PSScriptRoot\Run.wxs -isLauncherPlugin 1
Generate-FileList -fileDepsJson "" -fileListName calcImagesComponentFiles -wxsFilePath $PSScriptRoot\Run.wxs -depsPath "$PSScriptRoot..\..\..\$platform\Release\RunPlugins\Calculator\Images"
Generate-FileComponents -fileListName "calcComponentFiles" -wxsFilePath $PSScriptRoot\Run.wxs -regroot $registryroot
Generate-FileComponents -fileListName "calcImagesComponentFiles" -wxsFilePath $PSScriptRoot\Run.wxs -regroot $registryroot
Generate-FileComponents -fileListName "calcComponentFiles" -wxsFilePath $PSScriptRoot\Run.wxs
Generate-FileComponents -fileListName "calcImagesComponentFiles" -wxsFilePath $PSScriptRoot\Run.wxs
###Folder
Generate-FileList -fileDepsJson "$PSScriptRoot..\..\..\$platform\Release\RunPlugins\Folder\Microsoft.Plugin.Folder.deps.json" -fileListName FolderComponentFiles -wxsFilePath $PSScriptRoot\Run.wxs -isLauncherPlugin 1
Generate-FileList -fileDepsJson "" -fileListName FolderImagesComponentFiles -wxsFilePath $PSScriptRoot\Run.wxs -depsPath "$PSScriptRoot..\..\..\$platform\Release\RunPlugins\Folder\Images"
Generate-FileComponents -fileListName "FolderComponentFiles" -wxsFilePath $PSScriptRoot\Run.wxs -regroot $registryroot
Generate-FileComponents -fileListName "FolderImagesComponentFiles" -wxsFilePath $PSScriptRoot\Run.wxs -regroot $registryroot
Generate-FileComponents -fileListName "FolderComponentFiles" -wxsFilePath $PSScriptRoot\Run.wxs
Generate-FileComponents -fileListName "FolderImagesComponentFiles" -wxsFilePath $PSScriptRoot\Run.wxs
###Program
Generate-FileList -fileDepsJson "$PSScriptRoot..\..\..\$platform\Release\RunPlugins\Program\Microsoft.Plugin.Program.deps.json" -fileListName ProgramComponentFiles -wxsFilePath $PSScriptRoot\Run.wxs -isLauncherPlugin 1
Generate-FileList -fileDepsJson "" -fileListName ProgramImagesComponentFiles -wxsFilePath $PSScriptRoot\Run.wxs -depsPath "$PSScriptRoot..\..\..\$platform\Release\RunPlugins\Program\Images"
Generate-FileComponents -fileListName "ProgramComponentFiles" -wxsFilePath $PSScriptRoot\Run.wxs -regroot $registryroot
Generate-FileComponents -fileListName "ProgramImagesComponentFiles" -wxsFilePath $PSScriptRoot\Run.wxs -regroot $registryroot
Generate-FileComponents -fileListName "ProgramComponentFiles" -wxsFilePath $PSScriptRoot\Run.wxs
Generate-FileComponents -fileListName "ProgramImagesComponentFiles" -wxsFilePath $PSScriptRoot\Run.wxs
###Shell
Generate-FileList -fileDepsJson "$PSScriptRoot..\..\..\$platform\Release\RunPlugins\Shell\Microsoft.Plugin.Shell.deps.json" -fileListName ShellComponentFiles -wxsFilePath $PSScriptRoot\Run.wxs -isLauncherPlugin 1
Generate-FileList -fileDepsJson "" -fileListName ShellImagesComponentFiles -wxsFilePath $PSScriptRoot\Run.wxs -depsPath "$PSScriptRoot..\..\..\$platform\Release\RunPlugins\Shell\Images"
Generate-FileComponents -fileListName "ShellComponentFiles" -wxsFilePath $PSScriptRoot\Run.wxs -regroot $registryroot
Generate-FileComponents -fileListName "ShellImagesComponentFiles" -wxsFilePath $PSScriptRoot\Run.wxs -regroot $registryroot
Generate-FileComponents -fileListName "ShellComponentFiles" -wxsFilePath $PSScriptRoot\Run.wxs
Generate-FileComponents -fileListName "ShellImagesComponentFiles" -wxsFilePath $PSScriptRoot\Run.wxs
###Indexer
Generate-FileList -fileDepsJson "$PSScriptRoot..\..\..\$platform\Release\RunPlugins\Indexer\Microsoft.Plugin.Indexer.deps.json" -fileListName IndexerComponentFiles -wxsFilePath $PSScriptRoot\Run.wxs -isLauncherPlugin 1
Generate-FileList -fileDepsJson "" -fileListName IndexerImagesComponentFiles -wxsFilePath $PSScriptRoot\Run.wxs -depsPath "$PSScriptRoot..\..\..\$platform\Release\RunPlugins\Indexer\Images"
Generate-FileComponents -fileListName "IndexerComponentFiles" -wxsFilePath $PSScriptRoot\Run.wxs -regroot $registryroot
Generate-FileComponents -fileListName "IndexerImagesComponentFiles" -wxsFilePath $PSScriptRoot\Run.wxs -regroot $registryroot
Generate-FileComponents -fileListName "IndexerComponentFiles" -wxsFilePath $PSScriptRoot\Run.wxs
Generate-FileComponents -fileListName "IndexerImagesComponentFiles" -wxsFilePath $PSScriptRoot\Run.wxs
###UnitConverter
Generate-FileList -fileDepsJson "$PSScriptRoot..\..\..\$platform\Release\RunPlugins\UnitConverter\Community.PowerToys.Run.Plugin.UnitConverter.deps.json" -fileListName UnitConvCompFiles -wxsFilePath $PSScriptRoot\Run.wxs -isLauncherPlugin 1
Generate-FileList -fileDepsJson "" -fileListName UnitConvImagesCompFiles -wxsFilePath $PSScriptRoot\Run.wxs -depsPath "$PSScriptRoot..\..\..\$platform\Release\RunPlugins\UnitConverter\Images"
Generate-FileComponents -fileListName "UnitConvCompFiles" -wxsFilePath $PSScriptRoot\Run.wxs -regroot $registryroot
Generate-FileComponents -fileListName "UnitConvImagesCompFiles" -wxsFilePath $PSScriptRoot\Run.wxs -regroot $registryroot
Generate-FileComponents -fileListName "UnitConvCompFiles" -wxsFilePath $PSScriptRoot\Run.wxs
Generate-FileComponents -fileListName "UnitConvImagesCompFiles" -wxsFilePath $PSScriptRoot\Run.wxs
###WebSearch
Generate-FileList -fileDepsJson "$PSScriptRoot..\..\..\$platform\Release\RunPlugins\WebSearch\Community.PowerToys.Run.Plugin.WebSearch.deps.json" -fileListName WebSrchCompFiles -wxsFilePath $PSScriptRoot\Run.wxs -isLauncherPlugin 1
Generate-FileList -fileDepsJson "" -fileListName WebSrchImagesCompFiles -wxsFilePath $PSScriptRoot\Run.wxs -depsPath "$PSScriptRoot..\..\..\$platform\Release\RunPlugins\WebSearch\Images"
Generate-FileComponents -fileListName "WebSrchCompFiles" -wxsFilePath $PSScriptRoot\Run.wxs -regroot $registryroot
Generate-FileComponents -fileListName "WebSrchImagesCompFiles" -wxsFilePath $PSScriptRoot\Run.wxs -regroot $registryroot
Generate-FileComponents -fileListName "WebSrchCompFiles" -wxsFilePath $PSScriptRoot\Run.wxs
Generate-FileComponents -fileListName "WebSrchImagesCompFiles" -wxsFilePath $PSScriptRoot\Run.wxs
###History
Generate-FileList -fileDepsJson "$PSScriptRoot..\..\..\$platform\Release\RunPlugins\History\Microsoft.PowerToys.Run.Plugin.History.deps.json" -fileListName HistoryPluginComponentFiles -wxsFilePath $PSScriptRoot\Run.wxs -isLauncherPlugin 1
Generate-FileList -fileDepsJson "" -fileListName HistoryPluginImagesComponentFiles -wxsFilePath $PSScriptRoot\Run.wxs -depsPath "$PSScriptRoot..\..\..\$platform\Release\RunPlugins\History\Images"
Generate-FileComponents -fileListName "HistoryPluginComponentFiles" -wxsFilePath $PSScriptRoot\Run.wxs -regroot $registryroot
Generate-FileComponents -fileListName "HistoryPluginImagesComponentFiles" -wxsFilePath $PSScriptRoot\Run.wxs -regroot $registryroot
Generate-FileComponents -fileListName "HistoryPluginComponentFiles" -wxsFilePath $PSScriptRoot\Run.wxs
Generate-FileComponents -fileListName "HistoryPluginImagesComponentFiles" -wxsFilePath $PSScriptRoot\Run.wxs
###Uri
Generate-FileList -fileDepsJson "$PSScriptRoot..\..\..\$platform\Release\RunPlugins\Uri\Microsoft.Plugin.Uri.deps.json" -fileListName UriComponentFiles -wxsFilePath $PSScriptRoot\Run.wxs -isLauncherPlugin 1
Generate-FileList -fileDepsJson "" -fileListName UriImagesComponentFiles -wxsFilePath $PSScriptRoot\Run.wxs -depsPath "$PSScriptRoot..\..\..\$platform\Release\RunPlugins\Uri\Images"
Generate-FileComponents -fileListName "UriComponentFiles" -wxsFilePath $PSScriptRoot\Run.wxs -regroot $registryroot
Generate-FileComponents -fileListName "UriImagesComponentFiles" -wxsFilePath $PSScriptRoot\Run.wxs -regroot $registryroot
Generate-FileComponents -fileListName "UriComponentFiles" -wxsFilePath $PSScriptRoot\Run.wxs
Generate-FileComponents -fileListName "UriImagesComponentFiles" -wxsFilePath $PSScriptRoot\Run.wxs
###VSCodeWorkspaces
Generate-FileList -fileDepsJson "$PSScriptRoot..\..\..\$platform\Release\RunPlugins\VSCodeWorkspaces\Community.PowerToys.Run.Plugin.VSCodeWorkspaces.deps.json" -fileListName VSCWrkCompFiles -wxsFilePath $PSScriptRoot\Run.wxs -isLauncherPlugin 1
Generate-FileList -fileDepsJson "" -fileListName VSCWrkImagesCompFiles -wxsFilePath $PSScriptRoot\Run.wxs -depsPath "$PSScriptRoot..\..\..\$platform\Release\RunPlugins\VSCodeWorkspaces\Images"
Generate-FileComponents -fileListName "VSCWrkCompFiles" -wxsFilePath $PSScriptRoot\Run.wxs -regroot $registryroot
Generate-FileComponents -fileListName "VSCWrkImagesCompFiles" -wxsFilePath $PSScriptRoot\Run.wxs -regroot $registryroot
Generate-FileComponents -fileListName "VSCWrkCompFiles" -wxsFilePath $PSScriptRoot\Run.wxs
Generate-FileComponents -fileListName "VSCWrkImagesCompFiles" -wxsFilePath $PSScriptRoot\Run.wxs
###WindowWalker
Generate-FileList -fileDepsJson "$PSScriptRoot..\..\..\$platform\Release\RunPlugins\WindowWalker\Microsoft.Plugin.WindowWalker.deps.json" -fileListName WindowWlkrCompFiles -wxsFilePath $PSScriptRoot\Run.wxs -isLauncherPlugin 1
Generate-FileList -fileDepsJson "" -fileListName WindowWlkrImagesCompFiles -wxsFilePath $PSScriptRoot\Run.wxs -depsPath "$PSScriptRoot..\..\..\$platform\Release\RunPlugins\WindowWalker\Images"
Generate-FileComponents -fileListName "WindowWlkrCompFiles" -wxsFilePath $PSScriptRoot\Run.wxs -regroot $registryroot
Generate-FileComponents -fileListName "WindowWlkrImagesCompFiles" -wxsFilePath $PSScriptRoot\Run.wxs -regroot $registryroot
Generate-FileComponents -fileListName "WindowWlkrCompFiles" -wxsFilePath $PSScriptRoot\Run.wxs
Generate-FileComponents -fileListName "WindowWlkrImagesCompFiles" -wxsFilePath $PSScriptRoot\Run.wxs
###OneNote
Generate-FileList -fileDepsJson "$PSScriptRoot..\..\..\$platform\Release\RunPlugins\OneNote\Microsoft.PowerToys.Run.Plugin.OneNote.deps.json" -fileListName OneNoteComponentFiles -wxsFilePath $PSScriptRoot\Run.wxs -isLauncherPlugin 1
Generate-FileList -fileDepsJson "" -fileListName OneNoteImagesComponentFiles -wxsFilePath $PSScriptRoot\Run.wxs -depsPath "$PSScriptRoot..\..\..\$platform\Release\RunPlugins\OneNote\Images"
Generate-FileComponents -fileListName "OneNoteComponentFiles" -wxsFilePath $PSScriptRoot\Run.wxs -regroot $registryroot
Generate-FileComponents -fileListName "OneNoteImagesComponentFiles" -wxsFilePath $PSScriptRoot\Run.wxs -regroot $registryroot
Generate-FileComponents -fileListName "OneNoteComponentFiles" -wxsFilePath $PSScriptRoot\Run.wxs
Generate-FileComponents -fileListName "OneNoteImagesComponentFiles" -wxsFilePath $PSScriptRoot\Run.wxs
###Registry
Generate-FileList -fileDepsJson "$PSScriptRoot..\..\..\$platform\Release\RunPlugins\Registry\Microsoft.PowerToys.Run.Plugin.Registry.deps.json" -fileListName RegistryComponentFiles -wxsFilePath $PSScriptRoot\Run.wxs -isLauncherPlugin 1
Generate-FileList -fileDepsJson "" -fileListName RegistryImagesComponentFiles -wxsFilePath $PSScriptRoot\Run.wxs -depsPath "$PSScriptRoot..\..\..\$platform\Release\RunPlugins\Registry\Images"
Generate-FileComponents -fileListName "RegistryComponentFiles" -wxsFilePath $PSScriptRoot\Run.wxs -regroot $registryroot
Generate-FileComponents -fileListName "RegistryImagesComponentFiles" -wxsFilePath $PSScriptRoot\Run.wxs -regroot $registryroot
Generate-FileComponents -fileListName "RegistryComponentFiles" -wxsFilePath $PSScriptRoot\Run.wxs
Generate-FileComponents -fileListName "RegistryImagesComponentFiles" -wxsFilePath $PSScriptRoot\Run.wxs
###Service
Generate-FileList -fileDepsJson "$PSScriptRoot..\..\..\$platform\Release\RunPlugins\Service\Microsoft.PowerToys.Run.Plugin.Service.deps.json" -fileListName ServiceComponentFiles -wxsFilePath $PSScriptRoot\Run.wxs -isLauncherPlugin 1
Generate-FileList -fileDepsJson "" -fileListName ServiceImagesComponentFiles -wxsFilePath $PSScriptRoot\Run.wxs -depsPath "$PSScriptRoot..\..\..\$platform\Release\RunPlugins\Service\Images"
Generate-FileComponents -fileListName "ServiceComponentFiles" -wxsFilePath $PSScriptRoot\Run.wxs -regroot $registryroot
Generate-FileComponents -fileListName "ServiceImagesComponentFiles" -wxsFilePath $PSScriptRoot\Run.wxs -regroot $registryroot
Generate-FileComponents -fileListName "ServiceComponentFiles" -wxsFilePath $PSScriptRoot\Run.wxs
Generate-FileComponents -fileListName "ServiceImagesComponentFiles" -wxsFilePath $PSScriptRoot\Run.wxs
###System
Generate-FileList -fileDepsJson "$PSScriptRoot..\..\..\$platform\Release\RunPlugins\System\Microsoft.PowerToys.Run.Plugin.System.deps.json" -fileListName SystemComponentFiles -wxsFilePath $PSScriptRoot\Run.wxs -isLauncherPlugin 1
Generate-FileList -fileDepsJson "" -fileListName SystemImagesComponentFiles -wxsFilePath $PSScriptRoot\Run.wxs -depsPath "$PSScriptRoot..\..\..\$platform\Release\RunPlugins\System\Images"
Generate-FileComponents -fileListName "SystemComponentFiles" -wxsFilePath $PSScriptRoot\Run.wxs -regroot $registryroot
Generate-FileComponents -fileListName "SystemImagesComponentFiles" -wxsFilePath $PSScriptRoot\Run.wxs -regroot $registryroot
Generate-FileComponents -fileListName "SystemComponentFiles" -wxsFilePath $PSScriptRoot\Run.wxs
Generate-FileComponents -fileListName "SystemImagesComponentFiles" -wxsFilePath $PSScriptRoot\Run.wxs
###TimeDate
Generate-FileList -fileDepsJson "$PSScriptRoot..\..\..\$platform\Release\RunPlugins\TimeDate\Microsoft.PowerToys.Run.Plugin.TimeDate.deps.json" -fileListName TimeDateComponentFiles -wxsFilePath $PSScriptRoot\Run.wxs -isLauncherPlugin 1
Generate-FileList -fileDepsJson "" -fileListName TimeDateImagesComponentFiles -wxsFilePath $PSScriptRoot\Run.wxs -depsPath "$PSScriptRoot..\..\..\$platform\Release\RunPlugins\TimeDate\Images"
Generate-FileComponents -fileListName "TimeDateComponentFiles" -wxsFilePath $PSScriptRoot\Run.wxs -regroot $registryroot
Generate-FileComponents -fileListName "TimeDateImagesComponentFiles" -wxsFilePath $PSScriptRoot\Run.wxs -regroot $registryroot
Generate-FileComponents -fileListName "TimeDateComponentFiles" -wxsFilePath $PSScriptRoot\Run.wxs
Generate-FileComponents -fileListName "TimeDateImagesComponentFiles" -wxsFilePath $PSScriptRoot\Run.wxs
###WindowsSettings
Generate-FileList -fileDepsJson "$PSScriptRoot..\..\..\$platform\Release\RunPlugins\WindowsSettings\Microsoft.PowerToys.Run.Plugin.WindowsSettings.deps.json" -fileListName WinSetCmpFiles -wxsFilePath $PSScriptRoot\Run.wxs -isLauncherPlugin 1
Generate-FileList -fileDepsJson "" -fileListName WinSetImagesCmpFiles -wxsFilePath $PSScriptRoot\Run.wxs -depsPath "$PSScriptRoot..\..\..\$platform\Release\RunPlugins\WindowsSettings\Images"
Generate-FileComponents -fileListName "WinSetCmpFiles" -wxsFilePath $PSScriptRoot\Run.wxs -regroot $registryroot
Generate-FileComponents -fileListName "WinSetImagesCmpFiles" -wxsFilePath $PSScriptRoot\Run.wxs -regroot $registryroot
Generate-FileComponents -fileListName "WinSetCmpFiles" -wxsFilePath $PSScriptRoot\Run.wxs
Generate-FileComponents -fileListName "WinSetImagesCmpFiles" -wxsFilePath $PSScriptRoot\Run.wxs
###WindowsTerminal
Generate-FileList -fileDepsJson "$PSScriptRoot..\..\..\$platform\Release\RunPlugins\WindowsTerminal\Microsoft.PowerToys.Run.Plugin.WindowsTerminal.deps.json" -fileListName WinTermCmpFiles -wxsFilePath $PSScriptRoot\Run.wxs -isLauncherPlugin 1
Generate-FileList -fileDepsJson "" -fileListName WinTermImagesCmpFiles -wxsFilePath $PSScriptRoot\Run.wxs -depsPath "$PSScriptRoot..\..\..\$platform\Release\RunPlugins\WindowsTerminal\Images"
Generate-FileComponents -fileListName "WinTermCmpFiles" -wxsFilePath $PSScriptRoot\Run.wxs -regroot $registryroot
Generate-FileComponents -fileListName "WinTermImagesCmpFiles" -wxsFilePath $PSScriptRoot\Run.wxs -regroot $registryroot
Generate-FileComponents -fileListName "WinTermCmpFiles" -wxsFilePath $PSScriptRoot\Run.wxs
Generate-FileComponents -fileListName "WinTermImagesCmpFiles" -wxsFilePath $PSScriptRoot\Run.wxs
###PowerToys
Generate-FileList -fileDepsJson "$PSScriptRoot..\..\..\$platform\Release\RunPlugins\PowerToys\Microsoft.PowerToys.Run.Plugin.PowerToys.deps.json" -fileListName PowerToysCmpFiles -wxsFilePath $PSScriptRoot\Run.wxs -isLauncherPlugin 1
Generate-FileList -fileDepsJson "" -fileListName PowerToysImagesCmpFiles -wxsFilePath $PSScriptRoot\Run.wxs -depsPath "$PSScriptRoot..\..\..\$platform\Release\RunPlugins\PowerToys\Images"
Generate-FileComponents -fileListName "PowerToysCmpFiles" -wxsFilePath $PSScriptRoot\Run.wxs -regroot $registryroot
Generate-FileComponents -fileListName "PowerToysImagesCmpFiles" -wxsFilePath $PSScriptRoot\Run.wxs -regroot $registryroot
Generate-FileComponents -fileListName "PowerToysCmpFiles" -wxsFilePath $PSScriptRoot\Run.wxs
Generate-FileComponents -fileListName "PowerToysImagesCmpFiles" -wxsFilePath $PSScriptRoot\Run.wxs
###ValueGenerator
Generate-FileList -fileDepsJson "$PSScriptRoot..\..\..\$platform\Release\RunPlugins\ValueGenerator\Community.PowerToys.Run.Plugin.ValueGenerator.deps.json" -fileListName ValueGeneratorCmpFiles -wxsFilePath $PSScriptRoot\Run.wxs -isLauncherPlugin 1
Generate-FileList -fileDepsJson "" -fileListName ValueGeneratorImagesCmpFiles -wxsFilePath $PSScriptRoot\Run.wxs -depsPath "$PSScriptRoot..\..\..\$platform\Release\RunPlugins\ValueGenerator\Images"
Generate-FileComponents -fileListName "ValueGeneratorCmpFiles" -wxsFilePath $PSScriptRoot\Run.wxs -regroot $registryroot
Generate-FileComponents -fileListName "ValueGeneratorImagesCmpFiles" -wxsFilePath $PSScriptRoot\Run.wxs -regroot $registryroot
Generate-FileComponents -fileListName "ValueGeneratorCmpFiles" -wxsFilePath $PSScriptRoot\Run.wxs
Generate-FileComponents -fileListName "ValueGeneratorImagesCmpFiles" -wxsFilePath $PSScriptRoot\Run.wxs
## Plugins
#ShortcutGuide
Generate-FileList -fileDepsJson "" -fileListName ShortcutGuideSvgFiles -wxsFilePath $PSScriptRoot\ShortcutGuide.wxs -depsPath "$PSScriptRoot..\..\..\$platform\Release\Assets\ShortcutGuide\"
Generate-FileComponents -fileListName "ShortcutGuideSvgFiles" -wxsFilePath $PSScriptRoot\ShortcutGuide.wxs -regroot $registryroot
Generate-FileComponents -fileListName "ShortcutGuideSvgFiles" -wxsFilePath $PSScriptRoot\ShortcutGuide.wxs
#Settings
Generate-FileList -fileDepsJson "" -fileListName SettingsV2AssetsFiles -wxsFilePath $PSScriptRoot\Settings.wxs -depsPath "$PSScriptRoot..\..\..\$platform\Release\WinUI3Apps\Assets\Settings\"
Generate-FileList -fileDepsJson "" -fileListName SettingsV2AssetsModulesFiles -wxsFilePath $PSScriptRoot\Settings.wxs -depsPath "$PSScriptRoot..\..\..\$platform\Release\WinUI3Apps\Assets\Settings\Modules\"
Generate-FileList -fileDepsJson "" -fileListName SettingsV2OOBEAssetsModulesFiles -wxsFilePath $PSScriptRoot\Settings.wxs -depsPath "$PSScriptRoot..\..\..\$platform\Release\WinUI3Apps\Assets\Settings\Modules\OOBE\"
Generate-FileList -fileDepsJson "" -fileListName SettingsV2OOBEAssetsFluentIconsFiles -wxsFilePath $PSScriptRoot\Settings.wxs -depsPath "$PSScriptRoot..\..\..\$platform\Release\WinUI3Apps\Assets\Settings\Icons\"
Generate-FileComponents -fileListName "SettingsV2AssetsFiles" -wxsFilePath $PSScriptRoot\Settings.wxs -regroot $registryroot
Generate-FileComponents -fileListName "SettingsV2AssetsModulesFiles" -wxsFilePath $PSScriptRoot\Settings.wxs -regroot $registryroot
Generate-FileComponents -fileListName "SettingsV2OOBEAssetsModulesFiles" -wxsFilePath $PSScriptRoot\Settings.wxs -regroot $registryroot
Generate-FileComponents -fileListName "SettingsV2OOBEAssetsFluentIconsFiles" -wxsFilePath $PSScriptRoot\Settings.wxs -regroot $registryroot
Generate-FileList -fileDepsJson "" -fileListName SettingsV2IconsModelsFiles -wxsFilePath $PSScriptRoot\Settings.wxs -depsPath "$PSScriptRoot..\..\..\$platform\Release\WinUI3Apps\Assets\Settings\Icons\Models\"
Generate-FileComponents -fileListName "SettingsV2AssetsFiles" -wxsFilePath $PSScriptRoot\Settings.wxs
Generate-FileComponents -fileListName "SettingsV2AssetsModulesFiles" -wxsFilePath $PSScriptRoot\Settings.wxs
Generate-FileComponents -fileListName "SettingsV2OOBEAssetsModulesFiles" -wxsFilePath $PSScriptRoot\Settings.wxs
Generate-FileComponents -fileListName "SettingsV2OOBEAssetsFluentIconsFiles" -wxsFilePath $PSScriptRoot\Settings.wxs
Generate-FileComponents -fileListName "SettingsV2IconsModelsFiles" -wxsFilePath $PSScriptRoot\Settings.wxs
#Workspaces
Generate-FileList -fileDepsJson "" -fileListName WorkspacesImagesComponentFiles -wxsFilePath $PSScriptRoot\Workspaces.wxs -depsPath "$PSScriptRoot..\..\..\$platform\Release\Assets\Workspaces\"
Generate-FileComponents -fileListName "WorkspacesImagesComponentFiles" -wxsFilePath $PSScriptRoot\Workspaces.wxs -regroot $registryroot
Generate-FileComponents -fileListName "WorkspacesImagesComponentFiles" -wxsFilePath $PSScriptRoot\Workspaces.wxs
#DSC Resources - JSON manifest files in DSCModules subfolder
Generate-FileList -fileDepsJson "" -fileListName DscJsonFiles -wxsFilePath $PSScriptRoot\DscResources.wxs -depsPath "$PSScriptRoot..\..\..\$platform\Release\DSCModules\"
Generate-FileComponents -fileListName "DscJsonFiles" -wxsFilePath $PSScriptRoot\DscResources.wxs

View File

@@ -1,102 +0,0 @@
[CmdletBinding()]
Param(
[Parameter(Mandatory = $True)]
[string]$dscWxsFile,
[Parameter(Mandatory = $True)]
[string]$Platform,
[Parameter(Mandatory = $True)]
[string]$Configuration
)
$ErrorActionPreference = 'Stop'
$scriptDir = Split-Path -Parent $MyInvocation.MyCommand.Path
# Find build output directory
$buildOutputDir = Join-Path $scriptDir "..\..\$Platform\$Configuration"
if (-not (Test-Path $buildOutputDir)) {
Write-Error "Build output directory not found: '$buildOutputDir'"
exit 1
}
# Find all DSC manifest JSON files
$dscFiles = Get-ChildItem -Path $buildOutputDir -Filter "microsoft.powertoys.*.settings.dsc.resource.json" -File
if (-not $dscFiles) {
Write-Warning "No DSC manifest files found in '$buildOutputDir'"
# Create empty component group
$wxsContent = @"
<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs">
<?include `$(sys.CURRENTDIR)\Common.wxi?>
<Fragment>
<ComponentGroup Id="DscResourcesComponentGroup">
</ComponentGroup>
</Fragment>
</Wix>
"@
Set-Content -Path $dscWxsFile -Value $wxsContent
exit 0
}
Write-Host "Found $($dscFiles.Count) DSC manifest file(s)"
# Generate WiX fragment
$wxsContent = @"
<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs">
<?include `$(sys.CURRENTDIR)\Common.wxi?>
<Fragment>
<DirectoryRef Id="DSCModulesReferenceFolder">
"@
$componentRefs = @()
foreach ($file in $dscFiles) {
$componentId = "DscResource_" + ($file.BaseName -replace '[^A-Za-z0-9_]', '_')
$fileId = $componentId + "_File"
$guid = [System.Guid]::NewGuid().ToString().ToUpper()
$componentRefs += $componentId
$wxsContent += @"
<Component Id="$componentId" Guid="{$guid}" Directory="DSCModulesReferenceFolder">
<RegistryKey Root="`$(var.RegistryScope)" Key="Software\Classes\powertoys\components">
<RegistryValue Type="string" Name="$componentId" Value="" KeyPath="yes"/>
</RegistryKey>
<File Id="$fileId" Source="`$(var.BinDir)$($file.Name)" Vital="no"/>
</Component>
"@
}
$wxsContent += @"
</DirectoryRef>
</Fragment>
<Fragment>
<ComponentGroup Id="DscResourcesComponentGroup">
"@
foreach ($componentId in $componentRefs) {
$wxsContent += @"
<ComponentRef Id="$componentId"/>
"@
}
$wxsContent += @"
</ComponentGroup>
</Fragment>
</Wix>
"@
# Write the WiX file
Set-Content -Path $dscWxsFile -Value $wxsContent
Write-Host "Generated DSC resources WiX fragment: '$dscWxsFile'"

View File

@@ -2,17 +2,9 @@
<configuration>
<packageSources>
<clear />
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" />
<add key="PowerToysPublicDependencies" value="https://pkgs.dev.azure.com/shine-oss/PowerToys/_packaging/PowerToysPublicDependencies/nuget/v3/index.json" />
</packageSources>
<packageSourceMapping>
<packageSource key="nuget.org">
<package pattern="Microsoft.SemanticKernel*" />
<package pattern="Microsoft.Extensions.*" />
<package pattern="System.*" />
<package pattern="OpenAI" />
<package pattern="Azure.*" />
</packageSource>
<packageSource key="PowerToysPublicDependencies">
<package pattern="*" />
</packageSource>

View File

@@ -1,32 +0,0 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\Common.Dotnet.CsWinRT.props" />
<Import Project="..\Common.SelfContained.props" />
<PropertyGroup>
<OutputType>Exe</OutputType>
<RootNamespace>PowerToys.McpServer</RootNamespace>
<AssemblyName>PowerToys.McpServer</AssemblyName>
<Nullable>enable</Nullable>
<OutputPath>..\..\$(Platform)\$(Configuration)</OutputPath>
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
<AppendRuntimeIdentifierToOutputPath>false</AppendRuntimeIdentifierToOutputPath>
</PropertyGroup>
<PropertyGroup>
<ApplicationManifest>PowerToys.McpServer.dev.manifest</ApplicationManifest>
</PropertyGroup>
<PropertyGroup Condition="'$(CIBuild)'=='true'">
<ApplicationManifest>PowerToys.McpServer.prod.manifest</ApplicationManifest>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Hosting" />
<PackageReference Include="ModelContextProtocol" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\settings-ui\Settings.UI.Library\Settings.UI.Library.csproj" />
<ProjectReference Include="..\common\ManagedCommon\ManagedCommon.csproj" />
</ItemGroup>
</Project>

View File

@@ -1,8 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1">
<assemblyIdentity version="1.0.0.0" name="PowerToys.McpServer.app" />
<msix xmlns="urn:schemas-microsoft-com:msix.v1"
publisher="CN=PowerToys Dev, O=PowerToys, L=Redmond, S=Washington, C=US"
packageName="Microsoft.PowerToys.SparseApp"
applicationId="PowerToys.McpServer" />
</assembly>

View File

@@ -1,8 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1">
<assemblyIdentity version="1.0.0.0" name="PowerToys.McpServer.app" />
<msix xmlns="urn:schemas-microsoft-com:msix.v1"
publisher="CN=Microsoft Corporation, O=Microsoft Corporation, L=Redmond, S=Washington, C=US"
packageName="Microsoft.PowerToys.SparseApp"
applicationId="PowerToys.McpServer" />
</assembly>

View File

@@ -1,57 +0,0 @@
// Copyright (c) Microsoft Corporation
// The Microsoft Corporation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using System;
using System.IO;
using System.Threading.Tasks;
using ManagedCommon;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.Logging;
using ModelContextProtocol.Server;
using PowerToys.McpServer.Tools;
namespace PowerToys.McpServer
{
internal sealed class Program
{
private static async Task<int> Main(string[] args)
{
// Initialize PowerToys logger
// Logger.InitializeLogger expects path relative to Constants.AppDataPath()
// which already points to LocalAppData\Microsoft\PowerToys
string logPath = Path.Combine("\\McpServer", "Logs");
Logger.InitializeLogger(logPath);
Logger.LogInfo("Starting PowerToys MCP Server with official SDK");
try
{
var builder = Host.CreateApplicationBuilder(args);
// Configure all logs to go to stderr (required for MCP protocol)
builder.Logging.AddConsole(consoleLogOptions =>
{
consoleLogOptions.LogToStandardErrorThreshold = LogLevel.Trace;
});
// Register MCP server with stdio transport and tools
builder.Services
.AddMcpServer()
.WithStdioServerTransport()
.WithToolsFromAssembly();
Logger.LogInfo("Building and running MCP host...");
await builder.Build().RunAsync();
Logger.LogInfo("MCP server shutdown complete");
return 0;
}
catch (Exception ex)
{
Logger.LogError("Fatal error in MCP server", ex);
return 1;
}
}
}
}

View File

@@ -1,102 +0,0 @@
# PowerToys Model Context Protocol Server
This module hosts a standalone Model Context Protocol (MCP) server that exposes PowerToys functionality to MCP-compliant AI agents. The server is built as a .NET 9 console application that implements the MCP specification using the official ModelContextProtocol SDK.
## Project Structure
- **Program.cs**: Main entry point that configures the MCP server with stdio transport
- **Tools/AwakeTools.cs**: Implementation of Awake-related MCP tools
- **PowerToys.McpServer.csproj**: .NET 9 project configuration with MCP dependencies
## Dependencies
- **Microsoft.Extensions.Hosting**: For hosting infrastructure and dependency injection
- **ModelContextProtocol**: Official MCP SDK for .NET
- **PowerToys Settings Library**: Integration with PowerToys settings system
- **ManagedCommon**: PowerToys logging and utilities
## Available Tools
| Tool Name | Description | Parameters | Module |
|-----------|-------------|------------|--------|
| `GetAwakeStatus` | Returns the current Awake configuration (mode, timers, display policy) | None | Awake |
| `SetAwakePassive` | Set Awake to passive mode (allow system to sleep normally) | None | Awake |
| `SetAwakeIndefinite` | Set Awake to indefinite mode (keep system awake until manually changed) | `keepDisplayOn` (bool), `force` (bool) | Awake |
| `SetAwakeTimed` | Set Awake to timed mode (keep system awake for a specific duration) | `durationSeconds` (int), `keepDisplayOn` (bool), `force` (bool) | Awake |
## Building and Running
### Prerequisites
- .NET 9 SDK
- Visual Studio 2022 (recommended) or VS Code with C# extension
### Build
```bash
# From PowerToys root directory
msbuild src/McpServer/PowerToys.McpServer.csproj /p:Platform=x64 /p:Configuration=Debug
# Or using dotnet CLI
cd src/McpServer
dotnet build -c Debug
```
### Run the Server
The executable is built to `x64\Debug\PowerToys.McpServer.exe`. The server communicates over standard input/output using MCP framing (`Content-Length` header followed by JSON).
**Example MCP Client Session:**
1. Client sends `initialize` request with MCP version and capabilities
2. Client calls `tools/list` to discover available PowerToys tools
3. Client invokes `tools/call` with the desired tool name and arguments
4. Server responds with tool execution results or errors
The server will remain active until the process is terminated or a `shutdown` request is received.
### Logging
- Application logs are written to `%LOCALAPPDATA%\Microsoft\PowerToys\McpServer\Logs\`
- MCP protocol logs are sent to stderr (required by MCP specification)
## Architecture
The server uses the official ModelContextProtocol .NET SDK and follows these patterns:
- **Tool Discovery**: Tools are automatically discovered using `WithToolsFromAssembly()`
- **Tool Attributes**: Methods marked with `[McpServerTool]` and `[Description]` are exposed as MCP tools
- **Parameter Binding**: Method parameters are automatically bound from MCP tool call arguments
- **Error Handling**: Exceptions are caught and returned as MCP error responses
- **Settings Integration**: Uses PowerToys settings system for configuration persistence
## Adding New Module Tools
1. Create a new static class in the `Tools/` directory (e.g., `FancyZonesTools.cs`)
2. Mark the class with `[McpServerToolType]` attribute
3. Implement static methods with `[McpServerTool]` and `[Description]` attributes:
```csharp
[McpServerToolType]
public static class MyModuleTools
{
[McpServerTool]
[Description("Description of what this tool does")]
public static JsonObject MyTool(
[Description("Parameter description")] string parameter)
{
// Implementation here
return new JsonObject();
}
}
```
4. Follow existing patterns in `AwakeTools.cs` for:
- Settings integration using `SettingsUtils`
- Logging using `Logger.LogInfo/LogError`
- Error handling and response formatting
- PowerToys process detection and module status checks
## Integration with PowerToys
The MCP server integrates with PowerToys through:
- **Settings System**: Uses the same settings files as the main PowerToys application
- **Process Management**: Detects and interacts with running PowerToys processes
- **Module Status**: Checks if specific PowerToys modules are enabled
- **Logging**: Uses PowerToys logging infrastructure for troubleshooting
Refer to the PowerToys developer documentation for build and packaging instructions.

View File

@@ -1,694 +0,0 @@
// Copyright (c) Microsoft Corporation
// The Microsoft Corporation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using System;
using System.ComponentModel;
using System.Diagnostics;
using System.Globalization;
using System.IO;
using System.Text.Json.Nodes;
using ManagedCommon;
using Microsoft.PowerToys.Settings.UI.Library;
using ModelContextProtocol.Server;
using Lock = System.Threading.Lock;
namespace PowerToys.McpServer.Tools
{
/// <summary>
/// MCP tools for PowerToys Awake module.
/// </summary>
[McpServerToolType]
public static class AwakeTools
{
private static readonly SettingsUtils SettingsUtils = new SettingsUtils();
private const string PowerToysProcessName = "PowerToys";
private const string AwakeExecutableName = "PowerToys.Awake.exe";
private static readonly string[] AwakeRelativeSearchPaths =
[
AwakeExecutableName,
Path.Combine("modules", "Awake", AwakeExecutableName),
];
/// <summary>
/// Gets the current Awake mode and configuration.
/// </summary>
/// <returns>JSON object with current Awake status.</returns>
[McpServerTool]
[Description("Get the current Awake mode and configuration from the PowerToys settings store.")]
public static JsonObject GetAwakeStatus()
{
try
{
(bool powerToysRunning, bool awakeModuleEnabled) = CheckPowerToysAndAwakeStatus();
if (!powerToysRunning || !awakeModuleEnabled)
{
if (IsAwakeProcessRunning())
{
// Awake is running via CLI, but we cannot determine its actual configuration
Logger.LogInfo("[MCP] Detected Awake CLI process running while PowerToys is not active or Awake module is disabled.");
return AwakeStatusPayload.CreateUnknownActive().ToJsonObject();
}
return AwakeStatusPayload.CreateInactive().ToJsonObject();
}
// PowerToys is running and Awake module is enabled
bool awakeProcessRunning = IsAwakeProcessRunning();
AwakeSettings settings = SettingsUtils.GetSettingsOrDefault<AwakeSettings>(AwakeSettings.ModuleName);
string summary = FormatAwakeDescription(settings);
if (awakeProcessRunning)
{
summary = $"{summary} An Awake process is already running with the current configuration. To override the active session and apply new settings, use force=true.";
}
AwakeStatusPayload payload = AwakeStatusPayload.FromSettings(settings, summary);
Logger.LogInfo("[MCP] Retrieved Awake status via SDK tool.");
return payload.ToJsonObject();
}
catch (Exception ex)
{
Logger.LogError("[MCP] Failed to read Awake status.", ex);
return AwakeStatusPayload.CreateError(ex.Message).ToJsonObject();
}
}
/// <summary>
/// Sets the Awake mode to passive (allow system sleep).
/// </summary>
/// <returns>JSON object with updated Awake status.</returns>
[McpServerTool]
[Description("Set Awake to passive mode (allow system to sleep normally).")]
public static JsonObject SetAwakePassive()
{
try
{
(bool powerToysRunning, bool awakeModuleEnabled) = CheckPowerToysAndAwakeStatus();
if (!powerToysRunning || !awakeModuleEnabled)
{
StopAwakeProcesses();
Logger.LogInfo("[MCP] Stopped all Awake processes because PowerToys is not running.");
return AwakeStatusPayload.CreateInactive().ToJsonObject();
}
AwakeSettings settings = SettingsUtils.GetSettingsOrDefault<AwakeSettings>(AwakeSettings.ModuleName);
settings.Properties.Mode = AwakeMode.PASSIVE;
settings.Properties.KeepDisplayOn = false;
settings.Properties.IntervalHours = 0;
settings.Properties.IntervalMinutes = 0;
SettingsUtils.SaveSettings(settings.ToJsonString(), AwakeSettings.ModuleName);
string confirmation = FormatAwakeDescription(settings);
Logger.LogInfo($"[MCP] {confirmation}");
AwakeStatusPayload payload = AwakeStatusPayload.FromSettings(settings, confirmation);
return payload.ToJsonObject();
}
catch (Exception ex)
{
Logger.LogError("[MCP] Failed to set Awake to passive.", ex);
return AwakeStatusPayload.CreateError(ex.Message).ToJsonObject();
}
}
/// <summary>
/// Sets the Awake mode to indefinite (keep system awake forever).
/// </summary>
/// <param name="keepDisplayOn">Whether to keep the display on. Default is true.</param>
/// <returns>JSON object with updated Awake status.</returns>
[McpServerTool]
[Description("Set Awake to indefinite mode (keep system awake until manually changed).")]
public static JsonObject SetAwakeIndefinite(
[Description("Whether to keep the display on")] bool keepDisplayOn = true,
[Description("Force the change even if Awake is already running (default: false)")] bool force = false)
{
try
{
(bool powerToysRunning, bool awakeModuleEnabled) = CheckPowerToysAndAwakeStatus();
if (!powerToysRunning || !awakeModuleEnabled)
{
return AwakeStatusPayload.CreateError(
"Indefinite mode requires PowerToys to be running with Awake module enabled. CLI mode does not support indefinite operation.").ToJsonObject();
}
AwakeSettings settings = SettingsUtils.GetSettingsOrDefault<AwakeSettings>(AwakeSettings.ModuleName);
if (!force && IsAwakeActive(settings))
{
return BuildActiveProcessResponse(settings, true, false);
}
settings.Properties.Mode = AwakeMode.INDEFINITE;
settings.Properties.KeepDisplayOn = keepDisplayOn;
settings.Properties.IntervalHours = 0;
settings.Properties.IntervalMinutes = 0;
SettingsUtils.SaveSettings(settings.ToJsonString(), AwakeSettings.ModuleName);
string confirmation = FormatAwakeDescription(settings);
Logger.LogInfo($"[MCP] {confirmation}");
AwakeStatusPayload payload = AwakeStatusPayload.FromSettings(settings, confirmation);
return payload.ToJsonObject();
}
catch (Exception ex)
{
Logger.LogError("[MCP] Failed to set Awake to indefinite.", ex);
return AwakeStatusPayload.CreateError(ex.Message).ToJsonObject();
}
}
/// <summary>
/// Sets the Awake mode to expire at a specific date and time.
/// </summary>
/// <param name="expireAt">ISO 8601 date/time when Awake should expire (e.g., "2025-10-22T15:30:00").</param>
/// <param name="keepDisplayOn">Whether to keep the display on. Default is true.</param>
/// <returns>JSON object with updated Awake status.</returns>
[McpServerTool]
[Description("Set Awake to expire at a specific date and time (ISO 8601 format).")]
public static JsonObject SetAwakeExpireAt(
[Description("ISO 8601 date/time when Awake should expire (e.g., \"2025-10-22T15:30:00\")")] string expireAt,
[Description("Whether to keep the display on")] bool keepDisplayOn = true,
[Description("Force the change even if Awake is already running (default: false)")] bool force = false)
{
try
{
if (!DateTimeOffset.TryParse(expireAt, out DateTimeOffset expirationDateTime))
{
return AwakeStatusPayload.CreateError($"Invalid date format: '{expireAt}'. Please use ISO 8601 format (e.g., '2025-10-22T15:30:00').").ToJsonObject();
}
if (expirationDateTime <= DateTimeOffset.Now)
{
return AwakeStatusPayload.CreateError("Expiration time must be in the future.").ToJsonObject();
}
(bool powerToysRunning, bool awakeModuleEnabled) = CheckPowerToysAndAwakeStatus();
if (!powerToysRunning || !awakeModuleEnabled)
{
TimeSpan duration = expirationDateTime - DateTimeOffset.Now;
uint durationSeconds = (uint)Math.Max(60, duration.TotalSeconds);
return HandleCliScenario(AwakeMode.EXPIRABLE, keepDisplayOn, durationSeconds, force);
}
AwakeSettings settings = SettingsUtils.GetSettingsOrDefault<AwakeSettings>(AwakeSettings.ModuleName);
if (!force && IsAwakeActive(settings))
{
return BuildActiveProcessResponse(settings, true, false);
}
TimeSpan timeSpan = expirationDateTime - DateTimeOffset.Now;
uint hours = (uint)timeSpan.TotalHours;
uint minutes = (uint)Math.Ceiling(timeSpan.TotalMinutes % 60);
if (hours == 0 && minutes == 0)
{
minutes = 1;
}
settings.Properties.Mode = AwakeMode.EXPIRABLE;
settings.Properties.KeepDisplayOn = keepDisplayOn;
settings.Properties.IntervalHours = hours;
settings.Properties.IntervalMinutes = minutes;
settings.Properties.ExpirationDateTime = expirationDateTime;
SettingsUtils.SaveSettings(settings.ToJsonString(), AwakeSettings.ModuleName);
string confirmation = FormatAwakeDescription(settings);
Logger.LogInfo($"[MCP] {confirmation}");
AwakeStatusPayload payload = AwakeStatusPayload.FromSettings(settings, confirmation);
return payload.ToJsonObject();
}
catch (Exception ex)
{
Logger.LogError("[MCP] Failed to set Awake expire-at mode.", ex);
return AwakeStatusPayload.CreateError(ex.Message).ToJsonObject();
}
}
/// <summary>
/// Sets the Awake mode to timed (keep system awake for a specific duration).
/// </summary>
/// <param name="durationSeconds">Duration in seconds (minimum 60).</param>
/// <param name="keepDisplayOn">Whether to keep the display on. Default is true.</param>
/// <returns>JSON object with updated Awake status.</returns>
[McpServerTool]
[Description("Set Awake to timed mode (keep system awake for a specific duration).")]
public static JsonObject SetAwakeTimed(
[Description("Duration in seconds (minimum 60)")] int durationSeconds,
[Description("Whether to keep the display on")] bool keepDisplayOn = true,
[Description("Force the change even if Awake is already running (default: false)")] bool force = false)
{
try
{
if (durationSeconds < 60)
{
durationSeconds = 60;
}
(bool powerToysRunning, bool awakeModuleEnabled) = CheckPowerToysAndAwakeStatus();
if (!powerToysRunning || !awakeModuleEnabled)
{
return HandleCliScenario(AwakeMode.TIMED, keepDisplayOn, (uint)durationSeconds, force);
}
TimeSpan timeSpan = TimeSpan.FromSeconds(durationSeconds);
uint hours = (uint)timeSpan.TotalHours;
uint minutes = (uint)Math.Ceiling(timeSpan.TotalMinutes % 60);
if (hours == 0 && minutes == 0)
{
minutes = 1;
}
AwakeSettings settings = SettingsUtils.GetSettingsOrDefault<AwakeSettings>(AwakeSettings.ModuleName);
if (!force && IsAwakeActive(settings))
{
return BuildActiveProcessResponse(settings, true, false);
}
settings.Properties.Mode = AwakeMode.TIMED;
settings.Properties.KeepDisplayOn = keepDisplayOn;
settings.Properties.IntervalHours = hours;
settings.Properties.IntervalMinutes = minutes;
settings.Properties.ExpirationDateTime = DateTimeOffset.Now.Add(timeSpan);
SettingsUtils.SaveSettings(settings.ToJsonString(), AwakeSettings.ModuleName);
string confirmation = FormatAwakeDescription(settings);
Logger.LogInfo($"[MCP] {confirmation}");
AwakeStatusPayload payload = AwakeStatusPayload.FromSettings(settings, confirmation);
return payload.ToJsonObject();
}
catch (Exception ex)
{
Logger.LogError("[MCP] Failed to set Awake to timed mode.", ex);
return AwakeStatusPayload.CreateError(ex.Message).ToJsonObject();
}
}
private static string FormatAwakeDescription(AwakeSettings settings)
{
var mode = settings.Properties.Mode.ToString().ToLowerInvariant();
var display = settings.Properties.KeepDisplayOn ? "display on" : "display off";
return settings.Properties.Mode switch
{
AwakeMode.PASSIVE => "Awake mode: passive (system sleep allowed)",
AwakeMode.INDEFINITE => $"Awake mode: indefinite, {display}",
AwakeMode.TIMED => $"Awake mode: timed ({settings.Properties.IntervalHours}h {settings.Properties.IntervalMinutes}m), {display}",
AwakeMode.EXPIRABLE => $"Awake mode: expirable (until {settings.Properties.ExpirationDateTime:yyyy-MM-dd HH:mm}), {display}",
_ => $"Awake mode: {mode}",
};
}
private static JsonObject BuildActiveProcessResponse(AwakeSettings settings, bool powerToysRunning, bool launchedViaCli)
{
return AwakeStatusPayload.CreateError(
"Awake is already running. Use force=true to override.",
settings).ToJsonObject();
}
private static bool IsPowerToysRunning()
{
try
{
return Process.GetProcessesByName(PowerToysProcessName).Length > 0;
}
catch (Exception ex)
{
Logger.LogWarning($"[MCP] Unable to determine PowerToys runner status: {ex.Message}");
return true;
}
}
/// <summary>
/// Gets whether the Awake module is enabled in PowerToys settings.
/// </summary>
/// <returns>True if Awake module is enabled, false otherwise</returns>
private static bool IsAwakeModuleEnabled()
{
try
{
var generalSettings = SettingsUtils.GetSettings<GeneralSettings>();
return generalSettings?.Enabled?.Awake == true;
}
catch
{
// If we can't read settings, assume disabled
return false;
}
}
/// <summary>
/// Checks PowerToys and Awake module status.
/// </summary>
/// <returns>Tuple containing (powerToysRunning, awakeModuleEnabled)</returns>
private static (bool PowerToysRunning, bool AwakeModuleEnabled) CheckPowerToysAndAwakeStatus()
{
bool powerToysRunning = IsPowerToysRunning();
bool awakeModuleEnabled = powerToysRunning && IsAwakeModuleEnabled();
return (powerToysRunning, awakeModuleEnabled);
}
/// <summary>
/// Handles CLI scenario when PowerToys is not running or Awake module is disabled.
/// </summary>
/// <param name="mode">The Awake mode to set</param>
/// <param name="keepDisplayOn">Whether to keep display on</param>
/// <param name="durationSeconds">Duration in seconds (0 for indefinite)</param>
/// <param name="force">Whether to force override existing process</param>
/// <returns>JSON response for CLI scenario</returns>
private static JsonObject HandleCliScenario(AwakeMode mode, bool keepDisplayOn, uint durationSeconds, bool force)
{
if (!force && IsAwakeProcessRunning())
{
return AwakeStatusPayload.CreateError(
"Awake is already running and PowerToys is not active. Use force=true to override.").ToJsonObject();
}
if (IsAwakeProcessRunning())
{
StopAwakeProcesses();
}
JsonObject cliPayload = StartAwakeCliProcess(mode, keepDisplayOn, durationSeconds);
return cliPayload;
}
private static JsonObject StartAwakeCliProcess(AwakeMode mode, bool keepDisplayOn, uint durationSeconds)
{
try
{
if (!TryResolveAwakeExecutable(out string executablePath))
{
throw new FileNotFoundException("PowerToys.Awake.exe was not found near the MCP server executable.");
}
ProcessStartInfo startInfo = CreateSimpleStartInfo(executablePath, mode, keepDisplayOn, durationSeconds);
Process? launchedProcess = Process.Start(startInfo);
if (launchedProcess is null)
{
throw new InvalidOperationException("Failed to start PowerToys.Awake.exe.");
}
// No tracking, just launch and forget
launchedProcess.Dispose();
AwakeSettings snapshot = BuildAwakeSnapshot(mode, keepDisplayOn, durationSeconds);
string confirmation = FormatAwakeDescription(snapshot);
Logger.LogInfo($"[MCP] Launched Awake CLI for mode {mode} (PowerToys not running).");
AwakeStatusPayload payload = AwakeStatusPayload.FromSettings(snapshot, confirmation);
return payload.ToJsonObject();
}
catch (Exception ex)
{
Logger.LogError("[MCP] Failed to start Awake CLI.", ex);
return AwakeStatusPayload.CreateError(ex.Message).ToJsonObject();
}
}
private static ProcessStartInfo CreateSimpleStartInfo(string executablePath, AwakeMode mode, bool keepDisplayOn, uint durationSeconds)
{
string workingDirectory = Path.GetDirectoryName(executablePath) ?? AppDomain.CurrentDomain.BaseDirectory;
var startInfo = new ProcessStartInfo(executablePath)
{
UseShellExecute = false,
CreateNoWindow = true,
WorkingDirectory = string.IsNullOrEmpty(workingDirectory) ? AppDomain.CurrentDomain.BaseDirectory : workingDirectory,
};
startInfo.ArgumentList.Add("--display-on");
startInfo.ArgumentList.Add(keepDisplayOn ? "true" : "false");
if (mode == AwakeMode.TIMED && durationSeconds > 0)
{
startInfo.ArgumentList.Add("--time-limit");
startInfo.ArgumentList.Add(durationSeconds.ToString(CultureInfo.InvariantCulture));
}
else if (mode == AwakeMode.EXPIRABLE && durationSeconds > 0)
{
// For EXPIRABLE mode, convert duration to expiration datetime
DateTimeOffset expirationDateTime = DateTimeOffset.Now.AddSeconds(durationSeconds);
startInfo.ArgumentList.Add("--expire-at");
startInfo.ArgumentList.Add(expirationDateTime.ToString("O")); // ISO 8601 format
}
return startInfo;
}
private static void StopAwakeProcesses()
{
string processName = Path.GetFileNameWithoutExtension(AwakeExecutableName);
try
{
Process[] awakeProcesses = Process.GetProcessesByName(processName);
foreach (Process process in awakeProcesses)
{
try
{
if (!process.HasExited)
{
process.Kill(true);
process.WaitForExit(TimeSpan.FromSeconds(5));
}
}
catch (Exception ex)
{
Logger.LogWarning($"[MCP] Failed to terminate Awake process {process.Id}: {ex.Message}");
}
finally
{
process.Dispose();
}
}
}
catch (Exception ex)
{
Logger.LogWarning($"[MCP] Failed to enumerate Awake processes: {ex.Message}");
}
}
private static AwakeSettings BuildAwakeSnapshot(AwakeMode mode, bool keepDisplayOn, uint durationSeconds)
{
var snapshot = new AwakeSettings();
snapshot.Properties.Mode = mode;
snapshot.Properties.KeepDisplayOn = keepDisplayOn;
if (mode == AwakeMode.TIMED && durationSeconds > 0)
{
TimeSpan timeSpan = TimeSpan.FromSeconds(durationSeconds);
snapshot.Properties.IntervalHours = (uint)timeSpan.TotalHours;
snapshot.Properties.IntervalMinutes = (uint)Math.Ceiling(timeSpan.TotalMinutes % 60);
snapshot.Properties.ExpirationDateTime = DateTimeOffset.Now.Add(timeSpan);
}
else if (mode == AwakeMode.EXPIRABLE && durationSeconds > 0)
{
snapshot.Properties.IntervalHours = 0;
snapshot.Properties.IntervalMinutes = 0;
snapshot.Properties.ExpirationDateTime = DateTimeOffset.Now.AddSeconds(durationSeconds);
}
else
{
snapshot.Properties.IntervalHours = 0;
snapshot.Properties.IntervalMinutes = 0;
snapshot.Properties.ExpirationDateTime = DateTimeOffset.Now;
}
return snapshot;
}
private static bool TryResolveAwakeExecutable(out string executablePath)
{
string baseDirectory = AppDomain.CurrentDomain.BaseDirectory;
if (TryResolveAwakeExecutableFrom(baseDirectory, out executablePath))
{
return true;
}
string? parentDirectory = Directory.GetParent(baseDirectory)?.FullName;
if (!string.IsNullOrEmpty(parentDirectory) && TryResolveAwakeExecutableFrom(parentDirectory, out executablePath))
{
return true;
}
executablePath = string.Empty;
return false;
}
private static bool TryResolveAwakeExecutableFrom(string rootDirectory, out string executablePath)
{
foreach (string relativePath in AwakeRelativeSearchPaths)
{
string candidate = Path.Combine(rootDirectory, relativePath);
if (File.Exists(candidate))
{
executablePath = candidate;
return true;
}
}
executablePath = string.Empty;
return false;
}
private static bool IsAwakeProcessRunning()
{
try
{
string processName = Path.GetFileNameWithoutExtension(AwakeExecutableName);
return Process.GetProcessesByName(processName).Length > 0;
}
catch (Exception ex)
{
Logger.LogWarning($"[MCP] Unable to determine Awake process status: {ex.Message}");
return false;
}
}
private static bool IsAwakeActive(AwakeSettings settings)
{
// Only check if Awake module is enabled
return IsAwakeModuleEnabled();
}
private sealed class AwakeStatusPayload
{
internal string Mode { get; set; } = "unknown";
internal bool? KeepDisplayOn { get; set; }
internal uint? IntervalHours { get; set; }
internal uint? IntervalMinutes { get; set; }
internal string? ExpirationDateTime { get; set; }
internal string Summary { get; set; } = string.Empty;
internal bool Success { get; set; } = true;
internal string? ErrorMessage { get; set; }
internal JsonObject ToJsonObject()
{
var result = new JsonObject
{
["mode"] = Mode,
["summary"] = Summary,
};
// Add properties only if they have values
if (KeepDisplayOn.HasValue)
{
result["keepDisplayOn"] = KeepDisplayOn.Value;
}
if (IntervalHours.HasValue)
{
result["intervalHours"] = IntervalHours.Value;
}
if (IntervalMinutes.HasValue)
{
result["intervalMinutes"] = IntervalMinutes.Value;
}
if (!string.IsNullOrEmpty(ExpirationDateTime))
{
result["expirationDateTime"] = ExpirationDateTime;
}
// Add error handling properties
if (!Success)
{
result["success"] = false;
if (!string.IsNullOrEmpty(ErrorMessage))
{
result["error"] = ErrorMessage;
}
}
return result;
}
internal static AwakeStatusPayload FromSettings(AwakeSettings settings, string summary)
{
var payload = new AwakeStatusPayload
{
Mode = settings.Properties.Mode.ToString().ToLowerInvariant(),
Summary = summary,
};
// Only include properties relevant to the current mode
if (settings.Properties.Mode != AwakeMode.PASSIVE)
{
payload.KeepDisplayOn = settings.Properties.KeepDisplayOn;
}
if (settings.Properties.Mode == AwakeMode.TIMED || settings.Properties.Mode == AwakeMode.EXPIRABLE)
{
payload.IntervalHours = settings.Properties.IntervalHours;
payload.IntervalMinutes = settings.Properties.IntervalMinutes;
payload.ExpirationDateTime = settings.Properties.ExpirationDateTime.ToString("O");
}
return payload;
}
internal static AwakeStatusPayload CreateInactive()
{
return new AwakeStatusPayload
{
Mode = "inactive",
Summary = "PowerToys Awake is not running because PowerToys is not active.",
};
}
internal static AwakeStatusPayload CreateUnknownActive()
{
return new AwakeStatusPayload
{
Mode = "unknown",
Summary = "An Awake process is currently running, but its configuration cannot be determined. To terminate the existing process and start with new settings, use force=true.",
};
}
internal static AwakeStatusPayload CreateError(string errorMessage, AwakeSettings? settings = null)
{
var payload = new AwakeStatusPayload
{
Success = false,
ErrorMessage = errorMessage,
};
if (settings != null)
{
payload.Mode = settings.Properties.Mode.ToString().ToLowerInvariant();
// Only include properties relevant to the current mode
if (settings.Properties.Mode != AwakeMode.PASSIVE)
{
payload.KeepDisplayOn = settings.Properties.KeepDisplayOn;
}
if (settings.Properties.Mode == AwakeMode.TIMED || settings.Properties.Mode == AwakeMode.EXPIRABLE)
{
payload.IntervalHours = settings.Properties.IntervalHours;
payload.IntervalMinutes = settings.Properties.IntervalMinutes;
payload.ExpirationDateTime = settings.Properties.ExpirationDateTime.ToString("O");
}
payload.Summary = "An Awake session is already active with the current settings. To override and change the configuration, use force=true.";
}
else
{
payload.Mode = "unknown";
payload.Summary = "An Awake process is currently running. To terminate the existing process and start with new settings, use force=true.";
}
return payload;
}
}
}
}

View File

@@ -36,7 +36,7 @@
</Capabilities>
<Applications>
<Application Id="PowerToys.OCR" Executable="PowerToys.PowerOCR.exe" uap10:TrustLevel="mediumIL" uap10:RuntimeBehavior="win32App">
<Application Id="PowerToys.OCR" Executable="PowerToys.PowerOCR.exe" EntryPoint="Windows.FullTrustApplication">
<uap:VisualElements
DisplayName="PowerToys.OCR"
Description="PowerToys OCR Module"
@@ -45,7 +45,7 @@
Square44x44Logo="Images\Square44x44Logo.png">
</uap:VisualElements>
</Application>
<Application Id="PowerToys.SettingsUI" Executable="PowerToys.Settings.exe" uap10:TrustLevel="mediumIL" uap10:RuntimeBehavior="win32App">
<Application Id="PowerToys.SettingsUI" Executable="WinUI3Apps\PowerToys.Settings.exe" EntryPoint="Windows.FullTrustApplication">
<uap:VisualElements
DisplayName="PowerToys.SettingsUI"
Description="PowerToys Settings UI"
@@ -54,7 +54,7 @@
Square44x44Logo="Images\Square44x44Logo.png">
</uap:VisualElements>
</Application>
<Application Id="PowerToys.ImageResizerUI" Executable="WinUI3Apps\PowerToys.ImageResizer.exe" uap10:TrustLevel="mediumIL" uap10:RuntimeBehavior="win32App">
<Application Id="PowerToys.ImageResizerUI" Executable="WinUI3Apps\PowerToys.ImageResizer.exe" EntryPoint="Windows.FullTrustApplication">
<uap:VisualElements
DisplayName="PowerToys.ImageResizer"
Description="PowerToys Image Resizer UI"
@@ -63,28 +63,5 @@
Square44x44Logo="Images\Square44x44Logo.png">
</uap:VisualElements>
</Application>
<Application Id="PowerToys.McpServer" Executable="PowerToys.McpServer.exe" uap10:TrustLevel="mediumIL" uap10:RuntimeBehavior="win32App">
<uap:VisualElements
AppListEntry="none"
DisplayName="PowerToys.McpServer"
Description="PowerToys MCP Server"
BackgroundColor="transparent"
Square150x150Logo="Images\Square150x150Logo.png"
Square44x44Logo="Images\Square44x44Logo.png">
</uap:VisualElements>
<Extensions>
<uap3:Extension Category="windows.appExtension">
<uap3:AppExtension
Name="com.microsoft.windows.ai.mcpServer"
Id="PowerToys.McpServer"
DisplayName="PowerToys MCP Server"
PublicFolder="Assets">
<uap3:Properties>
<Registration>mcpServerConfig.json</Registration>
</uap3:Properties>
</uap3:AppExtension>
</uap3:Extension>
</Extensions>
</Application>
</Applications>
</Package>

View File

@@ -1,18 +0,0 @@
{
"manifest_version": "0.1",
"name": "PowerToys-McpServer",
"version": "1.0.0",
"description": "PowerToys McpServer",
"author": {
"name": "Microsoft"
},
"server": {
"type": "binary",
"entry_point": "PowerToys.McpServer.exe",
"mcp_config": {
"command": "PowerToys.McpServer.exe",
"args": [
]
}
}
}

View File

@@ -12,7 +12,8 @@ Param(
[switch]$Clean,
[switch]$ForceCert,
[switch]$NoSign
[switch]$NoSign,
[switch]$CIBuild
)
# PowerToys sparse packaging helper.
@@ -22,7 +23,7 @@ Param(
$ErrorActionPreference = 'Stop'
$isCIBuild = $false
if ($NoSign.IsPresent) {
if ($CIBuild.IsPresent) {
$isCIBuild = $true
} elseif ($env:CIBuild) {
$isCIBuild = $env:CIBuild -ieq 'true'
@@ -291,7 +292,6 @@ try {
$essentialFiles = @(
"AppxManifest.xml"
"Images\*"
"Assets\*"
)
foreach ($filePattern in $essentialFiles) {
@@ -310,11 +310,7 @@ try {
$sourceDir = $sourcePath.TrimEnd('\*')
$targetDir = Join-Path $stagingDir (Split-Path $relativePath.TrimEnd('\*') -Parent)
if (Test-Path $sourceDir) {
$targetSubDir = Join-Path $stagingDir ($relativePath.TrimEnd('\*'))
if (-not (Test-Path $targetSubDir)) {
New-Item -ItemType Directory -Path $targetSubDir -Force | Out-Null
}
Copy-Item -Path "$sourceDir\*" -Destination $targetSubDir -Force -ErrorAction SilentlyContinue
Copy-Item -Path "$sourceDir\*" -Destination $targetDir -Force -ErrorAction SilentlyContinue
}
} else {
# Copy single file

View File

@@ -2,20 +2,22 @@
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<!-- CI Build Configuration -->
<PropertyGroup Condition="'$(CIBuild)'=='true' and '$(ForceSign)' != 'true'">
<PropertyGroup Condition="'$(CIBuild)'=='true'">
<ForceCIPackaging>true</ForceCIPackaging>
<EffectiveCIBuild>true</EffectiveCIBuild>
<NoSignCI>true</NoSignCI>
</PropertyGroup>
<!-- Target to generate sparse MSIX package -->
<Target Name="GenerateSparsePackage" BeforeTargets="PrepareForBuild">
<!-- Use NoSign only for CI builds to avoid certificate issues on hosted agents -->
<PropertyGroup>
<NoSignParam Condition="'$(EffectiveCIBuild)' == 'true'">-NoSign</NoSignParam>
<NoSignParam Condition="'$(EffectiveCIBuild)' != 'true'"></NoSignParam>
<NoSignParam Condition="'$(NoSignCI)' == 'true'">-NoSign</NoSignParam>
<NoSignParam Condition="'$(NoSignCI)' != 'true'"></NoSignParam>
<CIBuildParam Condition="'$(CIBuild)' == 'true'">-CIBuild</CIBuildParam>
<CIBuildParam Condition="'$(CIBuild)' != 'true'"></CIBuildParam>
</PropertyGroup>
<Exec Command="pwsh -NonInteractive -ExecutionPolicy Bypass -File &quot;$(MSBuildThisFileDirectory)BuildSparsePackage.ps1&quot; -Platform $(Platform) -Configuration $(Configuration) $(NoSignParam)"
<Exec Command="pwsh -NonInteractive -ExecutionPolicy Bypass -File &quot;$(MSBuildThisFileDirectory)BuildSparsePackage.ps1&quot; -Platform $(Platform) -Configuration $(Configuration) $(NoSignParam) $(CIBuildParam)"
ContinueOnError="false"
WorkingDirectory="$(MSBuildThisFileDirectory)" />
</Target>
@@ -110,12 +112,6 @@
</Image>
</ItemGroup>
<ItemGroup>
<None Include="Assets\mcpServerConfig.json">
<Filter>Assets</Filter>
</None>
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">

View File

@@ -5,18 +5,11 @@
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
<Extensions>png;jpg;jpeg;gif;bmp;ico</Extensions>
</Filter>
<Filter Include="Assets">
<UniqueIdentifier>{B3E94A82-1F2C-4D3E-A5F6-789ABC012DEF}</UniqueIdentifier>
<Extensions>json;xml;txt</Extensions>
</Filter>
</ItemGroup>
<ItemGroup>
<None Include="AppxManifest.xml" />
<None Include="BuildSparsePackage.ps1" />
<None Include="BuildSparsePackage.cmd" />
<None Include="Assets\mcpServerConfig.json">
<Filter>Assets</Filter>
</None>
</ItemGroup>
<ItemGroup>
<Image Include="Images\Square150x150Logo.png">

View File

@@ -112,6 +112,10 @@ namespace winrt::PowerToys::GPOWrapper::implementation
{
return static_cast<GpoRuleConfigured>(powertoys_gpo::getConfiguredMousePointerCrosshairsEnabledValue());
}
GpoRuleConfigured GPOWrapper::GetConfiguredCursorWrapEnabledValue()
{
return static_cast<GpoRuleConfigured>(powertoys_gpo::getConfiguredCursorWrapEnabledValue());
}
GpoRuleConfigured GPOWrapper::GetConfiguredPowerRenameEnabledValue()
{
return static_cast<GpoRuleConfigured>(powertoys_gpo::getConfiguredPowerRenameEnabledValue());
@@ -192,6 +196,34 @@ namespace winrt::PowerToys::GPOWrapper::implementation
{
return static_cast<GpoRuleConfigured>(powertoys_gpo::getAllowedAdvancedPasteOnlineAIModelsValue());
}
GpoRuleConfigured GPOWrapper::GetAllowedAdvancedPasteOpenAIValue()
{
return static_cast<GpoRuleConfigured>(powertoys_gpo::getAllowedAdvancedPasteOpenAIValue());
}
GpoRuleConfigured GPOWrapper::GetAllowedAdvancedPasteAzureOpenAIValue()
{
return static_cast<GpoRuleConfigured>(powertoys_gpo::getAllowedAdvancedPasteAzureOpenAIValue());
}
GpoRuleConfigured GPOWrapper::GetAllowedAdvancedPasteAzureAIInferenceValue()
{
return static_cast<GpoRuleConfigured>(powertoys_gpo::getAllowedAdvancedPasteAzureAIInferenceValue());
}
GpoRuleConfigured GPOWrapper::GetAllowedAdvancedPasteMistralValue()
{
return static_cast<GpoRuleConfigured>(powertoys_gpo::getAllowedAdvancedPasteMistralValue());
}
GpoRuleConfigured GPOWrapper::GetAllowedAdvancedPasteGoogleValue()
{
return static_cast<GpoRuleConfigured>(powertoys_gpo::getAllowedAdvancedPasteGoogleValue());
}
GpoRuleConfigured GPOWrapper::GetAllowedAdvancedPasteOllamaValue()
{
return static_cast<GpoRuleConfigured>(powertoys_gpo::getAllowedAdvancedPasteOllamaValue());
}
GpoRuleConfigured GPOWrapper::GetAllowedAdvancedPasteFoundryLocalValue()
{
return static_cast<GpoRuleConfigured>(powertoys_gpo::getAllowedAdvancedPasteFoundryLocalValue());
}
GpoRuleConfigured GPOWrapper::GetConfiguredNewPlusEnabledValue()
{
return static_cast<GpoRuleConfigured>(powertoys_gpo::getConfiguredNewPlusEnabledValue());

View File

@@ -35,6 +35,7 @@ namespace winrt::PowerToys::GPOWrapper::implementation
static GpoRuleConfigured GetConfiguredMouseHighlighterEnabledValue();
static GpoRuleConfigured GetConfiguredMouseJumpEnabledValue();
static GpoRuleConfigured GetConfiguredMousePointerCrosshairsEnabledValue();
static GpoRuleConfigured GetConfiguredCursorWrapEnabledValue();
static GpoRuleConfigured GetConfiguredPowerRenameEnabledValue();
static GpoRuleConfigured GetConfiguredPowerLauncherEnabledValue();
static GpoRuleConfigured GetConfiguredQuickAccentEnabledValue();
@@ -54,6 +55,13 @@ namespace winrt::PowerToys::GPOWrapper::implementation
static GpoRuleConfigured GetConfiguredQoiPreviewEnabledValue();
static GpoRuleConfigured GetConfiguredQoiThumbnailsEnabledValue();
static GpoRuleConfigured GetAllowedAdvancedPasteOnlineAIModelsValue();
static GpoRuleConfigured GetAllowedAdvancedPasteOpenAIValue();
static GpoRuleConfigured GetAllowedAdvancedPasteAzureOpenAIValue();
static GpoRuleConfigured GetAllowedAdvancedPasteAzureAIInferenceValue();
static GpoRuleConfigured GetAllowedAdvancedPasteMistralValue();
static GpoRuleConfigured GetAllowedAdvancedPasteGoogleValue();
static GpoRuleConfigured GetAllowedAdvancedPasteOllamaValue();
static GpoRuleConfigured GetAllowedAdvancedPasteFoundryLocalValue();
static GpoRuleConfigured GetConfiguredNewPlusEnabledValue();
static GpoRuleConfigured GetConfiguredWorkspacesEnabledValue();
static GpoRuleConfigured GetConfiguredMwbClipboardSharingEnabledValue();

View File

@@ -38,6 +38,7 @@ namespace PowerToys
static GpoRuleConfigured GetConfiguredMouseHighlighterEnabledValue();
static GpoRuleConfigured GetConfiguredMouseJumpEnabledValue();
static GpoRuleConfigured GetConfiguredMousePointerCrosshairsEnabledValue();
static GpoRuleConfigured GetConfiguredCursorWrapEnabledValue();
static GpoRuleConfigured GetConfiguredMouseWithoutBordersEnabledValue();
static GpoRuleConfigured GetConfiguredPowerRenameEnabledValue();
static GpoRuleConfigured GetConfiguredPowerLauncherEnabledValue();
@@ -58,6 +59,13 @@ namespace PowerToys
static GpoRuleConfigured GetConfiguredQoiPreviewEnabledValue();
static GpoRuleConfigured GetConfiguredQoiThumbnailsEnabledValue();
static GpoRuleConfigured GetAllowedAdvancedPasteOnlineAIModelsValue();
static GpoRuleConfigured GetAllowedAdvancedPasteOpenAIValue();
static GpoRuleConfigured GetAllowedAdvancedPasteAzureOpenAIValue();
static GpoRuleConfigured GetAllowedAdvancedPasteAzureAIInferenceValue();
static GpoRuleConfigured GetAllowedAdvancedPasteMistralValue();
static GpoRuleConfigured GetAllowedAdvancedPasteGoogleValue();
static GpoRuleConfigured GetAllowedAdvancedPasteOllamaValue();
static GpoRuleConfigured GetAllowedAdvancedPasteFoundryLocalValue();
static GpoRuleConfigured GetConfiguredNewPlusEnabledValue();
static GpoRuleConfigured GetConfiguredWorkspacesEnabledValue();
static GpoRuleConfigured GetConfiguredMwbClipboardSharingEnabledValue();

View File

@@ -66,11 +66,5 @@ namespace PowerToys.GPOWrapperProjection
{
return (GpoRuleConfigured)PowerToys.GPOWrapper.GPOWrapper.GetConfiguredWorkspacesEnabledValue();
}
public static GpoRuleConfigured GetConfiguredMcpEnabledValue()
{
// MCP doesn't have GPO support yet, always return NotConfigured
return GpoRuleConfigured.NotConfigured;
}
}
}

View File

@@ -1,14 +0,0 @@
// Copyright (c) Microsoft Corporation
// The Microsoft Corporation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
namespace LanguageModelProvider;
internal static class AppUtils
{
public static string GetThemeAssetSuffix()
{
// Default suffix for assets that are theme-agnostic today.
return string.Empty;
}
}

View File

@@ -2,9 +2,8 @@
// The Microsoft Corporation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using System.Globalization;
using System.Text;
using System.Text.Json;
using ManagedCommon;
using Microsoft.AI.Foundry.Local;
namespace LanguageModelProvider.FoundryLocal;
@@ -12,53 +11,68 @@ internal sealed class FoundryClient
{
public static async Task<FoundryClient?> CreateAsync()
{
var serviceManager = FoundryServiceManager.TryCreate();
if (serviceManager is null)
try
{
return null;
}
Logger.LogInfo("[FoundryClient] Creating Foundry Local client");
if (!await serviceManager.IsRunning().ConfigureAwait(false))
{
if (!await serviceManager.StartService().ConfigureAwait(false))
var manager = new FoundryLocalManager();
// Check if service is already running
if (manager.IsServiceRunning)
{
return null;
Logger.LogInfo("[FoundryClient] Foundry service is already running");
return new FoundryClient(manager);
}
// Start the service using SDK's method
Logger.LogInfo("[FoundryClient] Starting Foundry service using manager.StartServiceAsync()");
await manager.StartServiceAsync().ConfigureAwait(false);
Logger.LogInfo("[FoundryClient] Foundry service started successfully");
return new FoundryClient(manager);
}
var serviceUrl = await serviceManager.GetServiceUrl().ConfigureAwait(false);
if (string.IsNullOrEmpty(serviceUrl))
catch (Exception ex)
{
Logger.LogError($"[FoundryClient] Error creating client: {ex.Message}");
if (ex.InnerException != null)
{
Logger.LogError($"[FoundryClient] Inner exception: {ex.InnerException.Message}");
}
return null;
}
var serviceUri = new Uri(serviceUrl, UriKind.Absolute);
var baseAddress = serviceUri.AbsoluteUri.EndsWith('/')
? serviceUri
: new Uri(serviceUri, "/");
var httpClient = new HttpClient
{
BaseAddress = baseAddress,
Timeout = TimeSpan.FromHours(2),
};
var assemblyVersion = typeof(FoundryClient).Assembly.GetName().Version?.ToString() ?? "unknown";
httpClient.DefaultRequestHeaders.UserAgent.ParseAdd($"foundry-local-cs-sdk/{assemblyVersion}");
return new FoundryClient(serviceManager, httpClient);
}
public FoundryServiceManager ServiceManager { get; }
private readonly HttpClient _httpClient;
private readonly FoundryLocalManager _foundryManager;
private readonly List<FoundryCatalogModel> _catalogModels = [];
private FoundryClient(FoundryServiceManager serviceManager, HttpClient httpClient)
private FoundryClient(FoundryLocalManager foundryManager)
{
ServiceManager = serviceManager;
_httpClient = httpClient;
_foundryManager = foundryManager;
}
public Task<string?> GetServiceUrl()
{
try
{
return Task.FromResult(_foundryManager.Endpoint?.ToString());
}
catch
{
return Task.FromResult<string?>(null);
}
}
public Uri? GetServiceUri()
{
try
{
return _foundryManager.ServiceUri;
}
catch
{
return null;
}
}
public async Task<List<FoundryCatalogModel>> ListCatalogModels()
@@ -70,20 +84,39 @@ internal sealed class FoundryClient
try
{
var response = await _httpClient.GetAsync("/foundry/list").ConfigureAwait(false);
response.EnsureSuccessStatusCode();
Logger.LogInfo("[FoundryClient] Listing catalog models");
var models = await _foundryManager.ListCatalogModelsAsync().ConfigureAwait(false);
var models = await JsonSerializer.DeserializeAsync(
response.Content.ReadAsStream(),
FoundryJsonContext.Default.ListFoundryCatalogModel).ConfigureAwait(false);
if (models is { Count: > 0 })
if (models != null)
{
models.ForEach(_catalogModels.Add);
foreach (var model in models)
{
_catalogModels.Add(new FoundryCatalogModel
{
Name = model.ModelId ?? string.Empty,
DisplayName = model.DisplayName ?? string.Empty,
ProviderType = model.ProviderType ?? string.Empty,
Uri = model.Uri ?? string.Empty,
Version = model.Version ?? string.Empty,
ModelType = model.ModelType ?? string.Empty,
Publisher = model.Publisher ?? string.Empty,
Task = model.Task ?? string.Empty,
FileSizeMb = model.FileSizeMb,
Alias = model.Alias ?? string.Empty,
License = model.License ?? string.Empty,
LicenseDescription = model.LicenseDescription ?? string.Empty,
ParentModelUri = model.ParentModelUri ?? string.Empty,
SupportsToolCalling = model.SupportsToolCalling,
});
}
Logger.LogInfo($"[FoundryClient] Found {_catalogModels.Count} catalog models");
}
}
catch
catch (Exception ex)
{
Logger.LogError($"[FoundryClient] Error listing catalog models: {ex.Message}");
// Surfacing errors here prevents listing other providers; swallow and return cached list instead.
}
@@ -92,138 +125,84 @@ internal sealed class FoundryClient
public async Task<List<FoundryCachedModel>> ListCachedModels()
{
var response = await _httpClient.GetAsync("/openai/models").ConfigureAwait(false);
response.EnsureSuccessStatusCode();
var catalogModels = await ListCatalogModels().ConfigureAwait(false);
var content = await response.Content.ReadAsStringAsync().ConfigureAwait(false);
var modelIds = content
.Trim('[', ']')
.Split(',', StringSplitOptions.TrimEntries | StringSplitOptions.RemoveEmptyEntries)
.Select(id => id.Trim('"'));
List<FoundryCachedModel> models = [];
foreach (var id in modelIds)
try
{
var model = catalogModels.FirstOrDefault(m => m.Name == id);
models.Add(model != null ? new FoundryCachedModel(id, model.Alias) : new FoundryCachedModel(id, null));
}
Logger.LogInfo("[FoundryClient] Listing cached models");
var cachedModels = await _foundryManager.ListCachedModelsAsync().ConfigureAwait(false);
var catalogModels = await ListCatalogModels().ConfigureAwait(false);
return models;
List<FoundryCachedModel> models = [];
foreach (var model in cachedModels)
{
var catalogModel = catalogModels.FirstOrDefault(m => m.Name == model.ModelId);
var alias = catalogModel?.Alias ?? model.Alias;
models.Add(new FoundryCachedModel(model.ModelId ?? string.Empty, alias));
}
Logger.LogInfo($"[FoundryClient] Found {models.Count} cached models");
return models;
}
catch (Exception ex)
{
Logger.LogError($"[FoundryClient] Error listing cached models: {ex.Message}");
return [];
}
}
public async Task<FoundryDownloadResult> DownloadModel(FoundryCatalogModel model, IProgress<float>? progress, CancellationToken cancellationToken = default)
public async Task<bool> IsModelLoaded(string modelId)
{
var models = await ListCachedModels().ConfigureAwait(false);
if (models.Any(m => m.Name == model.Name))
try
{
return new(true, "Model already downloaded");
var loadedModels = await _foundryManager.ListLoadedModelsAsync().ConfigureAwait(false);
var isLoaded = loadedModels.Any(m => m.ModelId == modelId);
Logger.LogInfo($"[FoundryClient] IsModelLoaded({modelId}): {isLoaded}");
Logger.LogInfo($"[FoundryClient] Loaded models: {string.Join(", ", loadedModels.Select(m => m.ModelId))}");
return isLoaded;
}
catch (Exception ex)
{
Logger.LogError($"[FoundryClient] IsModelLoaded exception: {ex.Message}");
return false;
}
}
return await Task.Run(
async () =>
public async Task<bool> EnsureModelLoaded(string modelId)
{
try
{
Logger.LogInfo($"[FoundryClient] EnsureModelLoaded called with: {modelId}");
// Check if already loaded
if (await IsModelLoaded(modelId).ConfigureAwait(false))
{
try
{
var providerType = model.ProviderType.EndsWith("Local", StringComparison.OrdinalIgnoreCase)
? model.ProviderType
: $"{model.ProviderType}Local";
Logger.LogInfo($"[FoundryClient] Model already loaded: {modelId}");
return true;
}
var downloadRequest = new FoundryDownloadBody
{
Model = new FoundryModelDownload
{
Name = model.Name,
Uri = model.Uri,
Publisher = model.Publisher,
ProviderType = providerType,
PromptTemplate = model.PromptTemplate,
},
Token = string.Empty,
IgnorePipeReport = true,
};
// Check if model exists in cache
var cachedModels = await ListCachedModels().ConfigureAwait(false);
Logger.LogInfo($"[FoundryClient] Cached models: {string.Join(", ", cachedModels.Select(m => m.Name))}");
var downloadBodyContext = FoundryJsonContext.Default.FoundryDownloadBody;
string body = JsonSerializer.Serialize(downloadRequest, downloadBodyContext);
if (!cachedModels.Any(m => m.Name == modelId))
{
Logger.LogWarning($"[FoundryClient] Model not found in cache: {modelId}");
return false;
}
using var request = new HttpRequestMessage(HttpMethod.Post, "/openai/download")
{
Content = new StringContent(body, Encoding.UTF8, "application/json"),
};
// Load the model
Logger.LogInfo($"[FoundryClient] Loading model: {modelId}");
await _foundryManager.LoadModelAsync(modelId).ConfigureAwait(false);
using var response = await _httpClient.SendAsync(request, HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false);
response.EnsureSuccessStatusCode();
using var stream = await response.Content.ReadAsStreamAsync(cancellationToken).ConfigureAwait(false);
using var reader = new StreamReader(stream);
StringBuilder jsonBuilder = new();
var collectingJson = false;
var completed = false;
while (!completed && (await reader.ReadLineAsync(cancellationToken).ConfigureAwait(false)) is string line)
{
if (string.IsNullOrWhiteSpace(line))
{
continue;
}
if (line.StartsWith("Total", StringComparison.CurrentCultureIgnoreCase) &&
line.Contains("Downloading", StringComparison.OrdinalIgnoreCase) &&
line.Contains('%'))
{
var percentStr = line.Split('%')[0].Split(' ').Last();
if (double.TryParse(percentStr, NumberStyles.Float, CultureInfo.CurrentCulture, out var percentage))
{
progress?.Report((float)(percentage / 100));
}
}
else if (line.Contains("[DONE]", StringComparison.OrdinalIgnoreCase) ||
line.Contains("All Completed", StringComparison.OrdinalIgnoreCase))
{
collectingJson = true;
}
else if (collectingJson && line.TrimStart().StartsWith('{'))
{
jsonBuilder.AppendLine(line);
}
else if (collectingJson && jsonBuilder.Length > 0)
{
jsonBuilder.AppendLine(line);
if (line.Trim() == "}")
{
completed = true;
}
}
}
var downloadResultContext = FoundryJsonContext.Default.FoundryDownloadResult;
var jsonPayload = jsonBuilder.Length > 0 ? jsonBuilder.ToString() : null;
if (jsonPayload is null)
{
return new FoundryDownloadResult(false, "No completion response received from server.");
}
try
{
return JsonSerializer.Deserialize(jsonPayload, downloadResultContext)
?? new FoundryDownloadResult(false, "Failed to parse completion response.");
}
catch (JsonException ex)
{
return new FoundryDownloadResult(false, $"Failed to parse completion response: {ex.Message}");
}
}
catch (Exception e)
{
return new FoundryDownloadResult(false, e.Message);
}
},
cancellationToken).ConfigureAwait(false);
// Verify it's loaded
var loaded = await IsModelLoaded(modelId).ConfigureAwait(false);
Logger.LogInfo($"[FoundryClient] Model load result: {loaded}");
return loaded;
}
catch (Exception ex)
{
Logger.LogError($"[FoundryClient] EnsureModelLoaded exception: {ex.Message}");
return false;
}
}
}

View File

@@ -1,19 +0,0 @@
// Copyright (c) Microsoft Corporation
// The Microsoft Corporation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using System.Text.Json.Serialization;
namespace LanguageModelProvider.FoundryLocal;
internal sealed class FoundryDownloadBody
{
[JsonPropertyName("Model")]
public required FoundryModelDownload Model { get; init; }
[JsonPropertyName("token")]
public required string Token { get; init; }
[JsonPropertyName("IgnorePipeReport")]
public required bool IgnorePipeReport { get; init; }
}

View File

@@ -12,9 +12,6 @@ namespace LanguageModelProvider.FoundryLocal;
WriteIndented = false)]
[JsonSerializable(typeof(FoundryCatalogModel))]
[JsonSerializable(typeof(List<FoundryCatalogModel>))]
[JsonSerializable(typeof(FoundryDownloadResult))]
[JsonSerializable(typeof(FoundryModelDownload))]
[JsonSerializable(typeof(FoundryDownloadBody))]
internal sealed partial class FoundryJsonContext : JsonSerializerContext
{
}

View File

@@ -1,25 +0,0 @@
// Copyright (c) Microsoft Corporation
// The Microsoft Corporation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using System.Text.Json.Serialization;
namespace LanguageModelProvider.FoundryLocal;
internal sealed class FoundryModelDownload
{
[JsonPropertyName("Name")]
public required string Name { get; init; }
[JsonPropertyName("Uri")]
public required string Uri { get; init; }
[JsonPropertyName("Publisher")]
public required string Publisher { get; init; }
[JsonPropertyName("ProviderType")]
public required string ProviderType { get; init; }
[JsonPropertyName("PromptTemplate")]
public required PromptTemplate? PromptTemplate { get; init; }
}

View File

@@ -1,80 +0,0 @@
// Copyright (c) Microsoft Corporation
// The Microsoft Corporation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using System.Diagnostics;
using System.Text.RegularExpressions;
namespace LanguageModelProvider.FoundryLocal;
internal sealed class FoundryServiceManager
{
public static FoundryServiceManager? TryCreate()
{
return IsAvailable() ? new FoundryServiceManager() : null;
}
private static bool IsAvailable()
{
using var process = new Process();
process.StartInfo.FileName = "where";
process.StartInfo.Arguments = "foundry";
process.StartInfo.RedirectStandardOutput = true;
process.StartInfo.RedirectStandardError = true;
process.StartInfo.UseShellExecute = false;
process.StartInfo.CreateNoWindow = true;
process.Start();
process.WaitForExit();
return process.ExitCode == 0;
}
private static string? GetUrl(string output)
{
var match = Regex.Match(output, @"https?:\/\/[^\/]+:\d+");
return match.Success ? match.Value : null;
}
public async Task<string?> GetServiceUrl()
{
var status = await Utils.RunFoundryWithArguments("service status").ConfigureAwait(false);
if (status.ExitCode != 0 || string.IsNullOrWhiteSpace(status.Output))
{
return null;
}
return GetUrl(status.Output);
}
public async Task<bool> IsRunning()
{
var url = await GetServiceUrl().ConfigureAwait(false);
return url is not null;
}
public async Task<bool> StartService(int maxWaitSeconds = 30)
{
if (await IsRunning().ConfigureAwait(false))
{
return true;
}
// Start foundry service (fire-and-forget, don't wait for the process to exit)
_ = Task.Run(() => Utils.RunFoundryWithArguments("service start"));
// Poll to check if service is running
int elapsedSeconds = 0;
while (elapsedSeconds < maxWaitSeconds)
{
await Task.Delay(1000).ConfigureAwait(false);
elapsedSeconds++;
if (await IsRunning().ConfigureAwait(false))
{
return true;
}
}
return false;
}
}

View File

@@ -1,37 +0,0 @@
// Copyright (c) Microsoft Corporation
// The Microsoft Corporation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using System.Diagnostics;
namespace LanguageModelProvider.FoundryLocal;
internal static class Utils
{
public static async Task<(string? Output, string? Error, int ExitCode)> RunFoundryWithArguments(string arguments)
{
try
{
using var process = new Process();
process.StartInfo.FileName = "foundry";
process.StartInfo.Arguments = arguments;
process.StartInfo.RedirectStandardOutput = true;
process.StartInfo.RedirectStandardError = true;
process.StartInfo.UseShellExecute = false;
process.StartInfo.CreateNoWindow = true;
process.Start();
string? output = await process.StandardOutput.ReadToEndAsync().ConfigureAwait(false);
string? error = await process.StandardError.ReadToEndAsync().ConfigureAwait(false);
await process.WaitForExitAsync().ConfigureAwait(false);
return (output, error, process.ExitCode);
}
catch
{
return (null, null, -1);
}
}
}

View File

@@ -2,13 +2,9 @@
// The Microsoft Corporation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using System;
using System.ClientModel;
using System.Collections.Generic;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using LanguageModelProvider.FoundryLocal;
using ManagedCommon;
using Microsoft.Extensions.AI;
using OpenAI;
@@ -17,7 +13,6 @@ namespace LanguageModelProvider;
public sealed class FoundryLocalModelProvider : ILanguageModelProvider
{
private IEnumerable<ModelDetails>? _downloadedModels;
private IEnumerable<ModelDetails>? _catalogModels;
private FoundryClient? _foundryManager;
private string? _serviceUrl;
@@ -25,46 +20,72 @@ public sealed class FoundryLocalModelProvider : ILanguageModelProvider
public string Name => "FoundryLocal";
public HardwareAccelerator ModelHardwareAccelerator => HardwareAccelerator.FOUNDRYLOCAL;
public string ProviderDescription => "The model will run locally via Foundry Local";
public string UrlPrefix => "fl://";
public string Icon => $"fl{AppUtils.GetThemeAssetSuffix()}.svg";
public string Url => _serviceUrl ?? string.Empty;
public string GetDetailsUrl(ModelDetails details)
{
throw new NotImplementedException();
}
public IChatClient? GetIChatClient(string url)
{
try
{
Logger.LogInfo($"[FoundryLocal] GetIChatClient called with url: {url}");
InitializeAsync().GetAwaiter().GetResult();
}
catch
catch (Exception ex)
{
Logger.LogError($"[FoundryLocal] Failed to initialize: {ex.Message}");
return null;
}
if (string.IsNullOrWhiteSpace(_serviceUrl))
if (string.IsNullOrWhiteSpace(_serviceUrl) || _foundryManager == null)
{
Logger.LogError("[FoundryLocal] Service URL or manager is null");
return null;
}
var modelId = url.Split('/').LastOrDefault();
// Extract model ID from URL (format: fl://modelname)
var modelId = url.Replace(UrlPrefix, string.Empty).Trim('/');
if (string.IsNullOrWhiteSpace(modelId))
{
Logger.LogError("[FoundryLocal] Model ID is empty after extraction");
return null;
}
Logger.LogInfo($"[FoundryLocal] Extracted model ID: {modelId}");
// Ensure the model is loaded before returning chat client
try
{
var isLoaded = _foundryManager.EnsureModelLoaded(modelId).GetAwaiter().GetResult();
if (!isLoaded)
{
Logger.LogError($"[FoundryLocal] Failed to load model: {modelId}");
return null;
}
Logger.LogInfo($"[FoundryLocal] Model is loaded: {modelId}");
}
catch (Exception ex)
{
Logger.LogError($"[FoundryLocal] Exception ensuring model loaded: {ex.Message}");
return null;
}
// Use ServiceUri instead of Endpoint since Endpoint already includes /v1
var baseUri = _foundryManager.GetServiceUri();
if (baseUri == null)
{
Logger.LogError("[FoundryLocal] Service URI is null");
return null;
}
var endpointUri = new Uri($"{baseUri.ToString().TrimEnd('/')}/v1");
Logger.LogInfo($"[FoundryLocal] Creating OpenAI client with endpoint: {endpointUri}");
Logger.LogInfo($"[FoundryLocal] Model ID for chat client: {modelId}");
return new OpenAIClient(
new ApiKeyCredential("none"),
new OpenAIClientOptions { Endpoint = new Uri($"{_serviceUrl}/v1") })
new OpenAIClientOptions { Endpoint = endpointUri })
.GetChatClient(modelId)
.AsIChatClient();
}
@@ -94,34 +115,16 @@ public sealed class FoundryLocalModelProvider : ILanguageModelProvider
{
if (ignoreCached)
{
Logger.LogInfo("[FoundryLocal] Ignoring cached models, resetting");
Reset();
}
await InitializeAsync(cancelationToken);
Logger.LogInfo($"[FoundryLocal] Returning {_downloadedModels?.Count() ?? 0} downloaded models");
return _downloadedModels ?? [];
}
public IEnumerable<ModelDetails> GetAllModelsInCatalog()
{
return _catalogModels ?? [];
}
public async Task<bool> DownloadModel(ModelDetails modelDetails, IProgress<float>? progress, CancellationToken cancellationToken = default)
{
if (_foundryManager == null)
{
return false;
}
if (modelDetails.ProviderModelDetails is not FoundryCatalogModel model)
{
return false;
}
return (await _foundryManager.DownloadModel(model, progress, cancellationToken)).Success;
}
private void Reset()
{
_downloadedModels = null;
@@ -135,38 +138,26 @@ public sealed class FoundryLocalModelProvider : ILanguageModelProvider
return;
}
Logger.LogInfo("[FoundryLocal] Initializing provider");
_foundryManager ??= await FoundryClient.CreateAsync();
if (_foundryManager == null)
{
Logger.LogError("[FoundryLocal] Failed to create Foundry client");
return;
}
_serviceUrl ??= await _foundryManager.ServiceManager.GetServiceUrl();
if (_catalogModels == null || !_catalogModels.Any())
{
_catalogModels = (await _foundryManager.ListCatalogModels()).Select(ToModelDetails).ToArray();
}
_serviceUrl ??= await _foundryManager.GetServiceUrl();
Logger.LogInfo($"[FoundryLocal] Service URL: {_serviceUrl}");
var cachedModels = await _foundryManager.ListCachedModels();
Logger.LogInfo($"[FoundryLocal] Found {cachedModels.Count} cached models");
List<ModelDetails> downloadedModels = [];
foreach (var model in _catalogModels)
{
var cachedModel = cachedModels.FirstOrDefault(m => m.Name == model.Name);
if (cachedModel != default)
{
model.Id = $"{UrlPrefix}{cachedModel.Id}";
downloadedModels.Add(model);
cachedModels.Remove(cachedModel);
}
}
foreach (var model in cachedModels)
{
Logger.LogInfo($"[FoundryLocal] Adding unmatched cached model: {model.Name}");
downloadedModels.Add(new ModelDetails
{
Id = $"fl-{model.Name}",
@@ -180,27 +171,15 @@ public sealed class FoundryLocalModelProvider : ILanguageModelProvider
}
_downloadedModels = downloadedModels;
}
private ModelDetails ToModelDetails(FoundryCatalogModel model)
{
return new ModelDetails
{
Id = $"fl-{model.Name}",
Name = model.Name,
Url = $"{UrlPrefix}{model.Name}",
Description = $"{model.Alias} running locally with Foundry Local",
HardwareAccelerators = [HardwareAccelerator.FOUNDRYLOCAL],
Size = model.FileSizeMb * 1024 * 1024,
SupportedOnQualcomm = true,
License = model.License?.ToLowerInvariant() ?? string.Empty,
ProviderModelDetails = model,
};
Logger.LogInfo($"[FoundryLocal] Initialization complete. Total downloaded models: {downloadedModels.Count}");
}
public async Task<bool> IsAvailable()
{
Logger.LogInfo("[FoundryLocal] Checking availability");
await InitializeAsync();
return _foundryManager != null;
var available = _foundryManager != null;
Logger.LogInfo($"[FoundryLocal] Available: {available}");
return available;
}
}

View File

@@ -12,10 +12,6 @@ public interface ILanguageModelProvider
string UrlPrefix { get; }
string Icon { get; }
HardwareAccelerator ModelHardwareAccelerator { get; }
string ProviderDescription { get; }
Task<IEnumerable<ModelDetails>> GetModelsAsync(bool ignoreCached = false, CancellationToken cancelationToken = default);
@@ -23,8 +19,4 @@ public interface ILanguageModelProvider
IChatClient? GetIChatClient(string url);
string GetIChatClientString(string url);
string GetDetailsUrl(ModelDetails details);
string Url { get; }
}

View File

@@ -10,6 +10,11 @@
<ItemGroup>
<PackageReference Include="Microsoft.Extensions.AI" />
<PackageReference Include="Microsoft.Extensions.AI.OpenAI" />
<PackageReference Include="Microsoft.AI.Foundry.Local" />
<PackageReference Include="OpenAI" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\ManagedCommon\ManagedCommon.csproj" />
</ItemGroup>
</Project>

View File

@@ -26,6 +26,16 @@ namespace ManagedCommon
private static readonly string Version = Assembly.GetExecutingAssembly().GetCustomAttribute<AssemblyFileVersionAttribute>()?.Version ?? "Unknown";
/// <summary>
/// Gets the path to the log directory for the current version of the app.
/// </summary>
public static string CurrentVersionLogDirectoryPath { get; private set; }
/// <summary>
/// Gets the path to the log directory for the app.
/// </summary>
public static string AppLogDirectoryPath { get; private set; }
/// <summary>
/// Initializes the logger and sets the path for logging.
/// </summary>
@@ -42,6 +52,9 @@ namespace ManagedCommon
Directory.CreateDirectory(versionedPath);
}
AppLogDirectoryPath = basePath;
CurrentVersionLogDirectoryPath = versionedPath;
var logFilePath = Path.Combine(versionedPath, "Log_" + DateTime.Now.ToString(@"yyyy-MM-dd", CultureInfo.InvariantCulture) + ".log");
Trace.Listeners.Add(new TextWriterTraceListener(logFilePath));
@@ -130,7 +143,7 @@ namespace ManagedCommon
{
exMessage +=
"Inner exception: " + Environment.NewLine +
ex.InnerException.GetType() + " (" + ex.HResult + "): " + ex.InnerException.Message + Environment.NewLine;
ex.InnerException.GetType() + " (" + ex.InnerException.HResult + "): " + ex.InnerException.Message + Environment.NewLine;
}
exMessage +=

View File

@@ -12,6 +12,7 @@ namespace ManagedCommon
ColorPicker,
CmdPal,
CropAndLock,
CursorWrap,
EnvironmentVariables,
FancyZones,
FileLocksmith,

View File

@@ -0,0 +1,175 @@
// Copyright (c) Microsoft Corporation
// The Microsoft Corporation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
using System.IO;
using System.Linq;
using System.Text.Json;
using Microsoft.PowerToys.Settings.UI.Library;
using Microsoft.PowerToys.Settings.UI.Library.Interfaces;
using Microsoft.PowerToys.Settings.UI.Library.Utilities;
namespace Microsoft.PowerToys.UITest
{
/// <summary>
/// Helper class for configuring PowerToys settings for UI tests.
/// </summary>
public class SettingsConfigHelper
{
private static readonly JsonSerializerOptions IndentedJsonOptions = new() { WriteIndented = true };
private static readonly SettingsUtils SettingsUtils = new SettingsUtils();
/// <summary>
/// Configures global PowerToys settings to enable only specified modules and disable all others.
/// </summary>
/// <param name="modulesToEnable">Array of module names to enable (e.g., "Peek", "FancyZones"). All other modules will be disabled.</param>
/// <exception cref="ArgumentNullException">Thrown when modulesToEnable is null.</exception>
/// <exception cref="InvalidOperationException">Thrown when settings file operations fail.</exception>
[UnconditionalSuppressMessage("Trimming", "IL2026", Justification = "This is test code and will not be trimmed")]
[UnconditionalSuppressMessage("AOT", "IL3050", Justification = "This is test code and will not be AOT compiled")]
public static void ConfigureGlobalModuleSettings(params string[] modulesToEnable)
{
ArgumentNullException.ThrowIfNull(modulesToEnable);
try
{
GeneralSettings settings;
try
{
settings = SettingsUtils.GetSettingsOrDefault<GeneralSettings>();
}
catch (Exception ex)
{
Debug.WriteLine($"Failed to load settings, creating defaults: {ex.Message}");
settings = new GeneralSettings();
}
string settingsJson = settings.ToJsonString();
using (JsonDocument doc = JsonDocument.Parse(settingsJson))
{
var options = new JsonSerializerOptions { WriteIndented = true };
var root = doc.RootElement.Clone();
if (root.TryGetProperty("enabled", out var enabledElement))
{
var enabledModules = new Dictionary<string, bool>();
foreach (var property in enabledElement.EnumerateObject())
{
string moduleName = property.Name;
bool shouldEnable = Array.Exists(modulesToEnable, m => string.Equals(m, moduleName, StringComparison.Ordinal));
enabledModules[moduleName] = shouldEnable;
}
var settingsDict = JsonSerializer.Deserialize<Dictionary<string, object>>(settingsJson);
if (settingsDict != null)
{
settingsDict["enabled"] = enabledModules;
settingsJson = JsonSerializer.Serialize(settingsDict, IndentedJsonOptions);
}
}
}
SettingsUtils.SaveSettings(settingsJson);
string enabledList = modulesToEnable.Length > 0 ? string.Join(", ", modulesToEnable) : "none";
Debug.WriteLine($"Successfully updated global settings");
Debug.WriteLine($"Enabled modules: {enabledList}");
}
catch (Exception ex)
{
Debug.WriteLine($"ERROR in ConfigureGlobalModuleSettings: {ex.Message}");
throw new InvalidOperationException($"Failed to configure global module settings: {ex.Message}", ex);
}
}
/// <summary>
/// Updates a module's settings file. If the file doesn't exist, creates it with default content.
/// If the file exists, reads it and applies the provided update function to modify the settings.
/// </summary>
/// <param name="moduleName">The name of the module (e.g., "Peek", "FancyZones").</param>
/// <param name="defaultSettingsContent">The default JSON content to use if the settings file doesn't exist.</param>
/// <param name="updateSettingsAction">
/// A callback function that modifies the settings dictionary. The function receives the deserialized settings
/// and should modify it in-place. The function should accept a Dictionary&lt;string, object&gt; and not return a value.
/// Example: (settings) => { ((Dictionary&lt;string, object&gt;)settings["properties"])["SomeSetting"] = newValue; }
/// </param>
/// <exception cref="ArgumentNullException">Thrown when moduleName or updateSettingsAction is null.</exception>
/// <exception cref="InvalidOperationException">Thrown when settings file operations fail.</exception>
[UnconditionalSuppressMessage("Trimming", "IL2026", Justification = "This is test code and will not be trimmed")]
[UnconditionalSuppressMessage("AOT", "IL3050", Justification = "This is test code and will not be AOT compiled")]
public static void UpdateModuleSettings(
string moduleName,
string defaultSettingsContent,
Action<Dictionary<string, object>> updateSettingsAction)
{
ArgumentNullException.ThrowIfNull(moduleName);
ArgumentNullException.ThrowIfNull(updateSettingsAction);
try
{
// Build the path to the module settings file
string powerToysSettingsDirectory = Path.Combine(
Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData),
"Microsoft",
"PowerToys");
string moduleDirectory = Path.Combine(powerToysSettingsDirectory, moduleName);
string settingsPath = Path.Combine(moduleDirectory, "settings.json");
// Ensure directory exists
Directory.CreateDirectory(moduleDirectory);
// Read existing settings or use default
string existingJson = string.Empty;
if (File.Exists(settingsPath))
{
existingJson = File.ReadAllText(settingsPath);
}
Dictionary<string, object>? settings;
// If file doesn't exist or is empty, create from defaults
if (string.IsNullOrWhiteSpace(existingJson))
{
if (string.IsNullOrWhiteSpace(defaultSettingsContent))
{
throw new ArgumentException("Default settings content must be provided when file doesn't exist.", nameof(defaultSettingsContent));
}
settings = JsonSerializer.Deserialize<Dictionary<string, object>>(defaultSettingsContent)
?? throw new InvalidOperationException($"Failed to deserialize default settings for {moduleName}");
Debug.WriteLine($"Created default settings for {moduleName} at {settingsPath}");
}
else
{
// Parse existing settings
settings = JsonSerializer.Deserialize<Dictionary<string, object>>(existingJson)
?? throw new InvalidOperationException($"Failed to deserialize existing settings for {moduleName}");
Debug.WriteLine($"Loaded existing settings for {moduleName} from {settingsPath}");
}
// Apply the update action to modify settings
updateSettingsAction(settings);
// Serialize and save the updated settings using SettingsUtils
string updatedJson = JsonSerializer.Serialize(settings, IndentedJsonOptions);
SettingsUtils.SaveSettings(updatedJson, moduleName);
Debug.WriteLine($"Successfully updated settings for {moduleName}");
}
catch (Exception ex)
{
Debug.WriteLine($"ERROR in UpdateModuleSettings for {moduleName}: {ex.Message}");
throw new InvalidOperationException($"Failed to update settings for {moduleName}: {ex.Message}", ex);
}
}
}
}

View File

@@ -8,7 +8,7 @@
<Nullable>enable</Nullable>
<PublishAot>true</PublishAot>
<InvariantGlobalization>true</InvariantGlobalization>
<TargetFramework>net9.0-windows10.0.22621.0</TargetFramework>
<TargetFramework>net9.0-windows10.0.26100.0</TargetFramework>
<UseWindowsForms>true</UseWindowsForms>
<PublishTrimmed>false</PublishTrimmed>
</PropertyGroup>
@@ -21,4 +21,8 @@
<PackageReference Include="CoenM.ImageSharp.ImageHash" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\settings-ui\Settings.UI.Library\Settings.UI.Library.csproj" />
</ItemGroup>
</Project>

View File

@@ -59,6 +59,7 @@ struct LogSettings
inline const static std::string mouseHighlighterLoggerName = "mouse-highlighter";
inline const static std::string mouseJumpLoggerName = "mouse-jump";
inline const static std::string mousePointerCrosshairsLoggerName = "mouse-pointer-crosshairs";
inline const static std::string cursorWrapLoggerName = "cursor-wrap";
inline const static std::string imageResizerLoggerName = "imageresizer";
inline const static std::string powerRenameLoggerName = "powerrename";
inline const static std::string alwaysOnTopLoggerName = "always-on-top";

View File

@@ -3,6 +3,7 @@
#include <Windows.h>
#include <optional>
#include <vector>
#include <string>
namespace powertoys_gpo
{
@@ -51,6 +52,7 @@ namespace powertoys_gpo
const std::wstring POLICY_CONFIGURE_ENABLED_MOUSE_HIGHLIGHTER = L"ConfigureEnabledUtilityMouseHighlighter";
const std::wstring POLICY_CONFIGURE_ENABLED_MOUSE_JUMP = L"ConfigureEnabledUtilityMouseJump";
const std::wstring POLICY_CONFIGURE_ENABLED_MOUSE_POINTER_CROSSHAIRS = L"ConfigureEnabledUtilityMousePointerCrosshairs";
const std::wstring POLICY_CONFIGURE_ENABLED_CURSOR_WRAP = L"ConfigureEnabledUtilityCursorWrap";
const std::wstring POLICY_CONFIGURE_ENABLED_POWER_RENAME = L"ConfigureEnabledUtilityPowerRename";
const std::wstring POLICY_CONFIGURE_ENABLED_POWER_LAUNCHER = L"ConfigureEnabledUtilityPowerLauncher";
const std::wstring POLICY_CONFIGURE_ENABLED_QUICK_ACCENT = L"ConfigureEnabledUtilityQuickAccent";
@@ -82,6 +84,13 @@ namespace powertoys_gpo
const std::wstring POLICY_CONFIGURE_RUN_AT_STARTUP = L"ConfigureRunAtStartup";
const std::wstring POLICY_CONFIGURE_ENABLED_POWER_LAUNCHER_ALL_PLUGINS = L"PowerLauncherAllPluginsEnabledState";
const std::wstring POLICY_ALLOW_ADVANCED_PASTE_ONLINE_AI_MODELS = L"AllowPowerToysAdvancedPasteOnlineAIModels";
const std::wstring POLICY_ALLOW_ADVANCED_PASTE_OPENAI = L"AllowAdvancedPasteOpenAI";
const std::wstring POLICY_ALLOW_ADVANCED_PASTE_AZURE_OPENAI = L"AllowAdvancedPasteAzureOpenAI";
const std::wstring POLICY_ALLOW_ADVANCED_PASTE_AZURE_AI_INFERENCE = L"AllowAdvancedPasteAzureAIInference";
const std::wstring POLICY_ALLOW_ADVANCED_PASTE_MISTRAL = L"AllowAdvancedPasteMistral";
const std::wstring POLICY_ALLOW_ADVANCED_PASTE_GOOGLE = L"AllowAdvancedPasteGoogle";
const std::wstring POLICY_ALLOW_ADVANCED_PASTE_OLLAMA = L"AllowAdvancedPasteOllama";
const std::wstring POLICY_ALLOW_ADVANCED_PASTE_FOUNDRY_LOCAL = L"AllowAdvancedPasteFoundryLocal";
const std::wstring POLICY_MWB_CLIPBOARD_SHARING_ENABLED = L"MwbClipboardSharingEnabled";
const std::wstring POLICY_MWB_FILE_TRANSFER_ENABLED = L"MwbFileTransferEnabled";
const std::wstring POLICY_MWB_USE_ORIGINAL_USER_INTERFACE = L"MwbUseOriginalUserInterface";
@@ -401,6 +410,11 @@ namespace powertoys_gpo
return getUtilityEnabledValue(POLICY_CONFIGURE_ENABLED_MOUSE_POINTER_CROSSHAIRS);
}
inline gpo_rule_configured_t getConfiguredCursorWrapEnabledValue()
{
return getUtilityEnabledValue(POLICY_CONFIGURE_ENABLED_CURSOR_WRAP);
}
inline gpo_rule_configured_t getConfiguredPowerRenameEnabledValue()
{
return getUtilityEnabledValue(POLICY_CONFIGURE_ENABLED_POWER_RENAME);
@@ -575,6 +589,41 @@ namespace powertoys_gpo
return getConfiguredValue(POLICY_ALLOW_ADVANCED_PASTE_ONLINE_AI_MODELS);
}
inline gpo_rule_configured_t getAllowedAdvancedPasteOpenAIValue()
{
return getConfiguredValue(POLICY_ALLOW_ADVANCED_PASTE_OPENAI);
}
inline gpo_rule_configured_t getAllowedAdvancedPasteAzureOpenAIValue()
{
return getConfiguredValue(POLICY_ALLOW_ADVANCED_PASTE_AZURE_OPENAI);
}
inline gpo_rule_configured_t getAllowedAdvancedPasteAzureAIInferenceValue()
{
return getConfiguredValue(POLICY_ALLOW_ADVANCED_PASTE_AZURE_AI_INFERENCE);
}
inline gpo_rule_configured_t getAllowedAdvancedPasteMistralValue()
{
return getConfiguredValue(POLICY_ALLOW_ADVANCED_PASTE_MISTRAL);
}
inline gpo_rule_configured_t getAllowedAdvancedPasteGoogleValue()
{
return getConfiguredValue(POLICY_ALLOW_ADVANCED_PASTE_GOOGLE);
}
inline gpo_rule_configured_t getAllowedAdvancedPasteOllamaValue()
{
return getConfiguredValue(POLICY_ALLOW_ADVANCED_PASTE_OLLAMA);
}
inline gpo_rule_configured_t getAllowedAdvancedPasteFoundryLocalValue()
{
return getConfiguredValue(POLICY_ALLOW_ADVANCED_PASTE_FOUNDRY_LOCAL);
}
inline gpo_rule_configured_t getConfiguredMwbClipboardSharingEnabledValue()
{
return getConfiguredValue(POLICY_MWB_CLIPBOARD_SHARING_ENABLED);

View File

@@ -33,9 +33,4 @@
<Target Name="PostBuildAction" AfterTargets="Build" Outputs="$(GeneratedDSCModule)" Condition="'$(Platform)'!='ARM64'">
<Exec Command="&quot;$(OutDir)$(AssemblyName).exe&quot; &quot;..\..\..\x64\$(Configuration)\WinUI3Apps\PowerToys.Settings.UI.Lib.dll&quot; $(GeneratedDSCModule) $(GeneratedDSCManifest)" />
</Target>
<Target Name="PreBuild" BeforeTargets="PreBuildEvent" Condition="'$(Platform)'=='ARM64'">
<Exec Command="&quot;$(MSBuildToolsPath)\msbuild.exe&quot; PowerToys.sln -p:Configuration=&quot;$(Configuration)&quot; -p:Platform=&quot;x64&quot; -verbosity:m -t:DSC\PowerToys_Settings_DSC_Schema_Generator" WorkingDirectory="..\..\..\" />
</Target>
</Project>

View File

@@ -13,7 +13,7 @@ namespace PowerToys.DSC.Models;
public sealed class DscManifest
{
private const string Schema = "https://aka.ms/dsc/schemas/v3/bundled/resource/manifest.vscode.json";
private const string Executable = @"PowerToys.DSC.exe";
private const string Executable = @"..\PowerToys.DSC.exe";
private readonly string _type;
private readonly string _version;

View File

@@ -40,9 +40,11 @@
</EmbeddedResource>
</ItemGroup>
<!-- In debug mode, generate the DSC resource JSON files -->
<Target Name="GenerateDscResourceJsonFiles" AfterTargets="Build" Condition="'$(Configuration)' == 'Debug'">
<Message Text="Generating DSC resource JSON files inside ..." Importance="high" />
<Exec Command="dotnet &quot;$(TargetPath)&quot; manifest --resource settings --outputDir &quot;$(TargetDir)\&quot;" />
<!-- Generate the DSC resource JSON files to DSCModules subfolder -->
<!-- Skip generation in CI/CD builds (CIBuild=true) to avoid unnecessary work during pipeline -->
<Target Name="GenerateDscResourceJsonFiles" AfterTargets="Build" Condition="'$(CIBuild)' != 'true'">
<Message Text="Generating DSC resource JSON files to DSCModules subfolder..." Importance="high" />
<MakeDir Directories="$(TargetDir)DSCModules" />
<Exec Command="dotnet &quot;$(TargetPath)&quot; manifest --resource settings --outputDir &quot;$(TargetDir)DSCModules&quot;" />
</Target>
</Project>

View File

@@ -1,11 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (c) Microsoft Corporation.
Licensed under the MIT License. -->
<policyDefinitions xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" revision="1.17" schemaVersion="1.0" xmlns="http://schemas.microsoft.com/GroupPolicy/2006/07/PolicyDefinitions">
<policyDefinitions xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" revision="1.18" schemaVersion="1.0" xmlns="http://schemas.microsoft.com/GroupPolicy/2006/07/PolicyDefinitions">
<policyNamespaces>
<target prefix="powertoys" namespace="Microsoft.Policies.PowerToys" />
</policyNamespaces>
<resources minRequiredRevision="1.17"/><!-- Last changed with PowerToys v0.90.0 -->
<resources minRequiredRevision="1.18"/><!-- Last changed with PowerToys v0.96.0 -->
<supportedOn>
<definitions>
<definition name="SUPPORTED_POWERTOYS_0_64_0" displayName="$(string.SUPPORTED_POWERTOYS_0_64_0)"/>
@@ -26,6 +26,7 @@
<definition name="SUPPORTED_POWERTOYS_0_88_0" displayName="$(string.SUPPORTED_POWERTOYS_0_88_0)"/>
<definition name="SUPPORTED_POWERTOYS_0_89_0" displayName="$(string.SUPPORTED_POWERTOYS_0_89_0)"/>
<definition name="SUPPORTED_POWERTOYS_0_90_0" displayName="$(string.SUPPORTED_POWERTOYS_0_90_0)"/>
<definition name="SUPPORTED_POWERTOYS_0_96_0" displayName="$(string.SUPPORTED_POWERTOYS_0_96_0)"/>
<definition name="SUPPORTED_POWERTOYS_0_64_0_TO_0_87_1" displayName="$(string.SUPPORTED_POWERTOYS_0_64_0_TO_0_87_1)"/>
</definitions>
</supportedOn>
@@ -614,6 +615,86 @@
<decimal value="0" />
</disabledValue>
</policy>
<policy name="AllowAdvancedPasteOpenAI" class="Both" displayName="$(string.AllowAdvancedPasteOpenAI)" explainText="$(string.AllowAdvancedPasteOpenAIDescription)" key="Software\Policies\PowerToys" valueName="AllowAdvancedPasteOpenAI">
<parentCategory ref="AdvancedPaste" />
<supportedOn ref="SUPPORTED_POWERTOYS_0_96_0" />
<enabledValue>
<decimal value="1" />
</enabledValue>
<disabledValue>
<decimal value="0" />
</disabledValue>
</policy>
<policy name="AllowAdvancedPasteAzureOpenAI" class="Both" displayName="$(string.AllowAdvancedPasteAzureOpenAI)" explainText="$(string.AllowAdvancedPasteAzureOpenAIDescription)" key="Software\Policies\PowerToys" valueName="AllowAdvancedPasteAzureOpenAI">
<parentCategory ref="AdvancedPaste" />
<supportedOn ref="SUPPORTED_POWERTOYS_0_96_0" />
<enabledValue>
<decimal value="1" />
</enabledValue>
<disabledValue>
<decimal value="0" />
</disabledValue>
</policy>
<policy name="AllowAdvancedPasteAzureAIInference" class="Both" displayName="$(string.AllowAdvancedPasteAzureAIInference)" explainText="$(string.AllowAdvancedPasteAzureAIInferenceDescription)" key="Software\Policies\PowerToys" valueName="AllowAdvancedPasteAzureAIInference">
<parentCategory ref="AdvancedPaste" />
<supportedOn ref="SUPPORTED_POWERTOYS_0_96_0" />
<enabledValue>
<decimal value="1" />
</enabledValue>
<disabledValue>
<decimal value="0" />
</disabledValue>
</policy>
<policy name="AllowAdvancedPasteMistral" class="Both" displayName="$(string.AllowAdvancedPasteMistral)" explainText="$(string.AllowAdvancedPasteMistralDescription)" key="Software\Policies\PowerToys" valueName="AllowAdvancedPasteMistral">
<parentCategory ref="AdvancedPaste" />
<supportedOn ref="SUPPORTED_POWERTOYS_0_96_0" />
<enabledValue>
<decimal value="1" />
</enabledValue>
<disabledValue>
<decimal value="0" />
</disabledValue>
</policy>
<policy name="AllowAdvancedPasteGoogle" class="Both" displayName="$(string.AllowAdvancedPasteGoogle)" explainText="$(string.AllowAdvancedPasteGoogleDescription)" key="Software\Policies\PowerToys" valueName="AllowAdvancedPasteGoogle">
<parentCategory ref="AdvancedPaste" />
<supportedOn ref="SUPPORTED_POWERTOYS_0_96_0" />
<enabledValue>
<decimal value="1" />
</enabledValue>
<disabledValue>
<decimal value="0" />
</disabledValue>
</policy>
<policy name="AllowAdvancedPasteAnthropic" class="Both" displayName="$(string.AllowAdvancedPasteAnthropic)" explainText="$(string.AllowAdvancedPasteAnthropicDescription)" key="Software\Policies\PowerToys" valueName="AllowAdvancedPasteAnthropic">
<parentCategory ref="AdvancedPaste" />
<supportedOn ref="SUPPORTED_POWERTOYS_0_96_0" />
<enabledValue>
<decimal value="1" />
</enabledValue>
<disabledValue>
<decimal value="0" />
</disabledValue>
</policy>
<policy name="AllowAdvancedPasteOllama" class="Both" displayName="$(string.AllowAdvancedPasteOllama)" explainText="$(string.AllowAdvancedPasteOllamaDescription)" key="Software\Policies\PowerToys" valueName="AllowAdvancedPasteOllama">
<parentCategory ref="AdvancedPaste" />
<supportedOn ref="SUPPORTED_POWERTOYS_0_96_0" />
<enabledValue>
<decimal value="1" />
</enabledValue>
<disabledValue>
<decimal value="0" />
</disabledValue>
</policy>
<policy name="AllowAdvancedPasteFoundryLocal" class="Both" displayName="$(string.AllowAdvancedPasteFoundryLocal)" explainText="$(string.AllowAdvancedPasteFoundryLocalDescription)" key="Software\Policies\PowerToys" valueName="AllowAdvancedPasteFoundryLocal">
<parentCategory ref="AdvancedPaste" />
<supportedOn ref="SUPPORTED_POWERTOYS_0_96_0" />
<enabledValue>
<decimal value="1" />
</enabledValue>
<disabledValue>
<decimal value="0" />
</disabledValue>
</policy>
<policy name="MwbClipboardSharingEnabled" class="Both" displayName="$(string.MwbClipboardSharingEnabled)" explainText="$(string.MwbClipboardSharingEnabledDescription)" key="Software\Policies\PowerToys" valueName="MwbClipboardSharingEnabled">
<parentCategory ref="MouseWithoutBorders" />
<supportedOn ref="SUPPORTED_POWERTOYS_0_83_0" />

View File

@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (c) Microsoft Corporation.
Licensed under the MIT License. -->
<policyDefinitionResources xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" revision="1.17" schemaVersion="1.0" xmlns="http://schemas.microsoft.com/GroupPolicy/2006/07/PolicyDefinitions">
<policyDefinitionResources xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" revision="1.18" schemaVersion="1.0" xmlns="http://schemas.microsoft.com/GroupPolicy/2006/07/PolicyDefinitions">
<displayName>PowerToys</displayName>
<description>PowerToys</description>
<resources>
@@ -33,6 +33,7 @@
<string id="SUPPORTED_POWERTOYS_0_88_0">PowerToys version 0.88.0 or later</string>
<string id="SUPPORTED_POWERTOYS_0_89_0">PowerToys version 0.89.0 or later</string>
<string id="SUPPORTED_POWERTOYS_0_90_0">PowerToys version 0.90.0 or later</string>
<string id="SUPPORTED_POWERTOYS_0_96_0">PowerToys version 0.96.0 or later</string>
<string id="SUPPORTED_POWERTOYS_0_64_0_TO_0_87_1">From PowerToys version 0.64.0 until PowerToys version 0.87.1</string>
<string id="ConfigureAllUtilityGlobalEnabledStateDescription">This policy configures the enabled state for all PowerToys utilities.
@@ -291,6 +292,54 @@ If you don't configure this policy, the user will be able to control the setting
<string id="ConfigureEnabledUtilityFileExplorerQOIPreview">QOI file preview: Configure enabled state</string>
<string id="ConfigureEnabledUtilityFileExplorerQOIThumbnails">QOI file thumbnail: Configure enabled state</string>
<string id="AllowPowerToysAdvancedPasteOnlineAIModels">Allow using online AI models</string>
<string id="AllowAdvancedPasteOpenAI">Advanced Paste: Allow OpenAI endpoint</string>
<string id="AllowAdvancedPasteOpenAIDescription">This policy controls whether users can use the OpenAI endpoint in Advanced Paste.
If you enable or don't configure this policy, users can configure and use OpenAI as their AI provider.
If you disable this policy, users will not be able to select or use OpenAI endpoint in Advanced Paste settings.</string>
<string id="AllowAdvancedPasteAzureOpenAI">Advanced Paste: Allow Azure OpenAI endpoint</string>
<string id="AllowAdvancedPasteAzureOpenAIDescription">This policy controls whether users can use the Azure OpenAI endpoint in Advanced Paste.
If you enable or don't configure this policy, users can configure and use Azure OpenAI as their AI provider.
If you disable this policy, users will not be able to select or use Azure OpenAI endpoint in Advanced Paste settings.</string>
<string id="AllowAdvancedPasteAzureAIInference">Advanced Paste: Allow Azure AI Inference endpoint</string>
<string id="AllowAdvancedPasteAzureAIInferenceDescription">This policy controls whether users can use the Azure AI Inference endpoint in Advanced Paste.
If you enable or don't configure this policy, users can configure and use Azure AI Inference as their AI provider.
If you disable this policy, users will not be able to select or use Azure AI Inference endpoint in Advanced Paste settings.</string>
<string id="AllowAdvancedPasteMistral">Advanced Paste: Allow Mistral endpoint</string>
<string id="AllowAdvancedPasteMistralDescription">This policy controls whether users can use the Mistral AI endpoint in Advanced Paste.
If you enable or don't configure this policy, users can configure and use Mistral as their AI provider.
If you disable this policy, users will not be able to select or use Mistral endpoint in Advanced Paste settings.</string>
<string id="AllowAdvancedPasteGoogle">Advanced Paste: Allow Google endpoint</string>
<string id="AllowAdvancedPasteGoogleDescription">This policy controls whether users can use the Google (Gemini) endpoint in Advanced Paste.
If you enable or don't configure this policy, users can configure and use Google as their AI provider.
If you disable this policy, users will not be able to select or use Google endpoint in Advanced Paste settings.</string>
<string id="AllowAdvancedPasteAnthropic">Advanced Paste: Allow Anthropic endpoint</string>
<string id="AllowAdvancedPasteAnthropicDescription">This policy controls whether users can use the Anthropic (Claude) endpoint in Advanced Paste.
If you enable or don't configure this policy, users can configure and use Anthropic as their AI provider.
If you disable this policy, users will not be able to select or use Anthropic endpoint in Advanced Paste settings.</string>
<string id="AllowAdvancedPasteOllama">Advanced Paste: Allow Ollama endpoint</string>
<string id="AllowAdvancedPasteOllamaDescription">This policy controls whether users can use the Ollama local model endpoint in Advanced Paste.
If you enable or don't configure this policy, users can configure and use Ollama as their AI provider.
If you disable this policy, users will not be able to select or use Ollama endpoint in Advanced Paste settings.</string>
<string id="AllowAdvancedPasteFoundryLocal">Advanced Paste: Allow Foundry Local endpoint</string>
<string id="AllowAdvancedPasteFoundryLocalDescription">This policy controls whether users can use the Foundry Local model endpoint in Advanced Paste.
If you enable or don't configure this policy, users can configure and use Foundry Local as their AI provider.
If you disable this policy, users will not be able to select or use Foundry Local endpoint in Advanced Paste settings.</string>
<string id="MwbClipboardSharingEnabled">Clipboard sharing enabled</string>
<string id="MwbFileTransferEnabled">File transfer enabled</string>
<string id="MwbUseOriginalUserInterface">Original user interface is available</string>

View File

@@ -0,0 +1,66 @@
// Copyright (c) Microsoft Corporation
// The Microsoft Corporation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Threading.Tasks;
using AdvancedPaste.Models;
using AdvancedPaste.Settings;
using Microsoft.PowerToys.Settings.UI.Library;
namespace AdvancedPaste.UnitTests.Mocks;
/// <summary>
/// Minimal <see cref="IUserSettings"/> implementation used by integration tests that
/// need to construct the runtime Advanced Paste services.
/// </summary>
internal sealed class IntegrationTestUserSettings : IUserSettings
{
private readonly PasteAIConfiguration _configuration;
private readonly IReadOnlyList<AdvancedPasteCustomAction> _customActions;
private readonly IReadOnlyList<PasteFormats> _additionalActions;
public IntegrationTestUserSettings()
{
var provider = new PasteAIProviderDefinition
{
Id = "integration-openai",
EnableAdvancedAI = true,
ServiceTypeKind = AIServiceType.OpenAI,
ModelName = "gpt-4o",
ModerationEnabled = true,
};
_configuration = new PasteAIConfiguration
{
ActiveProviderId = provider.Id,
Providers = new ObservableCollection<PasteAIProviderDefinition> { provider },
};
_customActions = Array.Empty<AdvancedPasteCustomAction>();
_additionalActions = Array.Empty<PasteFormats>();
}
public bool IsAIEnabled => true;
public bool ShowCustomPreview => false;
public bool CloseAfterLosingFocus => false;
public IReadOnlyList<AdvancedPasteCustomAction> CustomActions => _customActions;
public IReadOnlyList<PasteFormats> AdditionalActions => _additionalActions;
public PasteAIConfiguration PasteAIConfiguration => _configuration;
public event EventHandler Changed;
public Task SetActiveAIProviderAsync(string providerId)
{
_configuration.ActiveProviderId = providerId ?? string.Empty;
Changed?.Invoke(this, EventArgs.Empty);
return Task.CompletedTask;
}
}

View File

@@ -13,6 +13,8 @@ using System.Threading.Tasks;
using AdvancedPaste.Helpers;
using AdvancedPaste.Models;
using AdvancedPaste.Services;
using AdvancedPaste.Services.CustomActions;
using AdvancedPaste.Services.OpenAI;
using AdvancedPaste.UnitTests.Mocks;
using ManagedCommon;
@@ -79,7 +81,9 @@ public sealed class AIServiceBatchIntegrationTests
Assert.IsTrue(results.Count <= inputs.Count);
CollectionAssert.AreEqual(results.Select(result => result.ToInput()).ToList(), inputs.Take(results.Count).ToList());
#pragma warning disable IL2026, IL3050 // The tests rely on runtime JSON serialization for ad-hoc data files.
async Task WriteResultsAsync() => await File.WriteAllTextAsync(resultsFile, JsonSerializer.Serialize(results, SerializerOptions));
#pragma warning restore IL2026, IL3050
Logger.LogInfo($"Starting {nameof(TestGenerateBatchResults)}; Count={inputs.Count}, InCache={results.Count}");
@@ -101,8 +105,12 @@ public sealed class AIServiceBatchIntegrationTests
await WriteResultsAsync();
}
private static async Task<List<T>> GetDataListAsync<T>(string filePath) =>
File.Exists(filePath) ? JsonSerializer.Deserialize<List<T>>(await File.ReadAllTextAsync(filePath)) : [];
private static async Task<List<T>> GetDataListAsync<T>(string filePath)
{
#pragma warning disable IL2026, IL3050 // Tests only run locally and can depend on runtime JSON serialization.
return File.Exists(filePath) ? JsonSerializer.Deserialize<List<T>>(await File.ReadAllTextAsync(filePath)) : [];
#pragma warning restore IL2026, IL3050
}
private static async Task<string> GetTextOutputAsync(BatchTestInput input, PasteFormats format)
{
@@ -130,23 +138,35 @@ public sealed class AIServiceBatchIntegrationTests
private static async Task<DataPackage> GetOutputDataPackageAsync(BatchTestInput batchTestInput, PasteFormats format)
{
VaultCredentialsProvider credentialsProvider = new();
PromptModerationService promptModerationService = new(credentialsProvider);
var services = CreateServices();
NoOpProgress progress = new();
CustomTextTransformService customTextTransformService = new(credentialsProvider, promptModerationService);
switch (format)
{
case PasteFormats.CustomTextTransformation:
return DataPackageHelpers.CreateFromText(await customTextTransformService.TransformTextAsync(batchTestInput.Prompt, batchTestInput.Clipboard, CancellationToken.None, progress));
var transformResult = await services.CustomActionTransformService.TransformTextAsync(batchTestInput.Prompt, batchTestInput.Clipboard, CancellationToken.None, progress);
return DataPackageHelpers.CreateFromText(transformResult.Content ?? string.Empty);
case PasteFormats.KernelQuery:
var clipboardData = DataPackageHelpers.CreateFromText(batchTestInput.Clipboard).GetView();
KernelService kernelService = new(new NoOpKernelQueryCacheService(), credentialsProvider, promptModerationService, customTextTransformService);
return await kernelService.TransformClipboardAsync(batchTestInput.Prompt, clipboardData, isSavedQuery: false, CancellationToken.None, progress);
return await services.KernelService.TransformClipboardAsync(batchTestInput.Prompt, clipboardData, isSavedQuery: false, CancellationToken.None, progress);
default:
throw new InvalidOperationException($"Unexpected format {format}");
}
}
private static IntegrationTestServices CreateServices()
{
IntegrationTestUserSettings userSettings = new();
EnhancedVaultCredentialsProvider credentialsProvider = new(userSettings);
PromptModerationService promptModerationService = new(credentialsProvider);
PasteAIProviderFactory providerFactory = new();
ICustomActionTransformService customActionTransformService = new CustomActionTransformService(promptModerationService, providerFactory, credentialsProvider, userSettings);
IKernelService kernelService = new AdvancedAIKernelService(credentialsProvider, new NoOpKernelQueryCacheService(), promptModerationService, userSettings, customActionTransformService);
return new IntegrationTestServices(customActionTransformService, kernelService);
}
private readonly record struct IntegrationTestServices(ICustomActionTransformService CustomActionTransformService, IKernelService KernelService);
}

View File

@@ -11,6 +11,8 @@ using System.Threading.Tasks;
using AdvancedPaste.Helpers;
using AdvancedPaste.Models;
using AdvancedPaste.Services;
using AdvancedPaste.Services.CustomActions;
using AdvancedPaste.Services.OpenAI;
using AdvancedPaste.Telemetry;
using AdvancedPaste.UnitTests.Mocks;
@@ -27,16 +29,19 @@ namespace AdvancedPaste.UnitTests.ServicesTests;
public sealed class KernelServiceIntegrationTests : IDisposable
{
private const string StandardImageFile = "image_with_text_example.png";
private KernelService _kernelService;
private IKernelService _kernelService;
private AdvancedPasteEventListener _eventListener;
[TestInitialize]
public void TestInitialize()
{
VaultCredentialsProvider credentialsProvider = new();
IntegrationTestUserSettings userSettings = new();
EnhancedVaultCredentialsProvider credentialsProvider = new(userSettings);
PromptModerationService promptModerationService = new(credentialsProvider);
PasteAIProviderFactory providerFactory = new();
CustomActionTransformService customActionTransformService = new(promptModerationService, providerFactory, credentialsProvider, userSettings);
_kernelService = new KernelService(new NoOpKernelQueryCacheService(), credentialsProvider, promptModerationService, new CustomTextTransformService(credentialsProvider, promptModerationService));
_kernelService = new AdvancedAIKernelService(credentialsProvider, new NoOpKernelQueryCacheService(), promptModerationService, userSettings, customActionTransformService);
_eventListener = new();
}

View File

@@ -37,22 +37,10 @@
<None Remove="AdvancedPasteXAML\Controls\PromptBox.xaml" />
<None Remove="AdvancedPasteXAML\Styles\Button.xaml" />
<None Remove="Assets\AdvancedPaste\AIIcon.png" />
<None Remove="Assets\AdvancedPaste\Anthropic.svg" />
<None Remove="Assets\AdvancedPaste\Azure.svg" />
<None Remove="Assets\AdvancedPaste\AzureAI.svg" />
<None Remove="Assets\AdvancedPaste\Bedrock.svg" />
<None Remove="Assets\AdvancedPaste\FoundryLocal.svg" />
<None Remove="Assets\AdvancedPaste\Gemini.svg" />
<None Remove="Assets\AdvancedPaste\Gradient.png" />
<None Remove="AdvancedPasteXAML\Controls\AnimatedContentControl\AnimatedBorderBrush.xaml" />
<None Remove="AdvancedPasteXAML\Views\MainPage.xaml" />
<None Remove="Assets\AdvancedPaste\HuggingFace.svg" />
<None Remove="Assets\AdvancedPaste\Mistral.svg" />
<None Remove="Assets\AdvancedPaste\Ollama.svg" />
<None Remove="Assets\AdvancedPaste\Onnx.svg" />
<None Remove="Assets\AdvancedPaste\OpenAI.dark.svg" />
<None Remove="Assets\AdvancedPaste\OpenAI.light.svg" />
<None Remove="Assets\AdvancedPaste\WindowsML.svg" />
<None Remove="Assets\AdvancedPaste\SemanticKernel.svg" />
</ItemGroup>
<ItemGroup>
@@ -71,17 +59,15 @@
<PackageReference Include="CommunityToolkit.WinUI.Controls.Primitives" />
<!-- Including MessagePack to force version, since it's used by StreamJsonRpc but contains vulnerabilities. After StreamJsonRpc updates the version of MessagePack, we can upgrade StreamJsonRpc instead. -->
<PackageReference Include="MessagePack" />
<PackageReference Include="Microsoft.SemanticKernel.Connectors.Amazon" />
<PackageReference Include="Microsoft.SemanticKernel.Connectors.AzureAIInference" />
<PackageReference Include="Microsoft.SemanticKernel.Connectors.Google" />
<PackageReference Include="Microsoft.SemanticKernel.Connectors.HuggingFace" />
<PackageReference Include="Microsoft.SemanticKernel.Connectors.MistralAI" />
<PackageReference Include="Microsoft.SemanticKernel.Connectors.Ollama" />
<PackageReference Include="Microsoft.SemanticKernel.Connectors.AzureAIInference" />
<PackageReference Include="Microsoft.SemanticKernel.Connectors.Google" />
<PackageReference Include="Microsoft.SemanticKernel.Connectors.MistralAI" />
<PackageReference Include="Microsoft.SemanticKernel.Connectors.Ollama" />
<PackageReference Include="Microsoft.Extensions.Hosting" />
<PackageReference Include="Microsoft.SemanticKernel" />
<PackageReference Include="Microsoft.WindowsAppSDK" />
<PackageReference Include="Microsoft.Bcl.AsyncInterfaces" />
<PackageReference Include="System.ClientModel" />
<PackageReference Include="System.ClientModel" />
<PackageReference Include="Microsoft.Windows.Compatibility" />
<PackageReference Include="Microsoft.Windows.CsWin32" />
<PackageReference Include="Microsoft.Windows.SDK.BuildTools" />
@@ -151,4 +137,23 @@
<Generator>MSBuild:Compile</Generator>
</Page>
</ItemGroup>
<ItemGroup>
<!-- Share AI Model Provider Icons from Settings.UI to avoid duplication -->
<!-- These icons are included from Settings.UI project -->
<Content Include="..\..\..\settings-ui\Settings.UI\Assets\Settings\Icons\Models\*.svg">
<Link>Assets\Settings\Icons\Models\%(Filename)%(Extension)</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<!-- AdvancedPaste specific assets -->
<Content Include="Assets\AdvancedPaste\*.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Assets\AdvancedPaste\*.ico">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<!-- Keep SemanticKernel.svg as it's specific to AdvancedPaste -->
<Content Include="Assets\AdvancedPaste\SemanticKernel.svg">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
</ItemGroup>
</Project>

View File

@@ -112,11 +112,7 @@ namespace AdvancedPaste
/// Invoked when the application is launched.
/// </summary>
/// <param name="args">Details about the launch request and process.</param>
#if DEBUG
protected async override void OnLaunched(LaunchActivatedEventArgs args)
#else
protected override void OnLaunched(LaunchActivatedEventArgs args)
#endif
{
var cmdArgs = Environment.GetCommandLineArgs();
if (cmdArgs?.Length > 1)
@@ -138,10 +134,6 @@ namespace AdvancedPaste
{
ProcessNamedPipe(cmdArgs[2]);
}
#if DEBUG
await ShowWindow(); // This allows for direct access without using PowerToys Runner, not all functionality might work
#endif
}
private void ProcessNamedPipe(string pipeName)

View File

@@ -13,7 +13,7 @@
<converters:DateTimeToFriendlyStringConverter x:Key="DateTimeToFriendlyStringConverter" />
<tkconverters:BoolToVisibilityConverter x:Name="BoolToVisibilityConverter" />
</UserControl.Resources>
<Grid Height="64" ColumnSpacing="12">
<Grid ColumnSpacing="12">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="80" />
<ColumnDefinition Width="*" />

View File

@@ -14,28 +14,13 @@
mc:Ignorable="d">
<UserControl.Resources>
<ResourceDictionary>
<ResourceDictionary.ThemeDictionaries>
<ResourceDictionary x:Key="Default">
<Color x:Key="AccentGradientColor">#65C8F2</Color>
<LinearGradientBrush x:Key="AccentGradientBrush" StartPoint="0,0" EndPoint="1,1">
<GradientStop Offset="0.0" Color="#98EFFE" />
<GradientStop Offset="0.25" Color="#48B1E9" />
<GradientStop Offset="1.0" Color="{StaticResource AccentGradientColor}" />
</LinearGradientBrush>
</ResourceDictionary>
<ResourceDictionary x:Key="Light">
<Color x:Key="AccentGradientColor">#005FB8</Color>
<LinearGradientBrush x:Key="AccentGradientBrush" StartPoint="0,0" EndPoint="1,1">
<GradientStop Offset="0.0" Color="#4992C7" />
<GradientStop Offset="0.25" Color="#1353A0" />
<GradientStop Offset="1.0" Color="{StaticResource AccentGradientColor}" />
</LinearGradientBrush>
</ResourceDictionary>
<ResourceDictionary x:Key="HighContrast">
<Color x:Key="AccentGradientColor">#48B1E9</Color>
<SolidColorBrush x:Key="AccentGradientBrush" Color="{StaticResource AccentGradientColor}" />
</ResourceDictionary>
</ResourceDictionary.ThemeDictionaries>
<LinearGradientBrush x:Name="IntelligentUnderlineGradient" StartPoint="0,0.5" EndPoint="1,0.5">
<GradientStop Offset="0.0" Color="#FF0078D4" />
<GradientStop Offset="0.42" Color="#FF464FEB" />
<GradientStop Offset="0.87" Color="#FFD660FF" />
<GradientStop Offset="1.0" Color="#FFFEA874" />
</LinearGradientBrush>
<x:Double x:Key="ModelSelectorButtonWidth">44</x:Double>
<Style x:Key="CustomTextBoxStyle" TargetType="TextBox">
<Setter Property="Foreground" Value="{ThemeResource TextControlForeground}" />
@@ -171,6 +156,19 @@
BorderThickness="{TemplateBinding BorderThickness}"
Control.IsTemplateFocusTarget="True"
CornerRadius="{TemplateBinding CornerRadius}" />
<Rectangle
x:Name="FocusHighlighter"
Grid.Row="1"
Grid.RowSpan="1"
Grid.ColumnSpan="4"
Height="2"
Margin="12,0,12,0"
HorizontalAlignment="Stretch"
VerticalAlignment="Bottom"
Fill="{StaticResource IntelligentUnderlineGradient}"
RadiusX="1"
RadiusY="1"
Visibility="Collapsed" />
<Grid Grid.Row="1" Width="{StaticResource ModelSelectorButtonWidth}">
<ProgressRing
Width="20"
@@ -282,7 +280,10 @@
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="BorderElement" Storyboard.TargetProperty="Background">
<DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource TextControlBackgroundFocused}" />
</ObjectAnimationUsingKeyFrames>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="BorderElement" Storyboard.TargetProperty="BorderBrush">
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="FocusHighlighter" Storyboard.TargetProperty="Visibility">
<DiscreteObjectKeyFrame KeyTime="0" Value="Visible" />
</ObjectAnimationUsingKeyFrames>
<!--<ObjectAnimationUsingKeyFrames Storyboard.TargetName="BorderElement" Storyboard.TargetProperty="BorderBrush">
<DiscreteObjectKeyFrame KeyTime="0">
<DiscreteObjectKeyFrame.Value>
<LinearGradientBrush MappingMode="Absolute" StartPoint="0,0" EndPoint="0,2">
@@ -299,7 +300,7 @@
</ObjectAnimationUsingKeyFrames>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="BorderElement" Storyboard.TargetProperty="BorderThickness">
<DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource TextControlBorderThemeThicknessFocused}" />
</ObjectAnimationUsingKeyFrames>
</ObjectAnimationUsingKeyFrames>-->
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentElement" Storyboard.TargetProperty="Foreground">
<DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource TextControlForegroundFocused}" />
</ObjectAnimationUsingKeyFrames>
@@ -541,7 +542,10 @@
Source="{x:Bind ViewModel.ActiveAIProvider?.ServiceType, Mode=OneWay, Converter={StaticResource ServiceTypeToIconConverter}}" />
</DropDownButton.Content>
<DropDownButton.Flyout>
<Flyout Placement="Bottom" ShouldConstrainToRootBounds="False">
<Flyout
Opened="AIProviderFlyout_Opened"
Placement="Bottom"
ShouldConstrainToRootBounds="False">
<Grid
Width="386"
Margin="-4"
@@ -740,8 +744,8 @@
x:Name="LoadingText"
x:Uid="LoadingText"
Grid.Row="1"
FontWeight="SemiBold"
Foreground="{ThemeResource AccentGradientBrush}"
Margin="4,4,0,0"
Foreground="{ThemeResource TextFillColorSecondaryBrush}"
Style="{StaticResource CaptionTextBlockStyle}"
Visibility="Collapsed">
<animations:Implicit.ShowAnimations>

View File

@@ -22,6 +22,8 @@ namespace AdvancedPaste.Controls
{
public OptionsViewModel ViewModel { get; private set; }
private bool _syncingProviderSelection;
public static readonly DependencyProperty PlaceholderTextProperty = DependencyProperty.Register(
nameof(PlaceholderText),
typeof(string),
@@ -74,6 +76,11 @@ namespace AdvancedPaste.Controls
var state = ViewModel.IsBusy ? "LoadingState" : ViewModel.PasteActionError.HasText ? "ErrorState" : "DefaultState";
VisualStateManager.GoToState(this, state, true);
}
if (e.PropertyName is nameof(ViewModel.ActiveAIProvider) or nameof(ViewModel.AIProviders))
{
SyncProviderSelection();
}
}
private void ViewModel_PreviewRequested(object sender, EventArgs e)
@@ -87,6 +94,7 @@ namespace AdvancedPaste.Controls
private void Grid_Loaded(object sender, RoutedEventArgs e)
{
InputTxtBox.Focus(FocusState.Programmatic);
SyncProviderSelection();
}
[RelayCommand]
@@ -126,18 +134,56 @@ namespace AdvancedPaste.Controls
Loader.IsLoading = loading;
}
private void SyncProviderSelection()
{
if (AIProviderListView is null)
{
return;
}
try
{
_syncingProviderSelection = true;
AIProviderListView.SelectedItem = ViewModel.ActiveAIProvider;
}
finally
{
_syncingProviderSelection = false;
}
}
private void AIProviderFlyout_Opened(object sender, object e)
{
SyncProviderSelection();
}
private async void AIProviderListView_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
if (AIProviderListView.SelectedItem is PasteAIProviderDefinition provider)
if (_syncingProviderSelection)
{
if (ViewModel.SetActiveProviderCommand.CanExecute(provider))
{
await ViewModel.SetActiveProviderCommand.ExecuteAsync(provider);
}
var flyout = FlyoutBase.GetAttachedFlyout(AIProviderButton);
flyout?.Hide();
return;
}
var flyout = FlyoutBase.GetAttachedFlyout(AIProviderButton);
if (AIProviderListView.SelectedItem is not PasteAIProviderDefinition provider)
{
return;
}
if (string.Equals(ViewModel.ActiveAIProvider?.Id, provider.Id, StringComparison.OrdinalIgnoreCase))
{
flyout?.Hide();
return;
}
if (ViewModel.SetActiveProviderCommand.CanExecute(provider))
{
await ViewModel.SetActiveProviderCommand.ExecuteAsync(provider);
SyncProviderSelection();
}
flyout?.Hide();
}
}
}

View File

@@ -150,7 +150,7 @@
</Grid.RowDefinitions>
<Grid
Margin="8,8,8,4"
Margin="8,0,8,16"
Padding="4"
Background="{ThemeResource CardBackgroundFillColorDefaultBrush}"
BorderBrush="{ThemeResource CardStrokeColorDefaultBrush}"
@@ -161,7 +161,7 @@
<ColumnDefinition Width="*" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<controls:ClipboardHistoryItemPreviewControl Height="64" ClipboardItem="{x:Bind ViewModel.CurrentClipboardItem, Mode=OneWay}" />
<controls:ClipboardHistoryItemPreviewControl Height="48" ClipboardItem="{x:Bind ViewModel.CurrentClipboardItem, Mode=OneWay}" />
<Button
x:Uid="ClipboardHistoryButton"
Grid.Column="1"
@@ -210,7 +210,10 @@
<ColumnDefinition Width="*" MaxWidth="240" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<controls:ClipboardHistoryItemPreviewControl x:Phase="0" ClipboardItem="{x:Bind}" />
<controls:ClipboardHistoryItemPreviewControl
Height="64"
x:Phase="0"
ClipboardItem="{x:Bind}" />
<Button
x:Name="ClipboardHistoryItemMoreOptionsButton"
x:Uid="ClipboardHistoryItemMoreOptionsButton"
@@ -244,62 +247,57 @@
x:Name="CustomFormatTextBox"
x:Uid="CustomFormatTextBox"
Grid.Row="1"
Margin="20,4,20,0"
Margin="20,0,20,0"
x:FieldModifier="public"
IsEnabled="{x:Bind ViewModel.IsCustomAIServiceEnabled, Mode=OneWay}"
TabIndex="0">
<controls:PromptBox.Footer>
<StackPanel Orientation="Horizontal">
<TextBlock
x:Uid="AIMistakeNote"
Margin="0,0,2,0"
HorizontalAlignment="Left"
VerticalAlignment="Center"
Style="{StaticResource CaptionTextBlockStyle}">
<Run x:Uid="AIMistakeNote" Foreground="{ThemeResource TextFillColorSecondaryBrush}" />
</TextBlock>
<TextBlock
Margin="4,0,2,0"
HorizontalAlignment="Left"
FontSize="10"
Foreground="{ThemeResource TextFillColorSecondaryBrush}" />
<Button
Padding="0"
VerticalAlignment="Center"
Style="{StaticResource CaptionTextBlockStyle}">
<Hyperlink
x:Name="TermsHyperlink"
NavigateUri="https://openai.com/policies/terms-of-use"
TabIndex="3">
<Run x:Uid="TermsLink" />
</Hyperlink>
<ToolTipService.ToolTip>
<TextBlock Text="https://openai.com/policies/terms-of-use" />
</ToolTipService.ToolTip>
</TextBlock>
<TextBlock
Margin="0,0,2,0"
HorizontalAlignment="Left"
VerticalAlignment="Center"
Style="{StaticResource CaptionTextBlockStyle}"
ToolTipService.ToolTip="">
<Run x:Uid="AIFooterSeparator" Foreground="{ThemeResource TextFillColorSecondaryBrush}">|</Run>
</TextBlock>
<TextBlock
Margin="0,0,2,0"
HorizontalAlignment="Left"
VerticalAlignment="Center"
Style="{StaticResource CaptionTextBlockStyle}">
<Hyperlink NavigateUri="https://openai.com/policies/privacy-policy" TabIndex="3">
<Run x:Uid="PrivacyLink" />
</Hyperlink>
<ToolTipService.ToolTip>
<TextBlock Text="https://openai.com/policies/privacy-policy" />
</ToolTipService.ToolTip>
</TextBlock>
Style="{StaticResource SubtleButtonStyle}">
<FontIcon FontSize="12" Glyph="&#xE946;" />
<Button.Flyout>
<Flyout>
<StackPanel Spacing="8">
<TextBlock TextWrapping="Wrap">
<Run x:Uid="AIMistakeNote" /><LineBreak /><Run
FontSize="12"
Foreground="{ThemeResource TextFillColorSecondaryBrush}"
Text="You are using a custom endpoint. Verify all answers." />
</TextBlock>
<StackPanel Orientation="Horizontal" Spacing="8">
<HyperlinkButton
x:Name="TermsHyperlink"
x:Uid="TermsLink"
Padding="0"
FontSize="12"
NavigateUri="{x:Bind ViewModel.TermsLinkUri, Mode=OneWay}"
Visibility="{x:Bind ViewModel.HasTermsLink, Mode=OneWay, Converter={StaticResource BoolToVisibilityConverter}}" />
<HyperlinkButton
x:Name="PrivacyHyperLink"
x:Uid="PrivacyLink"
Padding="0"
FontSize="12"
NavigateUri="{x:Bind ViewModel.PrivacyLinkUri, Mode=OneWay}"
Visibility="{x:Bind ViewModel.HasPrivacyLink, Mode=OneWay, Converter={StaticResource BoolToVisibilityConverter}}" />
</StackPanel>
</StackPanel>
</Flyout>
</Button.Flyout>
</Button>
</StackPanel>
</controls:PromptBox.Footer>
</controls:PromptBox>
<Grid
Grid.Row="2"
Background="{ThemeResource LayerOnAcrylicFillColorDefaultBrush}"
BorderBrush="{ThemeResource CardStrokeColorDefaultBrush}"
BorderThickness="0,1,0,0"
RowSpacing="4">
<Grid Grid.Row="2" RowSpacing="4">
<Grid.RowDefinitions>
<RowDefinition Height="{x:Bind ViewModel.StandardPasteFormats.Count, Mode=OneWay, Converter={StaticResource standardPasteFormatsToHeightConverter}}" />
<RowDefinition Height="Auto" />
@@ -320,7 +318,6 @@
ScrollViewer.VerticalScrollMode="Auto"
SelectionMode="None"
TabIndex="1" />
<Rectangle
Grid.Row="1"
Height="1"

View File

@@ -1,10 +0,0 @@
<svg width="17" height="16" viewBox="0 0 17 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<g clip-path="url(#clip0_2092_1822)">
<path fill-rule="evenodd" clip-rule="evenodd" d="M9.718 2.34668H12.12L16.5 13.3333H14.098L9.718 2.34668ZM4.87933 2.34668H7.39067L11.7707 13.3333H9.32133L8.426 11.026H3.84467L2.94867 13.3327H0.5L4.88 2.34801L4.87933 2.34668ZM7.634 8.98601L6.13533 5.12468L4.63667 8.98668H7.63333L7.634 8.98601Z" fill="black"/>
</g>
<defs>
<clipPath id="clip0_2092_1822">
<rect width="16" height="16" fill="white" transform="translate(0.5)"/>
</clipPath>
</defs>
</svg>

Before

Width:  |  Height:  |  Size: 585 B

View File

@@ -1,23 +0,0 @@
<svg width="17" height="16" viewBox="0 0 17 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M6.05607 1.09062H10.3957L5.89074 14.4385C5.84444 14.5756 5.75629 14.6948 5.6387 14.7792C5.52111 14.8637 5.38 14.9091 5.23524 14.9091H1.85791C1.74822 14.9091 1.64011 14.883 1.54252 14.833C1.44493 14.7829 1.36066 14.7103 1.29669 14.6212C1.23271 14.5322 1.19087 14.4291 1.17462 14.3206C1.15837 14.2122 1.16818 14.1014 1.20324 13.9975L5.40041 1.56129C5.44669 1.42407 5.53485 1.30483 5.65248 1.22037C5.7701 1.1359 5.91126 1.09063 6.05607 1.09062Z" fill="url(#paint0_linear_2092_1811)"/>
<path d="M12.3626 10.0435H5.48096C5.41698 10.0434 5.35447 10.0626 5.30156 10.0986C5.24864 10.1345 5.20779 10.1856 5.18432 10.2451C5.16085 10.3046 5.15584 10.3698 5.16996 10.4322C5.18408 10.4946 5.21666 10.5513 5.26346 10.595L9.68546 14.7223C9.81421 14.8424 9.98373 14.9092 10.1598 14.9091H14.0565L12.3626 10.0435Z" fill="#0078D4"/>
<path d="M6.05617 1.0907C5.90978 1.09014 5.76704 1.1364 5.64881 1.22273C5.53058 1.30906 5.44305 1.43093 5.399 1.57054L1.2085 13.9862C1.17108 14.0905 1.15933 14.2023 1.17425 14.3121C1.18917 14.4219 1.23031 14.5265 1.2942 14.617C1.3581 14.7076 1.44285 14.7814 1.54131 14.8323C1.63976 14.8831 1.74902 14.9095 1.85983 14.9092H5.32433C5.45337 14.8861 5.57397 14.8293 5.67382 14.7443C5.77367 14.6594 5.84919 14.5495 5.89267 14.4259L6.72833 11.963L9.71333 14.7472C9.83842 14.8507 9.99534 14.9079 10.1577 14.9092H14.0398L12.3372 10.0435L7.37367 10.0447L10.4115 1.0907H6.05617Z" fill="url(#paint1_linear_2092_1811)"/>
<path d="M11.5996 1.5607C11.5533 1.4237 11.4653 1.30466 11.3479 1.22034C11.2304 1.13603 11.0895 1.09068 10.9449 1.0907H6.1084C6.25297 1.09071 6.3939 1.13606 6.51135 1.22038C6.62879 1.30469 6.71683 1.42372 6.76307 1.5607L10.9604 13.9974C10.9955 14.1013 11.0053 14.2121 10.9891 14.3206C10.9729 14.4291 10.931 14.5322 10.867 14.6213C10.8031 14.7104 10.7188 14.7831 10.6212 14.8331C10.5236 14.8832 10.4154 14.9094 10.3057 14.9094H15.1424C15.2521 14.9093 15.3602 14.8832 15.4578 14.8331C15.5554 14.783 15.6396 14.7104 15.7036 14.6213C15.7675 14.5321 15.8094 14.4291 15.8256 14.3206C15.8418 14.2121 15.832 14.1013 15.7969 13.9974L11.5996 1.5607Z" fill="url(#paint2_linear_2092_1811)"/>
<defs>
<linearGradient id="paint0_linear_2092_1811" x1="7.63774" y1="2.11462" x2="3.1309" y2="15.429" gradientUnits="userSpaceOnUse">
<stop stop-color="#114A8B"/>
<stop offset="1" stop-color="#0669BC"/>
</linearGradient>
<linearGradient id="paint1_linear_2092_1811" x1="9.04567" y1="8.31954" x2="8.00317" y2="8.67204" gradientUnits="userSpaceOnUse">
<stop stop-opacity="0.3"/>
<stop offset="0.071" stop-opacity="0.2"/>
<stop offset="0.321" stop-opacity="0.1"/>
<stop offset="0.623" stop-opacity="0.05"/>
<stop offset="1" stop-opacity="0"/>
</linearGradient>
<linearGradient id="paint2_linear_2092_1811" x1="8.4729" y1="1.72636" x2="13.4201" y2="14.9065" gradientUnits="userSpaceOnUse">
<stop stop-color="#3CCBF4"/>
<stop offset="1" stop-color="#2892DF"/>
</linearGradient>
</defs>
</svg>

Before

Width:  |  Height:  |  Size: 2.9 KiB

View File

@@ -1,49 +0,0 @@
<svg width="17" height="16" viewBox="0 0 17 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<g clip-path="url(#clip0_2092_1818)">
<path fill-rule="evenodd" clip-rule="evenodd" d="M11.3222 0C11.7976 0 12.2189 0.367333 12.3702 0.886C12.5216 1.40467 13.4069 4.61267 13.4069 4.61267V10.9873H10.1982L10.2636 0H11.3222Z" fill="url(#paint0_linear_2092_1818)"/>
<path d="M16.0323 4.97996C16.0323 4.75329 15.849 4.57996 15.6323 4.57996H13.7423C13.1034 4.58049 12.4908 4.83459 12.039 5.28645C11.5873 5.73832 11.3334 6.35101 11.333 6.98996V10.9873H13.6237C14.2624 10.9866 14.8747 10.7325 15.3263 10.2808C15.7779 9.82909 16.0318 9.21667 16.0323 8.57796V4.97996Z" fill="url(#paint1_linear_2092_1818)"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M11.3216 1.6754e-05C11.2349 -0.00060392 11.1489 0.0160265 11.0686 0.0489413C10.9883 0.0818561 10.9154 0.130399 10.854 0.191747C10.7927 0.253096 10.7442 0.326027 10.7112 0.406302C10.6783 0.486576 10.6617 0.572592 10.6623 0.65935L10.5976 12.7914C10.5975 13.6423 10.2594 14.4583 9.65765 15.06C9.05595 15.6617 8.23992 15.9998 7.38898 16H1.56631C1.50256 16.0004 1.43966 15.9854 1.3829 15.9564C1.32613 15.9274 1.27717 15.8852 1.24012 15.8333C1.20308 15.7814 1.17903 15.7214 1.17002 15.6583C1.161 15.5952 1.16727 15.5309 1.18831 15.4707L5.85498 2.15002C6.07482 1.5228 6.48378 0.979202 7.02549 0.594138C7.56721 0.209074 8.21502 0.00149836 8.87964 1.6754e-05H11.3323H11.3216Z" fill="url(#paint2_linear_2092_1818)"/>
</g>
<defs>
<linearGradient id="paint0_linear_2092_1818" x1="12.6616" y1="11.2247" x2="9.96091" y2="0.410667" gradientUnits="userSpaceOnUse">
<stop stop-color="#712575"/>
<stop offset="0.09" stop-color="#9A2884"/>
<stop offset="0.18" stop-color="#BF2C92"/>
<stop offset="0.27" stop-color="#DA2E9C"/>
<stop offset="0.34" stop-color="#EB30A2"/>
<stop offset="0.4" stop-color="#F131A5"/>
<stop offset="0.5" stop-color="#EC30A3"/>
<stop offset="0.61" stop-color="#DF2F9E"/>
<stop offset="0.72" stop-color="#C92D96"/>
<stop offset="0.83" stop-color="#AA2A8A"/>
<stop offset="0.95" stop-color="#83267C"/>
<stop offset="1" stop-color="#712575"/>
</linearGradient>
<linearGradient id="paint1_linear_2092_1818" x1="13.6883" y1="0.226623" x2="13.6883" y2="15.4813" gradientUnits="userSpaceOnUse">
<stop stop-color="#DA7ED0"/>
<stop offset="0.08" stop-color="#B17BD5"/>
<stop offset="0.19" stop-color="#8778DB"/>
<stop offset="0.3" stop-color="#6276E1"/>
<stop offset="0.41" stop-color="#4574E5"/>
<stop offset="0.54" stop-color="#2E72E8"/>
<stop offset="0.67" stop-color="#1D71EB"/>
<stop offset="0.81" stop-color="#1471EC"/>
<stop offset="1" stop-color="#1171ED"/>
</linearGradient>
<linearGradient id="paint2_linear_2092_1818" x1="12.769" y1="0.572683" x2="2.65698" y2="16.7887" gradientUnits="userSpaceOnUse">
<stop stop-color="#DA7ED0"/>
<stop offset="0.05" stop-color="#B77BD4"/>
<stop offset="0.11" stop-color="#9079DA"/>
<stop offset="0.18" stop-color="#6E77DF"/>
<stop offset="0.25" stop-color="#5175E3"/>
<stop offset="0.33" stop-color="#3973E7"/>
<stop offset="0.42" stop-color="#2772E9"/>
<stop offset="0.54" stop-color="#1A71EB"/>
<stop offset="0.68" stop-color="#1371EC"/>
<stop offset="1" stop-color="#1171ED"/>
</linearGradient>
<clipPath id="clip0_2092_1818">
<rect width="16" height="16" fill="white" transform="translate(0.5)"/>
</clipPath>
</defs>
</svg>

Before

Width:  |  Height:  |  Size: 3.2 KiB

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 5.7 KiB

View File

@@ -1,59 +0,0 @@
<svg width="17" height="16" viewBox="0 0 17 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<g clip-path="url(#clip0_2092_1741)">
<mask id="mask0_2092_1741" style="mask-type:luminance" maskUnits="userSpaceOnUse" x="0" y="0" width="17" height="16">
<path d="M16.5 0H0.5V16H16.5V0Z" fill="white"/>
</mask>
<g mask="url(#mask0_2092_1741)">
<mask id="mask1_2092_1741" style="mask-type:luminance" maskUnits="userSpaceOnUse" x="-1" y="-2" width="19" height="20">
<path d="M17.8337 -1.33337H-0.833008V17.3333H17.8337V-1.33337Z" fill="white"/>
</mask>
<g mask="url(#mask1_2092_1741)">
<path fill-rule="evenodd" clip-rule="evenodd" d="M11.1137 0.315668C11.57 0.315668 11.9744 0.657891 12.1196 1.15567C12.2648 1.65345 13.1152 4.73345 13.1152 4.73345V10.852H10.0352L10.0974 0.305298H11.1137V0.315668Z" fill="url(#paint0_linear_2092_1741)"/>
<path d="M15.6352 5.09586C15.6352 4.87808 15.4589 4.71216 15.2515 4.71216H13.4366C12.1611 4.71216 11.124 5.7492 11.124 7.02472V10.8618H13.3226C14.5982 10.8618 15.6352 9.82472 15.6352 8.54919V5.09586Z" fill="url(#paint1_linear_2092_1741)"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M11.1133 0.315674C10.7607 0.315674 10.4807 0.595674 10.4807 0.948265L10.4185 12.5942C10.4185 14.2949 9.0392 15.6742 7.33847 15.6742H1.74885C1.47921 15.6742 1.30292 15.4149 1.38589 15.1661L5.86589 2.37938C6.30144 1.14531 7.46293 0.315674 8.7696 0.315674H11.1237H11.1133Z" fill="url(#paint2_linear_2092_1741)"/>
</g>
</g>
</g>
<defs>
<linearGradient id="paint0_linear_2092_1741" x1="12.3996" y1="11.0801" x2="9.80702" y2="0.699373" gradientUnits="userSpaceOnUse">
<stop stop-color="#712575"/>
<stop offset="0.09" stop-color="#9A2884"/>
<stop offset="0.18" stop-color="#BF2C92"/>
<stop offset="0.27" stop-color="#DA2E9C"/>
<stop offset="0.34" stop-color="#EB30A2"/>
<stop offset="0.4" stop-color="#F131A5"/>
<stop offset="0.5" stop-color="#EC30A3"/>
<stop offset="0.61" stop-color="#DF2F9E"/>
<stop offset="0.72" stop-color="#C92D96"/>
<stop offset="0.83" stop-color="#AA2A8A"/>
<stop offset="0.95" stop-color="#83267C"/>
<stop offset="1" stop-color="#712575"/>
</linearGradient>
<linearGradient id="paint1_linear_2092_1741" x1="13.3848" y1="0.532897" x2="13.3848" y2="15.1759" gradientUnits="userSpaceOnUse">
<stop stop-color="#DA7ED0"/>
<stop offset="0.08" stop-color="#B17BD5"/>
<stop offset="0.19" stop-color="#8778DB"/>
<stop offset="0.3" stop-color="#6276E1"/>
<stop offset="0.41" stop-color="#4574E5"/>
<stop offset="0.54" stop-color="#2E72E8"/>
<stop offset="0.67" stop-color="#1D71EB"/>
<stop offset="0.81" stop-color="#1471EC"/>
<stop offset="1" stop-color="#1171ED"/>
</linearGradient>
<linearGradient id="paint2_linear_2092_1741" x1="12.5029" y1="0.865306" x2="2.79625" y2="16.4313" gradientUnits="userSpaceOnUse">
<stop stop-color="#DA7ED0"/>
<stop offset="0.05" stop-color="#B77BD4"/>
<stop offset="0.11" stop-color="#9079DA"/>
<stop offset="0.18" stop-color="#6E77DF"/>
<stop offset="0.25" stop-color="#5175E3"/>
<stop offset="0.33" stop-color="#3973E7"/>
<stop offset="0.42" stop-color="#2772E9"/>
<stop offset="0.54" stop-color="#1A71EB"/>
<stop offset="0.68" stop-color="#1371EC"/>
<stop offset="1" stop-color="#1171ED"/>
</linearGradient>
<clipPath id="clip0_2092_1741">
<rect width="16" height="16" fill="white" transform="translate(0.5)"/>
</clipPath>
</defs>
</svg>

Before

Width:  |  Height:  |  Size: 3.2 KiB

View File

@@ -1,20 +0,0 @@
<svg width="17" height="16" viewBox="0 0 17 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M14.2445 7.22331C13.137 6.75184 12.13 6.07273 11.2778 5.22264C10.0911 4.03353 9.2444 2.54831 8.8258 0.921308C8.80744 0.849046 8.76551 0.784967 8.70665 0.739197C8.6478 0.693428 8.57536 0.668579 8.5008 0.668579C8.42624 0.668579 8.35381 0.693428 8.29495 0.739197C8.2361 0.784967 8.19417 0.849046 8.1758 0.921308C7.75632 2.5481 6.90952 4.03315 5.72314 5.22264C4.87089 6.07263 3.8639 6.75172 2.75647 7.22331C2.32314 7.40998 1.8778 7.55998 1.4218 7.67531C1.3491 7.69317 1.28448 7.7349 1.23829 7.79382C1.1921 7.85274 1.16699 7.92544 1.16699 8.00031C1.16699 8.07518 1.1921 8.14788 1.23829 8.2068C1.28448 8.26572 1.3491 8.30744 1.4218 8.32531C1.8778 8.43998 2.3218 8.58998 2.75647 8.77664C3.86397 9.24811 4.87098 9.92722 5.72314 10.7773C6.9102 11.9666 7.75709 13.452 8.1758 15.0793C8.19367 15.152 8.2354 15.2166 8.29431 15.2628C8.35323 15.309 8.42594 15.3341 8.5008 15.3341C8.57567 15.3341 8.64838 15.309 8.7073 15.2628C8.76621 15.2166 8.80794 15.152 8.8258 15.0793C8.94047 14.6226 9.09047 14.1786 9.27714 13.744C9.74858 12.6365 10.4277 11.6294 11.2778 10.7773C12.4671 9.59052 13.9526 8.74386 15.5798 8.32531C15.6521 8.30694 15.7161 8.26502 15.7619 8.20616C15.8077 8.1473 15.8325 8.07487 15.8325 8.00031C15.8325 7.92575 15.8077 7.85332 15.7619 7.79446C15.7161 7.7356 15.6521 7.69367 15.5798 7.67531C15.1234 7.56047 14.6768 7.40932 14.2445 7.22331Z" fill="#3186FF"/>
<path d="M14.2445 7.22331C13.137 6.75184 12.13 6.07273 11.2778 5.22264C10.0911 4.03353 9.2444 2.54831 8.8258 0.921308C8.80744 0.849046 8.76551 0.784967 8.70665 0.739197C8.6478 0.693428 8.57536 0.668579 8.5008 0.668579C8.42624 0.668579 8.35381 0.693428 8.29495 0.739197C8.2361 0.784967 8.19417 0.849046 8.1758 0.921308C7.75632 2.5481 6.90952 4.03315 5.72314 5.22264C4.87089 6.07263 3.8639 6.75172 2.75647 7.22331C2.32314 7.40998 1.8778 7.55998 1.4218 7.67531C1.3491 7.69317 1.28448 7.7349 1.23829 7.79382C1.1921 7.85274 1.16699 7.92544 1.16699 8.00031C1.16699 8.07518 1.1921 8.14788 1.23829 8.2068C1.28448 8.26572 1.3491 8.30744 1.4218 8.32531C1.8778 8.43998 2.3218 8.58998 2.75647 8.77664C3.86397 9.24811 4.87098 9.92722 5.72314 10.7773C6.9102 11.9666 7.75709 13.452 8.1758 15.0793C8.19367 15.152 8.2354 15.2166 8.29431 15.2628C8.35323 15.309 8.42594 15.3341 8.5008 15.3341C8.57567 15.3341 8.64838 15.309 8.7073 15.2628C8.76621 15.2166 8.80794 15.152 8.8258 15.0793C8.94047 14.6226 9.09047 14.1786 9.27714 13.744C9.74858 12.6365 10.4277 11.6294 11.2778 10.7773C12.4671 9.59052 13.9526 8.74386 15.5798 8.32531C15.6521 8.30694 15.7161 8.26502 15.7619 8.20616C15.8077 8.1473 15.8325 8.07487 15.8325 8.00031C15.8325 7.92575 15.8077 7.85332 15.7619 7.79446C15.7161 7.7356 15.6521 7.69367 15.5798 7.67531C15.1234 7.56047 14.6768 7.40932 14.2445 7.22331Z" fill="url(#paint0_linear_2092_1806)"/>
<path d="M14.2445 7.22331C13.137 6.75184 12.13 6.07273 11.2778 5.22264C10.0911 4.03353 9.2444 2.54831 8.8258 0.921308C8.80744 0.849046 8.76551 0.784967 8.70665 0.739197C8.6478 0.693428 8.57536 0.668579 8.5008 0.668579C8.42624 0.668579 8.35381 0.693428 8.29495 0.739197C8.2361 0.784967 8.19417 0.849046 8.1758 0.921308C7.75632 2.5481 6.90952 4.03315 5.72314 5.22264C4.87089 6.07263 3.8639 6.75172 2.75647 7.22331C2.32314 7.40998 1.8778 7.55998 1.4218 7.67531C1.3491 7.69317 1.28448 7.7349 1.23829 7.79382C1.1921 7.85274 1.16699 7.92544 1.16699 8.00031C1.16699 8.07518 1.1921 8.14788 1.23829 8.2068C1.28448 8.26572 1.3491 8.30744 1.4218 8.32531C1.8778 8.43998 2.3218 8.58998 2.75647 8.77664C3.86397 9.24811 4.87098 9.92722 5.72314 10.7773C6.9102 11.9666 7.75709 13.452 8.1758 15.0793C8.19367 15.152 8.2354 15.2166 8.29431 15.2628C8.35323 15.309 8.42594 15.3341 8.5008 15.3341C8.57567 15.3341 8.64838 15.309 8.7073 15.2628C8.76621 15.2166 8.80794 15.152 8.8258 15.0793C8.94047 14.6226 9.09047 14.1786 9.27714 13.744C9.74858 12.6365 10.4277 11.6294 11.2778 10.7773C12.4671 9.59052 13.9526 8.74386 15.5798 8.32531C15.6521 8.30694 15.7161 8.26502 15.7619 8.20616C15.8077 8.1473 15.8325 8.07487 15.8325 8.00031C15.8325 7.92575 15.8077 7.85332 15.7619 7.79446C15.7161 7.7356 15.6521 7.69367 15.5798 7.67531C15.1234 7.56047 14.6768 7.40932 14.2445 7.22331Z" fill="url(#paint1_linear_2092_1806)"/>
<path d="M14.2445 7.22331C13.137 6.75184 12.13 6.07273 11.2778 5.22264C10.0911 4.03353 9.2444 2.54831 8.8258 0.921308C8.80744 0.849046 8.76551 0.784967 8.70665 0.739197C8.6478 0.693428 8.57536 0.668579 8.5008 0.668579C8.42624 0.668579 8.35381 0.693428 8.29495 0.739197C8.2361 0.784967 8.19417 0.849046 8.1758 0.921308C7.75632 2.5481 6.90952 4.03315 5.72314 5.22264C4.87089 6.07263 3.8639 6.75172 2.75647 7.22331C2.32314 7.40998 1.8778 7.55998 1.4218 7.67531C1.3491 7.69317 1.28448 7.7349 1.23829 7.79382C1.1921 7.85274 1.16699 7.92544 1.16699 8.00031C1.16699 8.07518 1.1921 8.14788 1.23829 8.2068C1.28448 8.26572 1.3491 8.30744 1.4218 8.32531C1.8778 8.43998 2.3218 8.58998 2.75647 8.77664C3.86397 9.24811 4.87098 9.92722 5.72314 10.7773C6.9102 11.9666 7.75709 13.452 8.1758 15.0793C8.19367 15.152 8.2354 15.2166 8.29431 15.2628C8.35323 15.309 8.42594 15.3341 8.5008 15.3341C8.57567 15.3341 8.64838 15.309 8.7073 15.2628C8.76621 15.2166 8.80794 15.152 8.8258 15.0793C8.94047 14.6226 9.09047 14.1786 9.27714 13.744C9.74858 12.6365 10.4277 11.6294 11.2778 10.7773C12.4671 9.59052 13.9526 8.74386 15.5798 8.32531C15.6521 8.30694 15.7161 8.26502 15.7619 8.20616C15.8077 8.1473 15.8325 8.07487 15.8325 8.00031C15.8325 7.92575 15.8077 7.85332 15.7619 7.79446C15.7161 7.7356 15.6521 7.69367 15.5798 7.67531C15.1234 7.56047 14.6768 7.40932 14.2445 7.22331Z" fill="url(#paint2_linear_2092_1806)"/>
<defs>
<linearGradient id="paint0_linear_2092_1806" x1="5.16714" y1="10.3333" x2="7.8338" y2="7.99997" gradientUnits="userSpaceOnUse">
<stop stop-color="#08B962"/>
<stop offset="1" stop-color="#08B962" stop-opacity="0"/>
</linearGradient>
<linearGradient id="paint1_linear_2092_1806" x1="5.8338" y1="3.66664" x2="8.16714" y2="7.33331" gradientUnits="userSpaceOnUse">
<stop stop-color="#F94543"/>
<stop offset="1" stop-color="#F94543" stop-opacity="0"/>
</linearGradient>
<linearGradient id="paint2_linear_2092_1806" x1="2.8338" y1="8.99998" x2="12.1671" y2="7.99998" gradientUnits="userSpaceOnUse">
<stop stop-color="#FABC12"/>
<stop offset="0.46" stop-color="#FABC12" stop-opacity="0"/>
</linearGradient>
</defs>
</svg>

Before

Width:  |  Height:  |  Size: 6.2 KiB

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 35 KiB

View File

@@ -1,24 +0,0 @@
<svg width="17" height="16" viewBox="0 0 17 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<g clip-path="url(#clip0_2092_1755)">
<mask id="mask0_2092_1755" style="mask-type:luminance" maskUnits="userSpaceOnUse" x="0" y="0" width="17" height="16">
<path d="M16.428 0H0.5V16H16.428V0Z" fill="white"/>
</mask>
<g mask="url(#mask0_2092_1755)">
<path d="M5.05035 0H2.77441V3.21057H5.05035V0Z" fill="#FFD800"/>
<path d="M14.1529 0H11.877V3.21057H14.1529V0Z" fill="#FFD800"/>
<path d="M7.32555 3.21082H2.77441V6.42139H7.32555V3.21082Z" fill="#FFAF00"/>
<path d="M14.1537 3.21082H9.60254V6.42139H14.1537V3.21082Z" fill="#FFAF00"/>
<path d="M14.1519 6.41992H2.77441V9.63049H14.1519V6.41992Z" fill="#FF8205"/>
<path d="M5.05035 9.63074H2.77441V12.8414H5.05035V9.63074Z" fill="#FA500F"/>
<path d="M9.60213 9.63074H7.32617V12.8414H9.60213V9.63074Z" fill="#FA500F"/>
<path d="M14.1529 9.63074H11.877V12.8414H14.1529V9.63074Z" fill="#FA500F"/>
<path d="M7.32633 12.8402H0.5V16.0509H7.32633V12.8402Z" fill="#E10500"/>
<path d="M16.4296 12.8402H9.60254V16.0509H16.4296V12.8402Z" fill="#E10500"/>
</g>
</g>
<defs>
<clipPath id="clip0_2092_1755">
<rect width="16" height="16" fill="white" transform="translate(0.5)"/>
</clipPath>
</defs>
</svg>

Before

Width:  |  Height:  |  Size: 1.2 KiB

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 6.7 KiB

View File

@@ -1,18 +0,0 @@
<svg width="17" height="16" viewBox="0 0 17 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<g clip-path="url(#clip0_2092_1790)">
<path d="M15.85 7.50005H15.75L13.08 2.54505C13.1287 2.45432 13.1544 2.35303 13.155 2.25005C13.155 2.16427 13.138 2.07933 13.105 2.00014C13.072 1.92095 13.0237 1.84907 12.9628 1.78865C12.9019 1.72823 12.8297 1.68045 12.7502 1.64808C12.6708 1.61571 12.5857 1.59939 12.5 1.60005C12.4129 1.59972 12.3267 1.6173 12.2467 1.65171C12.1667 1.68612 12.0946 1.73661 12.035 1.80005L6.71496 0.740047C6.70184 0.64745 6.66874 0.558814 6.61795 0.480283C6.56716 0.401752 6.4999 0.335204 6.42084 0.285253C6.34177 0.235302 6.25279 0.203143 6.16006 0.191003C6.06733 0.178864 5.97307 0.187036 5.88381 0.214952C5.79455 0.242869 5.71243 0.289862 5.64314 0.352674C5.57385 0.415486 5.51905 0.492615 5.48253 0.578715C5.44602 0.664814 5.42867 0.757825 5.43167 0.851299C5.43468 0.944773 5.45798 1.03647 5.49996 1.12005L1.34996 7.06505C1.29477 7.04867 1.23753 7.04025 1.17996 7.04005C1.01805 7.05429 0.867358 7.12867 0.757581 7.24853C0.647805 7.36838 0.586914 7.52502 0.586914 7.68755C0.586914 7.85008 0.647805 8.00671 0.757581 8.12657C0.867358 8.24643 1.01805 8.32081 1.17996 8.33505L3.42996 13.87C3.39194 13.9551 3.37153 14.0469 3.36996 14.14C3.37128 14.3116 3.44034 14.4756 3.5621 14.5964C3.68386 14.7173 3.84843 14.7851 4.01996 14.785C4.10788 14.7861 4.19505 14.7688 4.27596 14.7344C4.35686 14.7 4.42973 14.6491 4.48996 14.585L11.21 15.24C11.2312 15.4111 11.3195 15.5667 11.4554 15.6727C11.5914 15.7787 11.7639 15.8263 11.935 15.805C12.106 15.7838 12.2617 15.6955 12.3676 15.5596C12.4736 15.4236 12.5212 15.2511 12.5 15.08C12.498 14.9264 12.4433 14.7781 12.345 14.66L15.73 8.76005H15.84C15.9253 8.76137 16.0101 8.74587 16.0895 8.71442C16.1688 8.68297 16.2412 8.63619 16.3025 8.57676C16.3638 8.51733 16.4128 8.44641 16.4467 8.36804C16.4805 8.28968 16.4987 8.20541 16.5 8.12005C16.4947 7.95205 16.4236 7.79286 16.302 7.67686C16.1804 7.56085 16.018 7.49734 15.85 7.50005ZM12 2.64505C12.0769 2.74772 12.1833 2.82448 12.305 2.86505L11.305 10.55C11.2418 10.5642 11.1811 10.5878 11.125 10.62L5.49996 5.76005C5.51878 5.70543 5.52726 5.64778 5.52496 5.59005C5.52496 5.55005 5.52496 5.50505 5.52496 5.46505L12 2.64505ZM15.235 8.30505L11.79 10.66C11.763 10.6412 11.7345 10.6245 11.705 10.61L12.725 2.84505L15.355 7.69505C15.2499 7.81343 15.1928 7.96678 15.195 8.12505L15.235 8.30505ZM4.78496 4.95005C4.63217 4.97297 4.49283 5.0504 4.39266 5.16803C4.29249 5.28566 4.23825 5.43555 4.23996 5.59005V5.63505L1.92996 7.00005L5.49996 1.87005L4.78496 4.95005ZM4.99996 6.22505C5.08363 6.20348 5.16307 6.16798 5.23496 6.12005L10.79 10.955C10.7638 11.0306 10.7502 11.11 10.75 11.19V11.225L4.54996 13.775C4.46194 13.6393 4.32644 13.5412 4.16996 13.5L4.99996 6.22505ZM10.935 11.62C11.0198 11.7179 11.1337 11.7862 11.26 11.815L11.565 14.5C11.4362 14.5671 11.3327 14.6741 11.27 14.805L4.76996 14.165L10.935 11.62ZM11.7 11.765C11.8068 11.7099 11.8967 11.6269 11.9601 11.5248C12.0235 11.4226 12.058 11.3052 12.06 11.185C12.0622 11.1306 12.0537 11.0762 12.035 11.025L15.185 8.86005L12 14.4L11.7 11.765ZM11.86 2.22505L5.28996 5.08505L5.21496 5.03505L6.04996 1.45505H6.07496C6.18268 1.45615 6.28889 1.42961 6.38342 1.37796C6.47796 1.32631 6.55768 1.25129 6.61496 1.16005L11.86 2.20505V2.22505ZM1.82996 7.69005C1.82996 7.64505 1.82996 7.60505 1.82996 7.57005L4.42496 6.04005C4.47735 6.09439 4.53812 6.13997 4.60496 6.17505L3.74996 13.43L1.60996 8.17005C1.67867 8.11029 1.73383 8.03657 1.77177 7.95379C1.80971 7.87102 1.82955 7.7811 1.82996 7.69005Z" fill="#333333"/>
<path d="M12.7446 2.84497L15.3696 7.69497C15.2665 7.81456 15.2098 7.96712 15.2096 8.12497C15.2023 8.18475 15.2023 8.24519 15.2096 8.30497L11.7696 10.66L11.6846 10.61L12.6846 2.84497H12.7446Z" fill="#DEDEDD"/>
<path d="M11.7002 11.765C11.807 11.7099 11.8969 11.6268 11.9603 11.5247C12.0237 11.4226 12.0582 11.3052 12.0602 11.185C12.0625 11.1305 12.054 11.0762 12.0352 11.025L15.1852 8.85999L12.0002 14.4L11.7002 11.765Z" fill="#B2B2B2"/>
<path d="M10.9345 11.62C11.0194 11.7179 11.1332 11.7862 11.2595 11.815L11.5645 14.5C11.4358 14.567 11.3322 14.6741 11.2695 14.805L4.76953 14.165L10.9345 11.62Z" fill="#D1D1D1"/>
<path d="M4.99992 6.225C5.08359 6.20343 5.16303 6.16793 5.23492 6.12L10.7899 10.955C10.7637 11.0306 10.7502 11.11 10.7499 11.19V11.225L4.54992 13.775C4.4619 13.6392 4.3264 13.5412 4.16992 13.5L4.99992 6.225Z" fill="#F2F2F2"/>
<path d="M1.83035 7.69004C1.83035 7.64504 1.83035 7.60504 1.83035 7.57004L4.42535 6.04004C4.47774 6.09439 4.53851 6.13997 4.60535 6.17504L3.75035 13.43L1.61035 8.17004C1.67906 8.11029 1.73422 8.03656 1.77216 7.95378C1.8101 7.87101 1.82994 7.78109 1.83035 7.69004Z" fill="#D8D8D7"/>
<path d="M4.78469 4.95C4.6319 4.97292 4.49255 5.05034 4.39238 5.16797C4.29221 5.28561 4.23798 5.4355 4.23969 5.59V5.635L1.92969 7L5.49969 1.87L4.78469 4.95Z" fill="#B2B2B2"/>
<path d="M11.8598 2.22503L5.28984 5.08503L5.21484 5.03503L6.04984 1.45503H6.07484C6.18256 1.45613 6.28877 1.42959 6.38331 1.37795C6.47785 1.3263 6.55757 1.25127 6.61484 1.16003L11.8598 2.20503V2.22503Z" fill="#D1D1D1"/>
<path d="M12 2.64502C12.0769 2.74769 12.1833 2.82445 12.305 2.86502L11.305 10.55C11.2418 10.5642 11.1811 10.5878 11.125 10.62L5.5 5.76002C5.51882 5.7054 5.5273 5.64775 5.525 5.59002C5.525 5.55002 5.525 5.50502 5.525 5.46502L12 2.64502Z" fill="white"/>
</g>
<defs>
<clipPath id="clip0_2092_1790">
<rect width="16" height="16" fill="white" transform="translate(0.5)"/>
</clipPath>
</defs>
</svg>

Before

Width:  |  Height:  |  Size: 5.3 KiB

View File

@@ -1,15 +0,0 @@
<svg width="17" height="16" viewBox="0 0 17 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<g clip-path="url(#clip0_2092_1800)">
<mask id="mask0_2092_1800" style="mask-type:luminance" maskUnits="userSpaceOnUse" x="0" y="0" width="17" height="16">
<path d="M16.5 0H0.5V16H16.5V0Z" fill="white"/>
</mask>
<g mask="url(#mask0_2092_1800)">
<path d="M6.63673 5.772V4.26557C6.63673 4.13867 6.68433 4.0435 6.79527 3.98013L9.8241 2.23585C10.2364 1.998 10.728 1.88706 11.2353 1.88706C13.1382 1.88706 14.3434 3.3618 14.3434 4.9316C14.3434 5.0426 14.3434 5.16947 14.3275 5.29633L11.1877 3.45687C10.9975 3.3459 10.8071 3.3459 10.6169 3.45687L6.63673 5.772ZM13.709 11.6392V8.03953C13.709 7.8175 13.6138 7.65893 13.4236 7.54793L9.44343 5.2328L10.7437 4.48747C10.8547 4.42413 10.9499 4.42413 11.0609 4.48747L14.0897 6.23177C14.9619 6.73927 15.5485 7.8175 15.5485 8.864C15.5485 10.0691 14.835 11.1793 13.709 11.6392ZM5.70117 8.46777L4.40087 7.70667C4.28993 7.64333 4.2423 7.5481 4.2423 7.42123V3.9327C4.2423 2.23602 5.5426 0.951497 7.30277 0.951497C7.96887 0.951497 8.58717 1.17355 9.1106 1.56996L5.98673 3.37773C5.7965 3.4887 5.7013 3.64723 5.7013 3.86933L5.70117 8.46777ZM8.5 10.0852L6.63673 9.03863V6.8187L8.5 5.77217L10.3631 6.8187V9.03863L8.5 10.0852ZM9.6972 14.9058C9.03113 14.9058 8.41283 14.6838 7.8894 14.2874L11.0132 12.4796C11.2035 12.3686 11.2987 12.2101 11.2987 11.988V7.3894L12.6149 8.15053C12.7258 8.21387 12.7735 8.30907 12.7735 8.43597V11.9245C12.7735 13.6212 11.4572 14.9058 9.6972 14.9058ZM5.939 11.3697L2.91018 9.62543C2.03797 9.1179 1.45133 8.0397 1.45133 6.99317C1.45133 5.77217 2.18077 4.67803 3.30657 4.21813V7.83357C3.30657 8.0556 3.40178 8.21417 3.592 8.32513L7.5564 10.6244L6.2561 11.3697C6.14517 11.433 6.04993 11.433 5.939 11.3697ZM5.76467 13.9703C3.9728 13.9703 2.6566 12.6224 2.6566 10.9574C2.6566 10.8305 2.6725 10.7036 2.68826 10.5768L5.81213 12.3845C6.00237 12.4955 6.19273 12.4955 6.38297 12.3845L10.3631 10.0853V11.5918C10.3631 11.7186 10.3155 11.8138 10.2046 11.8772L7.17577 13.6215C6.76347 13.8593 6.27203 13.9703 5.76467 13.9703ZM9.6972 15.8572C11.6159 15.8572 13.2174 14.4935 13.5823 12.6857C15.3583 12.2258 16.5 10.5608 16.5 8.86417C16.5 7.7541 16.0243 6.6759 15.168 5.89887C15.2473 5.56583 15.2949 5.2328 15.2949 4.89993C15.2949 2.6324 13.4554 0.935567 11.3305 0.935567C10.9025 0.935567 10.4902 0.99892 10.0778 1.14172C9.36417 0.443973 8.381 0 7.30277 0C5.38407 0 3.78256 1.36364 3.41771 3.17142C1.64172 3.63133 0.5 5.29633 0.5 6.993C0.5 8.10307 0.975663 9.18127 1.83198 9.9583C1.7527 10.2913 1.70511 10.6244 1.70511 10.9572C1.70511 13.2248 3.54458 14.9216 5.66947 14.9216C6.09753 14.9216 6.50983 14.8582 6.92217 14.7154C7.63567 15.4132 8.61883 15.8572 9.6972 15.8572Z" fill="white"/>
</g>
</g>
<defs>
<clipPath id="clip0_2092_1800">
<rect width="16" height="16" fill="white" transform="translate(0.5)"/>
</clipPath>
</defs>
</svg>

Before

Width:  |  Height:  |  Size: 2.8 KiB

View File

@@ -1,10 +0,0 @@
<svg width="17" height="16" viewBox="0 0 17 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<g clip-path="url(#clip0_2092_1732)">
<path d="M6.63673 5.772V4.26557C6.63673 4.13867 6.68433 4.0435 6.79527 3.98013L9.8241 2.23585C10.2364 1.998 10.728 1.88706 11.2353 1.88706C13.1382 1.88706 14.3434 3.3618 14.3434 4.9316C14.3434 5.0426 14.3434 5.16947 14.3275 5.29633L11.1877 3.45687C10.9975 3.3459 10.8071 3.3459 10.6169 3.45687L6.63673 5.772ZM13.709 11.6392V8.03953C13.709 7.8175 13.6138 7.65893 13.4236 7.54793L9.44343 5.2328L10.7437 4.48747C10.8547 4.42413 10.9499 4.42413 11.0609 4.48747L14.0897 6.23177C14.9619 6.73927 15.5485 7.8175 15.5485 8.864C15.5485 10.0691 14.835 11.1793 13.709 11.6392ZM5.70117 8.46777L4.40087 7.70667C4.28993 7.64333 4.2423 7.5481 4.2423 7.42123V3.9327C4.2423 2.23602 5.5426 0.951497 7.30277 0.951497C7.96887 0.951497 8.58717 1.17355 9.1106 1.56996L5.98673 3.37773C5.7965 3.4887 5.7013 3.64723 5.7013 3.86933L5.70117 8.46777ZM8.5 10.0852L6.63673 9.03863V6.8187L8.5 5.77217L10.3631 6.8187V9.03863L8.5 10.0852ZM9.6972 14.9058C9.03113 14.9058 8.41283 14.6838 7.8894 14.2874L11.0132 12.4796C11.2035 12.3686 11.2987 12.2101 11.2987 11.988V7.3894L12.6149 8.15053C12.7258 8.21387 12.7735 8.30907 12.7735 8.43597V11.9245C12.7735 13.6212 11.4572 14.9058 9.6972 14.9058ZM5.939 11.3697L2.91018 9.62543C2.03797 9.1179 1.45133 8.0397 1.45133 6.99317C1.45133 5.77217 2.18077 4.67803 3.30657 4.21813V7.83357C3.30657 8.0556 3.40178 8.21417 3.592 8.32513L7.5564 10.6244L6.2561 11.3697C6.14517 11.433 6.04993 11.433 5.939 11.3697ZM5.76467 13.9703C3.9728 13.9703 2.6566 12.6224 2.6566 10.9574C2.6566 10.8305 2.6725 10.7036 2.68826 10.5768L5.81213 12.3845C6.00237 12.4955 6.19273 12.4955 6.38297 12.3845L10.3631 10.0853V11.5918C10.3631 11.7186 10.3155 11.8138 10.2046 11.8772L7.17577 13.6215C6.76347 13.8593 6.27203 13.9703 5.76467 13.9703ZM9.6972 15.8572C11.6159 15.8572 13.2174 14.4935 13.5823 12.6857C15.3583 12.2258 16.5 10.5608 16.5 8.86417C16.5 7.7541 16.0243 6.6759 15.168 5.89887C15.2473 5.56583 15.2949 5.2328 15.2949 4.89993C15.2949 2.6324 13.4554 0.935567 11.3305 0.935567C10.9025 0.935567 10.4902 0.99892 10.0778 1.14172C9.36417 0.443973 8.381 0 7.30277 0C5.38407 0 3.78256 1.36364 3.41771 3.17142C1.64172 3.63133 0.5 5.29633 0.5 6.993C0.5 8.10307 0.975663 9.18127 1.83198 9.9583C1.7527 10.2913 1.70511 10.6244 1.70511 10.9572C1.70511 13.2248 3.54458 14.9216 5.66947 14.9216C6.09753 14.9216 6.50983 14.8582 6.92217 14.7154C7.63567 15.4132 8.61883 15.8572 9.6972 15.8572Z" fill="black"/>
</g>
<defs>
<clipPath id="clip0_2092_1732">
<rect width="16" height="16" fill="white" transform="translate(0.5)"/>
</clipPath>
</defs>
</svg>

Before

Width:  |  Height:  |  Size: 2.6 KiB

View File

@@ -1,74 +0,0 @@
<svg width="17" height="16" viewBox="0 0 17 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<g clip-path="url(#clip0_2092_1770)">
<mask id="mask0_2092_1770" style="mask-type:luminance" maskUnits="userSpaceOnUse" x="0" y="0" width="17" height="16">
<path d="M16.5 0H0.5V16H16.5V0Z" fill="white"/>
</mask>
<g mask="url(#mask0_2092_1770)">
<mask id="mask1_2092_1770" style="mask-type:luminance" maskUnits="userSpaceOnUse" x="0" y="0" width="17" height="16">
<path d="M16.5 0H0.5V16H16.5V0Z" fill="white"/>
</mask>
<g mask="url(#mask1_2092_1770)">
<path d="M16.131 10.9838L9.24712 15.124C9.02152 15.2597 8.76328 15.3313 8.5 15.3313C8.23675 15.3313 7.97846 15.2597 7.75286 15.124L0.869003 10.9838C0.640038 10.8461 0.5 10.5985 0.5 10.3313C0.5 10.0641 0.640038 9.81645 0.869003 9.67877L7.75286 5.53867C7.97846 5.40299 8.23675 5.3313 8.5 5.3313C8.76328 5.3313 9.02152 5.40299 9.24712 5.53867L16.131 9.67877C16.36 9.81645 16.5 10.0641 16.5 10.3313C16.5 10.5985 16.36 10.8461 16.131 10.9838Z" fill="url(#paint0_linear_2092_1770)"/>
<path d="M16.131 8.65256L9.24712 12.7926C9.02152 12.9283 8.76328 13 8.5 13C8.23675 13 7.97846 12.9283 7.75286 12.7926L0.869003 8.65256C0.640038 8.5148 0.5 8.2672 0.5 8C0.5 7.73282 0.640038 7.48518 0.869003 7.34746L7.75286 3.20737C7.97846 3.07168 8.23675 3 8.5 3C8.76328 3 9.02152 3.07168 9.24712 3.20737L16.131 7.34746C16.36 7.48518 16.5 7.73282 16.5 8C16.5 8.2672 16.36 8.5148 16.131 8.65256Z" fill="url(#paint1_linear_2092_1770)"/>
<path d="M16.131 6.31818L9.24712 10.4583C9.02152 10.5939 8.76328 10.6656 8.5 10.6656C8.23675 10.6656 7.97846 10.5939 7.75286 10.4583L0.869003 6.31818C0.640038 6.18046 0.5 5.93283 0.5 5.66565C0.5 5.39846 0.640038 5.15083 0.869003 5.01311L7.75286 0.873017C7.97846 0.737337 8.23675 0.665649 8.5 0.665649C8.76328 0.665649 9.02152 0.737337 9.24712 0.873017L16.131 5.01311C16.36 5.15083 16.5 5.39846 16.5 5.66565C16.5 5.93283 16.36 6.18046 16.131 6.31818Z" fill="url(#paint2_linear_2092_1770)"/>
<path d="M11.8334 7.55765C11.8334 8.29403 11.2364 8.89099 10.5 8.89099H5.83334C5.09695 8.89099 4.5 8.29403 4.5 7.55765V2.66565H11.8334V7.55765Z" fill="url(#paint3_radial_2092_1770)" fill-opacity="0.4"/>
<path d="M11.8334 7.55765C11.8334 8.29403 11.2364 8.89099 10.5 8.89099H5.83334C5.09695 8.89099 4.5 8.29403 4.5 7.55765V2.66565H11.8334V7.55765Z" fill="url(#paint4_radial_2092_1770)" fill-opacity="0.4"/>
<path d="M11.8334 7.55765C11.8334 8.29403 11.2364 8.89099 10.5 8.89099H5.83334C5.09695 8.89099 4.5 8.29403 4.5 7.55765V2.66565H11.8334V7.55765Z" fill="url(#paint5_radial_2092_1770)" fill-opacity="0.4"/>
<path d="M11.8334 7.55765C11.8334 8.29403 11.2364 8.89099 10.5 8.89099H5.83334C5.09695 8.89099 4.5 8.29403 4.5 7.55765V2.66565H11.8334V7.55765Z" fill="url(#paint6_radial_2092_1770)" fill-opacity="0.4"/>
<path d="M11.8334 7.55765C11.8334 8.29403 11.2364 8.89099 10.5 8.89099H5.83334C5.09695 8.89099 4.5 8.29403 4.5 7.55765V2.66565H11.8334V7.55765Z" fill="url(#paint7_radial_2092_1770)" fill-opacity="0.4"/>
<path d="M11.8334 7.55765C11.8334 8.29403 11.2364 8.89099 10.5 8.89099H5.83334C5.09695 8.89099 4.5 8.29403 4.5 7.55765V2.66565H11.8334V7.55765Z" fill="url(#paint8_radial_2092_1770)" fill-opacity="0.4"/>
<path d="M8.01858 3.31028L7.76982 2.80011C7.749 2.7608 7.7104 2.72675 7.65934 2.70267C7.60826 2.67859 7.54725 2.66565 7.48468 2.66565C7.42214 2.66565 7.36112 2.67859 7.31005 2.70267C7.25898 2.72675 7.22038 2.7608 7.19957 2.80011L6.9508 3.31028C6.87498 3.46428 6.74675 3.60454 6.57612 3.72002C6.40548 3.83551 6.19708 3.92314 5.9672 3.97603L5.20177 4.14185C5.14277 4.15571 5.09168 4.18143 5.05555 4.21548C5.0194 4.24951 5 4.29019 5 4.33188C5 4.37357 5.0194 4.41423 5.05555 4.44828C5.09168 4.48231 5.14277 4.50803 5.20177 4.52191L5.9672 4.68771C6.16372 4.73139 6.34502 4.80035 6.501 4.89045C6.53005 4.90723 6.55823 4.92475 6.58548 4.94297C6.72874 5.03882 6.84258 5.152 6.92118 5.27615C6.93774 5.30231 6.95274 5.32895 6.9661 5.35602L7.21486 5.86619C7.23363 5.90162 7.26685 5.93279 7.31062 5.95622C7.3154 5.95879 7.32032 5.96127 7.32535 5.96363C7.37642 5.98771 7.43743 6.00065 7.5 6.00065C7.56257 6.00065 7.62358 5.98771 7.67465 5.96363C7.72572 5.93955 7.76432 5.9055 7.78514 5.86619L8.0339 5.35602C8.11125 5.20091 8.24182 5.05999 8.41522 4.94442C8.58864 4.82885 8.80008 4.74182 9.0328 4.69027L9.79824 4.52447C9.8572 4.51059 9.90832 4.48487 9.94448 4.45083C9.98056 4.41679 10 4.37611 10 4.33443C10 4.29274 9.98056 4.25207 9.94448 4.21803C9.90832 4.18399 9.8572 4.15827 9.79824 4.1444L9.78296 4.14185L9.01752 3.97603C8.7848 3.92448 8.57328 3.83747 8.39992 3.72188C8.22652 3.60631 8.09595 3.46539 8.01858 3.31028Z" fill="url(#paint9_linear_2092_1770)"/>
<path d="M11.0775 6.78623L11.5368 6.88572L11.546 6.88725C11.5813 6.89557 11.612 6.911 11.6336 6.93143C11.6553 6.95185 11.667 6.97625 11.667 7.00126C11.667 7.02628 11.6553 7.05068 11.6336 7.0711C11.612 7.09154 11.5813 7.10697 11.546 7.11528L11.0867 7.21477C10.947 7.2457 10.8202 7.29792 10.7161 7.36726C10.6121 7.4366 10.5337 7.52117 10.4873 7.61422L10.338 7.92032C10.3256 7.94392 10.3024 7.96434 10.2718 7.97878C10.2412 7.99323 10.2045 8.00104 10.167 8.00104C10.1295 8.00104 10.0928 7.99323 10.0622 7.97878C10.0316 7.96434 10.0084 7.94392 9.99587 7.92032L9.99539 7.91937L9.84667 7.61422C9.80051 7.52088 9.72235 7.43602 9.61827 7.3664C9.51419 7.29677 9.38715 7.24434 9.24731 7.21323L8.78803 7.11375C8.75267 7.10543 8.72195 7.09 8.70035 7.06958C8.67859 7.04915 8.66699 7.02475 8.66699 6.99974C8.66699 6.97472 8.67859 6.95032 8.70035 6.9299C8.72195 6.90946 8.75267 6.89403 8.78803 6.88572L9.24731 6.78623C9.38523 6.7545 9.51027 6.70192 9.61267 6.63262C9.71499 6.56334 9.79195 6.47918 9.83747 6.38678L9.98675 6.08068C9.99923 6.05708 10.0224 6.03666 10.053 6.02222C10.0836 6.00777 10.1203 6 10.1578 6C10.1953 6 10.232 6.00777 10.2626 6.02222C10.2932 6.03666 10.3164 6.05708 10.3288 6.08068L10.4781 6.38678C10.5245 6.47983 10.6029 6.5644 10.7069 6.63375C10.811 6.70308 10.9379 6.7553 11.0775 6.78623Z" fill="url(#paint10_linear_2092_1770)"/>
</g>
</g>
</g>
<defs>
<linearGradient id="paint0_linear_2092_1770" x1="0.5" y1="5.3313" x2="9.4888" y2="19.7133" gradientUnits="userSpaceOnUse">
<stop stop-color="#004695"/>
<stop offset="1" stop-color="#0078D4"/>
</linearGradient>
<linearGradient id="paint1_linear_2092_1770" x1="0.5" y1="3" x2="9.4888" y2="17.382" gradientUnits="userSpaceOnUse">
<stop stop-color="#0078D4"/>
<stop offset="1" stop-color="#0FAFFF"/>
</linearGradient>
<linearGradient id="paint2_linear_2092_1770" x1="0.9" y1="0.66565" x2="9.8888" y2="15.0477" gradientUnits="userSpaceOnUse">
<stop stop-color="#3BD5FF"/>
<stop offset="1" stop-color="#0FAFFF"/>
</linearGradient>
<radialGradient id="paint3_radial_2092_1770" cx="0" cy="0" r="1" gradientUnits="userSpaceOnUse" gradientTransform="translate(7.5 5.33231) rotate(90) scale(1 0.97124)">
<stop stop-color="#00204D"/>
<stop offset="1" stop-color="#00204D" stop-opacity="0"/>
</radialGradient>
<radialGradient id="paint4_radial_2092_1770" cx="0" cy="0" r="1" gradientUnits="userSpaceOnUse" gradientTransform="translate(8.5 4.99899) rotate(-14.0362) scale(1.37437 0.380635)">
<stop stop-color="#00204D"/>
<stop offset="1" stop-color="#00204D" stop-opacity="0"/>
</radialGradient>
<radialGradient id="paint5_radial_2092_1770" cx="0" cy="0" r="1" gradientUnits="userSpaceOnUse" gradientTransform="translate(6.5 4.99899) rotate(-165.964) scale(1.37437 0.384775)">
<stop stop-color="#00204D"/>
<stop offset="1" stop-color="#00204D" stop-opacity="0"/>
</radialGradient>
<radialGradient id="paint6_radial_2092_1770" cx="0" cy="0" r="1" gradientUnits="userSpaceOnUse" gradientTransform="translate(9.5 7.33231) rotate(-153.435) scale(0.745357 0.359002)">
<stop stop-color="#00204D"/>
<stop offset="1" stop-color="#00204D" stop-opacity="0"/>
</radialGradient>
<radialGradient id="paint7_radial_2092_1770" cx="0" cy="0" r="1" gradientUnits="userSpaceOnUse" gradientTransform="translate(10.8334 7.33231) rotate(-26.565) scale(0.745357 0.290223)">
<stop stop-color="#00204D"/>
<stop offset="1" stop-color="#00204D" stop-opacity="0"/>
</radialGradient>
<radialGradient id="paint8_radial_2092_1770" cx="0" cy="0" r="1" gradientUnits="userSpaceOnUse" gradientTransform="translate(10.1666 7.66565) rotate(90) scale(0.666666 0.627526)">
<stop offset="0.0638343" stop-color="#00204D"/>
<stop offset="1" stop-color="#00204D" stop-opacity="0"/>
</radialGradient>
<linearGradient id="paint9_linear_2092_1770" x1="6.43217" y1="3.09882" x2="8.32475" y2="8.55931" gradientUnits="userSpaceOnUse">
<stop stop-color="white"/>
<stop offset="1" stop-color="#DFFAFF"/>
</linearGradient>
<linearGradient id="paint10_linear_2092_1770" x1="6.43248" y1="3.09983" x2="8.32506" y2="8.56032" gradientUnits="userSpaceOnUse">
<stop stop-color="white"/>
<stop offset="1" stop-color="#DFFAFF"/>
</linearGradient>
<clipPath id="clip0_2092_1770">
<rect width="16" height="16" fill="white" transform="translate(0.5)"/>
</clipPath>
</defs>
</svg>

Before

Width:  |  Height:  |  Size: 8.7 KiB

View File

@@ -11,28 +11,22 @@ using AdvancedPaste.Settings;
using Microsoft.PowerToys.Settings.UI.Library;
using Microsoft.SemanticKernel;
using Microsoft.SemanticKernel.ChatCompletion;
using Microsoft.SemanticKernel.Connectors.Amazon;
using Microsoft.SemanticKernel.Connectors.AzureAIInference;
using Microsoft.SemanticKernel.Connectors.Google;
using Microsoft.SemanticKernel.Connectors.HuggingFace;
using Microsoft.SemanticKernel.Connectors.MistralAI;
using Microsoft.SemanticKernel.Connectors.Ollama;
using Microsoft.SemanticKernel.Connectors.OpenAI;
namespace AdvancedPaste.Services;
public sealed class AdvancedAIKernelService : KernelServiceBase
{
private readonly IAICredentialsProvider credentialsProvider;
private readonly record struct RuntimeConfig(
private sealed record RuntimeConfiguration(
AIServiceType ServiceType,
string ModelName,
string Endpoint,
string DeploymentName,
string ModelPath,
bool UsePasteScope,
bool ModerationEnabled);
string SystemPrompt,
bool ModerationEnabled) : IKernelRuntimeConfiguration;
private readonly IAICredentialsProvider credentialsProvider;
public AdvancedAIKernelService(
IAICredentialsProvider credentialsProvider,
@@ -47,7 +41,7 @@ public sealed class AdvancedAIKernelService : KernelServiceBase
this.credentialsProvider = credentialsProvider;
}
protected override string AdvancedAIModelName => GetRuntimeConfig().ModelName;
protected override string AdvancedAIModelName => GetRuntimeConfiguration().ModelName;
protected override PromptExecutionSettings PromptExecutionSettings => CreatePromptExecutionSettings();
@@ -55,16 +49,15 @@ public sealed class AdvancedAIKernelService : KernelServiceBase
{
ArgumentNullException.ThrowIfNull(kernelBuilder);
var runtimeConfig = GetRuntimeConfig();
var runtimeConfig = GetRuntimeConfiguration();
var serviceType = runtimeConfig.ServiceType;
var modelName = runtimeConfig.ModelName;
var requiresApiKey = RequiresApiKey(serviceType);
var apiKey = string.Empty;
if (requiresApiKey)
{
var scope = runtimeConfig.UsePasteScope ? AICredentialScope.PasteAI : AICredentialScope.AdvancedAI;
this.credentialsProvider.Refresh(scope);
apiKey = (this.credentialsProvider.GetKey(scope) ?? string.Empty).Trim();
this.credentialsProvider.Refresh();
apiKey = (this.credentialsProvider.GetKey() ?? string.Empty).Trim();
if (string.IsNullOrWhiteSpace(apiKey))
{
throw new InvalidOperationException($"An API key is required for {serviceType} but none was found in the credential vault.");
@@ -94,7 +87,7 @@ public sealed class AdvancedAIKernelService : KernelServiceBase
protected override bool ShouldModerateAdvancedAI()
{
if (!TryGetRuntimeConfig(out var runtimeConfig))
if (!TryGetRuntimeConfiguration(out var runtimeConfig))
{
return false;
}
@@ -112,9 +105,9 @@ public sealed class AdvancedAIKernelService : KernelServiceBase
return "gpt-4o";
}
private RuntimeConfig GetRuntimeConfig()
protected override IKernelRuntimeConfiguration GetRuntimeConfiguration()
{
if (TryGetRuntimeConfig(out var runtimeConfig))
if (TryGetRuntimeConfiguration(out var runtimeConfig))
{
return runtimeConfig;
}
@@ -122,11 +115,11 @@ public sealed class AdvancedAIKernelService : KernelServiceBase
throw new InvalidOperationException("No Advanced AI provider is configured.");
}
private bool TryGetRuntimeConfig(out RuntimeConfig runtimeConfig)
private bool TryGetRuntimeConfiguration(out IKernelRuntimeConfiguration runtimeConfig)
{
runtimeConfig = default;
runtimeConfig = null;
if (!TryResolveAdvancedProvider(out var provider, out var usePasteScope))
if (!TryResolveAdvancedProvider(out var provider))
{
return false;
}
@@ -137,21 +130,20 @@ public sealed class AdvancedAIKernelService : KernelServiceBase
return false;
}
runtimeConfig = new RuntimeConfig(
runtimeConfig = new RuntimeConfiguration(
serviceType,
GetModelName(provider),
provider.EndpointUrl,
provider.DeploymentName,
provider.ModelPath,
usePasteScope,
provider.SystemPrompt,
provider.ModerationEnabled);
return true;
}
private bool TryResolveAdvancedProvider(out PasteAIProviderDefinition provider, out bool usePasteScope)
private bool TryResolveAdvancedProvider(out PasteAIProviderDefinition provider)
{
provider = null;
usePasteScope = false;
var configuration = this.UserSettings?.PasteAIConfiguration;
if (configuration is null)
@@ -163,15 +155,18 @@ public sealed class AdvancedAIKernelService : KernelServiceBase
if (IsAdvancedProvider(activeProvider))
{
provider = activeProvider;
usePasteScope = true;
return true;
}
if (activeProvider is not null)
{
return false;
}
var fallback = configuration.Providers?.FirstOrDefault(IsAdvancedProvider);
if (fallback is not null)
{
provider = fallback;
usePasteScope = configuration.UseSharedCredentials;
return true;
}
@@ -216,7 +211,7 @@ public sealed class AdvancedAIKernelService : KernelServiceBase
private PromptExecutionSettings CreatePromptExecutionSettings()
{
var serviceType = GetRuntimeConfig().ServiceType;
var serviceType = GetRuntimeConfiguration().ServiceType;
return new OpenAIPromptExecutionSettings
{
FunctionChoiceBehavior = FunctionChoiceBehavior.Auto(),

View File

@@ -4,13 +4,17 @@
using System;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Threading;
using System.Threading.Tasks;
using AdvancedPaste.Helpers;
using AdvancedPaste.Models;
using AdvancedPaste.Settings;
using AdvancedPaste.Telemetry;
using ManagedCommon;
using Microsoft.PowerToys.Settings.UI.Library;
using Microsoft.PowerToys.Telemetry;
using Microsoft.SemanticKernel;
using Microsoft.SemanticKernel.Connectors.OpenAI;
@@ -87,6 +91,10 @@ namespace AdvancedPaste.Services.CustomActions
var usage = request.Usage;
var content = providerContent ?? string.Empty;
// Log endpoint usage
var endpointEvent = new AdvancedPasteEndpointUsageEvent(providerConfig.ProviderType);
PowerToysTelemetry.Log.WriteEvent(endpointEvent);
Logger.LogDebug($"{nameof(CustomActionTransformService)}.{nameof(TransformAsync)} complete; ModelName={providerConfig.Model ?? string.Empty}, PromptTokens={usage.PromptTokens}, CompletionTokens={usage.CompletionTokens}");
return new CustomActionTransformResult(content, usage);
@@ -100,10 +108,32 @@ namespace AdvancedPaste.Services.CustomActions
throw;
}
throw new PasteActionException(ErrorHelpers.TranslateErrorText(-1), ex);
var statusCode = ExtractStatusCode(ex);
var failureMessage = providerConfig.ProviderType switch
{
AIServiceType.OpenAI or AIServiceType.AzureOpenAI => ErrorHelpers.TranslateErrorText(statusCode),
_ => ResourceLoaderInstance.ResourceLoader.GetString("PasteError"),
};
throw new PasteActionException(failureMessage, ex);
}
}
private static int ExtractStatusCode(Exception exception)
{
if (exception is HttpOperationException httpOperationException)
{
return (int?)httpOperationException.StatusCode ?? -1;
}
if (exception is HttpRequestException httpRequestException && httpRequestException.StatusCode is HttpStatusCode statusCode)
{
return (int)statusCode;
}
return -1;
}
private static AIServiceType NormalizeServiceType(AIServiceType serviceType)
{
return serviceType == AIServiceType.Unknown ? AIServiceType.OpenAI : serviceType;
@@ -141,8 +171,8 @@ namespace AdvancedPaste.Services.CustomActions
return string.Empty;
}
credentialsProvider.Refresh(AICredentialScope.PasteAI);
return credentialsProvider.GetKey(AICredentialScope.PasteAI) ?? string.Empty;
credentialsProvider.Refresh();
return credentialsProvider.GetKey() ?? string.Empty;
}
private static bool RequiresApiKey(AIServiceType serviceType)
@@ -151,8 +181,6 @@ namespace AdvancedPaste.Services.CustomActions
{
AIServiceType.Onnx => false,
AIServiceType.Ollama => false,
AIServiceType.Anthropic => false,
AIServiceType.AmazonBedrock => false,
_ => true,
};
}

View File

@@ -47,62 +47,97 @@ public sealed class FoundryLocalPasteProvider : IPasteAIProvider
{
ArgumentNullException.ThrowIfNull(request);
var systemPrompt = request.SystemPrompt;
if (string.IsNullOrWhiteSpace(systemPrompt))
try
{
throw new ArgumentException("System prompt must be provided", nameof(request));
var systemPrompt = request.SystemPrompt;
if (string.IsNullOrWhiteSpace(systemPrompt))
{
throw new PasteActionException(
"System prompt is required for Foundry Local",
new ArgumentException("System prompt must be provided", nameof(request)));
}
var prompt = request.Prompt;
var inputText = request.InputText;
if (string.IsNullOrWhiteSpace(prompt) || string.IsNullOrWhiteSpace(inputText))
{
throw new PasteActionException(
"Prompt and input text are required",
new ArgumentException("Prompt and input text must be provided", nameof(request)));
}
var modelReference = _config?.Model;
if (string.IsNullOrWhiteSpace(modelReference))
{
throw new PasteActionException(
"No Foundry Local model selected",
new InvalidOperationException("Model identifier is required"),
aiServiceMessage: "Please select a model in the AI provider settings. Model identifier should be in the format 'fl://model-name'.");
}
cancellationToken.ThrowIfCancellationRequested();
var chatClient = LanguageModels.GetClient(modelReference);
if (chatClient is null)
{
throw new PasteActionException(
$"Unable to load Foundry Local model: {modelReference}",
new InvalidOperationException("Chat client resolution failed"),
aiServiceMessage: "The model may not be downloaded or the Foundry Local service may not be running. Please check the model status in settings.");
}
// Extract actual model ID from the URL (format: fl://modelId)
var actualModelId = modelReference.Replace("fl://", string.Empty).Trim('/');
var userMessageContent = $"""
User instructions:
{prompt}
Text:
{inputText}
Output:
""";
var chatMessages = new List<ChatMessage>
{
new(ChatRole.System, systemPrompt),
new(ChatRole.User, userMessageContent),
};
var chatOptions = CreateChatOptions(_config?.SystemPrompt, actualModelId);
progress?.Report(0.1);
var response = await chatClient.GetResponseAsync(chatMessages, chatOptions, cancellationToken).ConfigureAwait(false);
progress?.Report(0.8);
var responseText = GetResponseText(response);
request.Usage = ToUsage(response.Usage);
progress?.Report(1.0);
return responseText ?? string.Empty;
}
var prompt = request.Prompt;
var inputText = request.InputText;
if (string.IsNullOrWhiteSpace(prompt) || string.IsNullOrWhiteSpace(inputText))
catch (OperationCanceledException)
{
throw new ArgumentException("Prompt and input text must be provided", nameof(request));
// Let cancellation exceptions pass through unchanged
throw;
}
var modelReference = _config?.Model;
if (string.IsNullOrWhiteSpace(modelReference))
catch (PasteActionException)
{
throw new InvalidOperationException("Foundry Local requires a model identifier (for example, 'fl://model-name').");
// Let our custom exceptions pass through unchanged
throw;
}
cancellationToken.ThrowIfCancellationRequested();
var chatClient = LanguageModels.GetClient(modelReference);
if (chatClient is null)
catch (Exception ex)
{
throw new InvalidOperationException($"Unable to resolve Foundry Local client for '{modelReference}'. Ensure the model is downloaded.");
// Wrap any other exceptions with context
var modelInfo = !string.IsNullOrWhiteSpace(_config?.Model) ? $" (Model: {_config.Model})" : string.Empty;
throw new PasteActionException(
$"Failed to generate response using Foundry Local{modelInfo}",
ex,
aiServiceMessage: $"Error details: {ex.Message}");
}
var userMessageContent = $"""
User instructions:
{prompt}
Text:
{inputText}
Output:
""";
var chatMessages = new List<ChatMessage>
{
new(ChatRole.System, systemPrompt),
new(ChatRole.User, userMessageContent),
};
var chatOptions = CreateChatOptions(_config?.SystemPrompt, modelReference);
progress?.Report(0.1);
var response = await chatClient.GetResponseAsync(chatMessages, chatOptions, cancellationToken).ConfigureAwait(false);
progress?.Report(0.8);
var responseText = GetResponseText(response);
request.Usage = ToUsage(response.Usage);
progress?.Report(1.0);
return responseText ?? string.Empty;
}
private static ChatOptions CreateChatOptions(string systemPrompt, string modelReference)

Some files were not shown because too many files have changed in this diff Show More