Compare commits
236 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
423cd20922 | ||
|
|
69d5ef36e2 | ||
|
|
0dd17cc175 | ||
|
|
16e56c4edb | ||
|
|
f46b876fd6 | ||
|
|
1181ab67ba | ||
|
|
014c26be25 | ||
|
|
99eb9429fd | ||
|
|
d3b10d0d4d | ||
|
|
d9597d5ad5 | ||
|
|
55272e5ea2 | ||
|
|
d17fc86fa4 | ||
|
|
0b391584d4 | ||
|
|
e3e02aa30b | ||
|
|
403f53a397 | ||
|
|
bfd79e1af2 | ||
|
|
5745a984aa | ||
|
|
d2f1f67a22 | ||
|
|
d98cb50d7a | ||
|
|
cc4864976a | ||
|
|
92fa8b7421 | ||
|
|
aad2e8012b | ||
|
|
b3eae80ece | ||
|
|
b58d5b6066 | ||
|
|
f1b6e6570c | ||
|
|
8e758507b1 | ||
|
|
2601d8b702 | ||
|
|
fa0545e4b3 | ||
|
|
690208fd4e | ||
|
|
3272575f70 | ||
|
|
fad3142a47 | ||
|
|
1f74dcff14 | ||
|
|
62c7183922 | ||
|
|
ef73b0a07f | ||
|
|
ec7d42d1fd | ||
|
|
256a17f2c9 | ||
|
|
165ffed9e6 | ||
|
|
b89d6d78ef | ||
|
|
6890561723 | ||
|
|
849ce04def | ||
|
|
a29baf19d0 | ||
|
|
10d6a1fa54 | ||
|
|
6ea181c286 | ||
|
|
2d890603c6 | ||
|
|
d1ca30a28f | ||
|
|
35fccf8af8 | ||
|
|
f5baa56e05 | ||
|
|
d2c1be5c2d | ||
|
|
fd6525a9de | ||
|
|
ba03a134da | ||
|
|
9184c64ecb | ||
|
|
653a9664e4 | ||
|
|
51d0cedb29 | ||
|
|
fa6d1bb23c | ||
|
|
0f3b154699 | ||
|
|
d6e2b096ca | ||
|
|
2104a1250e | ||
|
|
ca99f60964 | ||
|
|
147c08bd71 | ||
|
|
ad440f70fa | ||
|
|
bb22155482 | ||
|
|
5c1999b3d0 | ||
|
|
87f0fcfd52 | ||
|
|
f6d53bc337 | ||
|
|
720fad80c3 | ||
|
|
196055e50e | ||
|
|
73125574e6 | ||
|
|
27a35a0388 | ||
|
|
8c6085b933 | ||
|
|
bef14f551e | ||
|
|
e56c2eb6ca | ||
|
|
165365473f | ||
|
|
3bdd9a850f | ||
|
|
b84ea020f2 | ||
|
|
90efc5740f | ||
|
|
c78e6588ad | ||
|
|
a21a3827fd | ||
|
|
2effbd0baf | ||
|
|
7ed03c8b90 | ||
|
|
59ce90e924 | ||
|
|
da38e6a23d | ||
|
|
698e5ec6ea | ||
|
|
7f25e3ba97 | ||
|
|
1a3500cad3 | ||
|
|
31c30a7602 | ||
|
|
014f3b9873 | ||
|
|
49cbcf01c6 | ||
|
|
f8cc129f04 | ||
|
|
236c1208e6 | ||
|
|
4c70e75bfc | ||
|
|
e8c5f3a882 | ||
|
|
302df56ee1 | ||
|
|
ccfc4d68f3 | ||
|
|
071ea1dc97 | ||
|
|
670033c4da | ||
|
|
fa7e4cc817 | ||
|
|
67c8d80190 | ||
|
|
792ce53992 | ||
|
|
b0a25f59d9 | ||
|
|
d76234c112 | ||
|
|
6fdfd3b9e7 | ||
|
|
38350a1ae4 | ||
|
|
ce2bba751c | ||
|
|
f149736a20 | ||
|
|
40330be123 | ||
|
|
93af4fc6b0 | ||
|
|
b574d4e388 | ||
|
|
eb4b429e19 | ||
|
|
21929b1db2 | ||
|
|
a5197ee039 | ||
|
|
e974981725 | ||
|
|
9ae4dd3dfe | ||
|
|
d0e4dabe90 | ||
|
|
a3c569137e | ||
|
|
3edb360d79 | ||
|
|
f5285b48b1 | ||
|
|
c01b76e098 | ||
|
|
6adb47c447 | ||
|
|
b0b2d3a727 | ||
|
|
8410d7b08e | ||
|
|
e6408a0c37 | ||
|
|
e96c82b171 | ||
|
|
ee31813a0d | ||
|
|
ac62fd6204 | ||
|
|
25fbcc144c | ||
|
|
30cb7e62fd | ||
|
|
7c7ccc3a07 | ||
|
|
fb3f4fa0a8 | ||
|
|
2b62244806 | ||
|
|
f5dc197e8b | ||
|
|
e6060048bd | ||
|
|
f83ff068ae | ||
|
|
b21a6b76e0 | ||
|
|
70527022d9 | ||
|
|
8cddd595d4 | ||
|
|
96b79d5f06 | ||
|
|
1c7b07d614 | ||
|
|
0d59de5767 | ||
|
|
e3613c54e9 | ||
|
|
5956e6d9c1 | ||
|
|
ec895f271b | ||
|
|
751f30e316 | ||
|
|
cee8253cd3 | ||
|
|
ae4cb6e372 | ||
|
|
398f976f3e | ||
|
|
5f049beb04 | ||
|
|
a8d67a1c60 | ||
|
|
26aa9727a1 | ||
|
|
3cef696a65 | ||
|
|
397b1533f0 | ||
|
|
5680a34ec1 | ||
|
|
84a197299f | ||
|
|
4307882fa8 | ||
|
|
d2dfbff832 | ||
|
|
8cc58d0b89 | ||
|
|
971fc462ab | ||
|
|
8d2256d359 | ||
|
|
8f3b863edd | ||
|
|
4cc6c5ec35 | ||
|
|
cf53614721 | ||
|
|
efe84e58d7 | ||
|
|
cf59ad76fb | ||
|
|
2216cda2f1 | ||
|
|
595b15fcd9 | ||
|
|
a104c7f0f8 | ||
|
|
059392d257 | ||
|
|
5a1b3da394 | ||
|
|
92d7c2926c | ||
|
|
8f39697e3d | ||
|
|
ff328381af | ||
|
|
3bb3c06456 | ||
|
|
1cbcd41b17 | ||
|
|
5ebd9eb577 | ||
|
|
850d9ee095 | ||
|
|
5db1f91b01 | ||
|
|
ac6b9712ad | ||
|
|
df93f4ba99 | ||
|
|
7c20d46eeb | ||
|
|
fe432fcca8 | ||
|
|
5b1638ea59 | ||
|
|
87a1d4088b | ||
|
|
038c346500 | ||
|
|
0bcaa13056 | ||
|
|
c0e62372e6 | ||
|
|
84169cce10 | ||
|
|
c2c163ac4e | ||
|
|
ecb5d2ae1c | ||
|
|
3d619f1670 | ||
|
|
3265549911 | ||
|
|
d5c3a3e5e8 | ||
|
|
30dff09d7e | ||
|
|
85f7d19eb2 | ||
|
|
6adda5c29c | ||
|
|
4a03756b5b | ||
|
|
b1554ebf37 | ||
|
|
b6307b4fd6 | ||
|
|
6f22c7ad19 | ||
|
|
bc9add783c | ||
|
|
ee67221068 | ||
|
|
71e528139c | ||
|
|
c674fe1f04 | ||
|
|
d047e95bb5 | ||
|
|
791518d6c4 | ||
|
|
83afd55e0e | ||
|
|
7870a66790 | ||
|
|
c923e96f3e | ||
|
|
dd79834137 | ||
|
|
8995f0af55 | ||
|
|
e75a74565b | ||
|
|
1792849b98 | ||
|
|
c7fb1f6d17 | ||
|
|
a856263081 | ||
|
|
582d1320a3 | ||
|
|
3789da4305 | ||
|
|
a36f97adfb | ||
|
|
2cda53d3af | ||
|
|
74007ea465 | ||
|
|
c88a7dba6b | ||
|
|
66b7863d43 | ||
|
|
19b318a488 | ||
|
|
c606e3db43 | ||
|
|
f89ab74b29 | ||
|
|
4bbdec5044 | ||
|
|
56a727cf0d | ||
|
|
32f74e41ef | ||
|
|
e249bc5856 | ||
|
|
32b8a344a6 | ||
|
|
61c0c35e92 | ||
|
|
2eecaf4570 | ||
|
|
8f59247acb | ||
|
|
eb3ec26279 | ||
|
|
f07d37ce0d | ||
|
|
2e8602eb43 | ||
|
|
4277041b0e | ||
|
|
6801190180 | ||
|
|
067a9cf54d |
10
.github/pull_request_template.md
vendored
@@ -6,11 +6,11 @@
|
||||
|
||||
<!-- Please review the items on the PR checklist before submitting-->
|
||||
## PR Checklist
|
||||
* [] Applies to #xxx
|
||||
* [] CLA signed. If not, go over [here](https://cla.opensource.microsoft.com/microsoft/PowerToys) and sign the CLA
|
||||
* [] Tests added/passed
|
||||
* [] Requires documentation to be updated
|
||||
* [] I've discussed this with core contributors already. If not checked, I'm ready to accept this work might be rejected in favor of a different grand plan. Issue number where discussion took place: #xxx
|
||||
* [ ] Applies to #xxx
|
||||
* [ ] CLA signed. If not, go over [here](https://cla.opensource.microsoft.com/microsoft/PowerToys) and sign the CLA
|
||||
* [ ] Tests added/passed
|
||||
* [ ] Requires documentation to be updated
|
||||
* [ ] I've discussed this with core contributors already. If not checked, I'm ready to accept this work might be rejected in favor of a different grand plan. Issue number where discussion took place: #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
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
cd /D "%~dp0"
|
||||
|
||||
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\Tools\VsDevCmd.bat" -arch=amd64 -host_arch=amd64 -winsdk=10.0.18362.0
|
||||
call msbuild ../installer/PowerToysSetup.sln /p:Configuration=Release /p:Platform=x64 || exit /b 1
|
||||
SET IsPipeline=1
|
||||
call msbuild ../installer/PowerToysSetup.sln /p:Configuration=Release /p:Platform=x64 /p:CIBuild=true || exit /b 1
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
cd /D "%~dp0"
|
||||
|
||||
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\Tools\VsDevCmd.bat" -arch=amd64 -host_arch=amd64 -winsdk=10.0.18362.0
|
||||
call msbuild ../PowerToys.sln /p:Configuration=Release /p:Platform=x64 || exit /b 1
|
||||
call msbuild ../src/common/notifications/notifications_dll.vcxproj /p:Configuration=Release /p:Platform=x64 || exit /b 1
|
||||
call msbuild ../src/common/notifications_winrt/notifications.vcxproj /p:Configuration=Release /p:Platform=x64 || exit /b 1
|
||||
call msbuild ../PowerToys.sln /p:Configuration=Release /p:Platform=x64 /p:CIBuild=true || exit /b 1
|
||||
SET PTRoot=..
|
||||
call "..\installer\PowerToysSetup\publish.cmd"
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
parameters:
|
||||
configuration: 'Release'
|
||||
platform: ''
|
||||
additionalBuildArguments: ''
|
||||
additionalBuildArguments: '/p:CIBuild=true'
|
||||
|
||||
jobs:
|
||||
- job: Build${{ parameters.platform }}${{ parameters.configuration }}
|
||||
|
||||
@@ -32,7 +32,6 @@ steps:
|
||||
platform: '$(BuildPlatform)'
|
||||
configuration: '$(BuildConfiguration)'
|
||||
msbuildArgs: ${{ parameters.additionalBuildArguments }}
|
||||
clean: true
|
||||
maximumCpuCount: true
|
||||
|
||||
- task: VSTest@2
|
||||
@@ -45,5 +44,6 @@ steps:
|
||||
**\UnitTests-SvgPreviewHandler.dll
|
||||
**\UnitTests-PreviewHandlerCommon.dll
|
||||
**\powerpreviewTest.dll
|
||||
**\UnitTests-CommonLib.dll
|
||||
!**\*TestAdapter.dll
|
||||
!**\obj\**
|
||||
|
||||
@@ -41,40 +41,45 @@ build:
|
||||
name: 'Build Power Toys'
|
||||
command: '.pipelines\build.cmd'
|
||||
artifacts:
|
||||
- to: 'Symbols'
|
||||
include:
|
||||
- 'x64/**/*.pdb'
|
||||
exclude:
|
||||
- 'x64/Release/obj/**/*.pdb'
|
||||
- from: 'x64/Release'
|
||||
to: 'Build_Output'
|
||||
include:
|
||||
- 'action_runner.exe'
|
||||
- 'modules\ar\ImageResizer.resources.dll'
|
||||
- 'modules\bg\ImageResizer.resources.dll'
|
||||
- 'modules\ca\ImageResizer.resources.dll'
|
||||
- 'modules\cs\ImageResizer.resources.dll'
|
||||
- 'modules\de\ImageResizer.resources.dll'
|
||||
- 'modules\es\ImageResizer.resources.dll'
|
||||
- 'modules\eu-ES\ImageResizer.resources.dll'
|
||||
- 'modules\fr\ImageResizer.resources.dll'
|
||||
- 'modules\he\ImageResizer.resources.dll'
|
||||
- 'modules\hu\ImageResizer.resources.dll'
|
||||
- 'modules\it\ImageResizer.resources.dll'
|
||||
- 'modules\nb-NO\ImageResizer.resources.dll'
|
||||
- 'modules\nl\ImageResizer.resources.dll'
|
||||
- 'modules\pl\ImageResizer.resources.dll'
|
||||
- 'modules\pt-BR\ImageResizer.resources.dll'
|
||||
- 'modules\ru\ImageResizer.resources.dll'
|
||||
- 'modules\sk\ImageResizer.resources.dll'
|
||||
- 'modules\tr\ImageResizer.resources.dll'
|
||||
- 'modules\zh-Hans\ImageResizer.resources.dll'
|
||||
- 'modules\ImageResizer\ar\ImageResizer.resources.dll'
|
||||
- 'modules\ImageResizer\bg\ImageResizer.resources.dll'
|
||||
- 'modules\ImageResizer\ca\ImageResizer.resources.dll'
|
||||
- 'modules\ImageResizer\cs\ImageResizer.resources.dll'
|
||||
- 'modules\ImageResizer\de\ImageResizer.resources.dll'
|
||||
- 'modules\ImageResizer\es\ImageResizer.resources.dll'
|
||||
- 'modules\ImageResizer\eu-ES\ImageResizer.resources.dll'
|
||||
- 'modules\ImageResizer\fr\ImageResizer.resources.dll'
|
||||
- 'modules\ImageResizer\he\ImageResizer.resources.dll'
|
||||
- 'modules\ImageResizer\hu\ImageResizer.resources.dll'
|
||||
- 'modules\ImageResizer\it\ImageResizer.resources.dll'
|
||||
- 'modules\ImageResizer\nb-NO\ImageResizer.resources.dll'
|
||||
- 'modules\ImageResizer\nl\ImageResizer.resources.dll'
|
||||
- 'modules\ImageResizer\pl\ImageResizer.resources.dll'
|
||||
- 'modules\ImageResizer\pt-BR\ImageResizer.resources.dll'
|
||||
- 'modules\ImageResizer\ru\ImageResizer.resources.dll'
|
||||
- 'modules\ImageResizer\sk\ImageResizer.resources.dll'
|
||||
- 'modules\ImageResizer\tr\ImageResizer.resources.dll'
|
||||
- 'modules\ImageResizer\zh-Hans\ImageResizer.resources.dll'
|
||||
- 'modules\FancyZones\fancyzones.dll'
|
||||
- 'modules\FancyZones\FancyZonesEditor.exe'
|
||||
- 'modules\FileExplorerPreview\MarkdownPreviewHandler.dll'
|
||||
- 'modules\FileExplorerPreview\powerpreview.dll'
|
||||
- 'modules\FileExplorerPreview\PreviewHandlerCommon.dll'
|
||||
- 'modules\FileExplorerPreview\SvgPreviewHandler.dll'
|
||||
- 'modules\ImageResizer.exe'
|
||||
- 'modules\ImageResizerExt.dll'
|
||||
- 'modules\KeyboardManager.dll'
|
||||
- 'modules\ImageResizer\ImageResizer.exe'
|
||||
- 'modules\ImageResizer\ImageResizerExt.dll'
|
||||
- 'modules\KeyboardManager\KeyboardManager.dll'
|
||||
- 'modules\launcher\Microsoft.PowerToys.Settings.UI.Lib.dll'
|
||||
- 'modules\launcher\Plugins\Microsoft.Plugin.Calculator\Microsoft.Plugin.Caculator.dll'
|
||||
- 'modules\launcher\Plugins\Microsoft.Plugin.Calculator\Microsoft.Plugin.Calculator.dll'
|
||||
- 'modules\launcher\Plugins\Microsoft.Plugin.Calculator\Wox.Infrastructure.dll'
|
||||
- 'modules\launcher\Plugins\Microsoft.Plugin.Calculator\Wox.Plugin.dll'
|
||||
- 'modules\launcher\Plugins\Microsoft.Plugin.Folder\Microsoft.Plugin.Folder.dll'
|
||||
@@ -102,8 +107,8 @@ build:
|
||||
- 'modules\launcher\Wox.Infrastructure.dll'
|
||||
- 'modules\launcher\Wox.Plugin.dll'
|
||||
- 'modules\Microsoft.Launcher.dll'
|
||||
- 'modules\PowerRenameExt.dll'
|
||||
- 'modules\shortcut_guide.dll'
|
||||
- 'modules\PowerRename\PowerRenameExt.dll'
|
||||
- 'modules\ShortcutGuide\ShortcutGuide.dll'
|
||||
- 'Notifications.dll'
|
||||
- 'os-detection.dll'
|
||||
- 'PowerToys.exe'
|
||||
@@ -127,34 +132,20 @@ build:
|
||||
- 'PowerToysSetup-*.msi'
|
||||
signing_options:
|
||||
sign_inline: true # This does signing a soon as this command completes
|
||||
# - !!buildcommand
|
||||
# name: 'Archive symbols to Symbol Server'
|
||||
# artifacts:
|
||||
# - to: 'x64 Symbols'
|
||||
# include:
|
||||
# - 'x64/Release/action_runner.pdb'
|
||||
# - 'x64/Release/Notifications.pdb'
|
||||
# - 'x64/Release/PowerRenameUWPUI.pdb'
|
||||
# - 'x64/Release/PowerToys.pdb'
|
||||
# - 'x64/Release/PowerToysSettings.pdb'
|
||||
# - 'x64/Release/modules/fancyzones.pdb'
|
||||
# - 'x64/Release/modules/FancyZonesEditor.pdb'
|
||||
# - 'x64/Release/modules/PowerRenameExt.pdb'
|
||||
# - 'x64/Release/modules/shortcut_guide.pdb'
|
||||
|
||||
package:
|
||||
commands:
|
||||
- !!buildcommand
|
||||
name: 'Build MSIX package'
|
||||
command: 'installer\msix\build_msix_cdpx.cmd'
|
||||
artifacts:
|
||||
- from: 'installer\msix\bin'
|
||||
to: 'Build_MSIX_Package_Output'
|
||||
include:
|
||||
- '*.msix'
|
||||
- '*.msixbundle'
|
||||
signing_options:
|
||||
profile: '400'
|
||||
#package:
|
||||
# commands:
|
||||
# - !!buildcommand
|
||||
# name: 'Build MSIX package'
|
||||
# command: 'installer\msix\build_msix_cdpx.cmd'
|
||||
# artifacts:
|
||||
# - from: 'installer\msix\bin'
|
||||
# to: 'Build_MSIX_Package_Output'
|
||||
# include:
|
||||
# - '*.msix'
|
||||
# - '*.msixbundle'
|
||||
# signing_options:
|
||||
# profile: '400'
|
||||
|
||||
static_analysis_options:
|
||||
binskim_options:
|
||||
|
||||
@@ -33,7 +33,8 @@ THE SOFTWARE.
|
||||
|
||||
### Wox License
|
||||
|
||||
**Source**: https://github.com/Wox-launcher/Wox
|
||||
**Fork project source**: https://github.com/jjw24/Wox/
|
||||
**Base project source**: https://github.com/Wox-launcher/Wox
|
||||
|
||||
The MIT License (MIT)
|
||||
|
||||
|
||||
@@ -34,12 +34,7 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "runner", "src\runner\runner
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "common", "src\common\common.vcxproj", "{74485049-C722-400F-ABE5-86AC52D929B3}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "shortcut_guide", "src\modules\shortcut_guide\shortcut_guide.vcxproj", "{A46629C4-1A6C-40FA-A8B6-10E5102BB0BA}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{74485049-C722-400F-ABE5-86AC52D929B3} = {74485049-C722-400F-ABE5-86AC52D929B3}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "example_powertoy", "src\modules\example_powertoy\example_powertoy.vcxproj", "{44CC9375-3E6E-4D99-8913-7FB748807EBD}"
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ShortcutGuide", "src\modules\shortcut_guide\shortcut_guide.vcxproj", "{A46629C4-1A6C-40FA-A8B6-10E5102BB0BA}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{74485049-C722-400F-ABE5-86AC52D929B3} = {74485049-C722-400F-ABE5-86AC52D929B3}
|
||||
EndProjectSection
|
||||
@@ -204,8 +199,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Microsoft.Launcher", "src\m
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "PowerLauncher", "src\modules\launcher\PowerLauncher\PowerLauncher.csproj", "{F97E5003-F263-4D4A-A964-0F1F3C82DEF2}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PowerLauncher.UI", "src\modules\launcher\PowerLauncher.UI\PowerLauncher.UI.csproj", "{4A3DE70C-684C-410D-B851-C23B6DAEDF16}"
|
||||
EndProject
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tests", "tests", "{E775CC2C-24CB-48D6-9C3A-BE4CCE0DB17A}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "win-app-driver", "src\tests\win-app-driver\win-app-driver.csproj", "{880ED251-9E16-4713-9A70-D35FE0C01669}"
|
||||
@@ -236,7 +229,7 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.PowerToys.Setting
|
||||
EndProject
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{4981CCD1-4CD9-4A49-B240-00AA46493FF8}"
|
||||
ProjectSection(SolutionItems) = preProject
|
||||
.editorconfig = .editorconfig
|
||||
src\.editorconfig = src\.editorconfig
|
||||
src\tests\win-app-driver\packages.config = src\tests\win-app-driver\packages.config
|
||||
EndProjectSection
|
||||
EndProject
|
||||
@@ -258,6 +251,10 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Telemetry", "src\common\Man
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "os-detection", "src\common\os-detection\os-detection.vcxproj", "{E6410BFC-B341-498C-8C67-312C20CDD8D5}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "KeyboardManagerTest", "src\modules\keyboardmanager\test\KeyboardManagerTest.vcxproj", "{62173D9A-6724-4C00-A1C8-FB646480A9EC}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ManagedCommon", "src\common\ManagedCommon\ManagedCommon.csproj", "{4AED67B6-55FD-486F-B917-E543DEE2CB3C}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|x64 = Debug|x64
|
||||
@@ -276,10 +273,6 @@ Global
|
||||
{A46629C4-1A6C-40FA-A8B6-10E5102BB0BA}.Debug|x64.Build.0 = Debug|x64
|
||||
{A46629C4-1A6C-40FA-A8B6-10E5102BB0BA}.Release|x64.ActiveCfg = Release|x64
|
||||
{A46629C4-1A6C-40FA-A8B6-10E5102BB0BA}.Release|x64.Build.0 = Release|x64
|
||||
{44CC9375-3E6E-4D99-8913-7FB748807EBD}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{44CC9375-3E6E-4D99-8913-7FB748807EBD}.Debug|x64.Build.0 = Debug|x64
|
||||
{44CC9375-3E6E-4D99-8913-7FB748807EBD}.Release|x64.ActiveCfg = Release|x64
|
||||
{44CC9375-3E6E-4D99-8913-7FB748807EBD}.Release|x64.Build.0 = Release|x64
|
||||
{07C389E3-6BC8-41CF-923E-307B1265FA2D}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{07C389E3-6BC8-41CF-923E-307B1265FA2D}.Debug|x64.Build.0 = Debug|x64
|
||||
{07C389E3-6BC8-41CF-923E-307B1265FA2D}.Release|x64.ActiveCfg = Release|x64
|
||||
@@ -420,10 +413,6 @@ Global
|
||||
{F97E5003-F263-4D4A-A964-0F1F3C82DEF2}.Debug|x64.Build.0 = Debug|x64
|
||||
{F97E5003-F263-4D4A-A964-0F1F3C82DEF2}.Release|x64.ActiveCfg = Release|x64
|
||||
{F97E5003-F263-4D4A-A964-0F1F3C82DEF2}.Release|x64.Build.0 = Release|x64
|
||||
{4A3DE70C-684C-410D-B851-C23B6DAEDF16}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{4A3DE70C-684C-410D-B851-C23B6DAEDF16}.Debug|x64.Build.0 = Debug|x64
|
||||
{4A3DE70C-684C-410D-B851-C23B6DAEDF16}.Release|x64.ActiveCfg = Release|x64
|
||||
{4A3DE70C-684C-410D-B851-C23B6DAEDF16}.Release|x64.Build.0 = Release|x64
|
||||
{880ED251-9E16-4713-9A70-D35FE0C01669}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{880ED251-9E16-4713-9A70-D35FE0C01669}.Debug|x64.Build.0 = Debug|x64
|
||||
{880ED251-9E16-4713-9A70-D35FE0C01669}.Release|x64.ActiveCfg = Release|x64
|
||||
@@ -504,6 +493,14 @@ Global
|
||||
{E6410BFC-B341-498C-8C67-312C20CDD8D5}.Debug|x64.Build.0 = Debug|x64
|
||||
{E6410BFC-B341-498C-8C67-312C20CDD8D5}.Release|x64.ActiveCfg = Release|x64
|
||||
{E6410BFC-B341-498C-8C67-312C20CDD8D5}.Release|x64.Build.0 = Release|x64
|
||||
{62173D9A-6724-4C00-A1C8-FB646480A9EC}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{62173D9A-6724-4C00-A1C8-FB646480A9EC}.Debug|x64.Build.0 = Debug|x64
|
||||
{62173D9A-6724-4C00-A1C8-FB646480A9EC}.Release|x64.ActiveCfg = Release|x64
|
||||
{62173D9A-6724-4C00-A1C8-FB646480A9EC}.Release|x64.Build.0 = Release|x64
|
||||
{4AED67B6-55FD-486F-B917-E543DEE2CB3C}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{4AED67B6-55FD-486F-B917-E543DEE2CB3C}.Debug|x64.Build.0 = Debug|x64
|
||||
{4AED67B6-55FD-486F-B917-E543DEE2CB3C}.Release|x64.ActiveCfg = Release|x64
|
||||
{4AED67B6-55FD-486F-B917-E543DEE2CB3C}.Release|x64.Build.0 = Release|x64
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
@@ -511,7 +508,6 @@ Global
|
||||
GlobalSection(NestedProjects) = preSolution
|
||||
{74485049-C722-400F-ABE5-86AC52D929B3} = {1AFB6476-670D-4E80-A464-657E01DFF482}
|
||||
{A46629C4-1A6C-40FA-A8B6-10E5102BB0BA} = {4574FDD0-F61D-4376-98BF-E5A1262C11EC}
|
||||
{44CC9375-3E6E-4D99-8913-7FB748807EBD} = {BEEAB7F2-FFF6-45AB-9CDB-B04CC0734B88}
|
||||
{3BB8493E-D18E-4485-A320-CB40F90F55AE} = {4574FDD0-F61D-4376-98BF-E5A1262C11EC}
|
||||
{D1D6BC88-09AE-4FB4-AD24-5DED46A791DD} = {4574FDD0-F61D-4376-98BF-E5A1262C11EC}
|
||||
{F9C68EDF-AC74-4B77-9AF1-005D9C9F6A99} = {D1D6BC88-09AE-4FB4-AD24-5DED46A791DD}
|
||||
@@ -552,7 +548,6 @@ Global
|
||||
{F8B870EB-D5F5-45BA-9CF7-A5C459818820} = {4AFC9975-2456-4C70-94A4-84073C1CED93}
|
||||
{E364F67B-BB12-4E91-B639-355866EBCD8B} = {C140A3EF-6DBF-4084-9D4C-4EB5A99FEE68}
|
||||
{F97E5003-F263-4D4A-A964-0F1F3C82DEF2} = {C140A3EF-6DBF-4084-9D4C-4EB5A99FEE68}
|
||||
{4A3DE70C-684C-410D-B851-C23B6DAEDF16} = {C140A3EF-6DBF-4084-9D4C-4EB5A99FEE68}
|
||||
{880ED251-9E16-4713-9A70-D35FE0C01669} = {E775CC2C-24CB-48D6-9C3A-BE4CCE0DB17A}
|
||||
{2F305555-C296-497E-AC20-5FA1B237996A} = {4574FDD0-F61D-4376-98BF-E5A1262C11EC}
|
||||
{AF2349B8-E5B6-4004-9502-687C1C7730B1} = {2F305555-C296-497E-AC20-5FA1B237996A}
|
||||
@@ -574,6 +569,8 @@ Global
|
||||
{08C8C05F-0362-41BC-818C-724572DF8B06} = {C140A3EF-6DBF-4084-9D4C-4EB5A99FEE68}
|
||||
{5D00D290-4016-4CFE-9E41-1E7C724509BA} = {1AFB6476-670D-4E80-A464-657E01DFF482}
|
||||
{E6410BFC-B341-498C-8C67-312C20CDD8D5} = {1AFB6476-670D-4E80-A464-657E01DFF482}
|
||||
{62173D9A-6724-4C00-A1C8-FB646480A9EC} = {38BDB927-829B-4C65-9CD9-93FB05D66D65}
|
||||
{4AED67B6-55FD-486F-B917-E543DEE2CB3C} = {1AFB6476-670D-4E80-A464-657E01DFF482}
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {C3A2F9D1-7930-4EF4-A6FC-7EE0A99821D0}
|
||||
|
||||
124
README.md
@@ -4,7 +4,7 @@
|
||||
|
||||
Microsoft PowerToys is a set of utilities for power users to tune and streamline their Windows experience for greater productivity. Inspired by the [Windows 95 era PowerToys project](https://en.wikipedia.org/wiki/Microsoft_PowerToys), this reboot provides power users with ways to squeeze more efficiency out of the Windows 10 shell and customize it for individual workflows. A great overview of the Windows 95 PowerToys can be found [here](https://socket3.wordpress.com/2016/10/22/using-windows-95-powertoys/).
|
||||
|
||||
[What's Happening](#whats-happening) | [Downloading & Release notes][github-release-link] | [Contributing to PowerToys](#contributing)
|
||||
[What's Happening](#whats-happening) | [Downloading & Release notes][github-release-link] | [Contributing to PowerToys](#contributing) | [Known issues](#known-issues)
|
||||
|
||||
## Build status
|
||||
|
||||
@@ -14,84 +14,82 @@ Microsoft PowerToys is a set of utilities for power users to tune and streamline
|
||||
|
||||
### FancyZones
|
||||
|
||||
<img align="left" src="./doc/images/overview/FancyZones_small.png" />[FancyZones](/src/modules/fancyzones/) is a window manager that makes it easy to create complex window layouts and quickly position windows into those layouts.
|
||||
[<img align="left" src="./doc/images/overview/FancyZones_small.png" />](https://aka.ms/PowerToysOverview_FancyZones) [FancyZones](https://aka.ms/PowerToysOverview_FancyZones) is a window manager that makes it easy to create complex window layouts and quickly position windows into those layouts.
|
||||
<br>
|
||||
<br>
|
||||
<br>
|
||||
<br>
|
||||
<br>
|
||||
|
||||
### Shortcut Guide
|
||||
### File Explorer Add-ons (Preview Panes)
|
||||
|
||||
<img align="left" src="./doc/images/overview/Shortcut guide_small.png" />[Windows key shortcut guide](/src/modules/shortcut_guide) appears when a user holds the Windows key down for more than one second and shows the available shortcuts for the current state of the desktop.
|
||||
[<img align="left" src="./doc/images/overview/PowerPreview_small.PNG" />](https://aka.ms/PowerToysOverview_FileExplorerAddOns) [File Explorer](https://aka.ms/PowerToysOverview_FileExplorerAddOns) add-ons right now are just limited to Preview Pane additions for File Explorer. Preview Pane is an existing feature in the File Explorer. To enable it, you just click the View tab in the ribbon and then click "Preview Pane".
|
||||
|
||||
PowerToys will now enable two types of files to be previewed: Markdown (.md) & SVG (.svg)
|
||||
<br>
|
||||
<br>
|
||||
|
||||
### Image Resizer
|
||||
|
||||
[<img align="left" src="./doc/images/overview/ImageResizer_small.png" />](https://aka.ms/PowerToysOverview_ImageResizer) [Image Resizer](https://aka.ms/PowerToysOverview_ImageResizer) is a Windows Shell Extension for quickly resizing images. With a simple right click from File Explorer, resize one or many images instantly. This code is based on [Brice Lambson's Image Resizer](https://github.com/bricelam/ImageResizer).
|
||||
<br>
|
||||
<br>
|
||||
<br>
|
||||
<br>
|
||||
|
||||
### Keyboard Manager
|
||||
|
||||
[<img align="left" src="./doc/images/overview/KBM_small.png" />](https://aka.ms/PowerToysOverview_KeyboardManager) [Keyboard Manager](https://aka.ms/PowerToysOverview_KeyboardManager) allows you to customize the keyboard to be more productive by remapping keys and creating your own keyboard shortcuts. This PowerToy requires Windows 10 1903 (build 18362) or later.
|
||||
<br>
|
||||
<br>
|
||||
<br>
|
||||
<br>
|
||||
|
||||
### PowerRename
|
||||
|
||||
<img align="left" src="./doc/images/overview/PowerRename_small.PNG" />[PowerRename](/src/modules/powerrename) is a Windows Shell Extension for advanced bulk renaming using search and replace or regular expressions. PowerRename allows simple search and replace or more advanced regular expression matching. While you type in the search and replace input fields, the preview area will show what the items will be renamed to. PowerRename then calls into the Windows Explorer file operations engine to perform the rename. This has the benefit of allowing the rename operation to be undone after PowerRename exits. This code is based on [Chris Davis's SmartRename](https://github.com/chrdavis/SmartRename).
|
||||
<br>
|
||||
[<img align="left" src="./doc/images/overview/PowerRename_small.PNG" />](https://aka.ms/PowerToysOverview_PowerRename) [PowerRename](https://aka.ms/PowerToysOverview_PowerRename) is a Windows Shell Extension for advanced bulk renaming using search and replace or regular expressions. PowerRename allows simple search and replace or more advanced regular expression matching. While you type in the search and replace input fields, the preview area will show what the items will be renamed to. PowerRename then calls into the Windows Explorer file operations engine to perform the rename. This has the benefit of allowing the rename operation to be undone after PowerRename exits. This code is based on [Chris Davis's SmartRename](https://github.com/chrdavis/SmartRename).
|
||||
<br>
|
||||
|
||||
### File Explorer (Preview Panes)
|
||||
|
||||
<img align="left" src="./doc/images/overview/PowerPreview_small.PNG" />[File Explorer](/src/modules/previewpane) add-ons right now are just limited to Preview Pane additions for File Explorer. Preview Pane is an existing feature in the File Explorer. To enable it, you just click the View tab in the ribbon and then click "Preview Pane".
|
||||
|
||||
PowerToys will now enable two types of files to be previewed: Markdown (.md) & SVG (.svg)
|
||||
<br>
|
||||
<br>
|
||||
<br>
|
||||
|
||||
### Image Resizer
|
||||
|
||||
<img align="left" src="./doc/images/overview/ImageResizer_small.png" />[Image Resizer](/src/modules/imageresizer) is a Windows Shell Extension for quickly resizing images. With a simple right click from File Explorer, resize one or many images instantly. This code is based on [Brice Lambson's Image Resizer](https://github.com/bricelam/ImageResizer).
|
||||
<br>
|
||||
<br>
|
||||
<br>
|
||||
|
||||
<!---
|
||||
### Keyboard Manager
|
||||
|
||||
<img align="left" src="./doc/images/overview/KBM_small.png" /> [Keyboard Manager](src/modules/keyboardmanager/) allows you to customize the keyboard to be more productive by remapping keys and creating your own keyboard shortcuts.
|
||||
<br>
|
||||
<br>
|
||||
<br>
|
||||
<br>
|
||||
<br>
|
||||
-->
|
||||
|
||||
<!---
|
||||
### PowerToys Run
|
||||
|
||||
<img align="left" src="./doc/images/overview/PowerLauncher_small.png" /> [PowerToys Run](src/modules/launcher/) is a new toy in PowerToys that can help you search and launch your app instantly! It is open source and modular for additional plugins. Window Walker is now inside!
|
||||
[<img align="left" src="./doc/images/overview/PowerLauncher_small.png" />](https://aka.ms/PowerToysOverview_PowerToysRun) [PowerToys Run](https://aka.ms/PowerToysOverview_PowerToysRun) is a new toy in PowerToys that can help you search and launch your app instantly with a simple alt-space and start typing! It is open source and modular for additional plugins. Window Walker is now inside too! This PowerToy requires Windows 10 1903 (build 18362) or later.
|
||||
<br>
|
||||
<br>
|
||||
<br>
|
||||
<br>
|
||||
<br>
|
||||
<br>
|
||||
-->
|
||||
|
||||
### Version 1.0 plan
|
||||
### Shortcut Guide
|
||||
|
||||
Our plan for all the [goals and utilities for v1.0 detailed over here in the wiki][v1].
|
||||
[<img align="left" src="./doc/images/overview/Shortcut guide_small.png" />](https://aka.ms/PowerToysOverview_ShortcutGuide) [Windows key shortcut guide](https://aka.ms/PowerToysOverview_ShortcutGuide) appears when a user holds the Windows key down for more than one second and shows the available shortcuts for the current state of the desktop.
|
||||
<br>
|
||||
<br>
|
||||
<br>
|
||||
<br>
|
||||
<br>
|
||||
|
||||
## Installing and running Microsoft PowerToys
|
||||
|
||||
👉 **Note:** Microsoft PowerToys requires Windows 10 1803 (build 17134) or later.
|
||||
**Requirements**
|
||||
- Windows 10 1803 (build 17134) or later.
|
||||
- Have [.NET Core 3.1 Desktop Runtime](https://dotnet.microsoft.com/download/dotnet-core/thank-you/runtime-desktop-3.1.4-windows-x64-installer). The installer will prompt this but we want to directly make people aware.
|
||||
|
||||
### Via Github with MSI [Recommended]
|
||||
|
||||
Install from the [Microsoft PowerToys GitHub releases page][github-release-link]. Click on `Assets` to show the files available in the release and then click on `PowerToysSetup-0.17.0-x64.msi` to download the PowerToys installer.
|
||||
Install from the [Microsoft PowerToys GitHub releases page][github-release-link]. Click on `Assets` to show the files available in the release and then click on `PowerToysSetup-0.18.2-x64.msi` to download the PowerToys installer.
|
||||
|
||||
**Note:** After installing, you will have to start PowerToys for the first time. We will improve install experience this moving forward but due to a possible install dependency, we can't start after install currently.
|
||||
|
||||
This is our preferred method.
|
||||
|
||||
### Via WinGet (Preview)
|
||||
Download PowerToys from [WinGet](https://github.com/microsoft/winget-cli/releases). To install PowerToys, run the following command from the command line / PowerShell:
|
||||
|
||||
```powershell
|
||||
WinGet install powertoys
|
||||
```
|
||||
|
||||
### Other install methods
|
||||
|
||||
#### Via Chocolatey - ⚠ Unofficial ⚠
|
||||
#### Via Chocolatey (Unofficial)
|
||||
|
||||
Download and upgrade PowerToys from [Chocolatey](https://chocolatey.org). If you have any issues when installing/upgrading the package please go to the [package page](https://chocolatey.org/packages/powertoys) and follow the [Chocolatey triage process](https://chocolatey.org/docs/package-triage-process)
|
||||
|
||||
@@ -107,6 +105,11 @@ To upgrade PowerToys, run the following command from the command line / PowerShe
|
||||
choco upgrade powertoys
|
||||
```
|
||||
|
||||
### Known issues
|
||||
|
||||
- [#2012 - Uninstalling with old control panel fails](https://github.com/microsoft/PowerToys/issues/2012): Please use the modern settings to uninstall. `Windows 10 Settings -> Apps -> Apps & features`
|
||||
- [#3384 - PowerToys Settings window is empty](https://github.com/microsoft/PowerToys/issues/3384): Workaround appears to be run as admin. We are proactively looking into this as a hotfix.
|
||||
|
||||
### Processor support
|
||||
|
||||
We currently support the matrix below.
|
||||
@@ -117,29 +120,30 @@ We currently support the matrix below.
|
||||
|
||||
## What's Happening
|
||||
|
||||
### April 2020 Update
|
||||
### May 2020 Update
|
||||
|
||||
Our goals for 0.17 release cycle were updatability and stability.
|
||||
Our goals for 0.18 release cycle was three big items, PowerToys Run, Keyboard manager, and migrating to the new settings system. This is also the first time we'll test out the auto-updating system.
|
||||
|
||||
**Auto-updating:** We just added in the code for doing updating, so the first chance to experience this will be when 0.18 is released. We’re also seeing how aggressive everyone wants with this so right now, you’ll have to click “Install” for it to kick off the installer. This is something we’d love feedback on.
|
||||
Feedback is critical. We know there are areas for improvement on PT Run. We would love feedback so we can improve. We also would love to know if you want us to be more aggressive on auto-upgrading.
|
||||
|
||||
Another thing we did was utilized telemetry from PowerToys to prioritize virtual desktop FancyZone work. We knew there was a subset of bugs caused by an underlying issue and seeing how many users it affected helped us reprioritize to do the work sooner.
|
||||
|
||||
- We shipped [v0.17][github-release-link]!
|
||||
- Auto-updating
|
||||
- FancyZone improvement:
|
||||
- Virtual desktop support should be much better!
|
||||
- Better taskbar positioning
|
||||
- Fixed non-admin install regression.
|
||||
- We shipped [v0.18][github-release-link]!
|
||||
- New Utilities
|
||||
- PowerToys Run, our new application launcher (use alt-space to activate)
|
||||
- Keyboard manager, a quick easy way to remap your keyboard
|
||||
- Fixed [#243](https://github.com/microsoft/PowerToys/issues/243)'s setting issue
|
||||
- Improved performance on FancyZones [#1264](https://github.com/microsoft/PowerToys/issues/1264)
|
||||
- Lots of bug fixes!
|
||||
|
||||
For [0.18](https://github.com/microsoft/PowerToys/issues?q=is%3Aopen+is%3Aissue+project%3Amicrosoft%2FPowerToys%2F4), we are proactively working on:
|
||||
For [0.19](https://github.com/microsoft/PowerToys/issues?q=is%3Aopen+is%3Aissue+project%3Amicrosoft%2FPowerToys%2F4), we are proactively working on:
|
||||
|
||||
- Win+R replacement (Launcher)
|
||||
- Keyboard remapping
|
||||
- Enable PT Run to be mapped to Win-Keys
|
||||
- Stability / tech debt fixes
|
||||
- Performance improvements with FancyZones
|
||||
- A testing utility for FancyZones to be sure we can test different window configurations.
|
||||
- Settings v2 / Fix bug #243
|
||||
|
||||
### Version 1.0 plan
|
||||
|
||||
Our plan for all the [goals and utilities for v1.0 detailed over here in the wiki][v1].
|
||||
|
||||
## Developer Guidance
|
||||
|
||||
@@ -147,7 +151,7 @@ Please read the [developer docs](/doc/devdocs) for a detailed breakdown.
|
||||
|
||||
## Contributing
|
||||
|
||||
This project welcomes contributions of all times. Help spec'ing, design, documentation, finding bugs are ways everyone can help on top of coding features / bug fixes. We are excited to work with the power user community to build a set of tools for helping you get the most out of Windows.
|
||||
This project welcomes contributions of all types. Help spec'ing, design, documentation, finding bugs are ways everyone can help on top of coding features / bug fixes. We are excited to work with the power user community to build a set of tools for helping you get the most out of Windows.
|
||||
|
||||
We ask that **before you start work on a feature that you would like to contribute**, please read our [Contributor's Guide](contributing.md). We will be happy to work with you to figure out the best approach, provide guidance and mentorship throughout feature development, and help avoid any wasted or duplicate effort.
|
||||
|
||||
|
||||
36
community.md
@@ -2,6 +2,8 @@
|
||||
|
||||
The PowerToys team is extremely grateful to have the support of an amazing active community. The work you do is incredibly important. PowerToys wouldn’t be near what it is without your help filing bugs, updating documentation, guiding the design, or writing features. We want to say thanks and to recognize your work. This is a living document dedicated to highlighting the high impact community members and their contributions.
|
||||
|
||||
Names are in alphabetical order based on first name.
|
||||
|
||||
## High impact community members
|
||||
|
||||
### [@Niels9001](https://github.com/niels9001/) - [Niels Laute](https://nielslaute.com/)
|
||||
@@ -10,4 +12,36 @@ Niels has helped drive large sums of our update toward a new [consistent and mod
|
||||
|
||||
### [@riverar](https://github.com/riverar) - [Rafael Rivera](https://withinrafael.com/)
|
||||
|
||||
Rafael has helped do the [upgrade from CppWinRT 1.x to 2.0](https://github.com/microsoft/PowerToys/issues/1907). He directly provided feedback to the CppWinRT team for bugs from this migration as well.
|
||||
Rafael has helped do the [upgrade from CppWinRT 1.x to 2.0](https://github.com/microsoft/PowerToys/issues/1907). He directly provided feedback to the CppWinRT team for bugs from this migration as well.
|
||||
|
||||
## Open source projects
|
||||
|
||||
As PowerToys creates new utilities, some will be based off existing technology. We'll continue to do our best to contribute back to these projects but their efforts were the base of some of our projects. We want to be sure their work is directly recognized.
|
||||
|
||||
### [@jjw24](https://github.com/jjw24/) - Jeremy Wu
|
||||
|
||||
Their fork of Wox was the base of PowerToys Run.
|
||||
|
||||
### [WoX Launcher](https://github.com/Wox-launcher/Wox/)
|
||||
|
||||
Initial base of jjw24's fork, which makes it the base of PowerToys Run.
|
||||
|
||||
## Microsoft community members
|
||||
|
||||
We would like to also directly call out some extremely helpful Microsoft employees that have directly contributed to PowerToys. This isn't their day job and was work they did out of passion. We want to say thank you and recognize your work.
|
||||
|
||||
### [@betsegaw](https://github.com/betsegaw/) - [Betsegaw Tadele](http://www.dreamsofameaningfullife.com/)
|
||||
|
||||
Window Walker, inside PowerToys Run, is from Beta.
|
||||
|
||||
### [@TheMrJukes](https://github.com/TheMrJukes/) - Bret Anderson
|
||||
|
||||
The base of FancyZones and a lot of performance adjustments are from the hard work of Bret.
|
||||
|
||||
### [@bricelam](https://github.com/bricelam/) - [Brice Lambson](https://bricelam.net/)
|
||||
|
||||
Image Resizer is from Brice.
|
||||
|
||||
### [@chrdavis](https://github.com/chrdavis/) - Chris Davis
|
||||
|
||||
PowerRename is from Chris's SmartRename.
|
||||
|
||||
@@ -1,5 +0,0 @@
|
||||
#### [`dllmain.cpp`](/src/modules/example_powertoy/dllmain.cpp)
|
||||
Contains DLL boilerplate code and implementation of the [PowerToys interface](/src/modules/interface/).
|
||||
|
||||
#### [`trace.cpp`](/src/modules/example_powertoy/trace.cpp)
|
||||
Contains code for telemetry.
|
||||
@@ -67,18 +67,6 @@ The returned PowerToy should be in the disabled state. The runner will call the
|
||||
|
||||
In case of errors returns `nullptr`.
|
||||
|
||||
Sample code from [`the example PowerToy`](/src/modules/example_powertoy/dllmain.cpp):
|
||||
|
||||
```cpp
|
||||
extern "C" __declspec(dllexport) PowertoyModuleIface* __cdecl powertoy_create() {
|
||||
return new ExamplePowertoy();
|
||||
}
|
||||
|
||||
ExamplePowertoy::ExamplePowertoy() {
|
||||
init_settings();
|
||||
}
|
||||
```
|
||||
|
||||
## get_name
|
||||
|
||||
```cpp
|
||||
@@ -87,13 +75,6 @@ virtual const wchar_t* get_name()
|
||||
|
||||
Returns the name of the PowerToy, it will be cached by the runner.
|
||||
|
||||
Sample code from [`the example PowerToy`](/src/modules/example_powertoy/dllmain.cpp):
|
||||
```cpp
|
||||
virtual const wchar_t* get_name() override {
|
||||
return L"Example Powertoy";
|
||||
}
|
||||
```
|
||||
|
||||
## get_events
|
||||
|
||||
```cpp
|
||||
@@ -106,17 +87,6 @@ Returns a null-terminated table of the names of the events the PowerToy wants to
|
||||
|
||||
A nullptr can be returned to signal that the PowerToy does not want to subscribe to any event.
|
||||
|
||||
Sample code from [`the example PowerToy`](/src/modules/example_powertoy/dllmain.cpp):
|
||||
|
||||
```cpp
|
||||
virtual const wchar_t** get_events() override {
|
||||
static const wchar_t* events[] = { ll_keyboard,
|
||||
win_hook_event,
|
||||
nullptr };
|
||||
return events;
|
||||
}
|
||||
```
|
||||
|
||||
## get_config
|
||||
|
||||
```
|
||||
@@ -129,44 +99,6 @@ If `buffer` is a null pointer or the buffer size is not large enough sets the re
|
||||
|
||||
Returns true if successful.
|
||||
|
||||
Sample code from [`the example PowerToy`](/src/modules/example_powertoy/dllmain.cpp):
|
||||
|
||||
```cpp
|
||||
virtual bool get_config(wchar_t* buffer, int* buffer_size) override {
|
||||
HINSTANCE hinstance = reinterpret_cast<HINSTANCE>(&__ImageBase);
|
||||
|
||||
// Create a Settings object.
|
||||
PowerToysSettings::Settings settings(hinstance, get_name());
|
||||
settings.set_description(L"Serves as an example powertoy, with example settings.");
|
||||
|
||||
// Add an overview link to show in the Settings.
|
||||
settings.set_overview_link(L"https://github.com/microsoft/PowerToys");
|
||||
|
||||
// Add a video link to show in the Settings.
|
||||
settings.set_video_link(L"https://www.youtube.com/watch?v=d3LHo2yXKoY&t=21462");
|
||||
|
||||
// Add a bool property with a toggle editor.
|
||||
settings.add_bool_toogle(
|
||||
L"test_bool_toggle", // property name.
|
||||
L"This is what a BoolToggle property looks like", // description or resource id of the localized string.
|
||||
test_bool_prop // property value.
|
||||
);
|
||||
|
||||
// More settings
|
||||
...
|
||||
|
||||
// Add a custom action property. When using this settings type, the "call_custom_action()" method should be overriden as well.
|
||||
settings.add_custom_action(
|
||||
L"test_custom_action", // action name.
|
||||
L"This is what a CustomAction property looks like", // label above the field.
|
||||
L"Call a custom action", // button text.
|
||||
L"Press the button to call a custom action in the Example PowerToy" // display values / extended info.
|
||||
);
|
||||
|
||||
return settings.serialize_to_buffer(buffer, buffer_size);
|
||||
}
|
||||
```
|
||||
|
||||
## set_config
|
||||
|
||||
```cpp
|
||||
@@ -175,31 +107,6 @@ virtual void set_config(const wchar_t* config)
|
||||
|
||||
After the user has changed the module settings in the Settings editor, the runner calls this method to pass to the module the updated values. It's a good place to save the settings as well.
|
||||
|
||||
Sample code from [`the example PowerToy`](/src/modules/example_powertoy/dllmain.cpp):
|
||||
|
||||
```cpp
|
||||
virtual void set_config(const wchar_t* config) override {
|
||||
try {
|
||||
// Parse the PowerToysValues object from the received json string.
|
||||
PowerToysSettings::PowerToyValues _values =
|
||||
PowerToysSettings::PowerToyValues::from_json_string(config);
|
||||
|
||||
// Update the bool property.
|
||||
if (_values.is_bool_value(L"test bool_toggle")) {
|
||||
test_bool_prop = _values.get_bool_value(L"test bool_toggle");
|
||||
}
|
||||
|
||||
// More settings
|
||||
...
|
||||
|
||||
save_settings();
|
||||
}
|
||||
catch (std::exception ex) {
|
||||
// Improper JSON.
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## call_custom_action
|
||||
|
||||
```cpp
|
||||
@@ -209,31 +116,6 @@ Sample code from [`the example PowerToy`](/src/modules/example_powertoy/dllmain.
|
||||
Calls a custom action in response to the user pressing the custom action button in the Settings editor.
|
||||
This can be used to spawn custom editors defined by the PowerToy.
|
||||
|
||||
Sample code from [`the example PowerToy`](/src/modules/example_powertoy/dllmain.cpp):
|
||||
|
||||
```cpp
|
||||
virtual void call_custom_action(const wchar_t* action) override {
|
||||
try {
|
||||
// Parse the action values, including name.
|
||||
PowerToysSettings::CustomActionObject action_object =
|
||||
PowerToysSettings::CustomActionObject::from_json_string(action);
|
||||
|
||||
if (action_object.get_name() == L"test_custom_action") {
|
||||
|
||||
// Custom action code to increase and show a counter.
|
||||
++this->test_custom_action_num_calls;
|
||||
std::wstring msg(L"I have been called ");
|
||||
msg += std::to_wstring(this->test_custom_action_num_calls);
|
||||
msg += L" time(s).";
|
||||
MessageBox(NULL, msg.c_str(), L"Custom action call.", MB_OK | MB_TOPMOST);
|
||||
}
|
||||
}
|
||||
catch (std::exception ex) {
|
||||
// Improper JSON.
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## enable
|
||||
|
||||
```cpp
|
||||
@@ -242,14 +124,6 @@ Sample code from [`the example PowerToy`](/src/modules/example_powertoy/dllmain.
|
||||
|
||||
Enables the PowerToy.
|
||||
|
||||
Sample code from [`the example PowerToy`](/src/modules/example_powertoy/dllmain.cpp):
|
||||
|
||||
```cpp
|
||||
virtual void enable() {
|
||||
m_enabled = true;
|
||||
}
|
||||
```
|
||||
|
||||
## disable
|
||||
|
||||
```cpp
|
||||
@@ -258,14 +132,6 @@ Sample code from [`the example PowerToy`](/src/modules/example_powertoy/dllmain.
|
||||
|
||||
Disables the PowerToy, should free as much memory as possible.
|
||||
|
||||
Sample code from [`the example PowerToy`](/src/modules/example_powertoy/dllmain.cpp):
|
||||
|
||||
```cpp
|
||||
virtual void disable() {
|
||||
m_enabled = false;
|
||||
}
|
||||
```
|
||||
|
||||
## is_enabled
|
||||
|
||||
```cpp
|
||||
@@ -274,13 +140,6 @@ Sample code from [`the example PowerToy`](/src/modules/example_powertoy/dllmain.
|
||||
|
||||
Returns the PowerToy state.
|
||||
|
||||
Sample code from [`the example PowerToy`](/src/modules/example_powertoy/dllmain.cpp):
|
||||
|
||||
```cpp
|
||||
virtual bool is_enabled() override {
|
||||
return m_enabled;
|
||||
}
|
||||
```
|
||||
## signal_event
|
||||
|
||||
```cpp
|
||||
@@ -294,24 +153,6 @@ The data argument and return value meaning are event-specific:
|
||||
|
||||
Please note that some of the events are currently being signalled from a separate thread.
|
||||
|
||||
Sample code from [`the example PowerToy`](/src/modules/example_powertoy/dllmain.cpp):
|
||||
|
||||
```cpp
|
||||
virtual intptr_t signal_event(const wchar_t* name, intptr_t data) override {
|
||||
if (wcscmp(name, ll_keyboard) == 0) {
|
||||
auto& event = *(reinterpret_cast<LowlevelKeyboardEvent*>(data));
|
||||
// Return 1 if the keypress is to be suppressed (not forwarded to Windows),
|
||||
// otherwise return 0.
|
||||
return 0;
|
||||
} else if (wcscmp(name, win_hook_event) == 0) {
|
||||
auto& event = *(reinterpret_cast<WinHookEvent*>(data));
|
||||
// Return value is ignored
|
||||
return 0;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
```
|
||||
|
||||
## register_system_menu_helper
|
||||
|
||||
```cpp
|
||||
@@ -338,14 +179,6 @@ Item name is passed as an argument, so that module can distinguish between diffe
|
||||
```
|
||||
Destroy the PowerToy and free all memory.
|
||||
|
||||
Sample code from [`the example PowerToy`](/src/modules/example_powertoy/dllmain.cpp):
|
||||
|
||||
```cpp
|
||||
virtual void destroy() override {
|
||||
delete this;
|
||||
}
|
||||
```
|
||||
|
||||
## Powertoys system menu helper interface
|
||||
|
||||
Interface for helper class responsible for handling all system menu related actions.
|
||||
@@ -393,15 +226,15 @@ Process action taken on specific system menu item.
|
||||
|
||||
# Code organization
|
||||
|
||||
### [`powertoy_module_interface.h`](/src/modules/example_powertoy/powertoy_module_interface.h)
|
||||
### [`powertoy_module_interface.h`](/src/modules/interface/powertoy_module_interface.h)
|
||||
Contains the PowerToys interface definition.
|
||||
|
||||
### [`powertoy_system_menu.h`](/src/modules/example_powertoy/powertoy_system_module.h)
|
||||
### [`powertoy_system_menu.h`](/src/modules/interface/powertoy_system_module.h)
|
||||
Contains the PowerToys system menu helper interface definition.
|
||||
|
||||
### [`lowlevel_keyboard_event_data.h`](/src/modules/example_powertoy/lowlevel_keyboard_event_data.h)
|
||||
### [`lowlevel_keyboard_event_data.h`](/src/modules/interface/lowlevel_keyboard_event_data.h)
|
||||
Contains the `LowlevelKeyboardEvent` structure that's passed to `signal_event` for `ll_keyboard` events.
|
||||
|
||||
### [`win_hook_event_data.h`](/src/modules/example_powertoy/win_hook_event_data.h)
|
||||
### [`win_hook_event_data.h`](/src/modules/interface/win_hook_event_data.h)
|
||||
Contains the `WinHookEvent` structure that's passed to `signal_event` for `win_hook_event` events.
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
- [Coding style](style.md).
|
||||
- Try to package new ideas/components into libraries that have nicely defined interfaces.
|
||||
- Package new ideas into classes or refactor existing ideas into a class as you extend.
|
||||
- When adding new classes/methos/changing existing code: add new unit tests or update the existing tests.
|
||||
- When adding new classes/methods/changing existing code: add new unit tests or update the existing tests.
|
||||
|
||||
## Github Workflow
|
||||
|
||||
@@ -46,32 +46,44 @@ Contains the source code of the PowerToys runner and of all of the PowerToys mod
|
||||
|
||||
Various tools used by PowerToys. Includes the Visual Studio 2019 project template for new PowerToys.
|
||||
|
||||
## Building code
|
||||
## Compiling PowerToys
|
||||
|
||||
### Build Prerequisites
|
||||
### Prerequisites for Compiling PowerToys
|
||||
|
||||
- Windows 10 1803 (build 10.0.17134.0) or above to build and run PowerToys.
|
||||
- Visual Studio 2019 Community edition or higher, with the 'Desktop Development with C++' component and the Windows 10 SDK version 10.0.18362.0 or higher.
|
||||
1. Windows 10 April 2018 Update (version 1803) or newer
|
||||
2. Visual Studio Community/Professional/Enterprise 2019
|
||||
3. Run the command below in cmd/terminal to install all the workloads and components for VS.<br />
|
||||
**Note:** the script assumes VS is installed and Community edition. Please update path accordingly if Professional/Enterprise.
|
||||
|
||||
### Building the Code
|
||||
```shell
|
||||
"%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vs_installer.exe" ^
|
||||
modify --installpath "%ProgramFiles(x86)%\Microsoft Visual Studio\2019\community" ^
|
||||
--add Microsoft.VisualStudio.Workload.NativeDesktop ^
|
||||
--add Microsoft.VisualStudio.Workload.ManagedDesktop ^
|
||||
--add Microsoft.VisualStudio.Workload.Universal ^
|
||||
--add Microsoft.VisualStudio.Component.Windows10SDK.17134 ^
|
||||
--add Microsoft.VisualStudio.ComponentGroup.UWP.VC ^
|
||||
--add Microsoft.VisualStudio.Component.VC.Runtimes.x86.x64.Spectre ^
|
||||
--add Microsoft.VisualStudio.Component.VC.ATL.Spectre
|
||||
```
|
||||
|
||||
### Compiling Source Code
|
||||
|
||||
- Open `powertoys.sln` in Visual Studio, in the `Solutions Configuration` drop-down menu select `Release` or `Debug`, from the `Build` menu choose `Build Solution`.
|
||||
- The PowerToys binaries will be in your repo under `x64\Release`.
|
||||
- If you want to copy the `PowerToys.exe` binary to a different location, you'll also need to copy the `modules` and the `svgs` folders.
|
||||
|
||||
### Building the .msi Installer
|
||||
## Building the Installer (.MSI)
|
||||
|
||||
* From the `installer` folder open `PowerToysSetup.sln` in Visual Studio, in the `Solutions Configuration` drop-down menu select `Release` or `Debug`, from the `Build` menu choose `Build Solution`.
|
||||
* The resulting `PowerToysSetup.msi` installer will be available in the `installer\PowerToysSetup\x64\Release\` folder.
|
||||
### Prerequisites Building the Installer (.MSI)
|
||||
|
||||
#### Prerequisites to Build the MSI Installer
|
||||
1. Install the [WiX Toolset Visual Studio 2019 Extension](https://marketplace.visualstudio.com/items?itemName=RobMensching.WiXToolset).
|
||||
2. Install the [WiX Toolset build tools](https://wixtoolset.org/releases/).
|
||||
|
||||
* Install the [WiX Toolset Visual Studio 2019 Extension](https://marketplace.visualstudio.com/items?itemName=RobMensching.WiXToolset).
|
||||
* Install the [WiX Toolset build tools](https://wixtoolset.org/releases/).
|
||||
### Compiling Installer (.MSI)
|
||||
|
||||
### Building the MSIX Installer
|
||||
|
||||
Please follow the [installer instructions](./installer/readme.md) which include items such as creating the self-signed cert for testing.
|
||||
- From the `installer` folder open `PowerToysSetup.sln` in Visual Studio, in the `Solutions Configuration` drop-down menu select `Release`, from the `Build` menu choose `Build Solution`.
|
||||
- The resulting `PowerToysSetup.msi` installer will be available in the `installer\PowerToysSetup\x64\Release\` folder.
|
||||
|
||||
## Debugging
|
||||
|
||||
@@ -79,8 +91,8 @@ The following configuration issue only applies if the user is a member of the Ad
|
||||
|
||||
Some PowerToys modules require being run with the highest permission level if the current user is a member of the Administrators group. The highest permission level is required to be able to perform some actions when an elevated application (e.g. Task Manager) is in the foreground or is the target of an action. Without elevated privileges some PowerToys modules will still work but with some limitations:
|
||||
|
||||
- the `FancyZones` module will be not be able to move an elevated window to a zone.
|
||||
- the `Shortcut Guide` module will not appear if the foreground window belongs to an elevated application.
|
||||
- The `FancyZones` module will be not be able to move an elevated window to a zone.
|
||||
- The `Shortcut Guide` module will not appear if the foreground window belongs to an elevated application.
|
||||
|
||||
To run and debug PowerToys from Visual Studio when the user is a member of the Administrators group, Visual Studio has to be started with elevated privileges. If you want to avoid running Visual Studio with elevated privileges and don't mind the limitations described above, you can do the following: open the `runner` project properties and navigate to the `Linker -> Manifest File` settings, edit the `UAC Execution Level` property and change it from `highestAvailable (level='highestAvailable')` to `asInvoker (/level='asInvoker')`, save the changes.
|
||||
|
||||
@@ -122,7 +134,7 @@ While developing, it's possible to connect the WebView to the development server
|
||||
|
||||
### [`Settings-web`](settings-web.md)
|
||||
This project generates the web UI shown in the [PowerToys Settings](/src/editor).
|
||||
It's a `ReactJS` project created using [UI Fabric](https://developer.microsoft.com/en-us/fabric#/).
|
||||
It's a `ReactJS` project created using [Fluent UI](https://developer.microsoft.com/en-us/fluentui#/).
|
||||
|
||||
## Current modules
|
||||
### [`FancyZones`](modules/fancyzones.md)
|
||||
@@ -134,11 +146,6 @@ PowerRename is a Windows Shell Context Menu Extension for advanced bulk renaming
|
||||
### [`Shortcut Guide`](modules/shortcut_guide.md)
|
||||
The Windows Shortcut Guide, displayed when the WinKey is held for some time.
|
||||
|
||||
### _obsolete_ [`example_powertoy`](modules/example_powertoy.md)
|
||||
An example PowerToy, that demonstrates how to create new ones. Please note, that this is going to become a Visual Studio project template soon.
|
||||
|
||||
This PowerToy serves as a sample to show how to implement the [PowerToys interface](/src/modules/interface/) when creating a PowerToy. It also showcases the currently implemented settings.
|
||||
|
||||
#### Options
|
||||
|
||||
This module has a setting to serve as an example for each of the currently implemented settings property:
|
||||
|
||||
@@ -8,7 +8,7 @@ If you're running any application as an administrator (aka elevated) and PowerTo
|
||||
|
||||
We understand users will run applications elevated. We do as well. We have two options for you when this scenario happens:
|
||||
|
||||
1. **Recommended:** PowerToys will prompt when we detect a process that is elevated. Go to PowerToys settings inside the General Tab and click "Relaunch as adminstrator".
|
||||
1. **Recommended:** PowerToys will prompt when we detect a process that is elevated. Go to PowerToys settings inside the General Tab and click "Relaunch as administrator".
|
||||
2. Enable "Always run as administrator" in the PowerToys settings.
|
||||
|
||||
## What is "Run as Administrator" / Elevated processes
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#### [`main.cpp`](/src/runner/main.cpp)
|
||||
Contains the executable starting point, initialization code and the list of known PowerToys. All singletones are also initialized here at the start. Loads all the powertoys by scanning the `./modules` folder and `enable()`s those makred as enabled in `%LOCALAPPDATA%\Microsoft\PowerToys\settings.json` config. Then it runs [a message loop](https://docs.microsoft.com/en-us/windows/win32/winmsg/using-messages-and-message-queues) for the tray UI. Note that this message loop also [handles lowlevel_keyboard_hook events](https://github.com/microsoft/PowerToys/blob/1760af50c8803588cb575167baae0439af38a9c1/src/runner/lowlevel_keyboard_event.cpp#L24).
|
||||
Contains the executable starting point, initialization code and the list of known PowerToys. All singletones are also initialized here at the start. Loads all the powertoys by scanning the `./modules` folder and `enable()`s those marked as enabled in `%LOCALAPPDATA%\Microsoft\PowerToys\settings.json` config. Then it runs [a message loop](https://docs.microsoft.com/en-us/windows/win32/winmsg/using-messages-and-message-queues) for the tray UI. Note that this message loop also [handles lowlevel_keyboard_hook events](https://github.com/microsoft/PowerToys/blob/1760af50c8803588cb575167baae0439af38a9c1/src/runner/lowlevel_keyboard_event.cpp#L24).
|
||||
|
||||
#### [`general_settings.cpp`](./general_settings.cpp)
|
||||
#### [`powertoy_module.h`](/src/runner/powertoy_module.h) and [`powertoy_module.cpp`](/src/runner/powertoy_module.cpp)
|
||||
|
||||
@@ -80,7 +80,7 @@ Example module JSON (taken from Shortcut Guide):
|
||||
```
|
||||
produces this settings screen:
|
||||
|
||||

|
||||

|
||||
|
||||
### Helper methods
|
||||
|
||||
@@ -191,7 +191,7 @@ settings.set_icon_key(L"pt-example");
|
||||
settings.add_string(L"string_val", L"Example string label", L"example value");
|
||||
settings.add_int_spinner(L"int_val", L"Example int label", 0, 0, 100, 10);
|
||||
```
|
||||
You can then use `std::wstring serialize()` or `bool serialize_to_buffer(wchar_t* buffer, int* uffer_size)` methods to generate output JSON string.
|
||||
You can then use `std::wstring serialize()` or `bool serialize_to_buffer(wchar_t* buffer, int* buffer_size)` methods to generate output JSON string.
|
||||
|
||||
### Saving settings
|
||||
Use
|
||||
@@ -204,7 +204,7 @@ declared in [`settings_helpers.h`](/src/common/settings_helpers.h).
|
||||
|
||||
### Bool toggle
|
||||
```c++
|
||||
add_bool_toogle(name, description, value)
|
||||
add_bool_toggle(name, description, value)
|
||||
```
|
||||
A simple on-off toggle. Parameters:
|
||||
* `name` - Key for the element in the JSON.
|
||||
@@ -213,7 +213,7 @@ A simple on-off toggle. Parameters:
|
||||
|
||||
This C++:
|
||||
```c++
|
||||
settings.add_bool_toogle(L"bool_name", L"description", true);
|
||||
settings.add_bool_toggle(L"bool_name", L"description", true);
|
||||
```
|
||||
produces this settings element:
|
||||
|
||||
|
||||
@@ -86,7 +86,7 @@ For a detailed reference of how the settings are implemented in the runner and i
|
||||
</td></tr></table>
|
||||
|
||||
```c++
|
||||
settings.add_bool_toogle(name, description, value)
|
||||
settings.add_bool_toggle(name, description, value)
|
||||
```
|
||||
A simple on-off toggle. Parameters:
|
||||
* `name` - Key for the element in the JSON.
|
||||
|
||||
|
Before Width: | Height: | Size: 2.4 MiB |
|
Before Width: | Height: | Size: 9.0 MiB |
|
Before Width: | Height: | Size: 1.4 MiB |
|
Before Width: | Height: | Size: 8.6 MiB |
|
Before Width: | Height: | Size: 6.5 MiB |
|
Before Width: | Height: | Size: 16 MiB |
|
Before Width: | Height: | Size: 762 KiB |
|
Before Width: | Height: | Size: 405 KiB |
|
Before Width: | Height: | Size: 588 KiB |
|
Before Width: | Height: | Size: 1.1 MiB |
|
Before Width: | Height: | Size: 3.1 MiB |
|
Before Width: | Height: | Size: 1.3 MiB |
|
Before Width: | Height: | Size: 1.0 MiB |
|
Before Width: | Height: | Size: 1.1 MiB |
|
Before Width: | Height: | Size: 1.2 MiB |
|
Before Width: | Height: | Size: 858 B |
|
Before Width: | Height: | Size: 641 KiB |
|
Before Width: | Height: | Size: 56 KiB After Width: | Height: | Size: 56 KiB |
|
Before Width: | Height: | Size: 65 KiB After Width: | Height: | Size: 65 KiB |
|
Before Width: | Height: | Size: 31 KiB |
|
Before Width: | Height: | Size: 73 KiB |
@@ -69,75 +69,11 @@
|
||||
</PropertyGroup>
|
||||
<Error Condition="!Exists('..\packages\WiX.3.11.2\build\wix.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\WiX.3.11.2\build\wix.props'))" />
|
||||
</Target>
|
||||
|
||||
<PropertyGroup>
|
||||
<PreBuildEvent>setlocal enableDelayedExpansion
|
||||
|
||||
rem Publish Settings
|
||||
SET settingsProfileFolderName=..\..\..\..\src\core\Microsoft.PowerToys.Settings.UI.Runner\Properties\PublishProfiles\
|
||||
rem Create the publish profile folder if it doesn%27t exist
|
||||
IF NOT EXIST !settingsProfileFolderName! (mkdir !settingsProfileFolderName!)
|
||||
SET settingsProfileFileName=SettingsProfile.pubxml
|
||||
SET settingsPublishProfile=!settingsProfileFolderName!!settingsProfileFileName!
|
||||
|
||||
rem Create the publish profile pubxml
|
||||
echo ^<%3fxml version="1.0" encoding="utf-8"%3f^> > !settingsPublishProfile!
|
||||
echo ^<^^!-- >> !settingsPublishProfile!
|
||||
echo https://go.microsoft.com/fwlink/%3fLinkID=208121. >> !settingsPublishProfile!
|
||||
echo --^> >> !settingsPublishProfile!
|
||||
echo ^<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"^> >> !settingsPublishProfile!
|
||||
echo ^<PropertyGroup^> >> !settingsPublishProfile!
|
||||
echo ^<PublishProtocol^>FileSystem^</PublishProtocol^> >> !settingsPublishProfile!
|
||||
echo ^<Configuration^>$(ConfigurationName)^</Configuration^> >> !settingsPublishProfile!
|
||||
echo ^<Platform^>$(PlatformName)^</Platform^> >> !settingsPublishProfile!
|
||||
echo ^<TargetFramework^>netcoreapp3.1^</TargetFramework^> >> !settingsPublishProfile!
|
||||
echo ^<PublishDir^>..\..\..\$(PlatformName)\$(ConfigurationName)\SettingsUIRunner^</PublishDir^> >> !settingsPublishProfile!
|
||||
echo ^<RuntimeIdentifier^>win-x64^</RuntimeIdentifier^> >> !settingsPublishProfile!
|
||||
echo ^<SelfContained^>false^</SelfContained^> >> !settingsPublishProfile!
|
||||
echo ^<PublishSingleFile^>False^</PublishSingleFile^> >> !settingsPublishProfile!
|
||||
echo ^<PublishReadyToRun^>False^</PublishReadyToRun^> >> !settingsPublishProfile!
|
||||
echo ^</PropertyGroup^> >> !settingsPublishProfile!
|
||||
echo ^</Project^> >> !settingsPublishProfile!
|
||||
|
||||
rem In case of Release we should not use Debug CRT in VCRT forwarders
|
||||
IF $(ConfigurationName)==Release (
|
||||
"$(MSBuildBinPath)\msbuild.exe" ..\..\..\..\src\core\Microsoft.PowerToys.Settings.UI.Runner\Microsoft.PowerToys.Settings.UI.Runner.csproj -t:Publish -p:Configuration="$(ConfigurationName)" -p:Platform="$(PlatformName)" -p:AppxBundle=Never -p:VCRTForwarders-IncludeDebugCRT=false -p:PublishProfile=!settingsProfileFileName!
|
||||
) ELSE (
|
||||
"$(MSBuildBinPath)\msbuild.exe" ..\..\..\..\src\core\Microsoft.PowerToys.Settings.UI.Runner\Microsoft.PowerToys.Settings.UI.Runner.csproj -t:Publish -p:Configuration="$(ConfigurationName)" -p:Platform="$(PlatformName)" -p:AppxBundle=Never -p:PublishProfile=!settingsProfileFileName!
|
||||
)
|
||||
|
||||
rem Publish Launcher
|
||||
SET launcherProfileFolderName=..\..\..\..\src\modules\launcher\PowerLauncher\Properties\PublishProfiles\
|
||||
|
||||
rem Create the publish profile folder if it doesn%27t exist
|
||||
IF NOT EXIST !launcherProfileFolderName! (mkdir !launcherProfileFolderName!)
|
||||
SET launcherProfileFileName=LauncherProfile.pubxml
|
||||
SET launcherPublishProfile=!launcherProfileFolderName!!launcherProfileFileName!
|
||||
|
||||
rem Create the publish profile pubxml
|
||||
echo ^<%3fxml version="1.0" encoding="utf-8"%3f^> > !launcherPublishProfile!
|
||||
echo ^<^^!-- >> !launcherPublishProfile!
|
||||
echo https://go.microsoft.com/fwlink/%3fLinkID=208121. >> !launcherPublishProfile!
|
||||
echo --^> >> !launcherPublishProfile!
|
||||
echo ^<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"^> >> !launcherPublishProfile!
|
||||
echo ^<PropertyGroup^> >> !launcherPublishProfile!
|
||||
echo ^<PublishProtocol^>FileSystem^</PublishProtocol^> >> !launcherPublishProfile!
|
||||
echo ^<Configuration^>$(ConfigurationName)^</Configuration^> >> !launcherPublishProfile!
|
||||
echo ^<Platform^>$(PlatformName)^</Platform^> >> !launcherPublishProfile!
|
||||
echo ^<TargetFramework^>netcoreapp3.1^</TargetFramework^> >> !launcherPublishProfile!
|
||||
echo ^<PublishDir^>..\..\..\..\$(PlatformName)\$(ConfigurationName)\modules\launcher^</PublishDir^> >> !launcherPublishProfile!
|
||||
echo ^<RuntimeIdentifier^>win-x64^</RuntimeIdentifier^> >> !launcherPublishProfile!
|
||||
echo ^<SelfContained^>false^</SelfContained^> >> !launcherPublishProfile!
|
||||
echo ^<PublishSingleFile^>False^</PublishSingleFile^> >> !launcherPublishProfile!
|
||||
echo ^<PublishReadyToRun^>False^</PublishReadyToRun^> >> !launcherPublishProfile!
|
||||
echo ^</PropertyGroup^> >> !launcherPublishProfile!
|
||||
echo ^</Project^> >> !launcherPublishProfile!
|
||||
|
||||
rem In case of Release we should not use Debug CRT in VCRT forwarders
|
||||
IF $(ConfigurationName)==Release (
|
||||
"$(MSBuildBinPath)\msbuild.exe" ..\..\..\..\src\modules\launcher\PowerLauncher\PowerLauncher.csproj -t:Publish -p:Configuration="$(ConfigurationName)" -p:Platform="$(PlatformName)" -p:AppxBundle=Never -p:VCRTForwarders-IncludeDebugCRT=false -p:PublishProfile=!launcherProfileFileName!
|
||||
) ELSE (
|
||||
"$(MSBuildBinPath)\msbuild.exe" ..\..\..\..\src\modules\launcher\PowerLauncher\PowerLauncher.csproj -t:Publish -p:Configuration="$(ConfigurationName)" -p:Platform="$(PlatformName)" -p:AppxBundle=Never -p:PublishProfile=!launcherProfileFileName!
|
||||
<PreBuildEvent>IF NOT DEFINED IsPipeline (
|
||||
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\Tools\VsDevCmd.bat" -arch=amd64 -host_arch=amd64 -winsdk=10.0.18362.0
|
||||
SET PTRoot=..\..\..\..
|
||||
call "..\..\publish.cmd"
|
||||
)</PreBuildEvent>
|
||||
</PropertyGroup>
|
||||
<!--
|
||||
|
||||
@@ -3,6 +3,12 @@
|
||||
xmlns:util="http://schemas.microsoft.com/wix/UtilExtension"
|
||||
xmlns:netfx="http://schemas.microsoft.com/wix/NetFxExtension" >
|
||||
|
||||
<?define FancyZonesProjectName="FancyZones"?>
|
||||
<?define ImageResizerProjectName="ImageResizer"?>
|
||||
<?define KeyboardManagerProjectName="KeyboardManager"?>
|
||||
<?define PowerRenameProjectName="PowerRename"?>
|
||||
<?define ShortcutGuideProjectName="ShortcutGuide"?>
|
||||
|
||||
<?define RepoDir="$(var.ProjectDir)..\..\" ?>
|
||||
<?define BinX64Dir="$(var.RepoDir)x64\$(var.Configuration)\" ?>
|
||||
<Product Id="*"
|
||||
@@ -198,10 +204,6 @@
|
||||
|
||||
<!-- Close 'PowerToys.exe' before uninstall-->
|
||||
<Property Id="MSIRESTARTMANAGERCONTROL" Value="Disable" />
|
||||
<!-- Restart explorer.exe if we detect existing PowerRenameExt.dll or ImageResizerExt.dll installation -->
|
||||
<util:CloseApplication Target="explorer.exe" RebootPrompt="no" TerminateProcess="0">
|
||||
EXISTINGPOWERRENAMEEXTPATH OR EXISTINGIMAGERESIZERPATH
|
||||
</util:CloseApplication>
|
||||
<util:CloseApplication CloseMessage="yes" Target="PowerToys.exe" ElevatedCloseMessage="yes" RebootPrompt="no" TerminateProcess="0" />
|
||||
</Product>
|
||||
|
||||
@@ -215,32 +217,33 @@
|
||||
<Directory Id="INSTALLFOLDER" Name="PowerToys">
|
||||
<Directory Id="SvgsInstallFolder" Name="svgs"/>
|
||||
<Directory Id="ModulesInstallFolder" Name="modules">
|
||||
<!-- Resource file directories -->
|
||||
<?foreach Language in ar;bg;ca;cs;de;es;eu-ES;fr;he;hu;it;nb-NO;nl;pl;pt-BR;ru;sk;tr;zh-Hans?>
|
||||
<Directory Id="ImageResizerInstallFolder" Name="$(var.ImageResizerProjectName)">
|
||||
<!-- Resource file directories -->
|
||||
<?foreach Language in ar;bg;ca;cs;de;es;eu-ES;fr;he;hu;it;nb-NO;nl;pl;pt-BR;ru;sk;tr;zh-Hans?>
|
||||
<!--NB: Ids can't contain hyphens-->
|
||||
<?if $(var.Language) = eu-ES?>
|
||||
<?define IdSafeLanguage = eu_ES?>
|
||||
<?define IdSafeLanguage = eu_ES?>
|
||||
<?elseif $(var.Language) = nb-NO?>
|
||||
<?define IdSafeLanguage = nb_NO?>
|
||||
<?define IdSafeLanguage = nb_NO?>
|
||||
<?elseif $(var.Language) = pt-BR?>
|
||||
<?define IdSafeLanguage = pt_BR?>
|
||||
<?define IdSafeLanguage = pt_BR?>
|
||||
<?elseif $(var.Language) = zh-Hans?>
|
||||
<?define IdSafeLanguage = zh_Hans?>
|
||||
<?define IdSafeLanguage = zh_Hans?>
|
||||
<?else?>
|
||||
<?define IdSafeLanguage = $(var.Language)?>
|
||||
<?define IdSafeLanguage = $(var.Language)?>
|
||||
<?endif?>
|
||||
<Directory Id="Resources$(var.IdSafeLanguage)Folder" Name="$(var.Language)" />
|
||||
<?undef IdSafeLanguage?>
|
||||
<?endforeach?>
|
||||
<?endforeach?>
|
||||
</Directory>
|
||||
<Directory Id="PowerRenameInstallFolder" Name="$(var.PowerRenameProjectName)"/>
|
||||
<Directory Id="ShortcutGuideInstallFolder" Name="$(var.ShortcutGuideProjectName)"/>
|
||||
<Directory Id="FileExplorerPreviewInstallFolder" Name="FileExplorerPreview" />
|
||||
<Directory Id="FancyZonesInstallFolder" Name="FancyZones" />
|
||||
<Directory Id="FancyZonesInstallFolder" Name="$(var.FancyZonesProjectName)" />
|
||||
<Directory Id="KeyboardManagerInstallFolder" Name="$(var.KeyboardManagerProjectName)" />
|
||||
<Directory Id="LauncherInstallFolder" Name="launcher">
|
||||
<Directory Id="AssetsFolder" Name="Assets" />
|
||||
<Directory Id="LauncherImagesFolder" Name="Images" />
|
||||
<Directory Id="LauncherUIControlsFolder" Name="Microsoft.Toolkit.Uwp.UI.Controls" />
|
||||
<Directory Id="LauncherXamlUIFolder" Name="Microsoft.UI.Xaml">
|
||||
<Directory Id="XamlUIAssetsFolder" Name="Assets" />
|
||||
</Directory>
|
||||
<Directory Id="LauncherImagesFolder" Name="Images" />
|
||||
<Directory Id="LauncherpinyindbFolder" Name="pinyindb" />
|
||||
<Directory Id="LauncherPluginsFolder" Name="Plugins">
|
||||
<Directory Id="CalculatorPluginFolder" Name="Microsoft.Plugin.Calculator">
|
||||
@@ -381,134 +384,30 @@
|
||||
</DirectoryRef>
|
||||
<DirectoryRef Id="FancyZonesInstallFolder" FileSource="$(var.BinX64Dir)modules\">
|
||||
<Component Id="Module_FancyZones" Guid="C6B5272E-6ED4-4B80-B0E7-2FF0355D8CF4" Win64="yes">
|
||||
<File Source="$(var.BinX64Dir)modules\fancyzones.dll" KeyPath="yes" />
|
||||
<File Source="$(var.BinX64Dir)modules\FancyZones\FancyZonesEditor.exe" >
|
||||
<File Source="$(var.BinX64Dir)modules\$(var.FancyZonesProjectName)\fancyzones.dll" KeyPath="yes" />
|
||||
<File Source="$(var.BinX64Dir)modules\$(var.FancyZonesProjectName)\FancyZonesEditor.exe" >
|
||||
<netfx:NativeImage Id="FancyZonesEditor.exe" Platform="64bit" Priority="0" />
|
||||
</File>
|
||||
<File Source="$(var.BinX64Dir)modules\FancyZones\ControlzEx.dll" />
|
||||
<File Source="$(var.BinX64Dir)modules\FancyZones\MahApps.Metro.dll" />
|
||||
<File Source="$(var.BinX64Dir)modules\FancyZones\Microsoft.Xaml.Behaviors.dll" />
|
||||
<File Source="$(var.BinX64Dir)modules\FancyZones\FancyZonesEditor.exe.config" />
|
||||
<File Source="$(var.BinX64Dir)modules\FancyZones\Microsoft.Bcl.AsyncInterfaces.dll" />
|
||||
<File Source="$(var.BinX64Dir)modules\FancyZones\System.Buffers.dll" />
|
||||
<File Source="$(var.BinX64Dir)modules\FancyZones\System.Memory.dll" />
|
||||
<File Source="$(var.BinX64Dir)modules\FancyZones\System.Numerics.Vectors.dll" />
|
||||
<File Source="$(var.BinX64Dir)modules\FancyZones\System.Runtime.CompilerServices.Unsafe.dll" />
|
||||
<File Source="$(var.BinX64Dir)modules\FancyZones\System.Text.Encodings.Web.dll" />
|
||||
<File Source="$(var.BinX64Dir)modules\FancyZones\System.Text.Json.dll" />
|
||||
<File Source="$(var.BinX64Dir)modules\FancyZones\System.Threading.Tasks.Extensions.dll" />
|
||||
<File Source="$(var.BinX64Dir)modules\FancyZones\System.ValueTuple.dll" />
|
||||
<File Source="$(var.BinX64Dir)modules\$(var.FancyZonesProjectName)\ControlzEx.dll" />
|
||||
<File Source="$(var.BinX64Dir)modules\$(var.FancyZonesProjectName)\MahApps.Metro.dll" />
|
||||
<File Source="$(var.BinX64Dir)modules\$(var.FancyZonesProjectName)\Microsoft.Xaml.Behaviors.dll" />
|
||||
<File Source="$(var.BinX64Dir)modules\$(var.FancyZonesProjectName)\FancyZonesEditor.exe.config" />
|
||||
<File Source="$(var.BinX64Dir)modules\$(var.FancyZonesProjectName)\Microsoft.Bcl.AsyncInterfaces.dll" />
|
||||
<File Source="$(var.BinX64Dir)modules\$(var.FancyZonesProjectName)\System.Buffers.dll" />
|
||||
<File Source="$(var.BinX64Dir)modules\$(var.FancyZonesProjectName)\System.Memory.dll" />
|
||||
<File Source="$(var.BinX64Dir)modules\$(var.FancyZonesProjectName)\System.Numerics.Vectors.dll" />
|
||||
<File Source="$(var.BinX64Dir)modules\$(var.FancyZonesProjectName)\System.Runtime.CompilerServices.Unsafe.dll" />
|
||||
<File Source="$(var.BinX64Dir)modules\$(var.FancyZonesProjectName)\System.Text.Encodings.Web.dll" />
|
||||
<File Source="$(var.BinX64Dir)modules\$(var.FancyZonesProjectName)\System.Text.Json.dll" />
|
||||
<File Source="$(var.BinX64Dir)modules\$(var.FancyZonesProjectName)\System.Threading.Tasks.Extensions.dll" />
|
||||
<File Source="$(var.BinX64Dir)modules\$(var.FancyZonesProjectName)\System.ValueTuple.dll" />
|
||||
<File Source="$(var.BinX64Dir)modules\$(var.FancyZonesProjectName)\ManagedCommon.dll" />
|
||||
<File Id="FancyZones_Telemetry.dll" Source="$(var.BinX64Dir)modules\$(var.FancyZonesProjectName)\Telemetry.dll" />
|
||||
</Component>
|
||||
</DirectoryRef>
|
||||
|
||||
<DirectoryRef Id="ModulesInstallFolder" FileSource="$(var.BinX64Dir)modules\">
|
||||
<Component Id="Module_ShortcutGuide" Guid="CBD0AC09-91D3-428E-B2B3-05745ADF3473" Win64="yes">
|
||||
<File Source="$(var.BinX64Dir)modules\shortcut_guide.dll" KeyPath="yes" />
|
||||
</Component>
|
||||
|
||||
<Component Id="Module_PowerRename" Guid="E4401D08-27FE-4F96-BA17-0C61FD79E684" Win64="yes">
|
||||
<File Source="$(var.BinX64Dir)modules\PowerRenameExt.dll" KeyPath="yes" />
|
||||
<RegistryKey Root="HKCR" Key="CLSID\{0440049F-D1DC-4E46-B27B-98393D79486B}">
|
||||
<RegistryValue Type="string" Value="PowerRename Shell Extension" />
|
||||
<RegistryValue Type="string" Key="InprocServer32" Value="[ModulesInstallFolder]PowerRenameExt.dll" />
|
||||
<RegistryValue Type="string" Key="InprocServer32" Name="ThreadingModel" Value="Apartment" />
|
||||
</RegistryKey>
|
||||
<RegistryKey Root="HKCR" Key="AllFileSystemObjects\ShellEx\ContextMenuHandlers\PowerRenameExt">
|
||||
<RegistryValue Type="string" Value="{0440049F-D1DC-4E46-B27B-98393D79486B}"/>
|
||||
</RegistryKey>
|
||||
</Component>
|
||||
|
||||
<Component Id="Module_Launcher" Guid="9A343236-B49D-451D-A27D-4C336F460A45" Win64="yes">
|
||||
<File Source="$(var.BinX64Dir)modules\Microsoft.Launcher.dll" />
|
||||
</Component>
|
||||
|
||||
<Component Id="Module_KeyboardManager" Guid="9279BD82-786F-4F0B-8E49-DB484EE34C9B" Win64="yes">
|
||||
<File Source="$(var.BinX64Dir)modules\KeyboardManager.dll" />
|
||||
</Component>
|
||||
|
||||
<Component Id="Module_ImageResizer" Guid="96E63289-759C-4A73-A56B-EE7429932F72" Win64="yes">
|
||||
<File Source="$(var.BinX64Dir)modules\ImageResizer.exe">
|
||||
<netfx:NativeImage Id="ImageResizer.exe" Platform="all" Priority="0" />
|
||||
</File>
|
||||
<File Source="$(var.BinX64Dir)modules\GalaSoft.MvvmLight.dll" />
|
||||
<File Source="$(var.BinX64Dir)modules\GalaSoft.MvvmLight.Platform.dll" />
|
||||
<File Source="$(var.BinX64Dir)modules\GalaSoft.MvvmLight.Extras.dll" />
|
||||
<File Source="$(var.BinX64Dir)modules\System.Windows.Interactivity.dll">
|
||||
<!-- NB: Needed since it's only referenced in XAML. -->
|
||||
<netfx:NativeImage Id="Interactivity" Platform="all" Priority="0"/>
|
||||
</File>
|
||||
<File Source="$(var.BinX64Dir)modules\Newtonsoft.Json.dll" />
|
||||
<File Source="$(var.BinX64Dir)modules\ImageResizerExt.dll" KeyPath="yes" />
|
||||
|
||||
<!-- VCRuntime -->
|
||||
<?foreach File in vcruntime140.dll;vcruntime140_1.dll;concrt140.dll;msvcp140.dll;msvcp140_1.dll;msvcp140_2.dll;msvcp140_codecvt_ids.dll;vccorlib140.dll?>
|
||||
<File Id="ImageResizer_$(var.File)" Source="$(var.RepoDir)installer\VCRuntime\$(var.File)" />
|
||||
<?endforeach?>
|
||||
</Component>
|
||||
<Component Id="Module_ImageResizer_Registry" Guid="8B593E2C-2D9B-4EBC-93F7-A2B69707DAC9" Win64="yes">
|
||||
<RegistryKey Root="HKCR" Key="CLSID\{51B4D7E5-7568-4234-B4BB-47FB3C016A69}\InprocServer32">
|
||||
<RegistryValue Value="[ModulesInstallFolder]ImageResizerExt.dll" Type="string" />
|
||||
<RegistryValue Name="ThreadingModel" Value="Apartment" Type="string" />
|
||||
</RegistryKey>
|
||||
<!-- Registry Key for the drag and drop handler -->
|
||||
<RegistryValue Root="HKCR"
|
||||
Key="Directory\ShellEx\DragDropHandlers\ImageResizer"
|
||||
Value="{51B4D7E5-7568-4234-B4BB-47FB3C016A69}"
|
||||
Type="string" />
|
||||
<!-- Registry Keys for the context menu handler for each of the following image formats: bmp, dib, gif, jfif, jpe, jpeg, jpg, jxr, png, rle, tif, tiff, wdp -->
|
||||
<RegistryValue Root="HKCR"
|
||||
Key="SystemFileAssociations\.bmp\ShellEx\ContextMenuHandlers\ImageResizer"
|
||||
Value="{51B4D7E5-7568-4234-B4BB-47FB3C016A69}"
|
||||
Type="string" />
|
||||
<RegistryValue Root="HKCR"
|
||||
Key="SystemFileAssociations\.dib\ShellEx\ContextMenuHandlers\ImageResizer"
|
||||
Value="{51B4D7E5-7568-4234-B4BB-47FB3C016A69}"
|
||||
Type="string" />
|
||||
<RegistryValue Root="HKCR"
|
||||
Key="SystemFileAssociations\.gif\ShellEx\ContextMenuHandlers\ImageResizer"
|
||||
Value="{51B4D7E5-7568-4234-B4BB-47FB3C016A69}"
|
||||
Type="string" />
|
||||
<RegistryValue Root="HKCR"
|
||||
Key="SystemFileAssociations\.jfif\ShellEx\ContextMenuHandlers\ImageResizer"
|
||||
Value="{51B4D7E5-7568-4234-B4BB-47FB3C016A69}"
|
||||
Type="string" />
|
||||
<RegistryValue Root="HKCR"
|
||||
Key="SystemFileAssociations\.jpe\ShellEx\ContextMenuHandlers\ImageResizer"
|
||||
Value="{51B4D7E5-7568-4234-B4BB-47FB3C016A69}"
|
||||
Type="string" />
|
||||
<RegistryValue Root="HKCR"
|
||||
Key="SystemFileAssociations\.jpeg\ShellEx\ContextMenuHandlers\ImageResizer"
|
||||
Value="{51B4D7E5-7568-4234-B4BB-47FB3C016A69}"
|
||||
Type="string" />
|
||||
<RegistryValue Root="HKCR"
|
||||
Key="SystemFileAssociations\.jpg\ShellEx\ContextMenuHandlers\ImageResizer"
|
||||
Value="{51B4D7E5-7568-4234-B4BB-47FB3C016A69}"
|
||||
Type="string" />
|
||||
<RegistryValue Root="HKCR"
|
||||
Key="SystemFileAssociations\.jxr\ShellEx\ContextMenuHandlers\ImageResizer"
|
||||
Value="{51B4D7E5-7568-4234-B4BB-47FB3C016A69}"
|
||||
Type="string" />
|
||||
<RegistryValue Root="HKCR"
|
||||
Key="SystemFileAssociations\.png\ShellEx\ContextMenuHandlers\ImageResizer"
|
||||
Value="{51B4D7E5-7568-4234-B4BB-47FB3C016A69}"
|
||||
Type="string" />
|
||||
<RegistryValue Root="HKCR"
|
||||
Key="SystemFileAssociations\.rle\ShellEx\ContextMenuHandlers\ImageResizer"
|
||||
Value="{51B4D7E5-7568-4234-B4BB-47FB3C016A69}"
|
||||
Type="string" />
|
||||
<RegistryValue Root="HKCR"
|
||||
Key="SystemFileAssociations\.tif\ShellEx\ContextMenuHandlers\ImageResizer"
|
||||
Value="{51B4D7E5-7568-4234-B4BB-47FB3C016A69}"
|
||||
Type="string" />
|
||||
<RegistryValue Root="HKCR"
|
||||
Key="SystemFileAssociations\.tiff\ShellEx\ContextMenuHandlers\ImageResizer"
|
||||
Value="{51B4D7E5-7568-4234-B4BB-47FB3C016A69}"
|
||||
Type="string" />
|
||||
<RegistryValue Root="HKCR"
|
||||
Key="SystemFileAssociations\.wdp\ShellEx\ContextMenuHandlers\ImageResizer"
|
||||
Value="{51B4D7E5-7568-4234-B4BB-47FB3C016A69}"
|
||||
Type="string" />
|
||||
</Component>
|
||||
<Component Id="Module_PowerPreview_PerUserRegistry" Guid="CD90ADC0-7CD5-4A62-B0AF-23545C1E6DD3" Win64="yes">
|
||||
<!-- Added a separate component for Per-User registry changes -->
|
||||
<!-- Registry Key for Class Registration of Svg Preview Handler -->
|
||||
@@ -571,7 +470,119 @@
|
||||
</RegistryKey>
|
||||
</Component>
|
||||
</DirectoryRef>
|
||||
|
||||
|
||||
<DirectoryRef Id="ImageResizerInstallFolder" FileSource="$(var.BinX64Dir)modules\$(var.ImageResizerProjectName)">
|
||||
<Component Id="Module_ImageResizer" Guid="96E63289-759C-4A73-A56B-EE7429932F72" Win64="yes">
|
||||
<File Source="$(var.BinX64Dir)modules\$(var.ImageResizerProjectName)\ImageResizer.exe">
|
||||
<netfx:NativeImage Id="ImageResizer.exe" Platform="all" Priority="0" />
|
||||
</File>
|
||||
<File Source="$(var.BinX64Dir)modules\$(var.ImageResizerProjectName)\GalaSoft.MvvmLight.dll" />
|
||||
<File Source="$(var.BinX64Dir)modules\$(var.ImageResizerProjectName)\GalaSoft.MvvmLight.Platform.dll" />
|
||||
<File Source="$(var.BinX64Dir)modules\$(var.ImageResizerProjectName)\GalaSoft.MvvmLight.Extras.dll" />
|
||||
<File Source="$(var.BinX64Dir)modules\$(var.ImageResizerProjectName)\System.Windows.Interactivity.dll">
|
||||
<!-- NB: Needed since it's only referenced in XAML. -->
|
||||
<netfx:NativeImage Id="Interactivity" Platform="all" Priority="0"/>
|
||||
</File>
|
||||
<File Source="$(var.BinX64Dir)modules\$(var.ImageResizerProjectName)\Newtonsoft.Json.dll" />
|
||||
<File Source="$(var.BinX64Dir)modules\$(var.ImageResizerProjectName)\ImageResizerExt.dll" KeyPath="yes" />
|
||||
|
||||
<!-- VCRuntime -->
|
||||
<?foreach File in vcruntime140.dll;vcruntime140_1.dll;concrt140.dll;msvcp140.dll;msvcp140_1.dll;msvcp140_2.dll;msvcp140_codecvt_ids.dll;vccorlib140.dll?>
|
||||
<File Id="ImageResizer_$(var.File)" Source="$(var.RepoDir)installer\VCRuntime\$(var.File)" />
|
||||
<?endforeach?>
|
||||
</Component>
|
||||
<Component Id="Module_ImageResizer_Registry" Guid="8B593E2C-2D9B-4EBC-93F7-A2B69707DAC9" Win64="yes">
|
||||
<RegistryKey Root="HKCR" Key="CLSID\{51B4D7E5-7568-4234-B4BB-47FB3C016A69}\InprocServer32">
|
||||
<RegistryValue Value="[ImageResizerInstallFolder]ImageResizerExt.dll" Type="string" />
|
||||
<RegistryValue Name="ThreadingModel" Value="Apartment" Type="string" />
|
||||
</RegistryKey>
|
||||
<!-- Registry Key for the drag and drop handler -->
|
||||
<RegistryValue Root="HKCR"
|
||||
Key="Directory\ShellEx\DragDropHandlers\ImageResizer"
|
||||
Value="{51B4D7E5-7568-4234-B4BB-47FB3C016A69}"
|
||||
Type="string" />
|
||||
<!-- Registry Keys for the context menu handler for each of the following image formats: bmp, dib, gif, jfif, jpe, jpeg, jpg, jxr, png, rle, tif, tiff, wdp -->
|
||||
<RegistryValue Root="HKCR"
|
||||
Key="SystemFileAssociations\.bmp\ShellEx\ContextMenuHandlers\ImageResizer"
|
||||
Value="{51B4D7E5-7568-4234-B4BB-47FB3C016A69}"
|
||||
Type="string" />
|
||||
<RegistryValue Root="HKCR"
|
||||
Key="SystemFileAssociations\.dib\ShellEx\ContextMenuHandlers\ImageResizer"
|
||||
Value="{51B4D7E5-7568-4234-B4BB-47FB3C016A69}"
|
||||
Type="string" />
|
||||
<RegistryValue Root="HKCR"
|
||||
Key="SystemFileAssociations\.gif\ShellEx\ContextMenuHandlers\ImageResizer"
|
||||
Value="{51B4D7E5-7568-4234-B4BB-47FB3C016A69}"
|
||||
Type="string" />
|
||||
<RegistryValue Root="HKCR"
|
||||
Key="SystemFileAssociations\.jfif\ShellEx\ContextMenuHandlers\ImageResizer"
|
||||
Value="{51B4D7E5-7568-4234-B4BB-47FB3C016A69}"
|
||||
Type="string" />
|
||||
<RegistryValue Root="HKCR"
|
||||
Key="SystemFileAssociations\.jpe\ShellEx\ContextMenuHandlers\ImageResizer"
|
||||
Value="{51B4D7E5-7568-4234-B4BB-47FB3C016A69}"
|
||||
Type="string" />
|
||||
<RegistryValue Root="HKCR"
|
||||
Key="SystemFileAssociations\.jpeg\ShellEx\ContextMenuHandlers\ImageResizer"
|
||||
Value="{51B4D7E5-7568-4234-B4BB-47FB3C016A69}"
|
||||
Type="string" />
|
||||
<RegistryValue Root="HKCR"
|
||||
Key="SystemFileAssociations\.jpg\ShellEx\ContextMenuHandlers\ImageResizer"
|
||||
Value="{51B4D7E5-7568-4234-B4BB-47FB3C016A69}"
|
||||
Type="string" />
|
||||
<RegistryValue Root="HKCR"
|
||||
Key="SystemFileAssociations\.jxr\ShellEx\ContextMenuHandlers\ImageResizer"
|
||||
Value="{51B4D7E5-7568-4234-B4BB-47FB3C016A69}"
|
||||
Type="string" />
|
||||
<RegistryValue Root="HKCR"
|
||||
Key="SystemFileAssociations\.png\ShellEx\ContextMenuHandlers\ImageResizer"
|
||||
Value="{51B4D7E5-7568-4234-B4BB-47FB3C016A69}"
|
||||
Type="string" />
|
||||
<RegistryValue Root="HKCR"
|
||||
Key="SystemFileAssociations\.rle\ShellEx\ContextMenuHandlers\ImageResizer"
|
||||
Value="{51B4D7E5-7568-4234-B4BB-47FB3C016A69}"
|
||||
Type="string" />
|
||||
<RegistryValue Root="HKCR"
|
||||
Key="SystemFileAssociations\.tif\ShellEx\ContextMenuHandlers\ImageResizer"
|
||||
Value="{51B4D7E5-7568-4234-B4BB-47FB3C016A69}"
|
||||
Type="string" />
|
||||
<RegistryValue Root="HKCR"
|
||||
Key="SystemFileAssociations\.tiff\ShellEx\ContextMenuHandlers\ImageResizer"
|
||||
Value="{51B4D7E5-7568-4234-B4BB-47FB3C016A69}"
|
||||
Type="string" />
|
||||
<RegistryValue Root="HKCR"
|
||||
Key="SystemFileAssociations\.wdp\ShellEx\ContextMenuHandlers\ImageResizer"
|
||||
Value="{51B4D7E5-7568-4234-B4BB-47FB3C016A69}"
|
||||
Type="string" />
|
||||
</Component>
|
||||
</DirectoryRef>
|
||||
|
||||
<DirectoryRef Id="PowerRenameInstallFolder" FileSource="$(var.BinX64Dir)modules\$(var.PowerRenameProjectName)">
|
||||
<Component Id="Module_PowerRename" Guid="E4401D08-27FE-4F96-BA17-0C61FD79E684" Win64="yes">
|
||||
<File Source="$(var.BinX64Dir)modules\$(var.PowerRenameProjectName)\PowerRenameExt.dll" KeyPath="yes" />
|
||||
<RegistryKey Root="HKCR" Key="CLSID\{0440049F-D1DC-4E46-B27B-98393D79486B}">
|
||||
<RegistryValue Type="string" Value="PowerRename Shell Extension" />
|
||||
<RegistryValue Type="string" Key="InprocServer32" Value="[PowerRenameInstallFolder]PowerRenameExt.dll" />
|
||||
<RegistryValue Type="string" Key="InprocServer32" Name="ThreadingModel" Value="Apartment" />
|
||||
</RegistryKey>
|
||||
<RegistryKey Root="HKCR" Key="AllFileSystemObjects\ShellEx\ContextMenuHandlers\PowerRenameExt">
|
||||
<RegistryValue Type="string" Value="{0440049F-D1DC-4E46-B27B-98393D79486B}"/>
|
||||
</RegistryKey>
|
||||
</Component>
|
||||
</DirectoryRef>
|
||||
|
||||
<DirectoryRef Id="ShortcutGuideInstallFolder" FileSource="$(var.BinX64Dir)modules\$(var.ShortcutGuideProjectName)\">
|
||||
<Component Id="Module_ShortcutGuide" Guid="CBD0AC09-91D3-428E-B2B3-05745ADF3473" Win64="yes">
|
||||
<File Source="$(var.BinX64Dir)modules\$(var.ShortcutGuideProjectName)\$(var.ShortcutGuideProjectName).dll" KeyPath="yes" />
|
||||
</Component>
|
||||
</DirectoryRef>
|
||||
|
||||
<DirectoryRef Id="KeyboardManagerInstallFolder" FileSource="$(var.BinX64Dir)modules\$(var.KeyboardManagerProjectName)\">
|
||||
<Component Id="Module_KeyboardManager" Guid="9279BD82-786F-4F0B-8E49-DB484EE34C9B" Win64="yes">
|
||||
<File Source="$(var.BinX64Dir)modules\$(var.KeyboardManagerProjectName)\KeyboardManager.dll" />
|
||||
</Component>
|
||||
</DirectoryRef>
|
||||
|
||||
<DirectoryRef Id="FileExplorerPreviewInstallFolder" FileSource="$(var.RepoDir)\modules\FileExplorerPreview\">
|
||||
<Component Id="Module_PowerPreview" Guid="FF1700D5-1B07-4E07-9A62-4D206645EEA9" Win64="yes">
|
||||
<!-- Component to include PowerPreview Module Source dll's -->
|
||||
@@ -601,7 +612,7 @@
|
||||
<File Source="$(var.BinX64Dir)SettingsUIRunner\Microsoft.PowerToys.Settings.UI.Runner.exe"/>
|
||||
<File Source="$(var.BinX64Dir)SettingsUIRunner\Microsoft.PowerToys.Settings.UI.exe"/>
|
||||
<!-- dll -->
|
||||
<?foreach File in concrt140_app.dll;Microsoft.Bcl.AsyncInterfaces.dll;Microsoft.PowerToys.Settings.UI.Lib.dll;Microsoft.PowerToys.Settings.UI.Runner.dll;Microsoft.Toolkit.dll;Microsoft.Toolkit.Uwp.dll;Microsoft.Toolkit.Uwp.UI.dll;Microsoft.Toolkit.Win32.UI.XamlHost.dll;Microsoft.Toolkit.Win32.UI.XamlHost.Managed.dll;Microsoft.Toolkit.Wpf.UI.Controls.dll;Microsoft.Toolkit.Wpf.UI.XamlHost.dll;Microsoft.UI.Xaml.dll;Microsoft.Xaml.Interactions.dll;Microsoft.Xaml.Interactivity.dll;msvcp140_1_app.dll;msvcp140_2_app.dll;msvcp140_app.dll;Newtonsoft.Json.dll;PowerToysInterop.dll;System.Runtime.CompilerServices.Unsafe.dll;System.Runtime.dll;System.Text.Encodings.Web.dll;System.Text.Json.dll;vcamp140_app.dll;vccorlib140_app.dll;vcomp140_app.dll;vcruntime140_1_app.dll;vcruntime140_app.dll;Telemetry.dll?>
|
||||
<?foreach File in concrt140_app.dll;Microsoft.Bcl.AsyncInterfaces.dll;Microsoft.PowerToys.Settings.UI.Lib.dll;Microsoft.PowerToys.Settings.UI.Runner.dll;Microsoft.Toolkit.dll;Microsoft.Toolkit.Uwp.dll;Microsoft.Toolkit.Uwp.UI.dll;Microsoft.Toolkit.Win32.UI.XamlHost.dll;Microsoft.Toolkit.Win32.UI.XamlHost.Managed.dll;Microsoft.Toolkit.Wpf.UI.Controls.dll;Microsoft.Toolkit.Wpf.UI.XamlHost.dll;Microsoft.UI.Xaml.dll;Microsoft.Xaml.Interactions.dll;Microsoft.Xaml.Interactivity.dll;msvcp140_1_app.dll;msvcp140_2_app.dll;msvcp140_app.dll;Newtonsoft.Json.dll;PowerToysInterop.dll;System.Runtime.CompilerServices.Unsafe.dll;System.Runtime.dll;System.Text.Encodings.Web.dll;System.Text.Json.dll;vcamp140_app.dll;vccorlib140_app.dll;vcomp140_app.dll;vcruntime140_1_app.dll;vcruntime140_app.dll;Telemetry.dll;ManagedCommon.dll?>
|
||||
<File Id="SettingsV2_$(var.File)" Source="$(var.BinX64Dir)SettingsUIRunner\$(var.File)" />
|
||||
<?endforeach?>
|
||||
<!-- json -->
|
||||
@@ -655,7 +666,7 @@
|
||||
</DirectoryRef>
|
||||
<DirectoryRef Id="SettingsV2StylesInstallFolder" FileSource="$(var.BinX64Dir)SettingsUIRunner\Styles">
|
||||
<Component Id="SettingsV2Styles" Guid="44B5C0E0-76DA-4604-BB86-FCD27A00EB71" Win64="yes">
|
||||
<?foreach File in Page.xbf;TextBlock.xbf;_Colors.xbf;_FontSizes.xbf;_Sizes.xbf;_Thickness.xbf?>
|
||||
<?foreach File in Page.xbf;TextBlock.xbf;_Colors.xbf;_FontSizes.xbf;_Sizes.xbf;_Thickness.xbf;Button.xbf?>
|
||||
<File Id="SettingsV2_Styles_$(var.File)" Source="$(var.BinX64Dir)SettingsUIRunner\Styles\$(var.File)" />
|
||||
<?endforeach?>
|
||||
</Component>
|
||||
@@ -729,7 +740,6 @@
|
||||
<ComponentRef Id="Module_ImageResizer_Registry" />
|
||||
<ComponentRef Id="Module_PowerPreview" />
|
||||
<ComponentRef Id="Module_PowerPreview_PerUserRegistry" />
|
||||
<ComponentRef Id="Module_Launcher" />
|
||||
<ComponentRef Id="Module_KeyboardManager" />
|
||||
<ComponentRef Id="SettingsV2" />
|
||||
<ComponentRef Id="SettingsV2Assets" />
|
||||
@@ -761,7 +771,7 @@
|
||||
<?define IdSafeLanguage = $(var.Language)?>
|
||||
<?endif?>
|
||||
<Component Id="Resources_$(var.IdSafeLanguage)_Component" Directory="Resources$(var.IdSafeLanguage)Folder">
|
||||
<File Id="Resources_ImageResizer_$(var.IdSafeLanguage)_File" Source="$(var.BinX64Dir)modules\$(var.Language)\ImageResizer.resources.dll" />
|
||||
<File Id="Resources_ImageResizer_$(var.IdSafeLanguage)_File" Source="$(var.BinX64Dir)modules\$(var.ImageResizerProjectName)\$(var.Language)\ImageResizer.resources.dll" />
|
||||
</Component>
|
||||
<?undef IdSafeLanguage?>
|
||||
<?endforeach?>
|
||||
@@ -770,7 +780,8 @@
|
||||
<Fragment>
|
||||
<ComponentGroup Id="LauncherComponents">
|
||||
<Component Id="launcherInstallComponent" Directory="LauncherInstallFolder" Guid="5E688DB4-C522-4268-BA54-ED1CDFFE9DB6">
|
||||
<?foreach File in App.xbf;ColorCode.Core.dll;ColorCode.UWP.dll;ColorCode.UWP.pri;concrt140_app.dll;ICSharpCode.SharpZipLib.dll;JetBrains.Annotations.dll;LauncherControl.xbf;Mages.Core.dll;Microsoft.Graphics.Canvas.dll;Microsoft.Graphics.Canvas.winmd;Microsoft.Search.Interop.dll;Microsoft.Toolkit.dll;Microsoft.Toolkit.Parsers.dll;Microsoft.Toolkit.Uwp.dll;Microsoft.Toolkit.Uwp.pri;Microsoft.Toolkit.Uwp.UI.Animations.dll;Microsoft.Toolkit.Uwp.UI.Animations.pri;Microsoft.Toolkit.Uwp.UI.Controls.dll;Microsoft.Toolkit.Uwp.UI.Controls.pri;Microsoft.Toolkit.Uwp.UI.dll;Microsoft.Toolkit.Uwp.UI.pri;Microsoft.Toolkit.Win32.UI.XamlHost.dll;Microsoft.Toolkit.Win32.UI.XamlHost.Managed.dll;Microsoft.Toolkit.Win32.UI.XamlHost.pri;Microsoft.Toolkit.Win32.UI.XamlHost.winmd;Microsoft.Toolkit.Win32.UI.XamlHost.xml;Microsoft.Toolkit.Wpf.UI.XamlHost.dll;Microsoft.UI.Xaml.dll;Microsoft.UI.Xaml.pri;Microsoft.UI.Xaml.winmd;Microsoft.Xaml.Interactions.dll;Microsoft.Xaml.Interactions.pri;Microsoft.Xaml.Interactivity.dll;Microsoft.Xaml.Interactivity.pri;Mono.Cecil.dll;Mono.Cecil.Mdb.dll;Mono.Cecil.Pdb.dll;Mono.Cecil.Rocks.dll;msvcp140_1_app.dll;msvcp140_2_app.dll;msvcp140_app.dll;netstandard.dll;Newtonsoft.Json.dll;NHotkey.dll;NHotkey.Wpf.dll;NLog.dll;NLog.Extensions.Logging.dll;NoiseAsset_256x256_PNG.png;Pinyin4Net.dll;PowerLauncher.deps.json;PowerLauncher.dll;PowerLauncher.exe;PowerLauncher.runtimeconfig.json;PowerLauncher.UI.exe;PowerLauncher.UI.xr.xml;resources.pri;ResultList.xbf;SQLite.Interop.dll;System.ComponentModel.Composition.dll;System.Data.OleDb.dll;System.Data.SqlClient.dll;System.Data.SQLite.dll;System.IO.Ports.dll;System.Net.Http.Rtc.dll;System.Numerics.Vectors.WindowsRuntime.dll;System.Private.Reflection.Metadata.Ecma335.dll;System.Private.ServiceModel.dll;System.Reflection.Context.dll;System.Security.Permissions.dll;System.ServiceModel.dll;System.ServiceModel.Duplex.dll;System.ServiceModel.Http.dll;System.ServiceModel.NetTcp.dll;System.ServiceModel.Primitives.dll;System.ServiceModel.Security.dll;vcamp140_app.dll;vccorlib140_app.dll;vcomp140_app.dll;vcruntime140_1_app.dll;vcruntime140_app.dll;WindowsInput.dll;Wox.Core.dll;Wox.dll;Wox.Infrastructure.dll;Wox.Plugin.dll;PowerToysInterop.dll;Telemetry.dll;PowerLauncher.Telemetry.dll;PropertyChanged.dll;Microsoft.Extensions.Configuration.Abstractions.dll;Microsoft.Extensions.Configuration.Binder.dll;Microsoft.Extensions.Configuration.dll;Microsoft.Extensions.DependencyInjection.Abstractions.dll;Microsoft.Extensions.DependencyInjection.dll;Microsoft.Extensions.Logging.Abstractions.dll;Microsoft.Extensions.Logging.dll;Microsoft.Extensions.Options.dll;Microsoft.Extensions.Primitives.dll?>
|
||||
<File Source="$(var.BinX64Dir)modules\Launcher\Microsoft.Launcher.dll" />
|
||||
<?foreach File in concrt140_app.dll;ICSharpCode.SharpZipLib.dll;JetBrains.Annotations.dll;Mages.Core.dll;Microsoft.Search.Interop.dll;EntityFramework.SqlServer.dll;EntityFramework.dll;Mono.Cecil.dll;Mono.Cecil.Mdb.dll;Mono.Cecil.Pdb.dll;Mono.Cecil.Rocks.dll;msvcp140_1_app.dll;msvcp140_2_app.dll;msvcp140_app.dll;Newtonsoft.Json.dll;NLog.dll;NLog.Extensions.Logging.dll;Pinyin4Net.dll;PowerLauncher.deps.json;PowerLauncher.dll;PowerLauncher.exe;Microsoft.Xaml.Behaviors.dll;System.Text.Json.dll;sni.dll;System.Data.SQLite.EF6.dll;PowerLauncher.runtimeconfig.json;SQLite.Interop.dll;System.Data.OleDb.dll;System.Data.SqlClient.dll;System.Data.SQLite.dll;vcamp140_app.dll;vccorlib140_app.dll;vcomp140_app.dll;vcruntime140_1_app.dll;vcruntime140_app.dll;WindowsInput.dll;Wox.Core.dll;Wox.dll;Wox.Infrastructure.dll;Wox.Plugin.dll;PowerToysInterop.dll;Telemetry.dll;PowerLauncher.Telemetry.dll;PropertyChanged.dll;Microsoft.Extensions.Configuration.Abstractions.dll;Microsoft.Extensions.Configuration.Binder.dll;Microsoft.Extensions.Configuration.dll;Microsoft.Extensions.DependencyInjection.Abstractions.dll;Microsoft.Extensions.DependencyInjection.dll;Microsoft.Extensions.Logging.Abstractions.dll;Microsoft.Extensions.Logging.dll;Microsoft.Extensions.Options.dll;Microsoft.Extensions.Primitives.dll;ControlzEx.dll;MahApps.Metro.dll;ManagedCommon.dll?>
|
||||
<File Id="File_$(var.File)" Source="$(var.BinX64Dir)modules\launcher\$(var.File)" />
|
||||
<?endforeach?>
|
||||
<File Source="$(var.BinX64Dir)SettingsUIRunner\Microsoft.PowerToys.Settings.UI.Lib.dll" />
|
||||
@@ -779,40 +790,27 @@
|
||||
<File Id="File_$(var.File)" Source="$(var.RepoDir)installer\VCRuntime\$(var.File)" />
|
||||
<?endforeach?>
|
||||
</Component>
|
||||
<Component Id="launcherAssetsComponent" Directory="AssetsFolder" Guid="6A86A414-D68B-49F0-A7AD-A342528D7ACD">
|
||||
<?foreach File in LockScreenLogo.scale-200.png;SplashScreen.scale-200.png;Square150x150Logo.scale-200.png;Square44x44Logo.scale-200.png;Square44x44Logo.targetsize-24_altform-unplated.png;StoreLogo.png;Wide310x150Logo.scale-200.png?>
|
||||
<File Source="$(var.BinX64Dir)modules\launcher\Assets\$(var.File)" />
|
||||
<?endforeach?>
|
||||
</Component>
|
||||
<Component Id="launcherImagesComponent" Directory="LauncherImagesFolder" Guid="D254220C-1DD9-4C74-8810-1AAB2F940DE8">
|
||||
<?foreach File in app.png;app_error.png;Browser.png;calculator.png;cancel.png;close.png;cmd.png;color.png;copy.png;down.png;EXE.png;file.png;find.png;folder.png;history.png;image.png;Link.png;lock.png;logoff.png;ok.png;open.png;plugin.png;recyclebin.png;restart.png;search.png;settings.png;shutdown.png;sleep.png;up.png;update.png;warning.png?>
|
||||
<File Id="File_$(var.File)" Source="$(var.BinX64Dir)modules\launcher\Images\$(var.File)" />
|
||||
<?endforeach?>
|
||||
<File Source="$(var.BinX64Dir)modules\launcher\Images\New Message.png" />
|
||||
</Component>
|
||||
<Component Id="launcherUIControlsComponent" Directory="LauncherUIControlsFolder" Guid="9C6C3785-D6FB-468A-9BEC-130F0403E7F8">
|
||||
<File Source="$(var.BinX64Dir)modules\launcher\Microsoft.Toolkit.Uwp.UI.Controls\Microsoft.Toolkit.Uwp.UI.Controls.xr.xml" />
|
||||
</Component>
|
||||
<Component Id="launcherXamlAssetsComponent" Directory="XamlUIAssetsFolder" Guid="C7ECA65E-73D3-4C02-A6FA-FD1E3215CC48">
|
||||
<File Source="$(var.BinX64Dir)modules\launcher\Microsoft.UI.Xaml\Assets\NoiseAsset_256X256_PNG.png" />
|
||||
</Component>
|
||||
<Component Id="launcherpinyinComponent" Directory="LauncherpinyindbFolder" Guid="F9EA53C7-D6AE-4E62-9800-0D32FBBD9F65">
|
||||
<?foreach File in pinyin_gwoyeu_mapping.xml;pinyin_mapping.xml;unicode_to_hanyu_pinyin.txt?>
|
||||
<File Source="$(var.BinX64Dir)modules\launcher\pinyindb\$(var.File)" />
|
||||
<?endforeach?>
|
||||
</Component>
|
||||
<Component Id="launcherPropertiesComponent" Directory="LauncherPropertiesFolder" Guid="5C18CDB8-DBBB-4D53-A935-943347BC6310">
|
||||
<File Source="$(var.BinX64Dir)modules\launcher\Properties\Default.rd.xml" />
|
||||
</Component>
|
||||
|
||||
<!-- Calculator Plugin -->
|
||||
<Component Id="calculatorComponent" Directory="CalculatorPluginFolder" Guid="19DE1022-583C-4969-9AFC-D43CB944003D">
|
||||
<?foreach File in plugin.json;Wox.Infrastructure.dll;Microsoft.Plugin.Caculator.deps.json;Microsoft.Plugin.Caculator.dll;Wox.Plugin.dll?>
|
||||
<File Id="Calculator_$(var.File)" Source="$(var.BinX64Dir)modules\launcher\Plugins\Microsoft.Plugin.Caculator\$(var.File)" />
|
||||
<?foreach File in plugin.json;Wox.Infrastructure.dll;Microsoft.Plugin.Calculator.deps.json;Microsoft.Plugin.Calculator.dll;Wox.Plugin.dll;Telemetry.dll?>
|
||||
<File Id="Calculator_$(var.File)" Source="$(var.BinX64Dir)modules\launcher\Plugins\Microsoft.Plugin.Calculator\$(var.File)" />
|
||||
<?endforeach?>
|
||||
</Component>
|
||||
<Component Id="calculatorImagesComponent" Directory="CalculatorImagesFolder" Guid="07EC9232-CF9A-4CDB-8D8E-E79DC75096C0">
|
||||
<File Id="calculatorPluginImg" Source="$(var.BinX64Dir)modules\launcher\Plugins\Microsoft.Plugin.Caculator\Images\calculator.png" />
|
||||
<File Id="calculatorPluginImg_calculator_light" Source="$(var.BinX64Dir)modules\launcher\Plugins\Microsoft.Plugin.Calculator\Images\calculator_light.png" />
|
||||
<File Id="calculatorPluginImg_calculator_dark" Source="$(var.BinX64Dir)modules\launcher\Plugins\Microsoft.Plugin.Calculator\Images\calculator_dark.png" />
|
||||
</Component>
|
||||
<Component Id="calculatorLanguagesComponent" Directory="CalculatorLanguagesFolder" Guid="2D8019E7-664F-4529-9FAA-83C8DACF0732">
|
||||
<?foreach LanguageFile in de.xaml;en.xaml;pl.xaml;tr.xaml;zh-cn.xaml;zh-tw.xaml?>
|
||||
@@ -824,19 +822,19 @@
|
||||
<?else?>
|
||||
<?define IdSafeLanguage = $(var.LanguageFile)?>
|
||||
<?endif?>
|
||||
<File Id="File_calc_Plugin_$(var.IdSafeLanguage)" Source="$(var.BinX64Dir)modules\launcher\Plugins\Microsoft.Plugin.Caculator\Languages\$(var.LanguageFile)" />
|
||||
<File Id="File_calc_Plugin_$(var.IdSafeLanguage)" Source="$(var.BinX64Dir)modules\launcher\Plugins\Microsoft.Plugin.Calculator\Languages\$(var.LanguageFile)" />
|
||||
<?undef IdSafeLanguage?>
|
||||
<?endforeach?>
|
||||
</Component>
|
||||
<Component Id="calculatorpinyindbComponent" Directory="CalculatorpinyindbFolder" Guid="D5527670-BE9A-4AA9-9D36-1249F2184B5B">
|
||||
<?foreach File in pinyin_gwoyeu_mapping.xml;pinyin_mapping.xml;unicode_to_hanyu_pinyin.txt?>
|
||||
<File Id="CalcPlugin_$(var.File)" Source="$(var.BinX64Dir)modules\launcher\Plugins\Microsoft.Plugin.Caculator\pinyindb\$(var.File)" />
|
||||
<File Id="CalcPlugin_$(var.File)" Source="$(var.BinX64Dir)modules\launcher\Plugins\Microsoft.Plugin.Calculator\pinyindb\$(var.File)" />
|
||||
<?endforeach?>
|
||||
</Component>
|
||||
|
||||
<!-- Folder Plugin -->
|
||||
<Component Id="FolderComponent" Directory="FolderPluginFolder" Guid="453D6C29-8F0D-46EC-B210-82E6AF547039">
|
||||
<?foreach File in plugin.json;Wox.Infrastructure.dll;Microsoft.Plugin.Folder.deps.json;Microsoft.Plugin.Folder.dll;Wox.Plugin.dll?>
|
||||
<?foreach File in plugin.json;Wox.Infrastructure.dll;Microsoft.Plugin.Folder.deps.json;Microsoft.Plugin.Folder.dll;Wox.Plugin.dll;Telemetry.dll?>
|
||||
<File Id="Folder_$(var.File)" Source="$(var.BinX64Dir)modules\launcher\Plugins\Microsoft.Plugin.Folder\$(var.File)" />
|
||||
<?endforeach?>
|
||||
</Component>
|
||||
@@ -867,7 +865,7 @@
|
||||
|
||||
<!-- Program Plugin -->
|
||||
<Component Id="ProgramComponent" Directory="ProgramPluginFolder" Guid="3C5CA6E6-3D36-4F4E-B40E-38AA5E5CB799">
|
||||
<?foreach File in plugin.json;Wox.Infrastructure.dll;Wox.Plugin.dll;Microsoft.Plugin.Program.deps.json;Microsoft.Plugin.Program.dll?>
|
||||
<?foreach File in plugin.json;Wox.Infrastructure.dll;Wox.Plugin.dll;Microsoft.Plugin.Program.deps.json;Microsoft.Plugin.Program.dll;Telemetry.dll?>
|
||||
<File Id="Program_$(var.File)" Source="$(var.BinX64Dir)modules\launcher\Plugins\Microsoft.Plugin.Program\$(var.File)" />
|
||||
<?endforeach?>
|
||||
</Component>
|
||||
@@ -898,7 +896,7 @@
|
||||
|
||||
<!-- Shell Plugin -->
|
||||
<Component Id="ShellComponent" Directory="ShellPluginFolder" Guid="6D3D7294-1804-47C9-83E5-47A8867F3801">
|
||||
<?foreach File in plugin.json;Wox.Infrastructure.dll;Wox.Plugin.dll;Microsoft.Plugin.Shell.deps.json;Microsoft.Plugin.Shell.dll?>
|
||||
<?foreach File in plugin.json;Wox.Infrastructure.dll;Wox.Plugin.dll;Microsoft.Plugin.Shell.deps.json;Microsoft.Plugin.Shell.dll;Telemetry.dll?>
|
||||
<File Id="Shell_$(var.File)" Source="$(var.BinX64Dir)modules\launcher\Plugins\Microsoft.Plugin.Shell\$(var.File)" />
|
||||
<?endforeach?>
|
||||
</Component>
|
||||
@@ -928,7 +926,7 @@
|
||||
|
||||
<!-- Indexer Plugin -->
|
||||
<Component Id="IndexerComponent" Directory="IndexerPluginFolder" Guid="FEA9816A-B4F7-42CC-99AF-B05F3E7F7EBF">
|
||||
<?foreach File in Microsoft.Plugin.Indexer.deps.json;Microsoft.Plugin.Indexer.dll;plugin.json;Wox.Infrastructure.dll?>
|
||||
<?foreach File in Microsoft.Plugin.Indexer.deps.json;Microsoft.Plugin.Indexer.dll;plugin.json;Wox.Infrastructure.dll;Telemetry.dll?>
|
||||
<File Id="Indexer_$(var.File)" Source="$(var.BinX64Dir)modules\launcher\Plugins\Microsoft.Plugin.Indexer\$(var.File)" />
|
||||
<?endforeach?>
|
||||
</Component>
|
||||
@@ -943,7 +941,7 @@
|
||||
|
||||
<!-- WindowWalker Plugin -->
|
||||
<Component Id="WindowWalkerComponent" Directory="WindowWalkerPluginFolder" Guid="EB1391C9-B701-421F-80FC-ABB2FEDFAD19">
|
||||
<?foreach File in plugin.json;Wox.Infrastructure.dll;Wox.Plugin.dll;Microsoft.Plugin.WindowWalker.deps.json;Microsoft.Plugin.WindowWalker.dll?>
|
||||
<?foreach File in plugin.json;Wox.Infrastructure.dll;Wox.Plugin.dll;Microsoft.Plugin.WindowWalker.deps.json;Microsoft.Plugin.WindowWalker.dll;Telemetry.dll?>
|
||||
<File Id="WindowWalker_$(var.File)" Source="$(var.BinX64Dir)modules\launcher\Plugins\Microsoft.Plugin.WindowWalker\$(var.File)" />
|
||||
<?endforeach?>
|
||||
</Component>
|
||||
@@ -961,4 +959,4 @@
|
||||
|
||||
</ComponentGroup>
|
||||
</Fragment>
|
||||
</Wix>
|
||||
</Wix>
|
||||
63
installer/PowerToysSetup/publish.cmd
Normal file
@@ -0,0 +1,63 @@
|
||||
setlocal enableDelayedExpansion
|
||||
|
||||
IF NOT DEFINED PTRoot (SET PTRoot=..\..)
|
||||
|
||||
rem Publish Settings
|
||||
SET settingsProfileFolderName=!PTRoot!\src\core\Microsoft.PowerToys.Settings.UI.Runner\Properties\PublishProfiles\
|
||||
rem Create the publish profile folder if it doesn't exist
|
||||
IF NOT EXIST !settingsProfileFolderName! (mkdir !settingsProfileFolderName!)
|
||||
SET settingsProfileFileName=SettingsProfile.pubxml
|
||||
SET settingsPublishProfile=!settingsProfileFolderName!!settingsProfileFileName!
|
||||
|
||||
rem Create the publish profile pubxml
|
||||
echo ^<?xml version="1.0" encoding="utf-8"?^> > !settingsPublishProfile!
|
||||
echo ^<^^!-- >> !settingsPublishProfile!
|
||||
echo https://go.microsoft.com/fwlink/?LinkID=208121. >> !settingsPublishProfile!
|
||||
echo --^> >> !settingsPublishProfile!
|
||||
echo ^<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"^> >> !settingsPublishProfile!
|
||||
echo ^<PropertyGroup^> >> !settingsPublishProfile!
|
||||
echo ^<PublishProtocol^>FileSystem^</PublishProtocol^> >> !settingsPublishProfile!
|
||||
echo ^<Configuration^>Release^</Configuration^> >> !settingsPublishProfile!
|
||||
echo ^<Platform^>x64^</Platform^> >> !settingsPublishProfile!
|
||||
echo ^<TargetFramework^>netcoreapp3.1^</TargetFramework^> >> !settingsPublishProfile!
|
||||
echo ^<PublishDir^>..\..\..\x64\Release\SettingsUIRunner^</PublishDir^> >> !settingsPublishProfile!
|
||||
echo ^<RuntimeIdentifier^>win-x64^</RuntimeIdentifier^> >> !settingsPublishProfile!
|
||||
echo ^<SelfContained^>false^</SelfContained^> >> !settingsPublishProfile!
|
||||
echo ^<PublishSingleFile^>False^</PublishSingleFile^> >> !settingsPublishProfile!
|
||||
echo ^<PublishReadyToRun^>False^</PublishReadyToRun^> >> !settingsPublishProfile!
|
||||
echo ^</PropertyGroup^> >> !settingsPublishProfile!
|
||||
echo ^</Project^> >> !settingsPublishProfile!
|
||||
|
||||
rem In case of Release we should not use Debug CRT in VCRT forwarders
|
||||
msbuild !PTRoot!\src\core\Microsoft.PowerToys.Settings.UI.Runner\Microsoft.PowerToys.Settings.UI.Runner.csproj -t:Publish -p:Configuration="Release" -p:Platform="x64" -p:AppxBundle=Never -p:VCRTForwarders-IncludeDebugCRT=false -p:PublishProfile=!settingsProfileFileName!
|
||||
|
||||
|
||||
rem Publish Launcher
|
||||
SET launcherProfileFolderName=!PTRoot!\src\modules\launcher\PowerLauncher\Properties\PublishProfiles\
|
||||
|
||||
rem Create the publish profile folder if it doesn't exist
|
||||
IF NOT EXIST !launcherProfileFolderName! (mkdir !launcherProfileFolderName!)
|
||||
SET launcherProfileFileName=LauncherProfile.pubxml
|
||||
SET launcherPublishProfile=!launcherProfileFolderName!!launcherProfileFileName!
|
||||
|
||||
rem Create the publish profile pubxml
|
||||
echo ^<?xml version="1.0" encoding="utf-8"?^> > !launcherPublishProfile!
|
||||
echo ^<^^!-- >> !launcherPublishProfile!
|
||||
echo https://go.microsoft.com/fwlink/?LinkID=208121. >> !launcherPublishProfile!
|
||||
echo --^> >> !launcherPublishProfile!
|
||||
echo ^<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"^> >> !launcherPublishProfile!
|
||||
echo ^<PropertyGroup^> >> !launcherPublishProfile!
|
||||
echo ^<PublishProtocol^>FileSystem^</PublishProtocol^> >> !launcherPublishProfile!
|
||||
echo ^<Configuration^>Release^</Configuration^> >> !launcherPublishProfile!
|
||||
echo ^<Platform^>x64^</Platform^> >> !launcherPublishProfile!
|
||||
echo ^<TargetFramework^>netcoreapp3.1^</TargetFramework^> >> !launcherPublishProfile!
|
||||
echo ^<PublishDir^>..\..\..\..\x64\Release\modules\launcher^</PublishDir^> >> !launcherPublishProfile!
|
||||
echo ^<RuntimeIdentifier^>win-x64^</RuntimeIdentifier^> >> !launcherPublishProfile!
|
||||
echo ^<SelfContained^>false^</SelfContained^> >> !launcherPublishProfile!
|
||||
echo ^<PublishSingleFile^>False^</PublishSingleFile^> >> !launcherPublishProfile!
|
||||
echo ^<PublishReadyToRun^>False^</PublishReadyToRun^> >> !launcherPublishProfile!
|
||||
echo ^</PropertyGroup^> >> !launcherPublishProfile!
|
||||
echo ^</Project^> >> !launcherPublishProfile!
|
||||
|
||||
rem In case of Release we should not use Debug CRT in VCRT forwarders
|
||||
msbuild !PTRoot!\src\modules\launcher\PowerLauncher\PowerLauncher.csproj -t:Publish -p:Configuration="Release" -p:Platform="x64" -p:AppxBundle=Never -p:VCRTForwarders-IncludeDebugCRT=false -p:PublishProfile=!launcherProfileFileName!
|
||||
@@ -54,7 +54,6 @@
|
||||
<PreprocessorDefinitions>WIN64;_DEBUG;_WINDOWS;_USRDLL;CUSTOMACTIONTEST_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
|
||||
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||
<LanguageStandard>stdcpplatest</LanguageStandard>
|
||||
@@ -77,7 +76,6 @@
|
||||
<PreprocessorDefinitions>WIN64;NDEBUG;_WINDOWS;_USRDLL;CUSTOMACTIONTEST_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||
<LanguageStandard>stdcpplatest</LanguageStandard>
|
||||
@@ -95,11 +93,16 @@
|
||||
<UACExecutionLevel>HighestAvailable</UACExecutionLevel>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(CIBuild)'!='true'">
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<PrecompiledHeaderFile>stdafx.h</PrecompiledHeaderFile>
|
||||
</ClCompile>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="CustomAction.cpp" />
|
||||
<ClCompile Include="stdafx.cpp">
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Create</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Create</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(CIBuild)'!='true'">Create</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<Version>0.18.0</Version>
|
||||
<Version>0.19.0</Version>
|
||||
<DefineConstants>Version=$(Version);</DefineConstants>
|
||||
</PropertyGroup>
|
||||
</Project>
|
||||
5
nuget.config
Normal file
@@ -0,0 +1,5 @@
|
||||
<configuration>
|
||||
<config>
|
||||
<clear />
|
||||
</config>
|
||||
</configuration>
|
||||
@@ -2,3 +2,6 @@
|
||||
|
||||
# SA1201: Elements should appear in the correct order
|
||||
dotnet_diagnostic.SA1201.severity = none
|
||||
|
||||
# CA1303: Do not pass literals as localized parameters
|
||||
dotnet_diagnostic.CA1303.severity = suggestion
|
||||
@@ -5,4 +5,4 @@ The PowerToys are split into DLLs for each PowerToy module ([`modules`](/src/mod
|
||||
|
||||
The settings window is a separate executable, contained in [`settings`](/src/settings) folder. It utilizes a WebView to display an HTML-based settings window (contained in [`settings-web`](/src/settings-web) folder).
|
||||
|
||||
The [`common`](/src/common) contains code for a static libary with helper functions, used by both the runner and the PowerToys modules.
|
||||
The [`common`](/src/common) contains code for a static library with helper functions, used by both the runner and the PowerToys modules.
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
|
||||
#include <common/common.h>
|
||||
#include <common/updating/updating.h>
|
||||
#include <common/updating/http_client.h>
|
||||
|
||||
#include <winrt/Windows.ApplicationModel.h>
|
||||
#include <winrt/Windows.Storage.h>
|
||||
@@ -56,18 +57,11 @@ std::optional<fs::path> copy_self_to_temp_dir()
|
||||
return std::move(dst_path);
|
||||
}
|
||||
|
||||
bool install_new_version_stage_1(const bool must_restart = false)
|
||||
bool install_new_version_stage_1(const std::wstring_view installer_filename, const bool must_restart = false)
|
||||
{
|
||||
std::optional<fs::path> installer;
|
||||
for (auto path : fs::directory_iterator{ updating::get_pending_updates_path() })
|
||||
{
|
||||
if (path.path().native().find(updating::installer_filename_pattern) != std::wstring::npos)
|
||||
{
|
||||
installer.emplace(std::move(path));
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!installer)
|
||||
const fs::path installer{ updating::get_pending_updates_path() / installer_filename };
|
||||
|
||||
if (!fs::is_regular_file(installer))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@@ -84,7 +78,7 @@ bool install_new_version_stage_1(const bool must_restart = false)
|
||||
|
||||
std::wstring arguments{ UPDATE_NOW_LAUNCH_STAGE2_CMDARG };
|
||||
arguments += L" \"";
|
||||
arguments += installer->c_str();
|
||||
arguments += installer.c_str();
|
||||
arguments += L"\" \"";
|
||||
arguments += get_module_folderpath();
|
||||
arguments += L"\" ";
|
||||
@@ -103,15 +97,35 @@ bool install_new_version_stage_1(const bool must_restart = false)
|
||||
}
|
||||
}
|
||||
|
||||
bool install_new_version_stage_2(std::wstring_view installer_path, std::wstring_view install_path, const bool launch_powertoys)
|
||||
bool install_new_version_stage_2(std::wstring installer_path, std::wstring_view install_path, const bool launch_powertoys)
|
||||
{
|
||||
if (MsiInstallProductW(installer_path.data(), nullptr) != ERROR_SUCCESS)
|
||||
std::transform(begin(installer_path), end(installer_path), begin(installer_path), ::towlower);
|
||||
|
||||
bool success = true;
|
||||
|
||||
if (installer_path.ends_with(L".msi"))
|
||||
{
|
||||
return false;
|
||||
success = MsiInstallProductW(installer_path.data(), nullptr) == ERROR_SUCCESS;
|
||||
}
|
||||
else
|
||||
{
|
||||
// If it's not .msi, then it's our .exe installer
|
||||
SHELLEXECUTEINFOW sei{ sizeof(sei) };
|
||||
sei.fMask = { SEE_MASK_FLAG_NO_UI | SEE_MASK_NOASYNC };
|
||||
sei.lpFile = installer_path.c_str();
|
||||
sei.nShow = SW_SHOWNORMAL;
|
||||
|
||||
success = ShellExecuteExW(&sei) == TRUE;
|
||||
}
|
||||
|
||||
std::error_code _;
|
||||
fs::remove(installer_path, _);
|
||||
|
||||
if (!success)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (launch_powertoys)
|
||||
{
|
||||
std::wstring new_pt_path{ install_path };
|
||||
@@ -151,7 +165,8 @@ bool install_dotnet()
|
||||
{
|
||||
try
|
||||
{
|
||||
updating::try_download_file(dotnet_download_path, download_link).wait();
|
||||
http::HttpClient client;
|
||||
client.download(download_link, dotnet_download_path).wait();
|
||||
download_success = true;
|
||||
break;
|
||||
}
|
||||
@@ -186,7 +201,68 @@ int WINAPI WinMain(HINSTANCE, HINSTANCE, LPSTR, int)
|
||||
}
|
||||
std::wstring_view action{ args[1] };
|
||||
|
||||
if (action == L"-install_dotnet")
|
||||
if (action == L"-run-non-elevated")
|
||||
{
|
||||
int nextArg = 2;
|
||||
|
||||
std::wstring_view target;
|
||||
std::wstring_view pidFile;
|
||||
std::wstring params;
|
||||
|
||||
while (nextArg < nArgs)
|
||||
{
|
||||
if (std::wstring_view(args[nextArg]) == L"-target" && nextArg + 1 < nArgs)
|
||||
{
|
||||
target = args[nextArg + 1];
|
||||
nextArg += 2;
|
||||
}
|
||||
else if (std::wstring_view(args[nextArg]) == L"-pidFile" && nextArg + 1 < nArgs)
|
||||
{
|
||||
pidFile = args[nextArg + 1];
|
||||
nextArg += 2;
|
||||
}
|
||||
else
|
||||
{
|
||||
params = args[nextArg];
|
||||
nextArg++;
|
||||
}
|
||||
}
|
||||
|
||||
HANDLE hMapFile = NULL;
|
||||
PDWORD pidBuffer = NULL;
|
||||
|
||||
if (!pidFile.empty())
|
||||
{
|
||||
hMapFile = OpenFileMappingW(FILE_MAP_WRITE, FALSE, pidFile.data());
|
||||
if (hMapFile)
|
||||
{
|
||||
pidBuffer = reinterpret_cast<PDWORD>(MapViewOfFile(hMapFile, FILE_MAP_ALL_ACCESS, 0, 0, sizeof(DWORD)));
|
||||
if (pidBuffer)
|
||||
{
|
||||
*pidBuffer = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
run_same_elevation(target.data(), params, pidBuffer);
|
||||
|
||||
// cleanup
|
||||
if (!pidFile.empty())
|
||||
{
|
||||
if (pidBuffer)
|
||||
{
|
||||
FlushViewOfFile(pidBuffer, sizeof(DWORD));
|
||||
UnmapViewOfFile(pidBuffer);
|
||||
}
|
||||
|
||||
if (hMapFile)
|
||||
{
|
||||
FlushFileBuffers(hMapFile);
|
||||
CloseHandle(hMapFile);
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (action == L"-install_dotnet")
|
||||
{
|
||||
if (dotnet_is_installed())
|
||||
{
|
||||
@@ -200,11 +276,13 @@ int WINAPI WinMain(HINSTANCE, HINSTANCE, LPSTR, int)
|
||||
}
|
||||
else if (action == UPDATE_NOW_LAUNCH_STAGE1_CMDARG)
|
||||
{
|
||||
return !install_new_version_stage_1();
|
||||
std::wstring_view installerFilename{ args[2] };
|
||||
return !install_new_version_stage_1(installerFilename);
|
||||
}
|
||||
else if (action == UPDATE_NOW_LAUNCH_STAGE1_START_PT_CMDARG)
|
||||
{
|
||||
return !install_new_version_stage_1(true);
|
||||
std::wstring_view installerFilename{ args[2] };
|
||||
return !install_new_version_stage_1(installerFilename, true);
|
||||
}
|
||||
else if (action == UPDATE_NOW_LAUNCH_STAGE2_CMDARG)
|
||||
{
|
||||
@@ -213,4 +291,4 @@ int WINAPI WinMain(HINSTANCE, HINSTANCE, LPSTR, int)
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
// Microsoft Visual C++ generated resource script.
|
||||
//
|
||||
#include <windows.h>
|
||||
#include "resource.h"
|
||||
#include "../common/version.h"
|
||||
|
||||
@@ -10,34 +9,34 @@ BEGIN
|
||||
END
|
||||
|
||||
1 VERSIONINFO
|
||||
FILEVERSION FILE_VERSION
|
||||
PRODUCTVERSION PRODUCT_VERSION
|
||||
FILEFLAGSMASK 0x3fL
|
||||
FILEVERSION FILE_VERSION
|
||||
PRODUCTVERSION PRODUCT_VERSION
|
||||
FILEFLAGSMASK VS_FFI_FILEFLAGSMASK
|
||||
#ifdef _DEBUG
|
||||
FILEFLAGS 0x1L
|
||||
FILEFLAGS VS_FF_DEBUG
|
||||
#else
|
||||
FILEFLAGS 0x0L
|
||||
FILEFLAGS 0x0L
|
||||
#endif
|
||||
FILEOS 0x40004L
|
||||
FILETYPE 0x1L
|
||||
FILESUBTYPE 0x0L
|
||||
FILEOS VOS_NT_WINDOWS32
|
||||
FILETYPE VFT_DLL
|
||||
FILESUBTYPE VFT2_UNKNOWN
|
||||
BEGIN
|
||||
BLOCK "StringFileInfo"
|
||||
BEGIN
|
||||
BLOCK "040904b0"
|
||||
BLOCK "040904b0" // US English (0x0409), Unicode (0x04B0) charset
|
||||
BEGIN
|
||||
VALUE "CompanyName", COMPANY_NAME
|
||||
VALUE "FileDescription", "PowerToys Action Runner"
|
||||
VALUE "FileDescription", FILE_DESCRIPTION
|
||||
VALUE "FileVersion", FILE_VERSION_STRING
|
||||
VALUE "InternalName", "PowerToys Action Runner"
|
||||
VALUE "InternalName", INTERNAL_NAME
|
||||
VALUE "LegalCopyright", COPYRIGHT_NOTE
|
||||
VALUE "OriginalFilename", "action_runner.exe"
|
||||
VALUE "ProductName", "PowerToys"
|
||||
VALUE "OriginalFilename", ORIGINAL_FILENAME
|
||||
VALUE "ProductName", PRODUCT_NAME
|
||||
VALUE "ProductVersion", PRODUCT_VERSION_STRING
|
||||
END
|
||||
END
|
||||
BLOCK "VarFileInfo"
|
||||
BEGIN
|
||||
VALUE "Translation", 0x409, 1200
|
||||
VALUE "Translation", 0x409, 1200 // US English (0x0409), Unicode (1200) charset
|
||||
END
|
||||
END
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="..\..\packages\Microsoft.Windows.CppWinRT.2.0.200316.3\build\native\Microsoft.Windows.CppWinRT.props" Condition="Exists('..\..\packages\Microsoft.Windows.CppWinRT.2.0.200316.3\build\native\Microsoft.Windows.CppWinRT.props')" />
|
||||
<Import Project="..\..\packages\Microsoft.Windows.CppWinRT.2.0.200514.2\build\native\Microsoft.Windows.CppWinRT.props" Condition="Exists('..\..\packages\Microsoft.Windows.CppWinRT.2.0.200514.2\build\native\Microsoft.Windows.CppWinRT.props')" />
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
@@ -165,20 +165,20 @@
|
||||
<ClInclude Include="resource.h" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="packages.config" />
|
||||
<ResourceCompile Include="action_runner.rc" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ResourceCompile Include="action_runner.rc" />
|
||||
<None Include="packages.config" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
<Import Project="..\..\packages\Microsoft.Windows.CppWinRT.2.0.200316.3\build\native\Microsoft.Windows.CppWinRT.targets" Condition="Exists('..\..\packages\Microsoft.Windows.CppWinRT.2.0.200316.3\build\native\Microsoft.Windows.CppWinRT.targets')" />
|
||||
<Import Project="..\..\packages\Microsoft.Windows.CppWinRT.2.0.200514.2\build\native\Microsoft.Windows.CppWinRT.targets" Condition="Exists('..\..\packages\Microsoft.Windows.CppWinRT.2.0.200514.2\build\native\Microsoft.Windows.CppWinRT.targets')" />
|
||||
</ImportGroup>
|
||||
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
|
||||
<PropertyGroup>
|
||||
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
|
||||
</PropertyGroup>
|
||||
<Error Condition="!Exists('..\..\packages\Microsoft.Windows.CppWinRT.2.0.200316.3\build\native\Microsoft.Windows.CppWinRT.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Microsoft.Windows.CppWinRT.2.0.200316.3\build\native\Microsoft.Windows.CppWinRT.props'))" />
|
||||
<Error Condition="!Exists('..\..\packages\Microsoft.Windows.CppWinRT.2.0.200316.3\build\native\Microsoft.Windows.CppWinRT.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Microsoft.Windows.CppWinRT.2.0.200316.3\build\native\Microsoft.Windows.CppWinRT.targets'))" />
|
||||
<Error Condition="!Exists('..\..\packages\Microsoft.Windows.CppWinRT.2.0.200514.2\build\native\Microsoft.Windows.CppWinRT.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Microsoft.Windows.CppWinRT.2.0.200514.2\build\native\Microsoft.Windows.CppWinRT.props'))" />
|
||||
<Error Condition="!Exists('..\..\packages\Microsoft.Windows.CppWinRT.2.0.200514.2\build\native\Microsoft.Windows.CppWinRT.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Microsoft.Windows.CppWinRT.2.0.200514.2\build\native\Microsoft.Windows.CppWinRT.targets'))" />
|
||||
</Target>
|
||||
</Project>
|
||||
@@ -1,4 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="Microsoft.Windows.CppWinRT" version="2.0.200316.3" targetFramework="native" />
|
||||
<package id="Microsoft.Windows.CppWinRT" version="2.0.200514.2" targetFramework="native" />
|
||||
</packages>
|
||||
@@ -1,3 +1,16 @@
|
||||
//{{NO_DEPENDENCIES}}
|
||||
// Microsoft Visual C++ generated include file.
|
||||
// Used by action_runner.rc
|
||||
|
||||
//////////////////////////////
|
||||
// Non-localizable
|
||||
|
||||
#define FILE_DESCRIPTION "PowerToys ActionRunner"
|
||||
#define INTERNAL_NAME "action_runner"
|
||||
#define ORIGINAL_FILENAME "action_runner.exe"
|
||||
|
||||
// Non-localizable
|
||||
//////////////////////////////
|
||||
|
||||
#define IDS_DOTNET_CORE_DOWNLOAD_FAILURE 101
|
||||
#define IDS_DOTNET_CORE_DOWNLOAD_FAILURE_TITLE 102
|
||||
|
||||
|
||||
39
src/common/ManagedCommon/ManagedCommon.csproj
Normal file
@@ -0,0 +1,39 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<Import Project="..\..\..\installer\Version.props" />
|
||||
<PropertyGroup>
|
||||
<TargetFramework>netstandard2.0</TargetFramework>
|
||||
<Platforms>x64</Platforms>
|
||||
<PlatformTarget>x64</PlatformTarget>
|
||||
<TargetFramework>netstandard2.0</TargetFramework>
|
||||
<Version>$(Version).0</Version>
|
||||
<Authors>Microsoft Corporation</Authors>
|
||||
<Product>PowerToys</Product>
|
||||
<Description>PowerToys ManagedCommon</Description>
|
||||
<Copyright>Copyright (C) 2020 Microsoft Corporation</Copyright>
|
||||
<RepositoryUrl>https://github.com/microsoft/PowerToys</RepositoryUrl>
|
||||
<RepositoryType>Github</RepositoryType>
|
||||
<PackageTags>PowerToys</PackageTags>
|
||||
<NeutralLanguage>en-US</NeutralLanguage>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.CodeAnalysis.FxCopAnalyzers" Version="2.9.6">
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
</PackageReference>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\ManagedTelemetry\Telemetry\Telemetry.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
14
src/common/ManagedCommon/NativeMethods.cs
Normal file
@@ -0,0 +1,14 @@
|
||||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace ManagedCommon
|
||||
{
|
||||
internal static class NativeMethods
|
||||
{
|
||||
[DllImport("kernel32.dll", SetLastError = true)]
|
||||
internal static extern IntPtr OpenProcess(uint processAccess, bool bInheritHandle, int processId);
|
||||
|
||||
[DllImport("kernel32.dll", SetLastError = true)]
|
||||
internal static extern uint WaitForSingleObject(IntPtr hHandle, uint dwMilliseconds);
|
||||
}
|
||||
}
|
||||
35
src/common/ManagedCommon/RunnerHelper.cs
Normal file
@@ -0,0 +1,35 @@
|
||||
using Microsoft.PowerToys.Telemetry;
|
||||
using Microsoft.PowerToys.Telemetry.Events;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Reflection;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ManagedCommon
|
||||
{
|
||||
public static class RunnerHelper
|
||||
{
|
||||
public static void WaitForPowerToysRunner(int powerToysPID, Action act)
|
||||
{
|
||||
var stackTrace = new StackTrace();
|
||||
var assembly = Assembly.GetCallingAssembly().GetName();
|
||||
var callingMethod = stackTrace.GetFrame(1).GetMethod().Name;
|
||||
PowerToysTelemetry.Log.WriteEvent(new DebugEvent() { Message = $"[{assembly}][{callingMethod}]WaitForPowerToysRunner waiting for Event powerToysPID={powerToysPID}" });
|
||||
Task.Run(() =>
|
||||
{
|
||||
const uint INFINITE = 0xFFFFFFFF;
|
||||
const uint WAIT_OBJECT_0 = 0x00000000;
|
||||
const uint SYNCHRONIZE = 0x00100000;
|
||||
|
||||
IntPtr powerToysProcHandle = NativeMethods.OpenProcess(SYNCHRONIZE, false, powerToysPID);
|
||||
if (NativeMethods.WaitForSingleObject(powerToysProcHandle, INFINITE) == WAIT_OBJECT_0)
|
||||
{
|
||||
PowerToysTelemetry.Log.WriteEvent(new DebugEvent() { Message = $"[{assembly}][{callingMethod}]WaitForPowerToysRunner Event Notified powerToysPID={powerToysPID}" });
|
||||
act.Invoke();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
14
src/common/ManagedTelemetry/Telemetry/Events/DebugEvent.cs
Normal file
@@ -0,0 +1,14 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics.Tracing;
|
||||
using System.Text;
|
||||
|
||||
namespace Microsoft.PowerToys.Telemetry.Events
|
||||
{
|
||||
[EventData]
|
||||
public class DebugEvent : EventBase, IEvent
|
||||
{
|
||||
public string Message { get; set; }
|
||||
public PartA_PrivTags PartA_PrivTags => PartA_PrivTags.ProductAndServicePerformance;
|
||||
}
|
||||
}
|
||||
@@ -1,9 +1,19 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<Import Project="..\..\..\..\installer\Version.props" />
|
||||
<PropertyGroup>
|
||||
<Platforms>x64</Platforms>
|
||||
<PlatformTarget>x64</PlatformTarget>
|
||||
<TargetFramework>netstandard2.0</TargetFramework>
|
||||
<Version>$(Version).0</Version>
|
||||
<Authors>Microsoft Corporation</Authors>
|
||||
<Product>PowerToys</Product>
|
||||
<Description>PowerToys Telemetry</Description>
|
||||
<Copyright>Copyright (C) 2020 Microsoft Corporation</Copyright>
|
||||
<RepositoryUrl>https://github.com/microsoft/PowerToys</RepositoryUrl>
|
||||
<RepositoryType>Github</RepositoryType>
|
||||
<PackageTags>PowerToys</PackageTags>
|
||||
<NeutralLanguage>en-US</NeutralLanguage>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
64
src/common/RestartManagement.cpp
Normal file
@@ -0,0 +1,64 @@
|
||||
#include "pch.h"
|
||||
#include "RestartManagement.h"
|
||||
|
||||
#include <RestartManager.h>
|
||||
#include <Psapi.h>
|
||||
|
||||
std::vector<RM_UNIQUE_PROCESS> GetProcessInfoByName(const std::wstring& processName)
|
||||
{
|
||||
DWORD bytesReturned{};
|
||||
std::vector<DWORD> processIds{};
|
||||
processIds.resize(1024);
|
||||
DWORD processIdSize{ (DWORD)processIds.size() * sizeof(DWORD) };
|
||||
EnumProcesses(processIds.data(), processIdSize, &bytesReturned);
|
||||
while (bytesReturned == processIdSize)
|
||||
{
|
||||
processIdSize *= 2;
|
||||
processIds.resize(processIdSize / sizeof(DWORD));
|
||||
EnumProcesses(processIds.data(), processIdSize, &bytesReturned);
|
||||
}
|
||||
std::vector<RM_UNIQUE_PROCESS> pInfos{};
|
||||
for (const DWORD& processId : processIds)
|
||||
{
|
||||
HANDLE hProcess = OpenProcess(PROCESS_QUERY_INFORMATION | PROCESS_VM_READ, FALSE, processId);
|
||||
if (hProcess)
|
||||
{
|
||||
wchar_t name[MAX_PATH];
|
||||
if (GetProcessImageFileName(hProcess, name, MAX_PATH) > 0)
|
||||
{
|
||||
if (processName == PathFindFileName(name))
|
||||
{
|
||||
FILETIME creationTime{};
|
||||
FILETIME exitTime{};
|
||||
FILETIME kernelTime{};
|
||||
FILETIME userTime{};
|
||||
if (GetProcessTimes(hProcess, &creationTime, &exitTime, &kernelTime, &userTime))
|
||||
{
|
||||
pInfos.push_back({ processId, creationTime });
|
||||
}
|
||||
}
|
||||
}
|
||||
CloseHandle(hProcess);
|
||||
}
|
||||
}
|
||||
return pInfos;
|
||||
}
|
||||
|
||||
void RestartProcess(const std::wstring& processName)
|
||||
{
|
||||
DWORD sessionHandle{};
|
||||
WCHAR sessionKey[CCH_RM_SESSION_KEY + 1];
|
||||
if (RmStartSession(&sessionHandle, 0, sessionKey) != ERROR_SUCCESS)
|
||||
{
|
||||
return;
|
||||
}
|
||||
std::vector<RM_UNIQUE_PROCESS> pInfo = GetProcessInfoByName(processName);
|
||||
if (pInfo.empty() ||
|
||||
RmRegisterResources(sessionHandle, 0, nullptr, sizeof(pInfo), pInfo.data(), 0, nullptr) != ERROR_SUCCESS)
|
||||
{
|
||||
return;
|
||||
}
|
||||
RmShutdown(sessionHandle, RmForceShutdown, nullptr);
|
||||
RmRestart(sessionHandle, 0, nullptr);
|
||||
RmEndSession(sessionHandle);
|
||||
}
|
||||
5
src/common/RestartManagement.h
Normal file
@@ -0,0 +1,5 @@
|
||||
#pragma once
|
||||
|
||||
#include <string>
|
||||
|
||||
void RestartProcess(const std::wstring& processName);
|
||||
@@ -364,7 +364,7 @@ namespace UnitTestsCommonLib
|
||||
const auto value = true;
|
||||
|
||||
Settings settings(nullptr, m_moduleName);
|
||||
settings.add_bool_toogle(m_defaultSettingsName, m_defaultSettingsDescription, value);
|
||||
settings.add_bool_toggle(m_defaultSettingsName, m_defaultSettingsDescription, value);
|
||||
|
||||
auto expected = m_defaultSettingsJson;
|
||||
auto expectedProperties = createSettingsProperties(L"bool_toggle");
|
||||
@@ -381,7 +381,7 @@ namespace UnitTestsCommonLib
|
||||
const auto value = false;
|
||||
|
||||
Settings settings(nullptr, m_moduleName);
|
||||
settings.add_bool_toogle(m_defaultSettingsName, m_defaultSettingsDescription, value);
|
||||
settings.add_bool_toggle(m_defaultSettingsName, m_defaultSettingsDescription, value);
|
||||
|
||||
auto expected = m_defaultSettingsJson;
|
||||
auto expectedProperties = createSettingsProperties(L"bool_toggle");
|
||||
|
||||
36
src/common/UnitTests-CommonLib/UnitTests-CommonLib.rc
Normal file
@@ -0,0 +1,36 @@
|
||||
#include <windows.h>
|
||||
#include "resource.h"
|
||||
#include "../version.h"
|
||||
|
||||
1 VERSIONINFO
|
||||
FILEVERSION FILE_VERSION
|
||||
PRODUCTVERSION PRODUCT_VERSION
|
||||
FILEFLAGSMASK VS_FFI_FILEFLAGSMASK
|
||||
#ifdef _DEBUG
|
||||
FILEFLAGS VS_FF_DEBUG
|
||||
#else
|
||||
FILEFLAGS 0x0L
|
||||
#endif
|
||||
FILEOS VOS_NT_WINDOWS32
|
||||
FILETYPE VFT_DLL
|
||||
FILESUBTYPE VFT2_UNKNOWN
|
||||
BEGIN
|
||||
BLOCK "StringFileInfo"
|
||||
BEGIN
|
||||
BLOCK "040904b0" // US English (0x0409), Unicode (0x04B0) charset
|
||||
BEGIN
|
||||
VALUE "CompanyName", COMPANY_NAME
|
||||
VALUE "FileDescription", FILE_DESCRIPTION
|
||||
VALUE "FileVersion", FILE_VERSION_STRING
|
||||
VALUE "InternalName", INTERNAL_NAME
|
||||
VALUE "LegalCopyright", COPYRIGHT_NOTE
|
||||
VALUE "OriginalFilename", ORIGINAL_FILENAME
|
||||
VALUE "ProductName", PRODUCT_NAME
|
||||
VALUE "ProductVersion", PRODUCT_VERSION_STRING
|
||||
END
|
||||
END
|
||||
BLOCK "VarFileInfo"
|
||||
BEGIN
|
||||
VALUE "Translation", 0x409, 1200 // US English (0x0409), Unicode (1200) charset
|
||||
END
|
||||
END
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="..\..\..\packages\Microsoft.Windows.CppWinRT.2.0.200316.3\build\native\Microsoft.Windows.CppWinRT.props" Condition="Exists('..\..\..\packages\Microsoft.Windows.CppWinRT.2.0.200316.3\build\native\Microsoft.Windows.CppWinRT.props')" />
|
||||
<Import Project="..\..\..\packages\Microsoft.Windows.CppWinRT.2.0.200514.2\build\native\Microsoft.Windows.CppWinRT.props" Condition="Exists('..\..\..\packages\Microsoft.Windows.CppWinRT.2.0.200514.2\build\native\Microsoft.Windows.CppWinRT.props')" />
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|x64">
|
||||
<Configuration>Debug</Configuration>
|
||||
@@ -59,7 +59,6 @@
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
@@ -68,7 +67,6 @@
|
||||
<AdditionalIncludeDirectories>..\;..\Telemetry;..\..\..\deps\cpprestsdk\include;$(VCInstallDir)UnitTest\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<UseFullPaths>true</UseFullPaths>
|
||||
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
|
||||
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
|
||||
<LanguageStandard>stdcpplatest</LanguageStandard>
|
||||
</ClCompile>
|
||||
@@ -82,14 +80,12 @@
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<AdditionalIncludeDirectories>$(VCInstallDir)UnitTest\include;..\;..\..\..\deps\cpprestsdk\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<UseFullPaths>true</UseFullPaths>
|
||||
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
|
||||
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
|
||||
<LanguageStandard>stdcpplatest</LanguageStandard>
|
||||
</ClCompile>
|
||||
@@ -99,17 +95,23 @@
|
||||
<AdditionalDependencies>RuntimeObject.lib;shlwapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(CIBuild)'!='true'">
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
|
||||
</ClCompile>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="UnitTestsCommon.cpp" />
|
||||
<ClCompile Include="UnitTestsVersionHelper.cpp" />
|
||||
<ClCompile Include="pch.cpp">
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Create</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Create</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(CIBuild)'!='true'">Create</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Settings.Tests.cpp" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="pch.h" />
|
||||
<ClInclude Include="resource.h" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\common.vcxproj">
|
||||
@@ -119,15 +121,18 @@
|
||||
<ItemGroup>
|
||||
<None Include="packages.config" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ResourceCompile Include="UnitTests-CommonLib.rc" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
<Import Project="..\..\..\packages\Microsoft.Windows.CppWinRT.2.0.200316.3\build\native\Microsoft.Windows.CppWinRT.targets" Condition="Exists('..\..\..\packages\Microsoft.Windows.CppWinRT.2.0.200316.3\build\native\Microsoft.Windows.CppWinRT.targets')" />
|
||||
<Import Project="..\..\..\packages\Microsoft.Windows.CppWinRT.2.0.200514.2\build\native\Microsoft.Windows.CppWinRT.targets" Condition="Exists('..\..\..\packages\Microsoft.Windows.CppWinRT.2.0.200514.2\build\native\Microsoft.Windows.CppWinRT.targets')" />
|
||||
</ImportGroup>
|
||||
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
|
||||
<PropertyGroup>
|
||||
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
|
||||
</PropertyGroup>
|
||||
<Error Condition="!Exists('..\..\..\packages\Microsoft.Windows.CppWinRT.2.0.200316.3\build\native\Microsoft.Windows.CppWinRT.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\packages\Microsoft.Windows.CppWinRT.2.0.200316.3\build\native\Microsoft.Windows.CppWinRT.props'))" />
|
||||
<Error Condition="!Exists('..\..\..\packages\Microsoft.Windows.CppWinRT.2.0.200316.3\build\native\Microsoft.Windows.CppWinRT.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\packages\Microsoft.Windows.CppWinRT.2.0.200316.3\build\native\Microsoft.Windows.CppWinRT.targets'))" />
|
||||
<Error Condition="!Exists('..\..\..\packages\Microsoft.Windows.CppWinRT.2.0.200514.2\build\native\Microsoft.Windows.CppWinRT.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\packages\Microsoft.Windows.CppWinRT.2.0.200514.2\build\native\Microsoft.Windows.CppWinRT.props'))" />
|
||||
<Error Condition="!Exists('..\..\..\packages\Microsoft.Windows.CppWinRT.2.0.200514.2\build\native\Microsoft.Windows.CppWinRT.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\packages\Microsoft.Windows.CppWinRT.2.0.200514.2\build\native\Microsoft.Windows.CppWinRT.targets'))" />
|
||||
</Target>
|
||||
</Project>
|
||||
@@ -32,8 +32,16 @@
|
||||
<ClInclude Include="pch.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="resource.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="packages.config" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ResourceCompile Include="UnitTests-CommonLib.rc">
|
||||
<Filter>Resource Files</Filter>
|
||||
</ResourceCompile>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
@@ -13,7 +13,7 @@ namespace UnitTestsVersionHelper
|
||||
TEST_CLASS (UnitTestsVersionHelper)
|
||||
{
|
||||
public:
|
||||
TEST_METHOD (integerConstructorShouldProprelyInitializateVersionNumbers)
|
||||
TEST_METHOD (integerConstructorShouldProperlyInitializationVersionNumbers)
|
||||
{
|
||||
VersionHelper sut(MAJOR_VERSION_0, MINOR_VERSION_12, REVISION_VERSION_0);
|
||||
|
||||
@@ -21,7 +21,7 @@ namespace UnitTestsVersionHelper
|
||||
Assert::AreEqual(MINOR_VERSION_12, sut.minor);
|
||||
Assert::AreEqual(REVISION_VERSION_0, sut.revision);
|
||||
}
|
||||
TEST_METHOD (integerConstructorShouldProprelyInitializateWithDifferentVersionNumbers)
|
||||
TEST_METHOD (integerConstructorShouldProperlyInitializationWithDifferentVersionNumbers)
|
||||
{
|
||||
const int testcaseMajor = 2;
|
||||
const int testcaseMinor = 25;
|
||||
@@ -32,7 +32,7 @@ namespace UnitTestsVersionHelper
|
||||
Assert::AreEqual(testcaseMinor, sut.minor);
|
||||
Assert::AreEqual(testcaseRevision, sut.revision);
|
||||
}
|
||||
TEST_METHOD (stringConstructorShouldProprelyInitializateVersionNumbers)
|
||||
TEST_METHOD (stringConstructorShouldProperlyInitializationVersionNumbers)
|
||||
{
|
||||
VersionHelper sut("v0.12.3");
|
||||
|
||||
@@ -40,7 +40,7 @@ namespace UnitTestsVersionHelper
|
||||
Assert::AreEqual(12, sut.minor);
|
||||
Assert::AreEqual(3, sut.revision);
|
||||
}
|
||||
TEST_METHOD (stringConstructorShouldProprelyInitializateWithDifferentVersionNumbers)
|
||||
TEST_METHOD (stringConstructorShouldProperlyInitializationWithDifferentVersionNumbers)
|
||||
{
|
||||
VersionHelper sut("v2.25.1");
|
||||
|
||||
@@ -48,28 +48,28 @@ namespace UnitTestsVersionHelper
|
||||
Assert::AreEqual(25, sut.minor);
|
||||
Assert::AreEqual(1, sut.revision);
|
||||
}
|
||||
TEST_METHOD (whenMajorVersionIsGreaterComparationOperatorShouldReturnProperValue)
|
||||
TEST_METHOD (whenMajorVersionIsGreaterComparisonOperatorShouldReturnProperValue)
|
||||
{
|
||||
VersionHelper lhs(MAJOR_VERSION_0 + 1, MINOR_VERSION_12, REVISION_VERSION_0);
|
||||
VersionHelper rhs(MAJOR_VERSION_0, MINOR_VERSION_12, REVISION_VERSION_0);
|
||||
|
||||
Assert::IsTrue(lhs > rhs);
|
||||
}
|
||||
TEST_METHOD (whenMajorVersionIsLesserComparationOperatorShouldReturnProperValue)
|
||||
TEST_METHOD (whenMajorVersionIsLesserComparisonOperatorShouldReturnProperValue)
|
||||
{
|
||||
VersionHelper lhs(MAJOR_VERSION_0, MINOR_VERSION_12, REVISION_VERSION_0);
|
||||
VersionHelper rhs(MAJOR_VERSION_0 + 1, MINOR_VERSION_12, REVISION_VERSION_0);
|
||||
|
||||
Assert::IsFalse(lhs > rhs);
|
||||
}
|
||||
TEST_METHOD (whenMajorVersionIsEqualComparationOperatorShouldCompareMinorVersionValue)
|
||||
TEST_METHOD (whenMajorVersionIsEqualComparisonOperatorShouldCompareMinorVersionValue)
|
||||
{
|
||||
VersionHelper lhs(MAJOR_VERSION_0, MINOR_VERSION_12, REVISION_VERSION_0);
|
||||
VersionHelper rhs(MAJOR_VERSION_0, MINOR_VERSION_12 - 1, REVISION_VERSION_0);
|
||||
|
||||
Assert::IsTrue(lhs > rhs);
|
||||
}
|
||||
TEST_METHOD (whenMajorVersionIsEqualComparationOperatorShouldCompareMinorVersionValue2)
|
||||
TEST_METHOD (whenMajorVersionIsEqualComparisonOperatorShouldCompareMinorVersionValue2)
|
||||
{
|
||||
VersionHelper lhs(MAJOR_VERSION_0, MINOR_VERSION_12 - 1, REVISION_VERSION_0);
|
||||
VersionHelper rhs(MAJOR_VERSION_0, MINOR_VERSION_12, REVISION_VERSION_0);
|
||||
@@ -77,14 +77,14 @@ namespace UnitTestsVersionHelper
|
||||
Assert::IsFalse(lhs > rhs);
|
||||
}
|
||||
|
||||
TEST_METHOD (whenMajorAndMinorVersionIsEqualComparationOperatorShouldCompareRevisionValue)
|
||||
TEST_METHOD (whenMajorAndMinorVersionIsEqualComparisonOperatorShouldCompareRevisionValue)
|
||||
{
|
||||
VersionHelper lhs(MAJOR_VERSION_0, MINOR_VERSION_12, REVISION_VERSION_0 + 1);
|
||||
VersionHelper rhs(MAJOR_VERSION_0, MINOR_VERSION_12, REVISION_VERSION_0);
|
||||
|
||||
Assert::IsTrue(lhs > rhs);
|
||||
}
|
||||
TEST_METHOD (whenMajorAndMinorVersionIsEqualComparationOperatorShouldCompareRevisionValue2)
|
||||
TEST_METHOD (whenMajorAndMinorVersionIsEqualComparisonOperatorShouldCompareRevisionValue2)
|
||||
{
|
||||
VersionHelper lhs(MAJOR_VERSION_0, MINOR_VERSION_12, REVISION_VERSION_0);
|
||||
VersionHelper rhs(MAJOR_VERSION_0, MINOR_VERSION_12, REVISION_VERSION_0 + 1);
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="Microsoft.Windows.CppWinRT" version="2.0.200316.3" targetFramework="native" />
|
||||
<package id="Microsoft.Windows.CppWinRT" version="2.0.200514.2" targetFramework="native" />
|
||||
</packages>
|
||||
13
src/common/UnitTests-CommonLib/resource.h
Normal file
@@ -0,0 +1,13 @@
|
||||
//{{NO_DEPENDENCIES}}
|
||||
// Microsoft Visual C++ generated include file.
|
||||
// Used by UnitTests-CommonLib.rc
|
||||
|
||||
//////////////////////////////
|
||||
// Non-localizable
|
||||
|
||||
#define FILE_DESCRIPTION "PowerToys UnitTests-CommonLib"
|
||||
#define INTERNAL_NAME "UnitTests-CommonLib"
|
||||
#define ORIGINAL_FILENAME "UnitTests-CommonLib.dll"
|
||||
|
||||
// Non-localizable
|
||||
//////////////////////////////
|
||||
@@ -3,12 +3,12 @@
|
||||
|
||||
/*
|
||||
Usage:
|
||||
When creating animation contstructor takes one parameter - how long
|
||||
When creating animation constructor takes one parameter - how long
|
||||
should the animation take in seconds.
|
||||
|
||||
Call reset() when starting animation.
|
||||
|
||||
When redering, call value() to get value from 0 to 1 - depending on animation
|
||||
When rendering, call value() to get value from 0 to 1 - depending on animation
|
||||
progress.
|
||||
*/
|
||||
class Animation
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
<ProjectGuid>{985B3F2F-CEED-4C0A-A249-69257E719145}</ProjectGuid>
|
||||
<Keyword>Win32Proj</Keyword>
|
||||
<RootNamespace>commonmdflag</RootNamespace>
|
||||
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
|
||||
<WindowsTargetPlatformVersion>10.0.17134.0</WindowsTargetPlatformVersion>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
@@ -53,16 +53,14 @@
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
|
||||
<ConformanceMode>false</ConformanceMode>
|
||||
<LanguageStandard>stdcpplatest</LanguageStandard>
|
||||
<AdditionalIncludeDirectories>inc;telemetry;..\..\deps\cpprestsdk\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<AdditionalIncludeDirectories>inc;telemetry;../../;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
@@ -73,20 +71,24 @@
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
|
||||
<ConformanceMode>false</ConformanceMode>
|
||||
<LanguageStandard>stdcpplatest</LanguageStandard>
|
||||
<AdditionalIncludeDirectories>inc;telemetry;..\..\deps\cpprestsdk\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<AdditionalIncludeDirectories>inc;telemetry;../../;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(CIBuild)'!='true'">
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
|
||||
</ClCompile>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\common.h" />
|
||||
<ClInclude Include="..\keyboard_layout.h" />
|
||||
@@ -98,7 +100,9 @@
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\common.cpp" />
|
||||
<ClCompile Include="..\keyboard_layout.cpp" />
|
||||
<ClCompile Include="..\pch.cpp" />
|
||||
<ClCompile Include="..\pch.cpp">
|
||||
<PrecompiledHeader Condition="'$(CIBuild)'!='true'">Create</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\two_way_pipe_message_ipc.cpp" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
@@ -106,12 +110,12 @@
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
<Import Project="..\..\..\packages\Microsoft.Windows.ImplementationLibrary.1.0.191107.2\build\native\Microsoft.Windows.ImplementationLibrary.targets" Condition="Exists('..\..\..\packages\Microsoft.Windows.ImplementationLibrary.1.0.191107.2\build\native\Microsoft.Windows.ImplementationLibrary.targets')" />
|
||||
<Import Project="..\..\..\packages\Microsoft.Windows.ImplementationLibrary.1.0.200519.2\build\native\Microsoft.Windows.ImplementationLibrary.targets" Condition="Exists('..\..\..\packages\Microsoft.Windows.ImplementationLibrary.1.0.200519.2\build\native\Microsoft.Windows.ImplementationLibrary.targets')" />
|
||||
</ImportGroup>
|
||||
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
|
||||
<PropertyGroup>
|
||||
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
|
||||
</PropertyGroup>
|
||||
<Error Condition="!Exists('..\..\..\packages\Microsoft.Windows.ImplementationLibrary.1.0.191107.2\build\native\Microsoft.Windows.ImplementationLibrary.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\packages\Microsoft.Windows.ImplementationLibrary.1.0.191107.2\build\native\Microsoft.Windows.ImplementationLibrary.targets'))" />
|
||||
<Error Condition="!Exists('..\..\..\packages\Microsoft.Windows.ImplementationLibrary.1.0.200519.2\build\native\Microsoft.Windows.ImplementationLibrary.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\packages\Microsoft.Windows.ImplementationLibrary.1.0.200519.2\build\native\Microsoft.Windows.ImplementationLibrary.targets'))" />
|
||||
</Target>
|
||||
</Project>
|
||||
@@ -1,4 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="Microsoft.Windows.ImplementationLibrary" version="1.0.191107.2" targetFramework="native" />
|
||||
<package id="Microsoft.Windows.ImplementationLibrary" version="1.0.200519.2" targetFramework="native" />
|
||||
</packages>
|
||||
@@ -171,17 +171,17 @@ ShortcutGuideFilter get_shortcutguide_filtered_window()
|
||||
{
|
||||
return result;
|
||||
}
|
||||
static HWND cortanda_hwnd = nullptr;
|
||||
if (cortanda_hwnd == nullptr)
|
||||
static HWND cortana_hwnd = nullptr;
|
||||
if (cortana_hwnd == nullptr)
|
||||
{
|
||||
if (strcmp(class_name.data(), "Windows.UI.Core.CoreWindow") == 0 &&
|
||||
get_process_path(active_window).ends_with(L"SearchUI.exe"))
|
||||
{
|
||||
cortanda_hwnd = active_window;
|
||||
cortana_hwnd = active_window;
|
||||
return result;
|
||||
}
|
||||
}
|
||||
else if (cortanda_hwnd == active_window)
|
||||
else if (cortana_hwnd == active_window)
|
||||
{
|
||||
return result;
|
||||
}
|
||||
@@ -191,7 +191,7 @@ ShortcutGuideFilter get_shortcutguide_filtered_window()
|
||||
// WinKey + Up just won't maximize the window. Similary, without
|
||||
// WS_MINIMIZEBOX the window will not get minimized. A "Save As..." dialog
|
||||
// is a example of such window - it can be snapped to both sides and to
|
||||
// all screen conrers, but will not get maximized nor minimized.
|
||||
// all screen corners, but will not get maximized nor minimized.
|
||||
// For now, since ShortcutGuide can only disable entire "Windows Controls"
|
||||
// group, we require that the window supports all the options.
|
||||
result.snappable = ((style & WS_MAXIMIZEBOX) == WS_MAXIMIZEBOX) &&
|
||||
@@ -321,7 +321,7 @@ WindowState get_window_state(HWND hwnd)
|
||||
|
||||
if (GetWindowPlacement(hwnd, &placement) == 0)
|
||||
{
|
||||
return UNKNONW;
|
||||
return UNKNOWN;
|
||||
}
|
||||
|
||||
if (placement.showCmd == SW_MINIMIZE || placement.showCmd == SW_SHOWMINIMIZED || IsIconic(hwnd))
|
||||
@@ -337,7 +337,7 @@ WindowState get_window_state(HWND hwnd)
|
||||
auto rectp = get_window_pos(hwnd);
|
||||
if (!rectp)
|
||||
{
|
||||
return UNKNONW;
|
||||
return UNKNOWN;
|
||||
}
|
||||
|
||||
auto rect = *rectp;
|
||||
@@ -461,7 +461,7 @@ bool run_elevated(const std::wstring& file, const std::wstring& params)
|
||||
}
|
||||
}
|
||||
|
||||
bool run_non_elevated(const std::wstring& file, const std::wstring& params)
|
||||
bool run_non_elevated(const std::wstring& file, const std::wstring& params, DWORD* returnPid)
|
||||
{
|
||||
auto executable_args = L"\"" + file + L"\"";
|
||||
if (!params.empty())
|
||||
@@ -510,8 +510,8 @@ bool run_non_elevated(const std::wstring& file, const std::wstring& params)
|
||||
siex.lpAttributeList = pptal;
|
||||
siex.StartupInfo.cb = sizeof(siex);
|
||||
|
||||
PROCESS_INFORMATION process_info = { 0 };
|
||||
auto succedded = CreateProcessW(file.c_str(),
|
||||
PROCESS_INFORMATION pi = { 0 };
|
||||
auto succeeded = CreateProcessW(file.c_str(),
|
||||
const_cast<LPWSTR>(executable_args.c_str()),
|
||||
nullptr,
|
||||
nullptr,
|
||||
@@ -520,28 +520,38 @@ bool run_non_elevated(const std::wstring& file, const std::wstring& params)
|
||||
nullptr,
|
||||
nullptr,
|
||||
&siex.StartupInfo,
|
||||
&process_info);
|
||||
if (process_info.hProcess)
|
||||
&pi);
|
||||
if (succeeded)
|
||||
{
|
||||
CloseHandle(process_info.hProcess);
|
||||
if (pi.hProcess)
|
||||
{
|
||||
if (returnPid)
|
||||
{
|
||||
*returnPid = GetProcessId(pi.hProcess);
|
||||
}
|
||||
|
||||
CloseHandle(pi.hProcess);
|
||||
}
|
||||
if (pi.hThread)
|
||||
{
|
||||
CloseHandle(pi.hThread);
|
||||
}
|
||||
}
|
||||
if (process_info.hThread)
|
||||
{
|
||||
CloseHandle(process_info.hThread);
|
||||
}
|
||||
return succedded;
|
||||
|
||||
return succeeded;
|
||||
}
|
||||
|
||||
bool run_same_elevation(const std::wstring& file, const std::wstring& params)
|
||||
bool run_same_elevation(const std::wstring& file, const std::wstring& params, DWORD* returnPid)
|
||||
{
|
||||
auto executable_args = L"\"" + file + L"\"";
|
||||
if (!params.empty())
|
||||
{
|
||||
executable_args += L" " + params;
|
||||
}
|
||||
|
||||
STARTUPINFO si = { 0 };
|
||||
PROCESS_INFORMATION pi = { 0 };
|
||||
auto succedded = CreateProcessW(file.c_str(),
|
||||
auto succeeded = CreateProcessW(file.c_str(),
|
||||
const_cast<LPWSTR>(executable_args.c_str()),
|
||||
nullptr,
|
||||
nullptr,
|
||||
@@ -551,15 +561,25 @@ bool run_same_elevation(const std::wstring& file, const std::wstring& params)
|
||||
nullptr,
|
||||
&si,
|
||||
&pi);
|
||||
if (pi.hProcess)
|
||||
|
||||
if (succeeded)
|
||||
{
|
||||
CloseHandle(pi.hProcess);
|
||||
if (pi.hProcess)
|
||||
{
|
||||
if (returnPid)
|
||||
{
|
||||
*returnPid = GetProcessId(pi.hProcess);
|
||||
}
|
||||
|
||||
CloseHandle(pi.hProcess);
|
||||
}
|
||||
|
||||
if (pi.hThread)
|
||||
{
|
||||
CloseHandle(pi.hThread);
|
||||
}
|
||||
}
|
||||
if (pi.hThread)
|
||||
{
|
||||
CloseHandle(pi.hThread);
|
||||
}
|
||||
return succedded;
|
||||
return succeeded;
|
||||
}
|
||||
|
||||
std::wstring get_process_path(HWND window) noexcept
|
||||
@@ -571,7 +591,7 @@ std::wstring get_process_path(HWND window) noexcept
|
||||
if (name.length() >= app_frame_host.length() &&
|
||||
name.compare(name.length() - app_frame_host.length(), app_frame_host.length(), app_frame_host) == 0)
|
||||
{
|
||||
// It is a UWP app. We will enumarate the windows and look for one created
|
||||
// It is a UWP app. We will enumerate the windows and look for one created
|
||||
// by something with a different PID
|
||||
DWORD new_pid = pid;
|
||||
EnumChildWindows(
|
||||
|
||||
@@ -6,12 +6,12 @@
|
||||
#include <memory>
|
||||
#include <vector>
|
||||
|
||||
// Returns RECT with positions of the minmize/maximize buttons of the given window.
|
||||
// Returns RECT with positions of the minimize/maximize buttons of the given window.
|
||||
// Does not always work, since some apps draw custom toolbars.
|
||||
std::optional<RECT> get_button_pos(HWND hwnd);
|
||||
// Gets position of given window.
|
||||
std::optional<RECT> get_window_pos(HWND hwnd);
|
||||
// Gets mouse postion.
|
||||
// Gets mouse position.
|
||||
std::optional<POINT> get_mouse_pos();
|
||||
|
||||
// Test if window can be zoned by FancyZones
|
||||
@@ -47,7 +47,7 @@ void show_last_error_message(LPCWSTR lpszFunction, DWORD dw);
|
||||
|
||||
enum WindowState
|
||||
{
|
||||
UNKNONW,
|
||||
UNKNOWN,
|
||||
MINIMIZED,
|
||||
MAXIMIZED,
|
||||
SNAPED_TOP_LEFT,
|
||||
@@ -63,17 +63,17 @@ WindowState get_window_state(HWND hwnd);
|
||||
// Returns true if the current process is running with elevated privileges
|
||||
bool is_process_elevated(const bool use_cached_value = true);
|
||||
|
||||
// Drops the elevated privilages if present
|
||||
// Drops the elevated privileges if present
|
||||
bool drop_elevated_privileges();
|
||||
|
||||
// Run command as elevated user, returns true if succeeded
|
||||
bool run_elevated(const std::wstring& file, const std::wstring& params);
|
||||
|
||||
// Run command as non-elevated user, returns true if succeeded
|
||||
bool run_non_elevated(const std::wstring& file, const std::wstring& params);
|
||||
// Run command as non-elevated user, returns true if succeeded, puts the process id into returnPid if returnPid != NULL
|
||||
bool run_non_elevated(const std::wstring& file, const std::wstring& params, DWORD* returnPid);
|
||||
|
||||
// Run command with the same elevation, returns true if succedded
|
||||
bool run_same_elevation(const std::wstring& file, const std::wstring& params);
|
||||
// Run command with the same elevation, returns true if succeeded
|
||||
bool run_same_elevation(const std::wstring& file, const std::wstring& params, DWORD* returnPid);
|
||||
|
||||
// Returns true if the current process is running from administrator account
|
||||
bool check_user_is_admin();
|
||||
@@ -136,3 +136,5 @@ struct overloaded : Ts...
|
||||
};
|
||||
template<class... Ts>
|
||||
overloaded(Ts...)->overloaded<Ts...>;
|
||||
|
||||
#define POWER_LAUNCHER_PID_SHARED_FILE L"Local\\3cbfbad4-199b-4e2c-9825-942d5d3d3c74"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="..\..\packages\Microsoft.Windows.CppWinRT.2.0.200316.3\build\native\Microsoft.Windows.CppWinRT.props" Condition="Exists('..\..\packages\Microsoft.Windows.CppWinRT.2.0.200316.3\build\native\Microsoft.Windows.CppWinRT.props')" />
|
||||
<Import Project="..\..\packages\Microsoft.Windows.CppWinRT.2.0.200514.2\build\native\Microsoft.Windows.CppWinRT.props" Condition="Exists('..\..\packages\Microsoft.Windows.CppWinRT.2.0.200514.2\build\native\Microsoft.Windows.CppWinRT.props')" />
|
||||
<Import Project="..\..\installer\Version.props" />
|
||||
<Target Name="GenerateVersionData" BeforeTargets="PrepareForBuild">
|
||||
<ItemGroup>
|
||||
@@ -68,12 +68,10 @@
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
|
||||
<LanguageStandard>stdcpplatest</LanguageStandard>
|
||||
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
|
||||
<AdditionalIncludeDirectories>inc;telemetry;..\..\deps\cpprestsdk\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
@@ -84,12 +82,17 @@
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
<Lib>
|
||||
<AdditionalLibraryDirectories>Shlwapi.lib;</AdditionalLibraryDirectories>
|
||||
<AdditionalDependencies>shlwapi.lib;shcore.lib</AdditionalDependencies>
|
||||
</Lib>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(CIBuild)'!='true'">
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
|
||||
</ClCompile>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
@@ -97,7 +100,6 @@
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<LanguageStandard>stdcpplatest</LanguageStandard>
|
||||
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
|
||||
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
|
||||
<AdditionalIncludeDirectories>inc;telemetry;..\..\deps\cpprestsdk\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<AdditionalOptions>/await %(AdditionalOptions)</AdditionalOptions>
|
||||
@@ -109,7 +111,7 @@
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
<Lib>
|
||||
<AdditionalLibraryDirectories>Shlwapi.lib;</AdditionalLibraryDirectories>
|
||||
<AdditionalDependencies>shlwapi.lib;shcore.lib</AdditionalDependencies>
|
||||
</Lib>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
@@ -118,11 +120,14 @@
|
||||
<ClInclude Include="d2d_svg.h" />
|
||||
<ClInclude Include="d2d_text.h" />
|
||||
<ClInclude Include="d2d_window.h" />
|
||||
<ClInclude Include="debug_control.h" />
|
||||
<ClInclude Include="dpi_aware.h" />
|
||||
<ClInclude Include="com_object_factory.h" />
|
||||
<ClInclude Include="keyboard_layout.h" />
|
||||
<ClInclude Include="keyboard_layout_impl.h" />
|
||||
<ClInclude Include="notifications.h" />
|
||||
<ClInclude Include="os-detection\os-detect.h" />
|
||||
<ClInclude Include="RestartManagement.h" />
|
||||
<ClInclude Include="shared_constants.h" />
|
||||
<ClInclude Include="timeutil.h" />
|
||||
<ClInclude Include="two_way_pipe_message_ipc.h" />
|
||||
@@ -156,10 +161,11 @@
|
||||
<ClCompile Include="monitors.cpp" />
|
||||
<ClCompile Include="notifications.cpp" />
|
||||
<ClCompile Include="on_thread_executor.cpp" />
|
||||
<ClCompile Include="os-detection\os-detect.cpp" />
|
||||
<ClCompile Include="pch.cpp">
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Create</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Create</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(CIBuild)'!='true'">Create</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
<ClCompile Include="RestartManagement.cpp" />
|
||||
<ClCompile Include="settings_helpers.cpp" />
|
||||
<ClCompile Include="settings_objects.cpp" />
|
||||
<ClCompile Include="icon_helpers.cpp" />
|
||||
@@ -178,15 +184,15 @@
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
<Import Project="..\..\packages\Microsoft.Windows.ImplementationLibrary.1.0.191107.2\build\native\Microsoft.Windows.ImplementationLibrary.targets" Condition="Exists('..\..\packages\Microsoft.Windows.ImplementationLibrary.1.0.191107.2\build\native\Microsoft.Windows.ImplementationLibrary.targets')" />
|
||||
<Import Project="..\..\packages\Microsoft.Windows.CppWinRT.2.0.200316.3\build\native\Microsoft.Windows.CppWinRT.targets" Condition="Exists('..\..\packages\Microsoft.Windows.CppWinRT.2.0.200316.3\build\native\Microsoft.Windows.CppWinRT.targets')" />
|
||||
<Import Project="..\..\packages\Microsoft.Windows.ImplementationLibrary.1.0.200519.2\build\native\Microsoft.Windows.ImplementationLibrary.targets" Condition="Exists('..\..\packages\Microsoft.Windows.ImplementationLibrary.1.0.200519.2\build\native\Microsoft.Windows.ImplementationLibrary.targets')" />
|
||||
<Import Project="..\..\packages\Microsoft.Windows.CppWinRT.2.0.200514.2\build\native\Microsoft.Windows.CppWinRT.targets" Condition="Exists('..\..\packages\Microsoft.Windows.CppWinRT.2.0.200514.2\build\native\Microsoft.Windows.CppWinRT.targets')" />
|
||||
</ImportGroup>
|
||||
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
|
||||
<PropertyGroup>
|
||||
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
|
||||
</PropertyGroup>
|
||||
<Error Condition="!Exists('..\..\packages\Microsoft.Windows.ImplementationLibrary.1.0.191107.2\build\native\Microsoft.Windows.ImplementationLibrary.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Microsoft.Windows.ImplementationLibrary.1.0.191107.2\build\native\Microsoft.Windows.ImplementationLibrary.targets'))" />
|
||||
<Error Condition="!Exists('..\..\packages\Microsoft.Windows.CppWinRT.2.0.200316.3\build\native\Microsoft.Windows.CppWinRT.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Microsoft.Windows.CppWinRT.2.0.200316.3\build\native\Microsoft.Windows.CppWinRT.props'))" />
|
||||
<Error Condition="!Exists('..\..\packages\Microsoft.Windows.CppWinRT.2.0.200316.3\build\native\Microsoft.Windows.CppWinRT.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Microsoft.Windows.CppWinRT.2.0.200316.3\build\native\Microsoft.Windows.CppWinRT.targets'))" />
|
||||
<Error Condition="!Exists('..\..\packages\Microsoft.Windows.ImplementationLibrary.1.0.200519.2\build\native\Microsoft.Windows.ImplementationLibrary.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Microsoft.Windows.ImplementationLibrary.1.0.200519.2\build\native\Microsoft.Windows.ImplementationLibrary.targets'))" />
|
||||
<Error Condition="!Exists('..\..\packages\Microsoft.Windows.CppWinRT.2.0.200514.2\build\native\Microsoft.Windows.CppWinRT.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Microsoft.Windows.CppWinRT.2.0.200514.2\build\native\Microsoft.Windows.CppWinRT.props'))" />
|
||||
<Error Condition="!Exists('..\..\packages\Microsoft.Windows.CppWinRT.2.0.200514.2\build\native\Microsoft.Windows.CppWinRT.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Microsoft.Windows.CppWinRT.2.0.200514.2\build\native\Microsoft.Windows.CppWinRT.targets'))" />
|
||||
</Target>
|
||||
</Project>
|
||||
@@ -111,6 +111,15 @@
|
||||
<ClInclude Include="two_way_pipe_message_ipc.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="os-detection\os-detect.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="RestartManagement.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="debug_control.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="d2d_svg.cpp">
|
||||
@@ -180,6 +189,12 @@
|
||||
<ClCompile Include="two_way_pipe_message_ipc.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="os-detection\os-detect.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="RestartManagement.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="packages.config" />
|
||||
|
||||
@@ -24,19 +24,19 @@ D2DText& D2DText::resize(float text_size, float scale)
|
||||
return *this;
|
||||
}
|
||||
|
||||
D2DText& D2DText::set_aligment_left()
|
||||
D2DText& D2DText::set_alignment_left()
|
||||
{
|
||||
winrt::check_hresult(format->SetTextAlignment(DWRITE_TEXT_ALIGNMENT_LEADING));
|
||||
return *this;
|
||||
}
|
||||
|
||||
D2DText& D2DText::set_aligment_center()
|
||||
D2DText& D2DText::set_alignment_center()
|
||||
{
|
||||
winrt::check_hresult(format->SetTextAlignment(DWRITE_TEXT_ALIGNMENT_CENTER));
|
||||
return *this;
|
||||
}
|
||||
|
||||
D2DText& D2DText::set_aligment_right()
|
||||
D2DText& D2DText::set_alignment_right()
|
||||
{
|
||||
winrt::check_hresult(format->SetTextAlignment(DWRITE_TEXT_ALIGNMENT_TRAILING));
|
||||
return *this;
|
||||
|
||||
@@ -7,9 +7,9 @@ class D2DText
|
||||
public:
|
||||
D2DText(float text_size = 15.0f, float scale = 1.0f);
|
||||
D2DText& resize(float text_size, float scale);
|
||||
D2DText& set_aligment_left();
|
||||
D2DText& set_aligment_center();
|
||||
D2DText& set_aligment_right();
|
||||
D2DText& set_alignment_left();
|
||||
D2DText& set_alignment_center();
|
||||
D2DText& set_alignment_right();
|
||||
void write(ID2D1DeviceContext5* d2d_dc, D2D1_COLOR_F color, D2D1_RECT_F rect, std::wstring text);
|
||||
|
||||
private:
|
||||
|
||||
@@ -69,7 +69,7 @@ void D2DWindow::base_init()
|
||||
&options,
|
||||
d2d_factory.put_void()));
|
||||
}
|
||||
// For all other stuff - assing nullptr first to release the object, to reset the com_ptr.
|
||||
// For all other stuff - assign nullptr first to release the object, to reset the com_ptr.
|
||||
d2d_dc = nullptr;
|
||||
d2d_device = nullptr;
|
||||
dxgi_factory = nullptr;
|
||||
|
||||
4
src/common/debug_control.h
Normal file
@@ -0,0 +1,4 @@
|
||||
#pragma once
|
||||
|
||||
// Prevent system-wide input lagging while paused in the debugger
|
||||
//#define DISABLE_LOWLEVEL_HOOKS_WHEN_DEBUGGED
|
||||
@@ -56,7 +56,7 @@ namespace DPIAware
|
||||
SetProcessDpiAwarenessContext(DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE_V2);
|
||||
}
|
||||
|
||||
AwarnessLevel GetAwarenessLevel(DPI_AWARENESS_CONTEXT system_returned_value)
|
||||
AwarenessLevel GetAwarenessLevel(DPI_AWARENESS_CONTEXT system_returned_value)
|
||||
{
|
||||
const std::array levels{ DPI_AWARENESS_CONTEXT_UNAWARE,
|
||||
DPI_AWARENESS_CONTEXT_SYSTEM_AWARE,
|
||||
@@ -67,9 +67,9 @@ namespace DPIAware
|
||||
{
|
||||
if (AreDpiAwarenessContextsEqual(levels[i], system_returned_value))
|
||||
{
|
||||
return static_cast<AwarnessLevel>(i);
|
||||
return static_cast<AwarenessLevel>(i);
|
||||
}
|
||||
}
|
||||
return AwarnessLevel::UNAWARE;
|
||||
return AwarenessLevel::UNAWARE;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@ namespace DPIAware
|
||||
void Convert(HMONITOR monitor_handle, int& width, int& height);
|
||||
void EnableDPIAwarenessForThisProcess();
|
||||
|
||||
enum AwarnessLevel
|
||||
enum AwarenessLevel
|
||||
{
|
||||
UNAWARE,
|
||||
SYSTEM_AWARE,
|
||||
@@ -18,5 +18,5 @@ namespace DPIAware
|
||||
PER_MONITOR_AWARE_V2,
|
||||
UNAWARE_GDISCALED
|
||||
};
|
||||
AwarnessLevel GetAwarenessLevel(DPI_AWARENESS_CONTEXT system_returned_value);
|
||||
AwarenessLevel GetAwarenessLevel(DPI_AWARENESS_CONTEXT system_returned_value);
|
||||
};
|
||||
|
||||
@@ -1,20 +0,0 @@
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
[assembly: AssemblyTitle("interop-tests")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("interop-tests")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2020")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
[assembly: Guid("437ad818-3f1f-4ca5-a79b-25233a157026")]
|
||||
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
||||
@@ -2,6 +2,39 @@
|
||||
<Project ToolsVersion="15.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="..\..\..\packages\MSTest.TestAdapter.2.1.0\build\net45\MSTest.TestAdapter.props" Condition="Exists('..\..\..\packages\MSTest.TestAdapter.2.1.0\build\net45\MSTest.TestAdapter.props')" />
|
||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||
<Import Project="..\..\..\installer\Version.props" />
|
||||
<!-- We don't have GenerateAssemblyInfo task until we use .net core, so we generate it with WriteLinesToFile -->
|
||||
<PropertyGroup>
|
||||
<AssemblyTitle>interop-tests</AssemblyTitle>
|
||||
<AssemblyCompany>Microsoft Corp.</AssemblyCompany>
|
||||
<AssemblyCopyright>Copyright (C) 2020 Microsoft Corp.</AssemblyCopyright>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<AssemblyVersionFiles Include="Generated Files\AssemblyInfo.cs" />
|
||||
</ItemGroup>
|
||||
<Target Name="GenerateAssemblyInfo" BeforeTargets="PrepareForBuild">
|
||||
<ItemGroup>
|
||||
<HeaderLines Include="// Copyright (c) Microsoft Corporation" />
|
||||
<HeaderLines Include="// The Microsoft Corporation licenses this file to you under the MIT license." />
|
||||
<HeaderLines Include="// See the LICENSE file in the project root for more information." />
|
||||
<HeaderLines Include="#pragma warning disable SA1516" />
|
||||
<HeaderLines Include="using System.Reflection%3b" />
|
||||
<HeaderLines Include="using System.Runtime.InteropServices%3b" />
|
||||
<HeaderLines Include="using System.Windows%3b" />
|
||||
<HeaderLines Include="[assembly: AssemblyTitle("$(AssemblyTitle)")]" />
|
||||
<HeaderLines Include="[assembly: AssemblyDescription("")]" />
|
||||
<HeaderLines Include="[assembly: AssemblyConfiguration("")]" />
|
||||
<HeaderLines Include="[assembly: AssemblyCompany("$(AssemblyCompany)")]" />
|
||||
<HeaderLines Include="[assembly: AssemblyCopyright("$(AssemblyCopyright)")]" />
|
||||
<HeaderLines Include="[assembly: AssemblyProduct("$(AssemblyTitle)")]" />
|
||||
<HeaderLines Include="[assembly: AssemblyTrademark("")]" />
|
||||
<HeaderLines Include="[assembly: AssemblyCulture("")]" />
|
||||
<HeaderLines Include="[assembly: ComVisible(false)]" />
|
||||
<HeaderLines Include="[assembly: AssemblyVersion("$(Version).0")]" />
|
||||
<HeaderLines Include="[assembly: AssemblyFileVersion("$(Version).0")]" />
|
||||
</ItemGroup>
|
||||
<WriteLinesToFile File="Generated Files\AssemblyInfo.cs" Lines="@(HeaderLines)" Overwrite="true" Encoding="Unicode" WriteOnlyWhenDifferent="true" />
|
||||
</Target>
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
@@ -53,7 +86,9 @@
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="UnitTest1.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="Generated Files\AssemblyInfo.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="packages.config" />
|
||||
|
||||
133
src/common/interop/HotkeyManager.cpp
Normal file
@@ -0,0 +1,133 @@
|
||||
#include "pch.h"
|
||||
#include "HotkeyManager.h"
|
||||
|
||||
using namespace interop;
|
||||
|
||||
HotkeyManager::HotkeyManager()
|
||||
{
|
||||
keyboardEventCallback = gcnew KeyboardEventCallback(this, &HotkeyManager::KeyboardEventProc);
|
||||
isActiveCallback = gcnew IsActiveCallback(this, &HotkeyManager::IsActiveProc);
|
||||
filterKeyboardCallback = gcnew FilterKeyboardEvent(this, &HotkeyManager::FilterKeyboardProc);
|
||||
|
||||
keyboardHook = gcnew KeyboardHook(
|
||||
keyboardEventCallback,
|
||||
isActiveCallback,
|
||||
filterKeyboardCallback
|
||||
);
|
||||
hotkeys = gcnew Dictionary<HOTKEY_HANDLE, HotkeyCallback ^>();
|
||||
pressedKeys = gcnew Hotkey();
|
||||
keyboardHook->Start();
|
||||
}
|
||||
|
||||
HotkeyManager::~HotkeyManager()
|
||||
{
|
||||
delete keyboardHook;
|
||||
}
|
||||
|
||||
// When all Shortcut keys are pressed, fire the HotkeyCallback event.
|
||||
void HotkeyManager::KeyboardEventProc(KeyboardEvent^ ev)
|
||||
{
|
||||
auto pressedKeysHandle = GetHotkeyHandle(pressedKeys);
|
||||
if (hotkeys->ContainsKey(pressedKeysHandle))
|
||||
{
|
||||
hotkeys[pressedKeysHandle]->Invoke();
|
||||
}
|
||||
}
|
||||
|
||||
// Hotkeys are intended to be global, therefore they are always active no matter the
|
||||
// context in which the keypress occurs.
|
||||
bool HotkeyManager::IsActiveProc()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
// KeyboardEvent callback is only fired for relevant key events.
|
||||
bool HotkeyManager::FilterKeyboardProc(KeyboardEvent^ ev)
|
||||
{
|
||||
auto oldHandle = GetHotkeyHandle(pressedKeys);
|
||||
|
||||
// Updating the pressed keys here so we know if the keypress event
|
||||
// should be propagated or not.
|
||||
UpdatePressedKeys(ev);
|
||||
|
||||
auto pressedKeysHandle = GetHotkeyHandle(pressedKeys);
|
||||
|
||||
// Check if the hotkey matches the pressed keys, and check if the pressed keys aren't duplicate
|
||||
// (there shouldn't be auto repeating hotkeys)
|
||||
if (hotkeys->ContainsKey(pressedKeysHandle) && oldHandle != pressedKeysHandle)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
// NOTE: Replaces old hotkey if one already present.
|
||||
HOTKEY_HANDLE HotkeyManager::RegisterHotkey(Hotkey ^ hotkey, HotkeyCallback ^ callback)
|
||||
{
|
||||
auto handle = GetHotkeyHandle(hotkey);
|
||||
hotkeys[handle] = callback;
|
||||
return handle;
|
||||
}
|
||||
|
||||
void HotkeyManager::UnregisterHotkey(HOTKEY_HANDLE handle)
|
||||
{
|
||||
hotkeys->Remove(handle);
|
||||
}
|
||||
|
||||
HOTKEY_HANDLE HotkeyManager::GetHotkeyHandle(Hotkey ^ hotkey)
|
||||
{
|
||||
HOTKEY_HANDLE handle = hotkey->Key;
|
||||
handle |= hotkey->Win << 8;
|
||||
handle |= hotkey->Ctrl << 9;
|
||||
handle |= hotkey->Shift << 10;
|
||||
handle |= hotkey->Alt << 11;
|
||||
return handle;
|
||||
}
|
||||
|
||||
void HotkeyManager::UpdatePressedKey(DWORD code, bool replaceWith, unsigned char replaceWithKey)
|
||||
{
|
||||
switch (code)
|
||||
{
|
||||
case VK_LWIN:
|
||||
case VK_RWIN:
|
||||
pressedKeys->Win = replaceWith;
|
||||
break;
|
||||
case VK_CONTROL:
|
||||
case VK_LCONTROL:
|
||||
case VK_RCONTROL:
|
||||
pressedKeys->Ctrl = replaceWith;
|
||||
break;
|
||||
case VK_SHIFT:
|
||||
case VK_LSHIFT:
|
||||
case VK_RSHIFT:
|
||||
pressedKeys->Shift = replaceWith;
|
||||
break;
|
||||
case VK_MENU:
|
||||
case VK_LMENU:
|
||||
case VK_RMENU:
|
||||
pressedKeys->Alt = replaceWith;
|
||||
break;
|
||||
default:
|
||||
pressedKeys->Key = replaceWithKey;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void HotkeyManager::UpdatePressedKeys(KeyboardEvent ^ ev)
|
||||
{
|
||||
switch (ev->message)
|
||||
{
|
||||
case WM_KEYDOWN:
|
||||
case WM_SYSKEYDOWN:
|
||||
{
|
||||
UpdatePressedKey(ev->key, true, ev->key);
|
||||
}
|
||||
break;
|
||||
case WM_KEYUP:
|
||||
case WM_SYSKEYUP:
|
||||
{
|
||||
UpdatePressedKey(ev->key, false, 0);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
57
src/common/interop/HotkeyManager.h
Normal file
@@ -0,0 +1,57 @@
|
||||
#pragma once
|
||||
#include <Windows.h>
|
||||
#include "KeyboardHook.h"
|
||||
|
||||
namespace interop
|
||||
{
|
||||
public
|
||||
ref struct Hotkey
|
||||
{
|
||||
bool Win;
|
||||
bool Ctrl;
|
||||
bool Shift;
|
||||
bool Alt;
|
||||
unsigned char Key;
|
||||
|
||||
Hotkey()
|
||||
{
|
||||
Win = false;
|
||||
Ctrl = false;
|
||||
Shift = false;
|
||||
Alt = false;
|
||||
Key = 0;
|
||||
}
|
||||
};
|
||||
|
||||
public
|
||||
delegate void HotkeyCallback();
|
||||
|
||||
typedef unsigned short HOTKEY_HANDLE;
|
||||
|
||||
public
|
||||
ref class HotkeyManager
|
||||
{
|
||||
public:
|
||||
HotkeyManager();
|
||||
~HotkeyManager();
|
||||
|
||||
HOTKEY_HANDLE RegisterHotkey(Hotkey ^ hotkey, HotkeyCallback ^ callback);
|
||||
void UnregisterHotkey(HOTKEY_HANDLE handle);
|
||||
|
||||
private:
|
||||
KeyboardHook ^ keyboardHook;
|
||||
Dictionary<HOTKEY_HANDLE, HotkeyCallback ^> ^ hotkeys;
|
||||
Hotkey ^ pressedKeys;
|
||||
KeyboardEventCallback ^ keyboardEventCallback;
|
||||
IsActiveCallback ^ isActiveCallback;
|
||||
FilterKeyboardEvent ^ filterKeyboardCallback;
|
||||
|
||||
|
||||
void KeyboardEventProc(KeyboardEvent ^ ev);
|
||||
bool IsActiveProc();
|
||||
bool FilterKeyboardProc(KeyboardEvent ^ ev);
|
||||
HOTKEY_HANDLE GetHotkeyHandle(Hotkey ^ hotkey);
|
||||
void UpdatePressedKeys(KeyboardEvent ^ ev);
|
||||
void UpdatePressedKey(DWORD code, bool replaceWith, unsigned char replaceWithKey);
|
||||
};
|
||||
}
|
||||
111
src/common/interop/KeyboardHook.cpp
Normal file
@@ -0,0 +1,111 @@
|
||||
#include "pch.h"
|
||||
#include "KeyboardHook.h"
|
||||
#include <exception>
|
||||
#include <msclr\marshal.h>
|
||||
#include <msclr\marshal_cppstd.h>
|
||||
#include <common/debug_control.h>
|
||||
|
||||
using namespace interop;
|
||||
using namespace System::Runtime::InteropServices;
|
||||
using namespace System;
|
||||
using namespace System::Diagnostics;
|
||||
|
||||
KeyboardHook::KeyboardHook(
|
||||
KeyboardEventCallback ^ keyboardEventCallback,
|
||||
IsActiveCallback ^ isActiveCallback,
|
||||
FilterKeyboardEvent ^ filterKeyboardEvent)
|
||||
{
|
||||
kbEventDispatch = gcnew Thread(gcnew ThreadStart(this, &KeyboardHook::DispatchProc));
|
||||
queue = gcnew Queue<KeyboardEvent ^>();
|
||||
this->keyboardEventCallback = keyboardEventCallback;
|
||||
this->isActiveCallback = isActiveCallback;
|
||||
this->filterKeyboardEvent = filterKeyboardEvent;
|
||||
}
|
||||
|
||||
KeyboardHook::~KeyboardHook()
|
||||
{
|
||||
quit = true;
|
||||
|
||||
// Notify the DispatchProc thread so that it isn't stuck at the Wait step
|
||||
Monitor::Enter(queue);
|
||||
Monitor::Pulse(queue);
|
||||
Monitor::Exit(queue);
|
||||
|
||||
kbEventDispatch->Join();
|
||||
|
||||
// Unregister low level hook procedure
|
||||
UnhookWindowsHookEx(hookHandle);
|
||||
}
|
||||
|
||||
void KeyboardHook::DispatchProc()
|
||||
{
|
||||
Monitor::Enter(queue);
|
||||
quit = false;
|
||||
while (!quit)
|
||||
{
|
||||
if (queue->Count == 0)
|
||||
{
|
||||
Monitor::Wait(queue);
|
||||
continue;
|
||||
}
|
||||
auto nextEv = queue->Dequeue();
|
||||
|
||||
// Release lock while callback is being invoked
|
||||
Monitor::Exit(queue);
|
||||
|
||||
keyboardEventCallback->Invoke(nextEv);
|
||||
|
||||
// Re-aquire lock
|
||||
Monitor::Enter(queue);
|
||||
}
|
||||
|
||||
Monitor::Exit(queue);
|
||||
}
|
||||
|
||||
void KeyboardHook::Start()
|
||||
{
|
||||
hookProc = gcnew HookProcDelegate(this, &KeyboardHook::HookProc);
|
||||
Process ^ curProcess = Process::GetCurrentProcess();
|
||||
ProcessModule ^ curModule = curProcess->MainModule;
|
||||
#if defined(DISABLE_LOWLEVEL_HOOKS_WHEN_DEBUGGED)
|
||||
const bool hookDisabled = IsDebuggerPresent();
|
||||
#else
|
||||
const bool hookDisabled = false;
|
||||
#endif
|
||||
if (!hookDisabled)
|
||||
{
|
||||
// register low level hook procedure
|
||||
hookHandle = SetWindowsHookEx(
|
||||
WH_KEYBOARD_LL,
|
||||
(HOOKPROC)(void*)Marshal::GetFunctionPointerForDelegate(hookProc),
|
||||
0,
|
||||
0);
|
||||
if (hookHandle == nullptr)
|
||||
{
|
||||
throw std::exception("SetWindowsHookEx failed.");
|
||||
}
|
||||
}
|
||||
|
||||
kbEventDispatch->Start();
|
||||
}
|
||||
|
||||
LRESULT CALLBACK KeyboardHook::HookProc(int nCode, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
if (nCode == HC_ACTION && isActiveCallback->Invoke())
|
||||
{
|
||||
KeyboardEvent ^ ev = gcnew KeyboardEvent();
|
||||
ev->message = wParam;
|
||||
ev->key = reinterpret_cast<KBDLLHOOKSTRUCT*>(lParam)->vkCode;
|
||||
if (filterKeyboardEvent != nullptr && !filterKeyboardEvent->Invoke(ev))
|
||||
{
|
||||
return CallNextHookEx(hookHandle, nCode, wParam, lParam);
|
||||
}
|
||||
|
||||
Monitor::Enter(queue);
|
||||
queue->Enqueue(ev);
|
||||
Monitor::Pulse(queue);
|
||||
Monitor::Exit(queue);
|
||||
return 1;
|
||||
}
|
||||
return CallNextHookEx(hookHandle, nCode, wParam, lParam);
|
||||
}
|
||||
49
src/common/interop/KeyboardHook.h
Normal file
@@ -0,0 +1,49 @@
|
||||
#pragma once
|
||||
|
||||
using namespace System::Threading;
|
||||
using namespace System::Collections::Generic;
|
||||
|
||||
namespace interop
|
||||
{
|
||||
public
|
||||
ref struct KeyboardEvent
|
||||
{
|
||||
WPARAM message;
|
||||
int key;
|
||||
};
|
||||
|
||||
public
|
||||
delegate void KeyboardEventCallback(KeyboardEvent ^ ev);
|
||||
public
|
||||
delegate bool IsActiveCallback();
|
||||
public
|
||||
delegate bool FilterKeyboardEvent(KeyboardEvent ^ ev);
|
||||
|
||||
public
|
||||
ref class KeyboardHook
|
||||
{
|
||||
public:
|
||||
KeyboardHook(
|
||||
KeyboardEventCallback ^ keyboardEventCallback,
|
||||
IsActiveCallback ^ isActiveCallback,
|
||||
FilterKeyboardEvent ^ filterKeyboardEvent);
|
||||
~KeyboardHook();
|
||||
|
||||
void Start();
|
||||
|
||||
private:
|
||||
delegate LRESULT HookProcDelegate(int nCode, WPARAM wParam, LPARAM lParam);
|
||||
Thread ^ kbEventDispatch;
|
||||
Queue<KeyboardEvent ^> ^ queue;
|
||||
KeyboardEventCallback ^ keyboardEventCallback;
|
||||
IsActiveCallback ^ isActiveCallback;
|
||||
FilterKeyboardEvent ^ filterKeyboardEvent;
|
||||
bool quit;
|
||||
HHOOK hookHandle;
|
||||
HookProcDelegate ^ hookProc;
|
||||
|
||||
void DispatchProc();
|
||||
LRESULT CALLBACK HookProc(int nCode, WPARAM wParam, LPARAM lParam);
|
||||
};
|
||||
|
||||
}
|
||||
@@ -1,3 +1,13 @@
|
||||
//{{NO_DEPENDENCIES}}
|
||||
// Microsoft Visual C++ generated include file.
|
||||
// Used by app.rc
|
||||
// Used by interop.rc
|
||||
|
||||
//////////////////////////////
|
||||
// Non-localizable
|
||||
|
||||
#define FILE_DESCRIPTION "PowerToys Interop"
|
||||
#define INTERNAL_NAME "PowerToysInterop"
|
||||
#define ORIGINAL_FILENAME "PowerToysInterop.dll"
|
||||
|
||||
// Non-localizable
|
||||
//////////////////////////////
|
||||
|
||||
|
Before Width: | Height: | Size: 40 KiB |
@@ -1,4 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="..\..\..\installer\Version.props" />
|
||||
<PropertyGroup>
|
||||
@@ -22,7 +22,7 @@
|
||||
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
|
||||
<Keyword>ManagedCProj</Keyword>
|
||||
<RootNamespace>interop</RootNamespace>
|
||||
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
|
||||
<WindowsTargetPlatformVersion>10.0.17134.0</WindowsTargetPlatformVersion>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
@@ -65,14 +65,12 @@
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories>$(SolutionDir)src\common\interop;$(SolutionDir)src;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<AdditionalIncludeDirectories>$(SolutionDir)src\common\interop;../../;../;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
|
||||
<OmitDefaultLibName>false</OmitDefaultLibName>
|
||||
<LanguageStandard>stdcpp17</LanguageStandard>
|
||||
<LanguageStandard>stdcpplatest</LanguageStandard>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<AdditionalDependencies>WindowsApp.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
@@ -82,13 +80,11 @@
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories>$(SolutionDir)src\common\interop;$(SolutionDir)src;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<AdditionalIncludeDirectories>$(SolutionDir)src\common\interop;../../;../;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
|
||||
<LanguageStandard>stdcpp17</LanguageStandard>
|
||||
<LanguageStandard>stdcpplatest</LanguageStandard>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<AdditionalDependencies>WindowsApp.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
@@ -96,6 +92,12 @@
|
||||
</DelayLoadDLLs>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(CIBuild)'!='true'">
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
|
||||
</ClCompile>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<AssemblyVersionFiles Include="Generated Files\AssemblyInfo.cpp" />
|
||||
</ItemGroup>
|
||||
@@ -122,23 +124,23 @@
|
||||
<WriteLinesToFile File="Generated Files\AssemblyInfo.cpp" Lines="@(HeaderLines)" Overwrite="true" Encoding="Unicode" WriteOnlyWhenDifferent="true" />
|
||||
</Target>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="HotkeyManager.h" />
|
||||
<ClInclude Include="interop.h" />
|
||||
<ClInclude Include="KeyboardHook.h" />
|
||||
<ClInclude Include="pch.h" />
|
||||
<ClInclude Include="Resource.h" />
|
||||
<ClInclude Include="resource.h" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="Generated Files\AssemblyInfo.cpp" />
|
||||
<ClCompile Include="HotkeyManager.cpp" />
|
||||
<ClCompile Include="interop.cpp" />
|
||||
<ClCompile Include="KeyboardHook.cpp" />
|
||||
<ClCompile Include="pch.cpp">
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Create</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Create</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(CIBuild)'!='true'">Create</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ResourceCompile Include="app.rc" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Image Include="app.ico" />
|
||||
<ResourceCompile Include="interop.rc" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="System" />
|
||||
|
||||
@@ -18,10 +18,16 @@
|
||||
<ClInclude Include="interop.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Resource.h">
|
||||
<ClInclude Include="pch.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="pch.h">
|
||||
<ClInclude Include="KeyboardHook.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="HotkeyManager.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="resource.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
@@ -35,15 +41,16 @@
|
||||
<ClCompile Include="Generated Files\AssemblyInfo.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="KeyboardHook.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="HotkeyManager.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ResourceCompile Include="app.rc">
|
||||
<ResourceCompile Include="interop.rc">
|
||||
<Filter>Resource Files</Filter>
|
||||
</ResourceCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Image Include="app.ico">
|
||||
<Filter>Resource Files</Filter>
|
||||
</Image>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
@@ -7,6 +7,8 @@
|
||||
#ifndef PCH_H
|
||||
#define PCH_H
|
||||
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
// add headers that you want to pre-compile here
|
||||
#include <Windows.h>
|
||||
|
||||
#endif //PCH_H
|
||||
|
||||
@@ -20,7 +20,7 @@ struct ScreenSize
|
||||
POINT middle() const { return { rect.left + width() / 2, rect.top + height() / 2 }; };
|
||||
POINT middle_right() const { return { rect.right, rect.top + height() / 2 }; };
|
||||
POINT bottom_left() const { return { rect.left, rect.bottom }; };
|
||||
POINT bottm_midle() const { return { rect.left + width() / 2, rect.bottom }; };
|
||||
POINT bottom_middle() const { return { rect.left + width() / 2, rect.bottom }; };
|
||||
POINT bottom_right() const { return { rect.right, rect.bottom }; };
|
||||
};
|
||||
|
||||
|
||||
@@ -36,6 +36,10 @@ namespace
|
||||
namespace localized_strings
|
||||
{
|
||||
constexpr std::wstring_view SNOOZE_BUTTON = L"Snooze";
|
||||
|
||||
constexpr std::wstring_view PT_UPDATE = L"PowerToys update";
|
||||
constexpr std::wstring_view DOWNLOAD_IN_PROGRESS = L"Downloading...";
|
||||
constexpr std::wstring_view DOWNLOAD_COMPLETE = L"Download complete";
|
||||
}
|
||||
|
||||
static DWORD loop_thread_id()
|
||||
@@ -83,7 +87,7 @@ public:
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
auto dispatcher = reinterpret_cast<decltype(dispatch_to_backround_handler)*>(GetProcAddress(lib, "dispatch_to_backround_handler"));
|
||||
auto dispatcher = reinterpret_cast<decltype(dispatch_to_background_handler)*>(GetProcAddress(lib, "dispatch_to_background_handler"));
|
||||
if (!dispatcher)
|
||||
{
|
||||
return 1;
|
||||
@@ -204,7 +208,19 @@ void notifications::show_toast_with_activations(std::wstring message, std::wstri
|
||||
toast_xml += title;
|
||||
toast_xml += L"</text><text>";
|
||||
toast_xml += message;
|
||||
toast_xml += L"</text></binding></visual><actions>";
|
||||
toast_xml += L"</text>";
|
||||
if (params.progress)
|
||||
{
|
||||
toast_xml += LR"(<progress title=")";
|
||||
toast_xml += localized_strings::PT_UPDATE;
|
||||
if (params.subtitle)
|
||||
{
|
||||
toast_xml += L" ";
|
||||
toast_xml += *params.subtitle;
|
||||
}
|
||||
toast_xml += LR"(" value="{progressValue}" valueStringOverride="{progressValueString}" status="{progressStatus}"/>)";
|
||||
}
|
||||
toast_xml += L"</binding></visual><actions>";
|
||||
for (size_t i = 0; i < size(actions); ++i)
|
||||
{
|
||||
std::visit(overloaded{
|
||||
@@ -294,6 +310,17 @@ void notifications::show_toast_with_activations(std::wstring message, std::wstri
|
||||
toast_xml_doc.LoadXml(toast_xml);
|
||||
ToastNotification notification{ toast_xml_doc };
|
||||
|
||||
if (params.progress)
|
||||
{
|
||||
float progress = std::clamp(params.progress.value(), 0.0f, 1.0f);
|
||||
winrt::Windows::Foundation::Collections::StringMap map;
|
||||
map.Insert(L"progressValue", std::to_wstring(progress));
|
||||
map.Insert(L"progressValueString", std::to_wstring(static_cast<int>(progress * 100)) + std::wstring(L"%"));
|
||||
map.Insert(L"progressStatus", localized_strings::DOWNLOAD_IN_PROGRESS);
|
||||
winrt::Windows::UI::Notifications::NotificationData data(map);
|
||||
notification.Data(data);
|
||||
}
|
||||
|
||||
const auto notifier = winstore::running_as_packaged() ? ToastNotificationManager::ToastNotificationManager::CreateToastNotifier() :
|
||||
ToastNotificationManager::ToastNotificationManager::CreateToastNotifier(WIN32_AUMID);
|
||||
|
||||
@@ -315,3 +342,30 @@ void notifications::show_toast_with_activations(std::wstring message, std::wstri
|
||||
|
||||
notifier.Show(notification);
|
||||
}
|
||||
|
||||
void notifications::update_progress_bar_toast(std::wstring plaintext_message, toast_params params)
|
||||
{
|
||||
if (!params.progress.has_value())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
const auto notifier = winstore::running_as_packaged() ? ToastNotificationManager::ToastNotificationManager::CreateToastNotifier() :
|
||||
ToastNotificationManager::ToastNotificationManager::CreateToastNotifier(WIN32_AUMID);
|
||||
|
||||
float progress = std::clamp(params.progress.value(), 0.0f, 1.0f);
|
||||
winrt::Windows::Foundation::Collections::StringMap map;
|
||||
map.Insert(L"progressValue", std::to_wstring(progress));
|
||||
map.Insert(L"progressValueString", std::to_wstring(static_cast<int>(progress * 100)) + std::wstring(L"%"));
|
||||
map.Insert(L"progressStatus", progress < 1 ? localized_strings::DOWNLOAD_IN_PROGRESS : localized_strings::DOWNLOAD_COMPLETE);
|
||||
|
||||
|
||||
winrt::Windows::UI::Notifications::NotificationData data(map);
|
||||
std::wstring tag = L"";
|
||||
if (params.tag.has_value() && params.tag->length() < 64)
|
||||
{
|
||||
tag = *params.tag;
|
||||
}
|
||||
|
||||
winrt::Windows::UI::Notifications::NotificationUpdateResult res = notifier.Update(data, tag);
|
||||
}
|
||||
|
||||
@@ -43,10 +43,13 @@ namespace notifications
|
||||
{
|
||||
std::optional<std::wstring_view> tag;
|
||||
bool resend_if_scheduled = true;
|
||||
std::optional<float> progress;
|
||||
std::optional<std::wstring_view> subtitle;
|
||||
};
|
||||
|
||||
using action_t = std::variant<link_button, background_activated_button, snooze_button>;
|
||||
|
||||
void show_toast(std::wstring plaintext_message, toast_params params = {});
|
||||
void show_toast_with_activations(std::wstring plaintext_message, std::wstring_view background_handler_id, std::vector<action_t> actions, toast_params params = {});
|
||||
void update_progress_bar_toast(std::wstring plaintext_message, toast_params params);
|
||||
}
|
||||
|
||||
@@ -3,4 +3,4 @@ DllCanUnloadNow = WINRT_CanUnloadNow PRIVATE
|
||||
DllGetActivationFactory = WINRT_GetActivationFactory PRIVATE
|
||||
DllRegisterServer PRIVATE
|
||||
DllUnregisterServer PRIVATE
|
||||
dispatch_to_backround_handler PRIVATE
|
||||
dispatch_to_background_handler PRIVATE
|
||||
@@ -1,35 +1,36 @@
|
||||
#include <windows.h>
|
||||
#include "resource.h"
|
||||
#include "../../../common/version.h"
|
||||
#include "../version.h"
|
||||
|
||||
1 VERSIONINFO
|
||||
FILEVERSION FILE_VERSION
|
||||
PRODUCTVERSION PRODUCT_VERSION
|
||||
FILEFLAGSMASK VS_FFI_FILEFLAGSMASK
|
||||
FILEVERSION FILE_VERSION
|
||||
PRODUCTVERSION PRODUCT_VERSION
|
||||
FILEFLAGSMASK VS_FFI_FILEFLAGSMASK
|
||||
#ifdef _DEBUG
|
||||
FILEFLAGS VS_FF_DEBUG
|
||||
FILEFLAGS VS_FF_DEBUG
|
||||
#else
|
||||
FILEFLAGS 0x0L
|
||||
FILEFLAGS 0x0L
|
||||
#endif
|
||||
FILEOS VOS_NT_WINDOWS32
|
||||
FILETYPE VFT_DLL
|
||||
FILESUBTYPE VFT2_UNKNOWN
|
||||
FILEOS VOS_NT_WINDOWS32
|
||||
FILETYPE VFT_DLL
|
||||
FILESUBTYPE VFT2_UNKNOWN
|
||||
BEGIN
|
||||
BLOCK "StringFileInfo"
|
||||
BEGIN
|
||||
BLOCK "040904b0" // English (0x0409), Unicode (0x04B0) charset
|
||||
BLOCK "040904b0" // US English (0x0409), Unicode (0x04B0) charset
|
||||
BEGIN
|
||||
VALUE "CompanyName", COMPANY_NAME
|
||||
VALUE "FileDescription", "PowerToys Notifications"
|
||||
VALUE "FileDescription", FILE_DESCRIPTION
|
||||
VALUE "FileVersion", FILE_VERSION_STRING
|
||||
VALUE "InternalName", "PowerToys Notifications"
|
||||
VALUE "InternalName", INTERNAL_NAME
|
||||
VALUE "LegalCopyright", COPYRIGHT_NOTE
|
||||
VALUE "OriginalFilename", "powertoys_notifications.dll"
|
||||
VALUE "ProductName", "PowerToys Notifications"
|
||||
VALUE "OriginalFilename", ORIGINAL_FILENAME
|
||||
VALUE "ProductName", PRODUCT_NAME
|
||||
VALUE "ProductVersion", PRODUCT_VERSION_STRING
|
||||
END
|
||||
END
|
||||
BLOCK "VarFileInfo"
|
||||
BEGIN
|
||||
VALUE "Translation", 0x409, 1200
|
||||
VALUE "Translation", 0x409, 1200 // US English (0x0409), Unicode (1200) charset
|
||||
END
|
||||
END
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="..\..\..\packages\Microsoft.Windows.CppWinRT.2.0.200316.3\build\native\Microsoft.Windows.CppWinRT.props" Condition="Exists('..\..\..\packages\Microsoft.Windows.CppWinRT.2.0.200316.3\build\native\Microsoft.Windows.CppWinRT.props')" />
|
||||
<Import Project="..\..\..\packages\Microsoft.Windows.CppWinRT.2.0.200514.2\build\native\Microsoft.Windows.CppWinRT.props" Condition="Exists('..\..\..\packages\Microsoft.Windows.CppWinRT.2.0.200514.2\build\native\Microsoft.Windows.CppWinRT.props')" />
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
@@ -93,13 +93,11 @@
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>NDEBUG;NOTIFICATIONSDLL_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
|
||||
<LanguageStandard>stdcpplatest</LanguageStandard>
|
||||
<AdditionalOptions>/await %(AdditionalOptions)</AdditionalOptions>
|
||||
<TreatWarningAsError>true</TreatWarningAsError>
|
||||
@@ -117,11 +115,9 @@
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;NOTIFICATIONSDLL_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
@@ -131,11 +127,9 @@
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>_DEBUG;NOTIFICATIONSDLL_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
|
||||
<LanguageStandard>stdcpplatest</LanguageStandard>
|
||||
<AdditionalOptions>/await %(AdditionalOptions)</AdditionalOptions>
|
||||
<TreatWarningAsError>true</TreatWarningAsError>
|
||||
@@ -151,13 +145,11 @@
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;NOTIFICATIONSDLL_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
@@ -167,6 +159,12 @@
|
||||
<EnableUAC>false</EnableUAC>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(CIBuild)'!='true'">
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
|
||||
</ClCompile>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<None Include="cpp.hint" />
|
||||
<None Include="notifications.def" />
|
||||
@@ -180,15 +178,12 @@
|
||||
<ItemGroup>
|
||||
<ClCompile Include="dllmain.cpp" />
|
||||
<ClCompile Include="pch.cpp">
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Create</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Create</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Create</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Create</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(CIBuild)'!='true'">Create</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
<Import Project="..\..\..\packages\Microsoft.Windows.CppWinRT.2.0.200316.3\build\native\Microsoft.Windows.CppWinRT.targets" Condition="Exists('..\..\..\packages\Microsoft.Windows.CppWinRT.2.0.200316.3\build\native\Microsoft.Windows.CppWinRT.targets')" />
|
||||
<Import Project="..\..\..\packages\Microsoft.Windows.CppWinRT.2.0.200514.2\build\native\Microsoft.Windows.CppWinRT.targets" Condition="Exists('..\..\..\packages\Microsoft.Windows.CppWinRT.2.0.200514.2\build\native\Microsoft.Windows.CppWinRT.targets')" />
|
||||
</ImportGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\notifications_winrt\notifications.vcxproj">
|
||||
@@ -202,7 +197,7 @@
|
||||
<PropertyGroup>
|
||||
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
|
||||
</PropertyGroup>
|
||||
<Error Condition="!Exists('..\..\..\packages\Microsoft.Windows.CppWinRT.2.0.200316.3\build\native\Microsoft.Windows.CppWinRT.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\packages\Microsoft.Windows.CppWinRT.2.0.200316.3\build\native\Microsoft.Windows.CppWinRT.props'))" />
|
||||
<Error Condition="!Exists('..\..\..\packages\Microsoft.Windows.CppWinRT.2.0.200316.3\build\native\Microsoft.Windows.CppWinRT.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\packages\Microsoft.Windows.CppWinRT.2.0.200316.3\build\native\Microsoft.Windows.CppWinRT.targets'))" />
|
||||
<Error Condition="!Exists('..\..\..\packages\Microsoft.Windows.CppWinRT.2.0.200514.2\build\native\Microsoft.Windows.CppWinRT.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\packages\Microsoft.Windows.CppWinRT.2.0.200514.2\build\native\Microsoft.Windows.CppWinRT.props'))" />
|
||||
<Error Condition="!Exists('..\..\..\packages\Microsoft.Windows.CppWinRT.2.0.200514.2\build\native\Microsoft.Windows.CppWinRT.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\packages\Microsoft.Windows.CppWinRT.2.0.200514.2\build\native\Microsoft.Windows.CppWinRT.targets'))" />
|
||||
</Target>
|
||||
</Project>
|
||||
@@ -1,4 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="Microsoft.Windows.CppWinRT" version="2.0.200316.3" targetFramework="native" />
|
||||
<package id="Microsoft.Windows.CppWinRT" version="2.0.200514.2" targetFramework="native" />
|
||||
</packages>
|
||||
@@ -1 +1,13 @@
|
||||
#include <windows.h>
|
||||
//{{NO_DEPENDENCIES}}
|
||||
// Microsoft Visual C++ generated include file.
|
||||
// Used by notifications_dll.rc
|
||||
|
||||
//////////////////////////////
|
||||
// Non-localizable
|
||||
|
||||
#define FILE_DESCRIPTION "PowerToys Notifications"
|
||||
#define INTERNAL_NAME "Notifications"
|
||||
#define ORIGINAL_FILENAME "Notifications.dll"
|
||||
|
||||
// Non-localizable
|
||||
//////////////////////////////
|
||||
|
||||
@@ -17,6 +17,6 @@ namespace winrt::PowerToysNotifications::implementation
|
||||
return;
|
||||
}
|
||||
|
||||
dispatch_to_backround_handler(details.Argument());
|
||||
dispatch_to_background_handler(details.Argument());
|
||||
}
|
||||
}
|
||||
|
||||