mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-01-07 21:06:58 +01:00
Compare commits
173 Commits
v0.80.0
...
dev/seraph
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
fb80c851bb | ||
|
|
efb235536f | ||
|
|
98ada58f29 | ||
|
|
46e2648050 | ||
|
|
d818700ceb | ||
|
|
26d8f89be6 | ||
|
|
89460d3f3a | ||
|
|
0660de54db | ||
|
|
80a5d43810 | ||
|
|
d813b63432 | ||
|
|
58a513a8a6 | ||
|
|
c42c116dbf | ||
|
|
aa41af5eb9 | ||
|
|
1daae799bf | ||
|
|
585d3b4754 | ||
|
|
edad88cdbe | ||
|
|
394ac183e9 | ||
|
|
e1241b3de5 | ||
|
|
c2d3eb0aef | ||
|
|
7ae037edbd | ||
|
|
be2f5a5463 | ||
|
|
cdf600dd54 | ||
|
|
041cddf095 | ||
|
|
c3d04d956a | ||
|
|
1c5dc3f96f | ||
|
|
99c4a34896 | ||
|
|
8085198dad | ||
|
|
8692aade81 | ||
|
|
2e482b56ec | ||
|
|
69b3da2256 | ||
|
|
5eed7f8739 | ||
|
|
3ecaafa28e | ||
|
|
da3ed72e06 | ||
|
|
f97865e49d | ||
|
|
285127020a | ||
|
|
0ab6f001c4 | ||
|
|
72ef8966aa | ||
|
|
cda1511ba3 | ||
|
|
efdb4025dc | ||
|
|
a4aedae4a8 | ||
|
|
0b6aec03d1 | ||
|
|
5e030f0357 | ||
|
|
d9394fd0ea | ||
|
|
42539d1e25 | ||
|
|
16311560d6 | ||
|
|
e22faa6453 | ||
|
|
2bfaf0f7eb | ||
|
|
cb47f11bbc | ||
|
|
88ca89b90d | ||
|
|
d837ef9a10 | ||
|
|
b71c2b76d5 | ||
|
|
5c555ba5fd | ||
|
|
e5668fb239 | ||
|
|
96d426b52f | ||
|
|
502e73a7ca | ||
|
|
8658ed2530 | ||
|
|
b227488e43 | ||
|
|
d97329acef | ||
|
|
c2fa3bae98 | ||
|
|
11aa0eb753 | ||
|
|
7f27b69079 | ||
|
|
2b336c4bfa | ||
|
|
f8ac674c45 | ||
|
|
4663095edb | ||
|
|
9cf0ab28af | ||
|
|
8ab5c1b929 | ||
|
|
dbe4982166 | ||
|
|
8942090911 | ||
|
|
c4f595b19e | ||
|
|
fe3d49cb19 | ||
|
|
8a2fdca92d | ||
|
|
5f7269ced1 | ||
|
|
ed4940ca68 | ||
|
|
bf4290866f | ||
|
|
e0f67fc2c0 | ||
|
|
89e7b49de4 | ||
|
|
70eb880363 | ||
|
|
c7cf00e5db | ||
|
|
21ee6db3f5 | ||
|
|
dd8420156f | ||
|
|
e12266541d | ||
|
|
343a8a9858 | ||
|
|
2966dc4828 | ||
|
|
47e05ee477 | ||
|
|
41edad57cb | ||
|
|
69de2646c6 | ||
|
|
ebdf0b8114 | ||
|
|
40e79e7bb2 | ||
|
|
4bdc395730 | ||
|
|
d159ab070a | ||
|
|
8a8100416e | ||
|
|
91299802ed | ||
|
|
fdab112728 | ||
|
|
57f5fb1d8f | ||
|
|
061d337195 | ||
|
|
82def1c5a0 | ||
|
|
a0e2c27746 | ||
|
|
1fc0d047f9 | ||
|
|
de827e6068 | ||
|
|
f07b6848cf | ||
|
|
950f6ae5e4 | ||
|
|
668b133496 | ||
|
|
759e5ad1b1 | ||
|
|
995610a967 | ||
|
|
47a228d295 | ||
|
|
3ba5edb697 | ||
|
|
1adad0de2f | ||
|
|
c17a886ad7 | ||
|
|
7b89e31900 | ||
|
|
6df4fc6735 | ||
|
|
653838d604 | ||
|
|
ce895e74b3 | ||
|
|
ea16192bc8 | ||
|
|
78701d8243 | ||
|
|
864248f18f | ||
|
|
6fbd2de127 | ||
|
|
101cff736f | ||
|
|
c5326584ca | ||
|
|
de5a60217b | ||
|
|
928ea7021d | ||
|
|
6a2fae87a1 | ||
|
|
cefe6ac235 | ||
|
|
1fa1c7d310 | ||
|
|
ed5fb23237 | ||
|
|
f5f0fcb3ac | ||
|
|
202cf72121 | ||
|
|
7bc6d897cf | ||
|
|
dd030d7ffe | ||
|
|
4a43d427e3 | ||
|
|
c29e4ddfd2 | ||
|
|
7a061ab337 | ||
|
|
d93b436c7d | ||
|
|
f929ca6847 | ||
|
|
efacbc2e3f | ||
|
|
ab56bd1ec1 | ||
|
|
b21f81b2dc | ||
|
|
451c7e6393 | ||
|
|
981b616ef4 | ||
|
|
70f31ae14e | ||
|
|
51f4969362 | ||
|
|
4f103199a2 | ||
|
|
f4b3e59e0b | ||
|
|
af59339b5a | ||
|
|
8f39e739a1 | ||
|
|
2559501827 | ||
|
|
b6cf2f32ac | ||
|
|
1c338ee02a | ||
|
|
7fbdffd307 | ||
|
|
59282afa74 | ||
|
|
5e6c704eb4 | ||
|
|
7d15b4137a | ||
|
|
799bfe44b4 | ||
|
|
b62c41413a | ||
|
|
e435e7465b | ||
|
|
937229da8a | ||
|
|
441cd1f25b | ||
|
|
0e6784888b | ||
|
|
61138a8f67 | ||
|
|
588f65663b | ||
|
|
3991e202cf | ||
|
|
13571d168d | ||
|
|
31a4711ac3 | ||
|
|
ac5437c0a6 | ||
|
|
f4e346adf2 | ||
|
|
057eba8b92 | ||
|
|
40dc94fd5c | ||
|
|
66ed4dd07b | ||
|
|
48c448f1c1 | ||
|
|
662a2e1715 | ||
|
|
d0ebc2d09f | ||
|
|
238aa70ccb | ||
|
|
d2b598e843 | ||
|
|
c8d5d3c6d1 |
3
.github/ISSUE_TEMPLATE/config.yml
vendored
3
.github/ISSUE_TEMPLATE/config.yml
vendored
@@ -1,5 +1,8 @@
|
||||
blank_issues_enabled: false
|
||||
contact_links:
|
||||
- name: "\U0001F6A8 Microsoft Security Response Center (MSRC)"
|
||||
url: https://msrc.microsoft.com/create-report
|
||||
about: Report security bugs
|
||||
- name: "\U0001F4DA PowerToys user documentation"
|
||||
url: https://aka.ms/powertoys-docs
|
||||
about: Documentation for users of PowerToys utilities
|
||||
|
||||
1
.github/actions/spell-check/allow/code.txt
vendored
1
.github/actions/spell-check/allow/code.txt
vendored
@@ -84,7 +84,6 @@ Ctrls
|
||||
EXSEL
|
||||
HOLDENTER
|
||||
HOLDESC
|
||||
HOLDSPACE
|
||||
KBDLLHOOKSTRUCT
|
||||
keyevent
|
||||
LAlt
|
||||
|
||||
5
.github/actions/spell-check/allow/names.txt
vendored
5
.github/actions/spell-check/allow/names.txt
vendored
@@ -40,13 +40,11 @@ Bao
|
||||
betadele
|
||||
betsegaw
|
||||
bricelam
|
||||
CCcat
|
||||
Chinh
|
||||
chrdavis
|
||||
Chrzan
|
||||
clayton
|
||||
Coplen
|
||||
craigloewen
|
||||
crutkas
|
||||
damienleroy
|
||||
davidegiacometti
|
||||
@@ -88,7 +86,6 @@ martinchrzan
|
||||
martinmoene
|
||||
Melman
|
||||
Mikhayelyan
|
||||
msft
|
||||
Myrvold
|
||||
Nemeth
|
||||
nielslaute
|
||||
@@ -102,7 +99,6 @@ Pooja
|
||||
Quriz
|
||||
randyrants
|
||||
ricardosantos
|
||||
ritchielawrence
|
||||
robmikh
|
||||
Rutkas
|
||||
ryanbodrug
|
||||
@@ -132,7 +128,6 @@ Zykova
|
||||
|
||||
# OTHERS
|
||||
|
||||
cmdow
|
||||
Controlz
|
||||
cortana
|
||||
fancymouse
|
||||
|
||||
2
.github/actions/spell-check/excludes.txt
vendored
2
.github/actions/spell-check/excludes.txt
vendored
@@ -98,6 +98,8 @@
|
||||
^\Q.github/workflows/spelling2.yml\E$
|
||||
^\Q.pipelines/ESRPSigning_core.json\E$
|
||||
^\Q.pipelines/sdl.gdnbaselines\E$
|
||||
^\Qdeps/WinAppDriver/EULA.rtf\E$
|
||||
^\Qdeps/WinAppDriver/Readme.txt\E$
|
||||
^\Qinstaller/PowerToysSetup/Settings.wxs\E$
|
||||
^\Qsrc/common/FilePreviewCommon/Assets/Monaco/monaco_languages.json\E$
|
||||
^\Qsrc/common/ManagedCommon/ColorFormatHelper.cs\E$
|
||||
|
||||
29
.github/actions/spell-check/expect.txt
vendored
29
.github/actions/spell-check/expect.txt
vendored
@@ -38,7 +38,6 @@ ALPHATYPE
|
||||
AModifier
|
||||
AMPROPERTY
|
||||
AMPROPSETID
|
||||
amr
|
||||
ANDSCANS
|
||||
animatedvisuals
|
||||
ansicolor
|
||||
@@ -54,7 +53,7 @@ Apm
|
||||
APPBARDATA
|
||||
appdata
|
||||
APPEXECLINK
|
||||
Appium
|
||||
appium
|
||||
Applicationcan
|
||||
appmanifest
|
||||
APPNAME
|
||||
@@ -100,7 +99,6 @@ bbwe
|
||||
bck
|
||||
BESTEFFORT
|
||||
bhid
|
||||
BIF
|
||||
bigbar
|
||||
bigobj
|
||||
binlog
|
||||
@@ -127,7 +125,6 @@ BPBF
|
||||
bpmf
|
||||
bpp
|
||||
Browsable
|
||||
BROWSEINFO
|
||||
bsd
|
||||
bthprops
|
||||
bti
|
||||
@@ -215,7 +212,6 @@ cominterop
|
||||
commandline
|
||||
COMMANDTITLE
|
||||
commctrl
|
||||
commdlg
|
||||
compmgmt
|
||||
COMPOSITIONFULL
|
||||
comsupp
|
||||
@@ -477,7 +473,6 @@ FILELOCKSMITHCONTEXTMENU
|
||||
FILELOCKSMITHEXT
|
||||
FILELOCKSMITHLIB
|
||||
FILELOCKSMITHLIBINTEROP
|
||||
FILEMUSTEXIST
|
||||
FILEOP
|
||||
FILEOS
|
||||
FILESUBTYPE
|
||||
@@ -489,7 +484,6 @@ Filterkeyboard
|
||||
Filterx
|
||||
findfast
|
||||
FIXEDFILEINFO
|
||||
flac
|
||||
flyouts
|
||||
FOF
|
||||
FOFX
|
||||
@@ -751,7 +745,6 @@ keyremaps
|
||||
KILLFOCUS
|
||||
killrunner
|
||||
Knownfolders
|
||||
ksh
|
||||
KSPROPERTY
|
||||
Kybd
|
||||
languagesjson
|
||||
@@ -808,7 +801,6 @@ LPCTSTR
|
||||
lpdw
|
||||
lpfn
|
||||
LPINPUT
|
||||
LPITEMIDLIST
|
||||
lpmi
|
||||
LPMINMAXINFO
|
||||
LPMONITORINFO
|
||||
@@ -816,7 +808,6 @@ LPOSVERSIONINFOEXW
|
||||
LPQUERY
|
||||
lprc
|
||||
LPSAFEARRAY
|
||||
lpstr
|
||||
lpsz
|
||||
lpt
|
||||
LPTHREAD
|
||||
@@ -842,7 +833,6 @@ lwin
|
||||
LZero
|
||||
majortype
|
||||
makecab
|
||||
MAKELANGID
|
||||
MAKEINTRESOURCE
|
||||
MAKEINTRESOURCEA
|
||||
MAKEINTRESOURCEW
|
||||
@@ -929,7 +919,6 @@ mscorlib
|
||||
msdata
|
||||
msedge
|
||||
MSGFLT
|
||||
msiexec
|
||||
MSIFASTINSTALL
|
||||
MSIHANDLE
|
||||
msiquery
|
||||
@@ -982,7 +971,6 @@ netsetup
|
||||
netsh
|
||||
newcolor
|
||||
newdev
|
||||
NEWDIALOGSTYLE
|
||||
newitem
|
||||
newpath
|
||||
newrow
|
||||
@@ -1029,7 +1017,6 @@ NOSIZE
|
||||
NOTIFICATIONSDLL
|
||||
NOTIFYICONDATAW
|
||||
NOTIMPL
|
||||
notlike
|
||||
NOTOPMOST
|
||||
NOTRACK
|
||||
NOTSRCCOPY
|
||||
@@ -1054,7 +1041,6 @@ ocr
|
||||
Ocrsettings
|
||||
odbccp
|
||||
officehubintl
|
||||
OFN
|
||||
ofs
|
||||
oldcolor
|
||||
olditem
|
||||
@@ -1065,7 +1051,6 @@ OLECHAR
|
||||
onebranch
|
||||
OOBEPT
|
||||
opencode
|
||||
OPENFILENAME
|
||||
opensource
|
||||
openxmlformats
|
||||
OPTIMIZEFORINVOKE
|
||||
@@ -1100,7 +1085,6 @@ parray
|
||||
PARTIALCONFIRMATIONDIALOGTITLE
|
||||
PATCOPY
|
||||
pathcch
|
||||
PATHMUSTEXIST
|
||||
Pathto
|
||||
PATINVERT
|
||||
PATPAINT
|
||||
@@ -1111,7 +1095,6 @@ pcb
|
||||
pcch
|
||||
pcelt
|
||||
pch
|
||||
pchast
|
||||
PCIDLIST
|
||||
PCWSTR
|
||||
pdisp
|
||||
@@ -1190,7 +1173,6 @@ PRINTCLIENT
|
||||
printmanagement
|
||||
prm
|
||||
proactively
|
||||
PROCESSENTRY
|
||||
PROCESSKEY
|
||||
processthreadsapi
|
||||
PRODEXT
|
||||
@@ -1310,7 +1292,6 @@ RESTORETOMAXIMIZED
|
||||
restrictedcapabilities
|
||||
restrictederrorinfo
|
||||
resultlist
|
||||
RETURNONLYFSDIRS
|
||||
RGBQUAD
|
||||
rgbs
|
||||
rgelt
|
||||
@@ -1455,7 +1436,6 @@ sln
|
||||
SMALLICON
|
||||
smartphone
|
||||
SMTO
|
||||
SNAPPROCESS
|
||||
snwprintf
|
||||
softline
|
||||
SOURCECLIENTAREAONLY
|
||||
@@ -1598,7 +1578,6 @@ tlbimp
|
||||
TMPVAR
|
||||
TNP
|
||||
toggleswitch
|
||||
Toolhelp
|
||||
toolkitconverters
|
||||
Toolset
|
||||
toolwindow
|
||||
@@ -1613,7 +1592,6 @@ TRAYMOUSEMESSAGE
|
||||
triaging
|
||||
TRK
|
||||
trl
|
||||
trx
|
||||
Tsd
|
||||
TServer
|
||||
TStr
|
||||
@@ -1656,12 +1634,12 @@ Updatelayout
|
||||
UPGRADINGPRODUCTCODE
|
||||
Uptool
|
||||
urld
|
||||
urlmon
|
||||
Usb
|
||||
USEDEFAULT
|
||||
USEFILEATTRIBUTES
|
||||
USERDATA
|
||||
Userenv
|
||||
uservoice
|
||||
USESHOWWINDOW
|
||||
USESTDHANDLES
|
||||
USRDLL
|
||||
@@ -1715,7 +1693,6 @@ vscdb
|
||||
vsconfig
|
||||
VSCROLL
|
||||
vsetq
|
||||
VSINSTALLDIR
|
||||
VSM
|
||||
vso
|
||||
vsonline
|
||||
@@ -1734,7 +1711,6 @@ wcautil
|
||||
WCE
|
||||
wcex
|
||||
WClass
|
||||
wcsicmp
|
||||
wcsnicmp
|
||||
WDA
|
||||
wdp
|
||||
@@ -1816,6 +1792,7 @@ WNDPROC
|
||||
workarounds
|
||||
wox
|
||||
wparam
|
||||
wpdev
|
||||
wpf
|
||||
wpftmp
|
||||
wpfui
|
||||
|
||||
2
.github/workflows/msstore-submissions.yml
vendored
2
.github/workflows/msstore-submissions.yml
vendored
@@ -1,4 +1,4 @@
|
||||
name: Store submission on release
|
||||
name: Submit Microsoft.PowerToys package to Windows Store
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
|
||||
4
.github/workflows/package-submissions.yml
vendored
4
.github/workflows/package-submissions.yml
vendored
@@ -1,4 +1,4 @@
|
||||
name: WinGet submission on release
|
||||
name: Submit Microsoft.PowerToys package to Windows Package Manager Community Repository
|
||||
# based off of https://github.com/nushell/nushell/blob/main/.github/workflows/winget-submission.yml
|
||||
|
||||
on:
|
||||
@@ -11,7 +11,7 @@ jobs:
|
||||
name: Publish winget package
|
||||
runs-on: windows-latest
|
||||
steps:
|
||||
- name: Submit Microsoft.PowerToys package to Windows Package Manager Community Repository
|
||||
- name: Submit package to Windows Package Manager Community Repository
|
||||
run: |
|
||||
|
||||
$wingetPackage = "Microsoft.PowerToys"
|
||||
|
||||
33
.github/workflows/similarIssues.yml
vendored
33
.github/workflows/similarIssues.yml
vendored
@@ -1,33 +0,0 @@
|
||||
name: GitGudSimilarIssues comments
|
||||
|
||||
on:
|
||||
issues:
|
||||
types: [opened]
|
||||
|
||||
jobs:
|
||||
getSimilarIssues:
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
message: ${{ steps.getBody.outputs.message }}
|
||||
steps:
|
||||
- id: getBody
|
||||
uses: craigloewen-msft/GitGudSimilarIssues@main
|
||||
with:
|
||||
issueTitle: ${{ github.event.issue.title }}
|
||||
issueBody: ${{ github.event.issue.body }}
|
||||
repo: ${{ github.repository }}
|
||||
similarityTolerance: "0.75"
|
||||
add-comment:
|
||||
needs: getSimilarIssues
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
issues: write
|
||||
if: needs.getSimilarIssues.outputs.message != ''
|
||||
steps:
|
||||
- name: Add comment
|
||||
run: gh issue comment "$NUMBER" --repo "$REPO" --body "$BODY"
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
NUMBER: ${{ github.event.issue.number }}
|
||||
REPO: ${{ github.repository }}
|
||||
BODY: ${{ needs.getSimilarIssues.outputs.message }}
|
||||
2
.gitignore
vendored
2
.gitignore
vendored
@@ -33,8 +33,6 @@ bld/
|
||||
# Visual Studio 2017 auto generated files
|
||||
Generated\ Files/
|
||||
|
||||
Generated/
|
||||
|
||||
# MSTest test Results
|
||||
[Tt]est[Rr]esult*/
|
||||
[Bb]uild[Ll]og.*
|
||||
|
||||
@@ -1,51 +0,0 @@
|
||||
{
|
||||
"Version": "1.0.0",
|
||||
"UseMinimatch": false,
|
||||
"SignBatches": [
|
||||
{
|
||||
"MatchedPath": [
|
||||
"Microsoft.PowerToys.Configure.psm1",
|
||||
"Microsoft.PowerToys.Configure.psd1"
|
||||
],
|
||||
"SigningInfo": {
|
||||
"Operations": [
|
||||
{
|
||||
"KeyCode": "CP-230012",
|
||||
"OperationSetCode": "SigntoolSign",
|
||||
"Parameters": [
|
||||
{
|
||||
"parameterName": "OpusName",
|
||||
"parameterValue": "Microsoft"
|
||||
},
|
||||
{
|
||||
"parameterName": "OpusInfo",
|
||||
"parameterValue": "http://www.microsoft.com"
|
||||
},
|
||||
{
|
||||
"parameterName": "FileDigest",
|
||||
"parameterValue": "/fd \"SHA256\""
|
||||
},
|
||||
{
|
||||
"parameterName": "PageHash",
|
||||
"parameterValue": "/NPH"
|
||||
},
|
||||
{
|
||||
"parameterName": "TimeStamp",
|
||||
"parameterValue": "/tr \"http://rfc3161.gtm.corp.microsoft.com/TSS/HttpTspServer\" /td sha256"
|
||||
}
|
||||
],
|
||||
"ToolName": "sign",
|
||||
"ToolVersion": "1.0"
|
||||
},
|
||||
{
|
||||
"KeyCode": "CP-230012",
|
||||
"OperationSetCode": "SigntoolVerify",
|
||||
"Parameters": [],
|
||||
"ToolName": "sign",
|
||||
"ToolVersion": "1.0"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -7,7 +7,7 @@
|
||||
"*.resources.dll",
|
||||
|
||||
"WinUI3Apps\\Assets\\Settings\\Scripts\\*.ps1",
|
||||
|
||||
|
||||
"PowerToys.ActionRunner.exe",
|
||||
"PowerToys.Update.exe",
|
||||
"PowerToys.BackgroundActivatorDLL.dll",
|
||||
@@ -54,7 +54,6 @@
|
||||
"fancyzones.dll",
|
||||
"PowerToys.FancyZonesEditor.exe",
|
||||
"PowerToys.FancyZonesEditor.dll",
|
||||
"PowerToys.FancyZonesEditorCommon.dll",
|
||||
"PowerToys.FancyZonesModuleInterface.dll",
|
||||
"PowerToys.FancyZones.exe",
|
||||
|
||||
|
||||
@@ -1,15 +0,0 @@
|
||||
$ProgressPreference = 'SilentlyContinue'
|
||||
|
||||
$WinAppDriverDownloadUrl = "https://github.com/microsoft/WinAppDriver/releases/download/v1.2.1/WindowsApplicationDriver_1.2.1.msi"
|
||||
|
||||
# Download WinAppDriver and verify their hash sums
|
||||
Invoke-WebRequest -Uri $WinAppDriverDownloadUrl -OutFile "$($ENV:Temp)\WindowsApplicationDriver_1.2.1.msi"
|
||||
$Hash = (Get-FileHash -Algorithm SHA256 "$($ENV:Temp)\WindowsApplicationDriver_1.2.1.msi").Hash
|
||||
if ($Hash -ne 'a76a8f4e44b29bad331acf6b6c248fcc65324f502f28826ad2acd5f3c80857fe')
|
||||
{
|
||||
Write-Error "$WinAppDriverHash"
|
||||
throw "WindowsApplicationDriver_1.2.1.msi has unexpected SHA256 hash: $Hash"
|
||||
}
|
||||
|
||||
# Install WinAppDriver
|
||||
Start-Process msiexec.exe -Wait -ArgumentList "/I $($ENV:Temp)\WindowsApplicationDriver_1.2.1.msi /quiet /passive"
|
||||
@@ -107,7 +107,7 @@ if (-not $Passive)
|
||||
else
|
||||
{
|
||||
Write-Output "Checking all files (passively)"
|
||||
$files = Get-ChildItem -Path "$PSScriptRoot\..\src\*.xaml" -Recurse | Select-Object -ExpandProperty FullName | Where-Object { $_ -notmatch "(\\obj\\)|(\\bin\\)|(\\x64\\)|(\\Generated Files\\PowerRenameXAML\\)" }
|
||||
$files = Get-ChildItem -Path "$PSScriptRoot\..\src\*.xaml" -Recurse | Select-Object -ExpandProperty FullName | Where-Object { $_ -notmatch "(\\obj\\)|(\\bin\\)|(\\x64\\)|(\\Generated Files\\PowerRenameXAML\\)|(\\colorPicker\\ColorPickerUI\\)" }
|
||||
|
||||
if ($files.count -gt 0)
|
||||
{
|
||||
|
||||
@@ -4,10 +4,10 @@ parameters:
|
||||
default: 'Release'
|
||||
- name: platform
|
||||
type: string
|
||||
default: 'x64'
|
||||
default: '/p:RestorePackagesConfig=true -m'
|
||||
- name: additionalBuildArguments
|
||||
type: string
|
||||
default: '-p:RestorePackagesConfig=true -m'
|
||||
default: '/p:RestorePackagesConfig=true -m'
|
||||
- name: enableCaching
|
||||
type: boolean
|
||||
default: false
|
||||
|
||||
@@ -91,21 +91,21 @@ steps:
|
||||
displayName: 'nuget restore packages.config'
|
||||
|
||||
- task: VSBuild@1
|
||||
displayName: 'Build and Test PowerToys.sln'
|
||||
displayName: 'Build PowerToys.sln'
|
||||
inputs:
|
||||
solution: '**\PowerToys.sln'
|
||||
vsVersion: 17.0
|
||||
platform: '$(BuildPlatform)'
|
||||
configuration: '$(BuildConfiguration)'
|
||||
${{ if eq(parameters.enableCaching, true) }}:
|
||||
msbuildArgs: -restore ${{ parameters.additionalBuildArguments }} -t:Build;Test -graph -reportfileaccesses -p:MSBuildCacheEnabled=true -p:MSBuildCacheLogDirectory=$(Build.ArtifactStagingDirectory)\logs\MSBuildCache -bl:$(Build.ArtifactStagingDirectory)\logs\PowerToys.binlog -ds:false
|
||||
msbuildArgs: -restore ${{ parameters.additionalBuildArguments }} -graph -reportfileaccesses -p:MSBuildCacheEnabled=true -p:MSBuildCacheLogDirectory=$(Build.ArtifactStagingDirectory)\logs\MSBuildCache -bl:$(Build.ArtifactStagingDirectory)\logs\PowerToys.binlog -ds:false
|
||||
${{ else }}:
|
||||
msbuildArgs: -restore ${{ parameters.additionalBuildArguments }} -t:Build;Test -graph -bl:$(Build.ArtifactStagingDirectory)\logs\PowerToys.binlog -ds:false
|
||||
msbuildArgs: -restore ${{ parameters.additionalBuildArguments }} -bl:$(Build.ArtifactStagingDirectory)\logs\PowerToys.binlog -ds:false
|
||||
msbuildArchitecture: x64
|
||||
maximumCpuCount: true
|
||||
${{ if eq(parameters.enableCaching, true) }}:
|
||||
env:
|
||||
SYSTEM_ACCESSTOKEN: $(System.AccessToken)
|
||||
SYSTEM_ACCESSTOKEN: $(System.AccessToken)
|
||||
|
||||
- task: VSBuild@1
|
||||
displayName: 'Build BugReportTool.sln'
|
||||
@@ -114,7 +114,7 @@ steps:
|
||||
vsVersion: 17.0
|
||||
platform: '$(BuildPlatform)'
|
||||
configuration: '$(BuildConfiguration)'
|
||||
msbuildArgs: -restore ${{ parameters.additionalBuildArguments }} -graph -bl:$(Build.ArtifactStagingDirectory)\logs\BugReportTool.binlog -ds:false
|
||||
msbuildArgs: -restore ${{ parameters.additionalBuildArguments }} -bl:$(Build.ArtifactStagingDirectory)\logs\BugReportTool.binlog -ds:false
|
||||
msbuildArchitecture: x64
|
||||
maximumCpuCount: true
|
||||
|
||||
@@ -125,7 +125,7 @@ steps:
|
||||
vsVersion: 17.0
|
||||
platform: '$(BuildPlatform)'
|
||||
configuration: '$(BuildConfiguration)'
|
||||
msbuildArgs: -restore ${{ parameters.additionalBuildArguments }} -graph -bl:$(Build.ArtifactStagingDirectory)\logs\WebcamReportTool.binlog -ds:false
|
||||
msbuildArgs: -restore ${{ parameters.additionalBuildArguments }} -bl:$(Build.ArtifactStagingDirectory)\logs\WebcamReportTool.binlog -ds:false
|
||||
msbuildArchitecture: x64
|
||||
maximumCpuCount: true
|
||||
|
||||
@@ -136,7 +136,7 @@ steps:
|
||||
vsVersion: 17.0
|
||||
platform: '$(BuildPlatform)'
|
||||
configuration: '$(BuildConfiguration)'
|
||||
msbuildArgs: -restore ${{ parameters.additionalBuildArguments }} -graph -bl:$(Build.ArtifactStagingDirectory)\logs\StylesReportTool.binlog -ds:false
|
||||
msbuildArgs: -restore ${{ parameters.additionalBuildArguments }} -bl:$(Build.ArtifactStagingDirectory)\logs\StylesReportTool.binlog -ds:false
|
||||
msbuildArchitecture: x64
|
||||
maximumCpuCount: true
|
||||
|
||||
@@ -222,13 +222,47 @@ steps:
|
||||
arguments: -targetDir '$(build.sourcesdirectory)\$(BuildPlatform)\$(BuildConfiguration)\WinUI3Apps'
|
||||
pwsh: true
|
||||
|
||||
# Publish test results which ran in MSBuild
|
||||
- task: PublishTestResults@2
|
||||
displayName: 'Publish Test Results'
|
||||
# directly not doing WinAppDriver testing
|
||||
- task: VSTest@2
|
||||
displayName: 'MS Tests'
|
||||
condition: ne(variables['BuildPlatform'], 'arm64') # No arm64 agents to run the tests.
|
||||
inputs:
|
||||
testResultsFormat: VSTest
|
||||
testResultsFiles: '**/*.trx'
|
||||
condition: always()
|
||||
platform: '$(BuildPlatform)'
|
||||
configuration: '$(BuildConfiguration)'
|
||||
testSelector: 'testAssemblies'
|
||||
testAssemblyVer2: |
|
||||
**\UnitTests-GcodeThumbnailProvider.dll
|
||||
**\UnitTests-StlThumbnailProvider.dll
|
||||
**\UnitTests-PdfThumbnailProvider.dll
|
||||
**\UnitTests-QoiThumbnailProvider.dll
|
||||
**\Settings.UI.UnitTests.dll
|
||||
**\UnitTests-GcodePreviewHandler.dll
|
||||
**\UnitTests-QoiPreviewHandler.dll
|
||||
**\UnitTests-FancyZonesEditor.dll
|
||||
**\UnitTests-PdfPreviewHandler.dll
|
||||
**\UnitTests-PreviewHandlerCommon.dll
|
||||
**\Microsoft.PowerToys.Run.Plugin.Registry.UnitTests.dll
|
||||
**\UnitTest-ColorPickerUI.dll
|
||||
**\Microsoft.Interop.Tests.dll
|
||||
**\ImageResizer.Test.dll
|
||||
**\Community.PowerToys.Run.Plugin.UnitConverter.UnitTest.dll
|
||||
**\Community.PowerToys.Run.Plugin.ValueGenerator.UnitTests.dll
|
||||
**\Microsoft.Plugin.Folder.UnitTests.dll
|
||||
**\Microsoft.Plugin.Program.UnitTests.dll
|
||||
**\Microsoft.PowerToys.Run.Plugin.Calculator.UnitTest.dll
|
||||
**\Microsoft.Plugin.Uri.UnitTests.dll
|
||||
**\Wox.Test.dll
|
||||
**\Microsoft.PowerToys.Run.Plugin.System.UnitTests.dll
|
||||
**\Microsoft.PowerToys.Run.Plugin.TimeDate.UnitTests.dll
|
||||
**\Microsoft.Plugin.WindowsTerminal.UnitTests.dll
|
||||
**\Microsoft.Plugin.WindowWalker.UnitTests.dll
|
||||
**\PreviewPaneUnitTests.dll
|
||||
**\UnitTests-SvgThumbnailProvider.dll
|
||||
**\UnitTests-SvgPreviewHandler.dll
|
||||
**\PowerToys.Hosts.Tests.dll
|
||||
**\MouseJumpUI.UnitTests.dll
|
||||
!**\obj\**
|
||||
!**\ref\**
|
||||
|
||||
# Native dlls
|
||||
- task: VSTest@2
|
||||
@@ -243,6 +277,7 @@ steps:
|
||||
**\KeyboardManagerEditorTest.dll
|
||||
**\UnitTests-CommonLib.dll
|
||||
**\PowerRenameUnitTests.dll
|
||||
**\powerpreviewTest.dll
|
||||
**\UnitTests-FancyZones.dll
|
||||
!**\obj\**
|
||||
|
||||
@@ -273,7 +308,9 @@ steps:
|
||||
contents: '$(BuildPlatform)/$(BuildConfiguration)/**/*'
|
||||
targetFolder: '$(Build.ArtifactStagingDirectory)\$(BuildPlatform)\$(BuildConfiguration)'
|
||||
|
||||
- publish: $(Build.ArtifactStagingDirectory)\$(BuildPlatform)\$(BuildConfiguration)
|
||||
- task: PublishBuildArtifacts@1
|
||||
displayName: Publish Build Artifacts
|
||||
artifact: build-$(BuildPlatform)-$(BuildConfiguration)
|
||||
condition: and(succeeded(), ne(variables['BuildPlatform'],'arm64'))
|
||||
inputs:
|
||||
pathToPublish: '$(Build.ArtifactStagingDirectory)\$(BuildPlatform)\$(BuildConfiguration)'
|
||||
artifactName: build-$(BuildPlatform)-$(BuildConfiguration)
|
||||
|
||||
@@ -20,9 +20,11 @@ jobs:
|
||||
clean: true
|
||||
fetchTags: false
|
||||
|
||||
- download: current
|
||||
- task: DownloadPipelineArtifact@2
|
||||
displayName: Download artifacts
|
||||
artifact: build-${{ parameters.platform }}-${{ parameters.configuration }}
|
||||
inputs:
|
||||
artifact: build-${{ parameters.platform }}-${{ parameters.configuration }}
|
||||
path: $(Build.ArtifactStagingDirectory)
|
||||
|
||||
- task: UseDotNet@2
|
||||
displayName: 'Use .NET 6 SDK'
|
||||
@@ -40,12 +42,6 @@ jobs:
|
||||
- task: VisualStudioTestPlatformInstaller@1
|
||||
displayName: Ensure VSTest Platform
|
||||
|
||||
- task: PowerShell@2
|
||||
displayName: Download and install WinAppDriver
|
||||
inputs:
|
||||
targetType: filePath
|
||||
filePath: '$(build.sourcesdirectory)\.pipelines\InstallWinAppDriver.ps1'
|
||||
|
||||
- task: ScreenResolutionUtility@1
|
||||
inputs:
|
||||
displaySettings: 'optimal'
|
||||
@@ -57,10 +53,10 @@ jobs:
|
||||
platform: '$(BuildPlatform)'
|
||||
configuration: '$(BuildConfiguration)'
|
||||
testSelector: 'testAssemblies'
|
||||
searchFolder: '$(Pipeline.Workspace)\build-${{ parameters.platform }}-${{ parameters.configuration }}'
|
||||
searchFolder: '$(Build.ArtifactStagingDirectory)'
|
||||
vstestLocationMethod: 'location' # otherwise fails to find vstest.console.exe
|
||||
#vstestLocation: '$(Agent.ToolsDirectory)\VsTest\**\${{ parameters.platform }}\tools\net462\Common7\IDE\Extensions\TestPlatform'
|
||||
vstestLocation: '$(Agent.ToolsDirectory)\VsTest\17.10.0-release-24177-07\x64\tools\net462\Common7\IDE\Extensions\TestPlatform'
|
||||
vstestLocation: '$(Agent.ToolsDirectory)\VsTest\17.10.0-preview-24080-01\x64\tools\net462\Common7\IDE\Extensions\TestPlatform'
|
||||
uiTests: true
|
||||
rerunFailedTests: true
|
||||
testAssemblyVer2: |
|
||||
|
||||
@@ -1,19 +1,19 @@
|
||||
$ProgressPreference = 'SilentlyContinue'
|
||||
|
||||
$WixDownloadUrl = "https://github.com/wixtoolset/wix3/releases/download/wix3141rtm/wix314.exe"
|
||||
$WixBinariesDownloadUrl = "https://github.com/wixtoolset/wix3/releases/download/wix3141rtm/wix314-binaries.zip"
|
||||
$WixDownloadUrl = "https://github.com/wixtoolset/wix3/releases/download/wix314rtm/wix314.exe"
|
||||
$WixBinariesDownloadUrl = "https://github.com/wixtoolset/wix3/releases/download/wix314rtm/wix314-binaries.zip"
|
||||
|
||||
# Download WiX binaries and verify their hash sums
|
||||
Invoke-WebRequest -Uri $WixDownloadUrl -OutFile "$($ENV:Temp)\wix314.exe"
|
||||
$Hash = (Get-FileHash -Algorithm SHA256 "$($ENV:Temp)\wix314.exe").Hash
|
||||
if ($Hash -ne '6BF6D03D6923D9EF827AE1D943B90B42B8EBB1B0F68EF6D55F868FA34C738A29')
|
||||
if ($Hash -ne '704439EA88FC9E5A3647EEDEEB45943F9A392E3D209F58512280130096847937')
|
||||
{
|
||||
Write-Error "$WixHash"
|
||||
throw "wix314.exe has unexpected SHA256 hash: $Hash"
|
||||
}
|
||||
Invoke-WebRequest -Uri $WixBinariesDownloadUrl -OutFile "$($ENV:Temp)\wix314-binaries.zip"
|
||||
$Hash = (Get-FileHash -Algorithm SHA256 "$($ENV:Temp)\wix314-binaries.zip").Hash
|
||||
if($Hash -ne '6AC824E1642D6F7277D0ED7EA09411A508F6116BA6FAE0AA5F2C7DAA2FF43D31')
|
||||
if($Hash -ne '13F067F38969FAF163D93A804B48EA0576790A202C8F10291F2000F0E356E934')
|
||||
{
|
||||
throw "wix314-binaries.zip has unexpected SHA256 hash: $Hash"
|
||||
}
|
||||
|
||||
@@ -43,6 +43,10 @@ steps:
|
||||
- powershell: 'tar czf LocOutput.tar.gz LocOutput'
|
||||
displayName: 'PowerShell Script'
|
||||
|
||||
- publish: LocOutput.tar.gz
|
||||
- task: PublishBuildArtifacts@1
|
||||
displayName: 'Publish Artifact: LocOutput'
|
||||
artifact: LocOutput
|
||||
inputs:
|
||||
PathtoPublish: LocOutput.tar.gz
|
||||
ArtifactName: LocOutput
|
||||
|
||||
|
||||
|
||||
@@ -156,7 +156,7 @@ extends:
|
||||
inputs:
|
||||
solution: '**\PowerToys.sln'
|
||||
vsVersion: 17.0
|
||||
msbuildArgs: -restore -graph /p:RestorePackagesConfig=true /p:RestoreConfigFile="$(Build.SourcesDirectory)\.pipelines\release-nuget.config" /p:CIBuild=true /bl:$(Build.SourcesDirectory)\msbuild.binlog
|
||||
msbuildArgs: -restore /p:RestorePackagesConfig=true /p:RestoreConfigFile="$(Build.SourcesDirectory)\.pipelines\release-nuget.config" /p:CIBuild=true /bl:$(Build.SourcesDirectory)\msbuild.binlog
|
||||
platform: $(BuildPlatform)
|
||||
configuration: $(BuildConfiguration)
|
||||
clean: true
|
||||
@@ -167,7 +167,7 @@ extends:
|
||||
inputs:
|
||||
solution: '**/tools/BugReportTool/BugReportTool.sln'
|
||||
vsVersion: 17.0
|
||||
msbuildArgs: -restore -graph /p:RestorePackagesConfig=true /p:RestoreConfigFile="$(Build.SourcesDirectory)\.pipelines\release-nuget.config" /p:CIBuild=true /bl:$(Build.SourcesDirectory)\msbuild.binlog
|
||||
msbuildArgs: -restore /p:RestorePackagesConfig=true /p:RestoreConfigFile="$(Build.SourcesDirectory)\.pipelines\release-nuget.config" /p:CIBuild=true /bl:$(Build.SourcesDirectory)\msbuild.binlog
|
||||
platform: $(BuildPlatform)
|
||||
configuration: $(BuildConfiguration)
|
||||
clean: true
|
||||
@@ -178,7 +178,7 @@ extends:
|
||||
inputs:
|
||||
solution: '**/tools/WebcamReportTool/WebcamReportTool.sln'
|
||||
vsVersion: 17.0
|
||||
msbuildArgs: -restore -graph /p:RestorePackagesConfig=true /p:RestoreConfigFile="$(Build.SourcesDirectory)\.pipelines\release-nuget.config" /p:CIBuild=true /bl:$(Build.SourcesDirectory)\msbuild.binlog
|
||||
msbuildArgs: -restore /p:RestorePackagesConfig=true /p:RestoreConfigFile="$(Build.SourcesDirectory)\.pipelines\release-nuget.config" /p:CIBuild=true /bl:$(Build.SourcesDirectory)\msbuild.binlog
|
||||
platform: $(BuildPlatform)
|
||||
configuration: $(BuildConfiguration)
|
||||
clean: true
|
||||
@@ -189,7 +189,7 @@ extends:
|
||||
inputs:
|
||||
solution: '**/tools/StylesReportTool/StylesReportTool.sln'
|
||||
vsVersion: 17.0
|
||||
msbuildArgs: -restore -graph /p:RestorePackagesConfig=true /p:RestoreConfigFile="$(Build.SourcesDirectory)\.pipelines\release-nuget.config" /p:CIBuild=true /bl:$(Build.SourcesDirectory)\msbuild.binlog
|
||||
msbuildArgs: -restore /p:RestorePackagesConfig=true /p:RestoreConfigFile="$(Build.SourcesDirectory)\.pipelines\release-nuget.config" /p:CIBuild=true /bl:$(Build.SourcesDirectory)\msbuild.binlog
|
||||
platform: $(BuildPlatform)
|
||||
configuration: $(BuildConfiguration)
|
||||
clean: true
|
||||
@@ -202,7 +202,6 @@ extends:
|
||||
vsVersion: 17.0
|
||||
msbuildArgs: >-
|
||||
/target:Publish
|
||||
/graph
|
||||
/p:Configuration=$(BuildConfiguration);Platform=$(BuildPlatform);AppxBundle=Never
|
||||
/p:VCRTForwarders-IncludeDebugCRT=false
|
||||
/p:PowerToysRoot=$(Build.SourcesDirectory)
|
||||
@@ -219,7 +218,6 @@ extends:
|
||||
# The arguments should be the same as the ones for Settings; make sure they are.
|
||||
msbuildArgs: >-
|
||||
/target:Publish
|
||||
/graph
|
||||
/p:Configuration=$(BuildConfiguration);Platform=$(BuildPlatform);AppxBundle=Never
|
||||
/p:VCRTForwarders-IncludeDebugCRT=false
|
||||
/p:PowerToysRoot=$(Build.SourcesDirectory)
|
||||
@@ -236,7 +234,6 @@ extends:
|
||||
# The arguments should be the same as the ones for Settings; make sure they are.
|
||||
msbuildArgs: >-
|
||||
/target:Publish
|
||||
/graph
|
||||
/p:Configuration=$(BuildConfiguration);Platform=$(BuildPlatform);AppxBundle=Never
|
||||
/p:VCRTForwarders-IncludeDebugCRT=false
|
||||
/p:PowerToysRoot=$(Build.SourcesDirectory)
|
||||
@@ -253,7 +250,6 @@ extends:
|
||||
# The arguments should be the same as the ones for Settings; make sure they are.
|
||||
msbuildArgs: >-
|
||||
/target:Publish
|
||||
/graph
|
||||
/p:Configuration=$(BuildConfiguration);Platform=$(BuildPlatform);AppxBundle=Never
|
||||
/p:VCRTForwarders-IncludeDebugCRT=false
|
||||
/p:PowerToysRoot=$(Build.SourcesDirectory)
|
||||
@@ -270,7 +266,6 @@ extends:
|
||||
# The arguments should be the same as the ones for Settings; make sure they are.
|
||||
msbuildArgs: >-
|
||||
/target:Publish
|
||||
/graph
|
||||
/p:Configuration=$(BuildConfiguration);Platform=$(BuildPlatform);AppxBundle=Never
|
||||
/p:VCRTForwarders-IncludeDebugCRT=false
|
||||
/p:PowerToysRoot=$(Build.SourcesDirectory)
|
||||
@@ -287,7 +282,6 @@ extends:
|
||||
# The arguments should be the same as the ones for Settings; make sure they are.
|
||||
msbuildArgs: >-
|
||||
/target:Publish
|
||||
/graph
|
||||
/p:Configuration=$(BuildConfiguration);Platform=$(BuildPlatform);AppxBundle=Never
|
||||
/p:VCRTForwarders-IncludeDebugCRT=false
|
||||
/p:PowerToysRoot=$(Build.SourcesDirectory)
|
||||
@@ -304,7 +298,6 @@ extends:
|
||||
# The arguments should be the same as the ones for Settings; make sure they are.
|
||||
msbuildArgs: >-
|
||||
/target:Publish
|
||||
/graph
|
||||
/p:Configuration=$(BuildConfiguration);Platform=$(BuildPlatform);AppxBundle=Never
|
||||
/p:VCRTForwarders-IncludeDebugCRT=false
|
||||
/p:PowerToysRoot=$(Build.SourcesDirectory)
|
||||
@@ -349,15 +342,6 @@ extends:
|
||||
batchSignPolicyFile: '$(build.sourcesdirectory)\.pipelines\ESRPSigning_core.json'
|
||||
ciPolicyFile: '$(build.sourcesdirectory)\.pipelines\CIPolicy.xml'
|
||||
|
||||
- task: SFP.build-tasks.custom-build-task-1.EsrpCodeSigning@3
|
||||
displayName: Sign DSC Powershell files
|
||||
inputs:
|
||||
ConnectedServiceName: 'Terminal/Console/WinAppDriver Team Code Signing Connection'
|
||||
FolderPath: 'src/dsc/Microsoft.PowerToys.Configure'
|
||||
signType: batchSigning
|
||||
batchSignPolicyFile: '$(build.sourcesdirectory)\.pipelines\ESRPSigning_DSC.json'
|
||||
ciPolicyFile: '$(build.sourcesdirectory)\.pipelines\CIPolicy.xml'
|
||||
|
||||
- task: SFP.build-tasks.custom-build-task-1.EsrpCodeSigning@3
|
||||
displayName: Sign x86 directshow VCM
|
||||
inputs:
|
||||
|
||||
@@ -22,6 +22,14 @@
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
|
||||
<!-- Props that should be disabled while building on CI server -->
|
||||
<ItemDefinitionGroup Condition="'$(CIBuild)'!='true'">
|
||||
<ClCompile>
|
||||
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
</ItemDefinitionGroup>
|
||||
|
||||
<!-- Run code analysis locally and in PR CI, but not on release CI -->
|
||||
<PropertyGroup Condition="'$(SkipCppCodeAnalysis)' == ''">
|
||||
<RunCodeAnalysis>true</RunCodeAnalysis>
|
||||
@@ -40,8 +48,6 @@
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup>
|
||||
<ClCompile>
|
||||
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||
<PrecompiledHeader Condition="'$(UsePrecompiledHeaders)' != 'false'">Use</PrecompiledHeader>
|
||||
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<DisableSpecificWarnings>4679;5271;%(DisableSpecificWarnings)</DisableSpecificWarnings>
|
||||
|
||||
@@ -44,20 +44,6 @@
|
||||
</PackageReference>
|
||||
</ItemGroup>
|
||||
|
||||
<!-- Add ability to run tests via "msbuild /t:Test" -->
|
||||
<Sdk Name="Microsoft.Build.RunVSTest" Version="1.0.319" />
|
||||
<PropertyGroup>
|
||||
<VSTestLogger>trx</VSTestLogger>
|
||||
<!--
|
||||
RunVSTest by default uses %VSINSTALLDIR%\Common7\IDE\CommonExtensions\Microsoft\TestWindow\vstest.console.exe,
|
||||
but some of the CI scenarios don't define %VSINSTALLDIR%, so be explicit about where to look for vstest.
|
||||
Note: $(VsInstallRoot) is a built-in MSBuild property, so should always be defined.
|
||||
-->
|
||||
<VSTestToolPath>$(VsInstallRoot)\Common7\IDE\CommonExtensions\Microsoft\TestWindow</VSTestToolPath>
|
||||
<!-- No arm64 agents to run the tests. -->
|
||||
<RunVSTest Condition="'$(Platform)' == 'ARM64'">false</RunVSTest>
|
||||
</PropertyGroup>
|
||||
|
||||
<!-- MSBuildCache -->
|
||||
<PropertyGroup>
|
||||
<!-- Off by default -->
|
||||
@@ -69,9 +55,6 @@
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(MSBuildCacheEnabled)' == 'true'">
|
||||
<!-- Disable when running in a pipeline as the time to upload or download the massive .pch/.pchast to the cache is greater than the savings they provide. -->
|
||||
<UsePrecompiledHeaders Condition="'$(TF_BUILD)' != ''">false</UsePrecompiledHeaders>
|
||||
|
||||
<!-- Change this to bust the cache -->
|
||||
<MSBuildCacheCacheUniverse Condition="'$(MSBuildCacheCacheUniverse)' == ''">202310210737</MSBuildCacheCacheUniverse>
|
||||
|
||||
@@ -88,12 +71,6 @@
|
||||
E:\;
|
||||
</MSBuildCacheAllowFileAccessAfterProjectFinishFilePatterns>
|
||||
|
||||
<!-- Unit tests of low-priv processes, eg the preview handler tests, may log to this location. -->
|
||||
<MSBuildCacheAllowFileAccessAfterProjectFinishFilePatterns>
|
||||
$(MSBuildCacheAllowFileAccessAfterProjectFinishFilePatterns);
|
||||
$(USERPROFILE)\AppData\LocalLow\Microsoft\PowerToys\**;
|
||||
</MSBuildCacheAllowFileAccessAfterProjectFinishFilePatterns>
|
||||
|
||||
<!--
|
||||
This repo uses a common output directory with many projects writing duplicate outputs. Allow everything, but note this costs some performance in the form of requiring
|
||||
the cache to use copies instead of hardlinks when pulling from cache.
|
||||
|
||||
@@ -36,7 +36,7 @@
|
||||
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
|
||||
<PackageVersion Include="Microsoft.Extensions.ObjectPool" Version="8.0.0" />
|
||||
<PackageVersion Include="Microsoft.Toolkit.Uwp.Notifications" Version="7.1.2" />
|
||||
<PackageVersion Include="Microsoft.Web.WebView2" Version="1.0.2365.46" />
|
||||
<PackageVersion Include="Microsoft.Web.WebView2" Version="1.0.2088.41" />
|
||||
<!-- Package Microsoft.Win32.SystemEvents added as a hack for being able to exclude the runtime assets so they don't conflict with 8.0.1. This is a dependency of System.Drawing.Common but the 8.0.1 version wasn't published to nuget. -->
|
||||
<PackageVersion Include="Microsoft.Win32.SystemEvents" Version="8.0.0" />
|
||||
<PackageVersion Include="Microsoft.Windows.Compatibility" Version="8.0.1" />
|
||||
@@ -45,7 +45,7 @@
|
||||
<PackageVersion Include="Microsoft.Windows.CsWinRT" Version="2.0.4" />
|
||||
<PackageVersion Include="Microsoft.Windows.SDK.BuildTools" Version="10.0.22621.2428" />
|
||||
<PackageVersion Include="Microsoft.Windows.SDK.Contracts" Version="10.0.19041.1" />
|
||||
<PackageVersion Include="Microsoft.WindowsAppSDK" Version="1.5.240311000" />
|
||||
<PackageVersion Include="Microsoft.WindowsAppSDK" Version="1.4.231219000" />
|
||||
<PackageVersion Include="Microsoft.Xaml.Behaviors.WinUI.Managed" Version="2.0.9" />
|
||||
<PackageVersion Include="Microsoft.Xaml.Behaviors.Wpf" Version="1.1.39" />
|
||||
<PackageVersion Include="ModernWpfUI" Version="0.9.4" />
|
||||
@@ -73,7 +73,7 @@
|
||||
<PackageVersion Include="System.Diagnostics.EventLog" Version="8.0.0" />
|
||||
<!-- Package System.Diagnostics.PerformanceCounter added as a hack for being able to exclude the runtime assets so they don't conflict with 8.0.1. This is a dependency of System.Data.OleDb but the 8.0.1 version wasn't published to nuget. -->
|
||||
<PackageVersion Include="System.Diagnostics.PerformanceCounter" Version="8.0.0" />
|
||||
<PackageVersion Include="System.Drawing.Common" Version="8.0.3" />
|
||||
<PackageVersion Include="System.Drawing.Common" Version="8.0.2" />
|
||||
<PackageVersion Include="System.IO.Abstractions" Version="17.2.3" />
|
||||
<PackageVersion Include="System.IO.Abstractions.TestingHelpers" Version="17.2.3" />
|
||||
<PackageVersion Include="System.Management" Version="8.0.0" />
|
||||
|
||||
@@ -1326,14 +1326,14 @@ EXHIBIT A -Mozilla Public License.
|
||||
- Microsoft.Extensions.ObjectPool 8.0.0
|
||||
- Microsoft.NET.Test.Sdk 17.8.0
|
||||
- Microsoft.Toolkit.Uwp.Notifications 7.1.2
|
||||
- Microsoft.Web.WebView2 1.0.2365.46
|
||||
- Microsoft.Web.WebView2 1.0.2088.41
|
||||
- Microsoft.Win32.SystemEvents 8.0.0
|
||||
- Microsoft.Windows.Compatibility 8.0.1
|
||||
- Microsoft.Windows.CsWin32 0.2.46-beta
|
||||
- Microsoft.Windows.CsWinRT 2.0.4
|
||||
- Microsoft.Windows.SDK.BuildTools 10.0.22621.2428
|
||||
- Microsoft.Windows.SDK.Contracts 10.0.19041.1
|
||||
- Microsoft.WindowsAppSDK 1.5.240311000
|
||||
- Microsoft.WindowsAppSDK 1.4.231219000
|
||||
- Microsoft.Xaml.Behaviors.WinUI.Managed 2.0.9
|
||||
- Microsoft.Xaml.Behaviors.Wpf 1.1.39
|
||||
- ModernWpfUI 0.9.4
|
||||
@@ -1354,7 +1354,7 @@ EXHIBIT A -Mozilla Public License.
|
||||
- System.Data.SqlClient 4.8.6
|
||||
- System.Diagnostics.EventLog 8.0.0
|
||||
- System.Diagnostics.PerformanceCounter 8.0.0
|
||||
- System.Drawing.Common 8.0.3
|
||||
- System.Drawing.Common 8.0.2
|
||||
- System.IO.Abstractions 17.2.3
|
||||
- System.IO.Abstractions.TestingHelpers 17.2.3
|
||||
- System.Management 8.0.0
|
||||
|
||||
@@ -574,13 +574,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "UITests-FancyZonesEditor",
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FancyZonesEditorCommon", "src\modules\fancyzones\FancyZonesEditorCommon\FancyZonesEditorCommon.csproj", "{C0974915-8A1D-4BF0-977B-9587D3807AB7}"
|
||||
EndProject
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "DSC", "DSC", "{557C4636-D7E1-4838-A504-7D19B725EE95}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "PowerToys.Settings.DSC.Schema.Generator", "src\dsc\PowerToys.Settings.DSC.Schema.Generator\PowerToys.Settings.DSC.Schema.Generator.csproj", "{1D6893CB-BC0C-46A8-A76C-9728706CA51A}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{020A7474-3601-4160-A159-D7B70B77B15F} = {020A7474-3601-4160-A159-D7B70B77B15F}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|ARM64 = Debug|ARM64
|
||||
@@ -2543,18 +2536,6 @@ Global
|
||||
{C0974915-8A1D-4BF0-977B-9587D3807AB7}.Release|x64.Build.0 = Release|x64
|
||||
{C0974915-8A1D-4BF0-977B-9587D3807AB7}.Release|x86.ActiveCfg = Release|x64
|
||||
{C0974915-8A1D-4BF0-977B-9587D3807AB7}.Release|x86.Build.0 = Release|x64
|
||||
{1D6893CB-BC0C-46A8-A76C-9728706CA51A}.Debug|ARM64.ActiveCfg = Debug|ARM64
|
||||
{1D6893CB-BC0C-46A8-A76C-9728706CA51A}.Debug|ARM64.Build.0 = Debug|ARM64
|
||||
{1D6893CB-BC0C-46A8-A76C-9728706CA51A}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{1D6893CB-BC0C-46A8-A76C-9728706CA51A}.Debug|x64.Build.0 = Debug|x64
|
||||
{1D6893CB-BC0C-46A8-A76C-9728706CA51A}.Debug|x86.ActiveCfg = Debug|x64
|
||||
{1D6893CB-BC0C-46A8-A76C-9728706CA51A}.Debug|x86.Build.0 = Debug|x64
|
||||
{1D6893CB-BC0C-46A8-A76C-9728706CA51A}.Release|ARM64.ActiveCfg = Release|ARM64
|
||||
{1D6893CB-BC0C-46A8-A76C-9728706CA51A}.Release|ARM64.Build.0 = Release|ARM64
|
||||
{1D6893CB-BC0C-46A8-A76C-9728706CA51A}.Release|x64.ActiveCfg = Release|x64
|
||||
{1D6893CB-BC0C-46A8-A76C-9728706CA51A}.Release|x64.Build.0 = Release|x64
|
||||
{1D6893CB-BC0C-46A8-A76C-9728706CA51A}.Release|x86.ActiveCfg = Release|x64
|
||||
{1D6893CB-BC0C-46A8-A76C-9728706CA51A}.Release|x86.Build.0 = Release|x64
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
@@ -2767,7 +2748,6 @@ Global
|
||||
{FE38FC07-1C05-4B57-ADA3-2FE2F53C6A52} = {D1D6BC88-09AE-4FB4-AD24-5DED46A791DD}
|
||||
{3A9A791E-94A9-49F8-8401-C11CE288D5FB} = {D1D6BC88-09AE-4FB4-AD24-5DED46A791DD}
|
||||
{C0974915-8A1D-4BF0-977B-9587D3807AB7} = {D1D6BC88-09AE-4FB4-AD24-5DED46A791DD}
|
||||
{1D6893CB-BC0C-46A8-A76C-9728706CA51A} = {557C4636-D7E1-4838-A504-7D19B725EE95}
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {C3A2F9D1-7930-4EF4-A6FC-7EE0A99821D0}
|
||||
|
||||
194
README.md
194
README.md
@@ -40,19 +40,19 @@ Microsoft PowerToys is a set of utilities for power users to tune and streamline
|
||||
Go to the [Microsoft PowerToys GitHub releases page][github-release-link] and click on `Assets` at the bottom to show the files available in the release. Please use the appropriate PowerToys installer that matches your machine's architecture and install scope. For most, it is `x64` and per-user.
|
||||
|
||||
<!-- items that need to be updated release to release -->
|
||||
[github-next-release-work]: https://github.com/microsoft/PowerToys/issues?q=project%3Amicrosoft%2FPowerToys%2F53
|
||||
[github-current-release-work]: https://github.com/microsoft/PowerToys/issues?q=project%3Amicrosoft%2FPowerToys%2F52
|
||||
[ptUserX64]: https://github.com/microsoft/PowerToys/releases/download/v0.79.0/PowerToysUserSetup-0.79.0-x64.exe
|
||||
[ptUserArm64]: https://github.com/microsoft/PowerToys/releases/download/v0.79.0/PowerToysUserSetup-0.79.0-arm64.exe
|
||||
[ptMachineX64]: https://github.com/microsoft/PowerToys/releases/download/v0.79.0/PowerToysSetup-0.79.0-x64.exe
|
||||
[ptMachineArm64]: https://github.com/microsoft/PowerToys/releases/download/v0.79.0/PowerToysSetup-0.79.0-arm64.exe
|
||||
[github-next-release-work]: https://github.com/microsoft/PowerToys/issues?q=project%3Amicrosoft%2FPowerToys%2F52
|
||||
[github-current-release-work]: https://github.com/microsoft/PowerToys/issues?q=project%3Amicrosoft%2FPowerToys%2F51
|
||||
[ptUserX64]: https://github.com/microsoft/PowerToys/releases/download/v0.78.0/PowerToysUserSetup-0.78.0-x64.exe
|
||||
[ptUserArm64]: https://github.com/microsoft/PowerToys/releases/download/v0.78.0/PowerToysUserSetup-0.78.0-arm64.exe
|
||||
[ptMachineX64]: https://github.com/microsoft/PowerToys/releases/download/v0.78.0/PowerToysSetup-0.78.0-x64.exe
|
||||
[ptMachineArm64]: https://github.com/microsoft/PowerToys/releases/download/v0.78.0/PowerToysSetup-0.78.0-arm64.exe
|
||||
|
||||
| Description | Filename | sha256 hash |
|
||||
|----------------|----------|-------------|
|
||||
| Per user - x64 | [PowerToysUserSetup-0.79.0-x64.exe][ptUserX64] | CF1C715F952A34416CDBE5D06D24FFF47790DDA1D4CA3F81BCAD9D28FF0039A1 |
|
||||
| Per user - ARM64 | [PowerToysUserSetup-0.79.0-arm64.exe][ptUserArm64] | ADE572B6F1B59DCDC60A2550D9FD00B8CC7C78BE9330F534691CE4B056ED76F1 |
|
||||
| Machine wide - x64 | [PowerToysSetup-0.79.0-x64.exe][ptMachineX64] | 3FD2A6BD9C8F8973BFBBF5DB9236C3D8AF3AE57E5AEC275DDEB5EF31581F80FE |
|
||||
| Machine wide - ARM64 | [PowerToysSetup-0.79.0-arm64.exe][ptMachineArm64] | B93017C2A5CFB0DEF708DB412570AA39828E91D85E800EFD22481B46F0DC6852 |
|
||||
| Per user - x64 | [PowerToysUserSetup-0.78.0-x64.exe][ptUserX64] | 120B1CEFC94D76EC593A61D717BBB2E12AF195D19E04C811F519D3F9B9B3B5C0 |
|
||||
| Per user - ARM64 | [PowerToysUserSetup-0.78.0-arm64.exe][ptUserArm64] | 3C3C8A8A549ABDD1C5E5DA7DC22D254F7BBD0F9DC05DA17E51020B153662F083 |
|
||||
| Machine wide - x64 | [PowerToysSetup-0.78.0-x64.exe][ptMachineX64] | 19E025381588ABAEC209CDD0A18BB779EE58FC24646D898C2A7C38A4858EAEDB |
|
||||
| Machine wide - ARM64 | [PowerToysSetup-0.78.0-arm64.exe][ptMachineArm64] | 5C70054A8991885A958F066B00D7FAFE608C730FC7A99178D6C64A1F03A3C109 |
|
||||
|
||||
This is our preferred method.
|
||||
|
||||
@@ -98,143 +98,149 @@ For guidance on developing for PowerToys, please read the [developer docs](/doc/
|
||||
|
||||
Our [prioritized roadmap][roadmap] of features and utilities that the core team is focusing on.
|
||||
|
||||
### 0.79 - February 2024 Update
|
||||
### 0.78 - January 2024 Update
|
||||
|
||||
In this release, we focused on stability and improvements.
|
||||
|
||||
**Highlights**
|
||||
|
||||
- New feature: Keyboard Manager allows mapping shortcuts to start applications or opening URIs. Thanks [@jefflord](https://github.com/jefflord)!
|
||||
- New feature: Keyboard Manager allows shortcuts with chords. Thanks [@jefflord](https://github.com/jefflord)!
|
||||
- Modernized Color Picker with Fluent UX. Thanks [@niels9001](https://github.com/niels9001)!
|
||||
- Peek now is able to preview drives. Thanks [@davidegiacometti](https://github.com/davidegiacometti)!
|
||||
- File Locksmith has now an entry in the Windows 11 tier 1 context menu.
|
||||
- New languages added: Arabic (Saudi Arabia), Hebrew, Persian and Ukrainian. We are going to assume we have some bugs. We want to identify & fix them and are open for community help.
|
||||
- Many dependencies updated, aiming for security and stability.
|
||||
- Fixed commonly reported PowerToys Run startup crashes after an upgrade.
|
||||
- New settings and GPO policies to help control behavior after an upgrade. Thanks [@htcfreek](https://github.com/htcfreek)!
|
||||
|
||||
Here are some screenshots of the new languages:
|
||||

|
||||

|
||||

|
||||

|
||||
|
||||
### General
|
||||
|
||||
- Refactored code so that English is used as a fallback language when a localized resource cannot be found.
|
||||
- Added Arabic (Saudi Arabia) translation.
|
||||
- Added Hebrew translation.
|
||||
- Added Persian translation.
|
||||
- Added Ukrainian translation.
|
||||
- Improved the file watcher used across many utilities to consume less resources. Thanks [@davidegiacometti](https://github.com/davidegiacometti)!
|
||||
|
||||
### Awake
|
||||
### AlwaysOnTop
|
||||
|
||||
- The setting now reverts to "Keep using the current power plan" after Awake deactivates itself after any of the timed modes has expired.
|
||||
|
||||
### Color Picker
|
||||
|
||||
- Now uses WPFUI and the UI was updated to follow Fluent UX principles. Thanks [@niels9001](https://github.com/niels9001)!
|
||||
- Added enable and disable telemetry to align it with the other utilities.
|
||||
- Fixed an invisible border issue when the border color was set to the black color.
|
||||
- Added the AlwayOnTop icon to the base application executable. Thanks [@ckirby19](https://github.com/ckirby19)!
|
||||
|
||||
### Command Not Found
|
||||
|
||||
- Added telemetry for when a module instance is created in PowerShell.
|
||||
|
||||
### FancyZones
|
||||
|
||||
- Fixed a memory leak occurring on work area changes.
|
||||
- Signed the PowerShell scripts used by the Command Not Found installation process.
|
||||
|
||||
### File Explorer add-ons
|
||||
|
||||
- Added support to the .ksh, .zsh, .bsh and .env file types to Monaco previewer. Thanks [@Aaron-Junker](https://github.com/Aaron-Junker)!
|
||||
- Re-enabled the RendererAppContainer feature in WebView2, since the associated crash has been fixed in the latest WebView2 releases.
|
||||
- Fixed an issue causing SVG Thumbnail generation to hang when trying to preview SVG files at the same time.
|
||||
|
||||
### File Locksmith
|
||||
|
||||
- Added as an entry in the Windows 11 tier 1 context menu.
|
||||
- Improved the context menu entry caption. Thanks [@niels9001](https://github.com/niels9001)!
|
||||
|
||||
### Find My Mouse
|
||||
|
||||
- Added more settings to tune shake detection when activating through mouse shake.
|
||||
|
||||
### Hosts File Editor
|
||||
|
||||
- Tweaked filter button style to indicate if filters are applied.
|
||||
- Added an error indicator to each input field to indicate why a new entry can't be created.
|
||||
- Added an in-line delete button for each entry.
|
||||
- Added a feature to duplicate an entry. Thanks [@davidegiacometti](https://github.com/davidegiacometti)!
|
||||
|
||||
### Installer
|
||||
|
||||
- Included the new languages localization files in the installer.
|
||||
|
||||
### Image Resizer
|
||||
|
||||
- Units and resize modes are now localized.
|
||||
- Tweaked and improved UI. Thanks [@Jay-o-Way](https://github.com/Jay-o-Way)!
|
||||
|
||||
### Keyboard Manager
|
||||
|
||||
- Added a feature that allows remapping a shortcut to starting an application. Thanks [@jefflord](https://github.com/jefflord)!
|
||||
- Added a feature that allows remapping a shortcut to open a URI. Thanks [@jefflord](https://github.com/jefflord)!
|
||||
- Added chords to shortcuts. Thanks [@jefflord](https://github.com/jefflord)!
|
||||
- Send telemetry about the key/shortcut to key/shortcut remappings that are set. This doesn't include remap to text, application or URI since those might contain personal information.
|
||||
- Added telemetry to send a daily event that at least a key/shortcut to key/shortcut remapping was used.
|
||||
- Tweaked and fixed the chords code to better follow conventions when trying to call the same chord multiple times.
|
||||
|
||||
### Mouse Without Borders
|
||||
- Fixed an issue causing the target path string to be corrupted when registering as a service.
|
||||
|
||||
### Paste as Plain Text
|
||||
|
||||
- Prevent the start menu from activating when the Windows key is part of the activation shortcut and is released sooner.
|
||||
- Improved the context menu entry caption. Thanks [@niels9001](https://github.com/niels9001)!
|
||||
|
||||
### Peek
|
||||
|
||||
- Fixed a title bar issue after maximizing Peek's window. Thanks [@davidegiacometti](https://github.com/davidegiacometti)!
|
||||
- Fixed a crash when trying to use Peek in File Explorer alternatives.
|
||||
- Added a previewer for drives. Thanks [@davidegiacometti](https://github.com/davidegiacometti)!
|
||||
- The folder previewer will now asynchronously calculate size, similar to the Properties screen in File Explorer. Thanks [@davidegiacometti](https://github.com/davidegiacometti)!
|
||||
- Added support to the .ksh, .zsh, .bsh and .env file types to Monaco previewer. Thanks [@Aaron-Junker](https://github.com/Aaron-Junker)!
|
||||
- Added a missing tooltip for the file size. Thanks [@HydroH](https://github.com/HydroH)!
|
||||
|
||||
### PowerRename
|
||||
|
||||
- PowerRename context menu accelerator key readded.
|
||||
- Tweaked PowerRename apply button style. Thanks [@niels9001](https://github.com/niels9001)!
|
||||
- Improved and added localization to the context menu entry caption. Thanks [@niels9001](https://github.com/niels9001)!
|
||||
|
||||
### PowerToys Run
|
||||
|
||||
- Fixed an issue causing win32 application icons to not appear correctly in the Programs plugin.
|
||||
- Unified phrasing in the plugin descriptions.
|
||||
- Fixed an issue causing the PowerToys Run plugin settings to be cleared with each upgrade.
|
||||
- Fixed an issue causing VSCodeWorkspaces plugin to not find WSL workspaces.
|
||||
- Fixed results tooltip closing fast. Thanks [@davidegiacometti](https://github.com/davidegiacometti)!
|
||||
- Improved the Registry plugin tooltip spacing. Thanks [@davidegiacometti](https://github.com/davidegiacometti)!
|
||||
- Allow pressing '=' to replace the query with the current result when using the calculator plugin. Thanks [@davidegiacometti](https://github.com/davidegiacometti)!
|
||||
- Optimized the code that gathers results from the plugin to reduce CPU consumption.
|
||||
- Optimized memory usage in the Window Walker plugin.
|
||||
- Fixed crashes and improved error handling when saving json configuration files.
|
||||
- The Program plugin will now correctly get the icon for a newly installed packaged application. Thanks [@davidegiacometti](https://github.com/davidegiacometti)!
|
||||
- Removed references to unused settings from the code, which were causing crashes on some machines. Thanks [@davidegiacometti](https://github.com/davidegiacometti)!
|
||||
- Fixed an issue causing a scrollbar to be out of view. Thanks [@niels9001](https://github.com/niels9001)!
|
||||
- Added logic to try and detect running games to full screen detection. Thanks [@anaisbetts](https://github.com/anaisbetts)!
|
||||
- Added support for converting negative values in the Unit Converter plugin. Thanks [@Dub1shu](https://github.com/Dub1shu)!
|
||||
- Fixed stale results in the Visual Studio Code Workspaces plugin by checking if files still exist. Thanks [@anderspk](https://github.com/anderspk)!
|
||||
- Fixed an activation crash that occurred after 0.77 on some configurations.
|
||||
- Fixed a startup crash that occurred when saving the new version of settings after an upgrade.
|
||||
- You can now calculate bigger hexadecimal numbers in the Calculator plugin.
|
||||
- The "max results to show before scrolling" setting can now also be applied to the initial plugin hint listing.
|
||||
|
||||
### Quick Accent
|
||||
|
||||
- Added support for the Slovenian character set. Thanks [@aklemen](https://github.com/aklemen)!
|
||||
|
||||
### Registry Preview
|
||||
|
||||
- Fixed a crash when closing the application and the editor's right click menu is opened.
|
||||
- Added the ellipses character to all languages. Thanks [@HydroH](https://github.com/HydroH)!
|
||||
- Added an option to not activate when playing a game. Thanks [@HydroH](https://github.com/HydroH)!
|
||||
- Added the E with breve and pilcrow characters to all languages. Thanks [@PesBandi](https://github.com/PesBandi)!
|
||||
|
||||
### Settings
|
||||
|
||||
- Fixed an alignment issue in the flyout icons causing some icons to be centered when they shouldn't. Thanks [@niels9001](https://github.com/niels9001)!
|
||||
- Added the mention that Monaco supports .txt files. Thanks [@Aaron-Junker](https://github.com/Aaron-Junker)!
|
||||
- Fixed an issue causing the Settings window to lose its previous maximized state. Thanks [@davidegiacometti](https://github.com/davidegiacometti)!
|
||||
- Removed the Command Not Found listing from the Settings dashboard and flyout, since it can't really be enabled or disabled from there.
|
||||
- Added a settings and GPO rule to disable opening the What's New OOBE page after an update. Thanks [@htcfreek](https://github.com/htcfreek)!
|
||||
- Added a settings and GPO rule to disable toast notifications about new updates being available. Thanks [@htcfreek](https://github.com/htcfreek)!
|
||||
- Fixed an issue causing the Settings window to not be brought to the foreground after activating through the system tray icon.
|
||||
- Standardized accent brush and corner radius on the dashboard page.
|
||||
- Improved UI and messages for GPO locked settings. Thanks [@htcfreek](https://github.com/htcfreek)!
|
||||
- Fixed an issue causing the OOBE window to maximize and hide the system taskbar.
|
||||
- Reworked the update settings in the General page. Thanks [@htcfreek](https://github.com/htcfreek)!
|
||||
- Tweaked UI for the update settings in the General page. Thanks [@niels9001](https://github.com/niels9001)!
|
||||
- Updated the modules images in the Settings and OOBE screens. Thanks [@niels9001](https://github.com/niels9001)!
|
||||
- Updated OOBE descriptions to take into account the changes in context menu captions. Thanks [@niels9001](https://github.com/niels9001)!
|
||||
|
||||
### Documentation
|
||||
|
||||
- Fixed broken links in doc/devdocs/readme.md. Thanks [@jem-experience](https://github.com/jem-experience)!
|
||||
- Added Spotify plugin to PowerToys Run thirdPartyRunPlugins.md docs. Thanks [@waaverecords](https://github.com/waaverecords)!
|
||||
- Added InputTyper and ClipboardManager plugins to PowerToys Run thirdPartyRunPlugins.md docs. Thanks [@CoreyHayward](https://github.com/CoreyHayward)!
|
||||
- Added CurrencyConverter plugin to PowerToys Run thirdPartyRunPlugins.md docs. Thanks [@Advaith3600](https://github.com/Advaith3600)!
|
||||
- Updated and cleaned up the new PowerToys plugin checklist documentation. Thanks [@Parvezkhan0](https://github.com/Parvezkhan0) and [@hlaueriksson](https://github.com/hlaueriksson)!
|
||||
- Added a documentation page to describe status code colors for Mouse Without Borders. Thanks [@ckirby19](https://github.com/ckirby19)!
|
||||
|
||||
### Development
|
||||
|
||||
- Updated Microsoft.MSBuildCache to 0.1.258-preview. Thanks [@dfederm](https://github.com/dfederm)!
|
||||
- Fixed CI to point VCToolsVersion to VC.CRT instead of VC.Redist version. Thanks [@snickler](https://github.com/snickler)!
|
||||
- Updated MSTest adapter and framework to 3.2.
|
||||
- Fixed CI by pointing WiX 3.14 urls and hashes to the latest release on GitHub.
|
||||
- Added Pro and Enterprise editions of Visual Studio to the repository's development configuration DSC scripts.
|
||||
- Updated CppWinRT to 2.0.240111.5.
|
||||
- Updated System.Drawing.Common to 8.0.2 to fix CI builds after the .NET 8.0.2 upgrade was released.
|
||||
- Updated WPFUI version to 3.0.0. Thanks [@niels9001](https://github.com/niels9001)!
|
||||
- XAML Styler is now fully tested in the solution when CI runs. Thanks [@davidegiacometti](https://github.com/davidegiacometti)!
|
||||
- Fixed a faulty XAML binding in the Text Extractor settings page.
|
||||
- Updated Microsoft.Web.WebView2 to 1.0.2365.46.
|
||||
- Fixed dependency issues on upgrading .NET from 8.0.0 to 8.0.1.
|
||||
- Upgraded Microsoft.Extensions.ObjectPool from .NET 5 to .NET 8.
|
||||
- Upgraded the Windows SDK Build Tools to 10.0.22621.2428.
|
||||
- Upgraded the Windows Implementation Library to 1.0.231216.1.
|
||||
- Upgraded NLog.Schema to 5.2.8 and NLog.Extensions.Logging to 5.3.8.
|
||||
- Upgraded Markdig.Signed to 0.34.0.
|
||||
- Upgraded Microsoft.NET.Test.Sdk to 17.8.
|
||||
- Upgraded CommunityToolkit.WinUI dependencies to 8.0.240109.
|
||||
- Upgraded CommunityToolkit.Mvvm to 8.2.2. Thanks [@davidegiacometti](https://github.com/davidegiacometti)!
|
||||
- Upgraded Windows App SDK to 1.4.4. Thanks [@snickler](https://github.com/snickler)!
|
||||
- Upgraded WPFUI version to 3.0.0-preview.13. Thanks [@niels9001](https://github.com/niels9001)!
|
||||
- Upgraded StyleCop.Analyzers to 1.2.0-beta.556. Thanks [@davidegiacometti](https://github.com/davidegiacometti)!
|
||||
- Upgraded Microsoft.Windows.Compatibility to 8.0.1.
|
||||
- Upgraded System.Data.SqlClient to 4.8.6.
|
||||
- Consolidate XAML Namespaces across the solutions. Thanks [@Jay-o-Way](https://github.com/Jay-o-Way)!
|
||||
- Removed the toolkit labs package source reference, since the controls we were using made it to the generally available community toolkit.
|
||||
- Added Microsoft.MSBuildCache to experiment with build caching to reduce pipeline runs duration. Thanks [@dfederm](https://github.com/dfederm)!
|
||||
- Configured the release CI to follow the latest 1ES pipeline release version again.
|
||||
- Removed the copyright year from assembly information. Thanks [@Aaron-Junker](https://github.com/Aaron-Junker)!
|
||||
- Added the Command Not Found entry to the GitHub templates.
|
||||
- Removed unused code for a GPO policy to control auto updating of PowerToys. Thanks [@htcfreek](https://github.com/htcfreek)!
|
||||
- Improved code behind for getting the localization of context menu entries.
|
||||
- Locked some terms in resource files to avoid localization.
|
||||
|
||||
#### What is being planned for version 0.80
|
||||
#### What is being planned for version 0.79
|
||||
|
||||
For [v0.80][github-next-release-work], we'll work on the items below:
|
||||
For [v0.79][github-next-release-work], we'll work on the items below:
|
||||
|
||||
- Stability / bug fixes
|
||||
- Language selection
|
||||
- Automated UI testing through WinAppDriver
|
||||
- Develop support for Desired State Configuration
|
||||
- New module: File Actions Menu
|
||||
- Modernize and refresh the UX of PowerToys based on WPF. Here's the Work in Progress preview for "Color Picker":
|
||||
|
||||

|
||||
|
||||
## PowerToys Community
|
||||
|
||||
|
||||
1102
deps/WinAppDriver/EULA.rtf
vendored
Normal file
1102
deps/WinAppDriver/EULA.rtf
vendored
Normal file
File diff suppressed because it is too large
Load Diff
BIN
deps/WinAppDriver/Microsoft.Win32.Primitives.dll
vendored
Normal file
BIN
deps/WinAppDriver/Microsoft.Win32.Primitives.dll
vendored
Normal file
Binary file not shown.
BIN
deps/WinAppDriver/Microsoft.Win32.Registry.dll
vendored
Normal file
BIN
deps/WinAppDriver/Microsoft.Win32.Registry.dll
vendored
Normal file
Binary file not shown.
BIN
deps/WinAppDriver/MitaBroker.dll
vendored
Normal file
BIN
deps/WinAppDriver/MitaBroker.dll
vendored
Normal file
Binary file not shown.
BIN
deps/WinAppDriver/MitaLite.AppModel.dll
vendored
Normal file
BIN
deps/WinAppDriver/MitaLite.AppModel.dll
vendored
Normal file
Binary file not shown.
BIN
deps/WinAppDriver/MitaLite.Foundation.dll
vendored
Normal file
BIN
deps/WinAppDriver/MitaLite.Foundation.dll
vendored
Normal file
Binary file not shown.
BIN
deps/WinAppDriver/MitaLite.Localization.dll
vendored
Normal file
BIN
deps/WinAppDriver/MitaLite.Localization.dll
vendored
Normal file
Binary file not shown.
BIN
deps/WinAppDriver/MitaLite.UIAutomationAdapter.dll
vendored
Normal file
BIN
deps/WinAppDriver/MitaLite.UIAutomationAdapter.dll
vendored
Normal file
Binary file not shown.
BIN
deps/WinAppDriver/MitaLite.UIAutomationClient.dll
vendored
Normal file
BIN
deps/WinAppDriver/MitaLite.UIAutomationClient.dll
vendored
Normal file
Binary file not shown.
BIN
deps/WinAppDriver/Newtonsoft.Json.dll
vendored
Normal file
BIN
deps/WinAppDriver/Newtonsoft.Json.dll
vendored
Normal file
Binary file not shown.
7
deps/WinAppDriver/Readme.txt
vendored
Normal file
7
deps/WinAppDriver/Readme.txt
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
Windows Application Driver
|
||||
|
||||
For documentation, sample code, and logging issues:
|
||||
https://github.com/Microsoft/WinAppDriver
|
||||
|
||||
To request new features and upvote requests filed by others:
|
||||
https://wpdev.uservoice.com
|
||||
BIN
deps/WinAppDriver/System.Diagnostics.Process.dll
vendored
Normal file
BIN
deps/WinAppDriver/System.Diagnostics.Process.dll
vendored
Normal file
Binary file not shown.
BIN
deps/WinAppDriver/System.Threading.Thread.dll
vendored
Normal file
BIN
deps/WinAppDriver/System.Threading.Thread.dll
vendored
Normal file
Binary file not shown.
BIN
deps/WinAppDriver/WinAppDriver.exe
vendored
Normal file
BIN
deps/WinAppDriver/WinAppDriver.exe
vendored
Normal file
Binary file not shown.
BIN
deps/WinAppDriver/WinAppDriverCore.dll
vendored
Normal file
BIN
deps/WinAppDriver/WinAppDriverCore.dll
vendored
Normal file
Binary file not shown.
BIN
deps/WinAppDriver/cpprest140_2_9.dll
vendored
Normal file
BIN
deps/WinAppDriver/cpprest140_2_9.dll
vendored
Normal file
Binary file not shown.
@@ -4,13 +4,12 @@ UI tests are implemented using [Windows Application Driver](https://github.com/m
|
||||
|
||||
## Before running tests
|
||||
|
||||
- Install Windows Application Driver v1.2.1 from https://github.com/microsoft/WinAppDriver/releases/tag/v1.2.1.
|
||||
- Download and run Windows Application Driver installer from https://github.com/Microsoft/WinAppDriver/releases
|
||||
- Enable Developer Mode in Windows settings
|
||||
|
||||
## Running tests
|
||||
|
||||
- Exit PowerToys if it's running
|
||||
- Run WinAppDriver.exe from the installation directory. Skip this step if installed in the default directory (`C:\Program Files (x86)\Windows Application Driver`); in this case, it'll be launched automatically during tests.
|
||||
- Run WinAppDriver.exe from the installation directory (E.g. `C:\Program Files (x86)\Windows Application Driver`)
|
||||
- Open `PowerToys.sln` in Visual Studio and build the solution.
|
||||
- Run tests in the Test Explorer (`Test > Test Explorer` or `Ctrl+E, T`).
|
||||
|
||||
|
||||
@@ -80,8 +80,8 @@ The installer can only be compiled in `Release` mode; steps 1 and 2 must be perf
|
||||
### Prerequisites for building the MSI installer
|
||||
|
||||
1. Install the [WiX Toolset Visual Studio 2022 Extension](https://marketplace.visualstudio.com/items?itemName=WixToolset.WixToolsetVisualStudio2022Extension).
|
||||
1. Install the [WiX Toolset build tools](https://github.com/wixtoolset/wix3/releases/tag/wix3141rtm). (installer [direct link](https://github.com/wixtoolset/wix3/releases/download/wix3141rtm/wix314.exe))
|
||||
1. Download [WiX binaries](https://github.com/wixtoolset/wix3/releases/download/wix3141rtm/wix314-binaries.zip) and extract `wix.targets` to `C:\Program Files (x86)\WiX Toolset v3.14`.
|
||||
1. Install the [WiX Toolset build tools](https://github.com/wixtoolset/wix3/releases/tag/wix314rtm). (installer [direct link](https://github.com/wixtoolset/wix3/releases/download/wix314rtm/wix314.exe))
|
||||
1. Download [WiX binaries](https://github.com/wixtoolset/wix3/releases/download/wix314rtm/wix314-binaries.zip) and extract `wix.targets` to `C:\Program Files (x86)\WiX Toolset v3.14`.
|
||||
|
||||
### Building prerequisite projects
|
||||
|
||||
|
||||
@@ -1,98 +0,0 @@
|
||||
# What is it
|
||||
|
||||
We would like to enable our users to use [`winget configure`](https://learn.microsoft.com/en-us/windows/package-manager/winget/configure) command to install PowerToys and configure its settings with a [Winget configuration file](https://learn.microsoft.com/en-us/windows/package-manager/configuration/create). For example:
|
||||
|
||||
```yaml
|
||||
properties:
|
||||
resources:
|
||||
- resource: Microsoft.WinGet.DSC/WinGetPackage
|
||||
directives:
|
||||
description: Install PowerToys
|
||||
allowPrerelease: true
|
||||
settings:
|
||||
id: PowerToys (Preview)
|
||||
source: winget
|
||||
|
||||
- resource: PowerToysConfigure
|
||||
directives:
|
||||
description: Configure PowerToys
|
||||
settings:
|
||||
ShortcutGuide:
|
||||
Enabled: false
|
||||
OverlayOpacity: 1
|
||||
FancyZones:
|
||||
Enabled: true
|
||||
FancyzonesEditorHotkey: "Shift+Ctrl+Alt+F"
|
||||
configurationVersion: 0.2.0
|
||||
```
|
||||
|
||||
This should install PowerToys and make `PowerToysConfigure` resource available. We can use it in the same file.
|
||||
|
||||
# How it works
|
||||
|
||||
`PowerToysConfigure` is a [class-based DSC resource](https://learn.microsoft.com/en-us/powershell/dsc/concepts/class-based-resources?view=dsc-2.0). It looks up whether each setting was specified or not by checking whether it's `$null` or `0` for `enum`s and invokes `PowerToys.Settings.exe` with the updated value like so:
|
||||
```
|
||||
PowerToys.Settings.exe set <ModuleName>.<SettingName> <SettingValue>
|
||||
```
|
||||
|
||||
So for the example the config above should perform 3 following invocations:
|
||||
```
|
||||
PowerToys.Settings.exe set ShortcutGuide.Enabled false
|
||||
PowerToys.Settings.exe set FancyZones.Enabled true
|
||||
PowerToys.Settings.exe set FancyZones.FancyzonesEditorHotkey "Shift+Ctrl+Alt+F"
|
||||
```
|
||||
|
||||
`PowerToys.Settings` uses dotnet reflection capabilities to determine `SettingName` type and tries to convert the supplied `SettingValue` string accordingly. We use `ICmdReprParsable` for custom setting types.
|
||||
|
||||
|
||||
# How DSC is implemented
|
||||
|
||||
We use `PowerToys.Settings.DSC.Schema.Generator` to generate the bulk of `PowerToysConfigure.psm1` and `PowerToysConfigure.psd1` files. It also uses dotnet reflection capabilities to inspect `PowerToys.Settings.UI.Lib.dll` assembly and generate properties for the modules we have. The actual generation is done as a `PowerToys.Settings.DSC.Schema.Generator.csproj` post-build action.
|
||||
|
||||
# Debugging DSC resources
|
||||
|
||||
First, make sure that PowerShell 7.4+ is installed. Then make sure that you have DSC installed:
|
||||
|
||||
```ps
|
||||
Install-Module -Name PSDesiredStateConfiguration -RequiredVersion 2.0.7
|
||||
```
|
||||
|
||||
After that, start a new `pwsh` session and `cd` to `src\dsc\Microsoft.PowerToys.Configure\Generated` directory. From there, you should execute:
|
||||
```ps
|
||||
$env:PSModulePath += ";$pwd"
|
||||
```
|
||||
|
||||
You should have the generated `Microsoft.PowerToys.Configure.psm1` and `Microsoft.PowerToys.Configure.psd1` files inside the `src\dsc\Microsoft.PowerToys.Configure\Generated\Microsoft.PowerToys.Configure\0.0.1\` folder.
|
||||
|
||||
This will allow DSC to discover our DSC Resource module. See [PSModulePath](https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_psmodulepath?view=powershell-7.4#long-description) for more info.
|
||||
|
||||
If everything works, you should see that your module is discovered by executing the following command:
|
||||
|
||||
```ps
|
||||
Get-Module -ListAvailable | grep PowerToys
|
||||
```
|
||||
|
||||
The resource itself should also be available:
|
||||
```ps
|
||||
Get-DSCResource | grep PowerToys
|
||||
```
|
||||
|
||||
Otherwise, you can force-import the module to diagnose issues:
|
||||
|
||||
```
|
||||
Import-Module .\Microsoft.PowerToys.Configure.psd1
|
||||
```
|
||||
|
||||
If it's imported successfully, you could also try to invoke it directly:
|
||||
|
||||
```ps
|
||||
Invoke-DscResource -Name PowerToysConfigure -Method Set -ModuleName Microsoft.PowerToys.Configure -Property @{ Debug = $true; Awake = @{ Enabled = $false; Mode = "TIMED"; IntervalMinutes = "10" } }
|
||||
```
|
||||
|
||||
Note that we've supplied `Debug` option, so a `%TEMP\PowerToys.DSC.TestConfigure.txt` is created with the supplied properties, a current timestamp, and other debug output.
|
||||
|
||||
Finally, you can test it with winget by invoking it as such:
|
||||
|
||||
```ps
|
||||
winget configure .\configuration.dsc.yaml --accept-configuration-agreements --disable-interactivity
|
||||
```
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 46 KiB After Width: | Height: | Size: 74 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 24 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 131 KiB After Width: | Height: | Size: 206 KiB |
@@ -15,36 +15,26 @@ Refer to plugin instruction for more details.
|
||||
|
||||
## Disclaimer
|
||||
|
||||
The following plugins are created and maintained by third-party and not officially supported or recognized by Microsoft. Users install and use these plugins at their own risk, and Microsoft takes no responsibility for their functionality or any potential issues they may cause.
|
||||
|
||||
## Support
|
||||
|
||||
The following plugins are created and maintained by third-party and not officially supported or recognized by Microsoft.
|
||||
Users install and use these plugins at their own risk, and Microsoft takes no responsibility for their functionality or any potential issues they may cause.
|
||||
Contact the developers of a plugin directly for assistance with a specific plugin.
|
||||
|
||||
## General plugins
|
||||
## Plugins
|
||||
|
||||
| Plugin | Author | Description |
|
||||
| ------ | ------ | ----------- |
|
||||
| [BrowserSearch](https://github.com/TBM13/BrowserSearch) | [TBM13](https://github.com/TBM13) | Search your browser history |
|
||||
| [Edge Favorite](https://github.com/davidegiacometti/PowerToys-Run-EdgeFavorite) | [davidegiacometti](https://github.com/davidegiacometti) | Open Microsoft Edge favorites |
|
||||
| [Everything](https://github.com/lin-ycv/EverythingPowerToys) | [Yu Chieh (Victor) Lin](https://github.com/Lin-ycv) | Get search results from Everything |
|
||||
| [GitHub Emoji](https://github.com/hlaueriksson/GEmojiSharp) | [hlaueriksson](https://github.com/hlaueriksson) | Search GitHub Emoji |
|
||||
| [GitKraken](https://github.com/davidegiacometti/PowerToys-Run-GitKraken) | [davidegiacometti](https://github.com/davidegiacometti) | Open GitKraken repositories |
|
||||
| [Guid](https://github.com/skttl/ptrun-guid) | [skttl](https://github.com/skttl) | Guid generator |
|
||||
| [PowerTranslator](https://github.com/N0I0C0K/PowerTranslator) | [N0I0C0K](https://github.com/N0I0C0K) | Text translator based on Youdao |
|
||||
| [Quick Lookup](https://github.com/GTGalaxi/quick-lookup-ptrun) | [gtgalaxi](https://github.com/GTGalaxi) | Search across multiple cyber security tools |
|
||||
| [Input Typer](https://github.com/CoreyHayward/PowerToys-Run-InputTyper) | [CoreyHayward](https://github.com/CoreyHayward) | Type the input as if sent from a keyboard |
|
||||
| [Clipboard Manager](https://github.com/CoreyHayward/PowerToys-Run-ClipboardManager) | [CoreyHayward](https://github.com/CoreyHayward) | Search and paste text from your clipboard history |
|
||||
| [Currency Converter](https://github.com/Advaith3600/PowerToys-Run-Currency-Converter) | [advaith3600](https://github.com/advaith3600) | Convert real and crypto currencies |
|
||||
| [FastWeb](https://github.com/CCcat8059/FastWeb) | [CCcat](https://github.com/CCcat8059) | Open website in browser |
|
||||
|
||||
## Extending software plugins
|
||||
|
||||
Below are community created plugins that target a website or software. They are created and maintained by a third-party and not officially supported or recognized by the website or software they extend.
|
||||
|
||||
| Plugin | Author | Description |
|
||||
| ------ | ------ | ----------- |
|
||||
| [Edge Favorite](https://github.com/davidegiacometti/PowerToys-Run-EdgeFavorite) | [davidegiacometti](https://github.com/davidegiacometti) | Open Microsoft Edge favorites |
|
||||
| [Everything](https://github.com/lin-ycv/EverythingPowerToys) | [Yu Chieh (Victor) Lin](https://github.com/Lin-ycv) | Get search results from Everything |
|
||||
| [GitKraken](https://github.com/davidegiacometti/PowerToys-Run-GitKraken) | [davidegiacometti](https://github.com/davidegiacometti) | Open GitKraken repositories |
|
||||
| [Visual Studio Recents](https://github.com/davidegiacometti/PowerToys-Run-VisualStudio) | [davidegiacometti](https://github.com/davidegiacometti) | Open Visual Studio recents |
|
||||
| [Visual Studio](https://github.com/davidegiacometti/PowerToys-Run-VisualStudio) | [davidegiacometti](https://github.com/davidegiacometti) | Open Visual Studio recents |
|
||||
| [WinGet](https://github.com/bostrot/PowerToysRunPluginWinget) | [bostrot](https://github.com/bostrot) | Search and install packages from WinGet |
|
||||
| [Scoop](https://github.com/Quriz/PowerToysRunScoop) | [Quriz](https://github.com/Quriz) | Search and install packages from Scoop |
|
||||
| [Spotify](https://github.com/waaverecords/PowerToys-Run-Spotify) | [waaverecords](https://github.com/waaverecords) | Search Spotify and control its player |
|
||||
| [Input Typer](https://github.com/CoreyHayward/PowerToys-Run-InputTyper) | [CoreyHayward](https://github.com/CoreyHayward) | Type the input as if sent from a keyboard |
|
||||
| [Clipboard Manager](https://github.com/CoreyHayward/PowerToys-Run-ClipboardManager) | [CoreyHayward](https://github.com/CoreyHayward) | Search and paste text from your clipboard history |
|
||||
| [Currency Converter](https://github.com/Advaith3600/PowerToys-Run-Currency-Converter) | [advaith3600](https://github.com/advaith3600) | Convert real and crypto currencies |
|
||||
|
||||
@@ -46,49 +46,6 @@
|
||||
</Component>
|
||||
</DirectoryRef>
|
||||
|
||||
<?if $(var.PerUser) = "true" ?>
|
||||
<DirectoryRef Id="PersonalFolder">
|
||||
<Directory Id="WindowsPowerShellFolder" Name="PowerShell">
|
||||
<Directory Id="PowerShellModulesFolder" Name="Modules">
|
||||
<Directory Id="PowerToysDscFolder" Name="Microsoft.PowerToys.Configure">
|
||||
<Directory Id="PowerToysDscVerFolder" Name="$(var.Version)">
|
||||
<Component Id="PowerToysDSC" Win64="yes" Guid="4A033E3B-6590-43FD-8FBD-27F9DF557F7F">
|
||||
<RegistryValue Root="HKCU"
|
||||
Key="Software\[Manufacturer]\[ProductName]"
|
||||
Name="DSCInstalled"
|
||||
Type="integer"
|
||||
Value="1"
|
||||
KeyPath="yes"/>
|
||||
<File Source="$(var.RepoDir)\src\dsc\Microsoft.PowerToys.Configure\Generated\Microsoft.PowerToys.Configure\$(var.Version)\Microsoft.PowerToys.Configure.psd1" Id="PTConf.psd1" />
|
||||
<File Source="$(var.RepoDir)\src\dsc\Microsoft.PowerToys.Configure\Generated\Microsoft.PowerToys.Configure\$(var.Version)\Microsoft.PowerToys.Configure.psm1" Id="PTConf.psm1" />
|
||||
<RemoveFolder Id="RemoveThisFolder" On="uninstall" />
|
||||
<RemoveFolder Id="RemovePowerToysDscVerFolder" Directory="PowerToysDscVerFolder" On="uninstall" />
|
||||
<RemoveFolder Id="RemovePowerToysDscFolder" Directory="PowerToysDscFolder" On="uninstall" />
|
||||
<RemoveFolder Id="RemovePowerShellModulesFolder" Directory="PowerShellModulesFolder" On="uninstall" />
|
||||
<RemoveFolder Id="RemoveWindowsPowerShellFolder" Directory="WindowsPowerShellFolder" On="uninstall" />
|
||||
</Component>
|
||||
</Directory>
|
||||
</Directory>
|
||||
</Directory>
|
||||
</Directory>
|
||||
</DirectoryRef>
|
||||
<?else?>
|
||||
<DirectoryRef Id="ProgramFiles64Folder">
|
||||
<Directory Id="WindowsPowerShellFolder" Name="WindowsPowerShell">
|
||||
<Directory Id="PowerShellModulesFolder" Name="Modules">
|
||||
<Directory Id="PowerToysDscFolder" Name="Microsoft.PowerToys.Configure">
|
||||
<Directory Id="PowerToysDscVerFolder" Name="$(var.Version)">
|
||||
<Component Id="PowerToysDSC" Win64="yes" Guid="C52AECA0-DA73-49B8-BB49-31EF6640FF1F">
|
||||
<File Source="$(var.RepoDir)\src\dsc\Microsoft.PowerToys.Configure\Generated\Microsoft.PowerToys.Configure\$(var.Version)\Microsoft.PowerToys.Configure.psd1" Id="PTConf.psd1" />
|
||||
<File Source="$(var.RepoDir)\src\dsc\Microsoft.PowerToys.Configure\Generated\Microsoft.PowerToys.Configure\$(var.Version)\Microsoft.PowerToys.Configure.psm1" Id="PTConf.psm1" />
|
||||
</Component>
|
||||
</Directory>
|
||||
</Directory>
|
||||
</Directory>
|
||||
</Directory>
|
||||
</DirectoryRef>
|
||||
<?endif?>
|
||||
|
||||
<DirectoryRef Id="ApplicationProgramsFolder">
|
||||
<Component Id="PowerToysStartMenuShortcut" >
|
||||
<Shortcut Id="ApplicationStartMenuShortcut"
|
||||
@@ -144,7 +101,6 @@
|
||||
<ComponentRef Id="License_rtf" />
|
||||
<ComponentRef Id="Notice_md" />
|
||||
<ComponentRef Id="DesktopShortcut" />
|
||||
<ComponentRef Id="PowerToysDSC" />
|
||||
</ComponentGroup>
|
||||
</Fragment>
|
||||
</Wix>
|
||||
|
||||
@@ -68,7 +68,7 @@
|
||||
Vital="no">
|
||||
</ExePackage>
|
||||
<ExePackage
|
||||
DisplayName="Microsoft Edge WebView2"
|
||||
DisplayName="Installing Microsoft Edge WebView2"
|
||||
Name="MicrosoftEdgeWebview2Setup.exe"
|
||||
Compressed="yes"
|
||||
Id="WebView2"
|
||||
@@ -81,7 +81,7 @@
|
||||
UninstallCommand="/silent /uninstall">
|
||||
</ExePackage>
|
||||
<MsiPackage
|
||||
DisplayName="PowerToys MSI"
|
||||
DisplayName="Installing PowerToys"
|
||||
SourceFile="$(var.PowerToysPlatform)\Release\$(var.MSIPath)\$(var.MSIName)"
|
||||
Compressed="yes"
|
||||
DisplayInternalUI="no">
|
||||
|
||||
@@ -395,7 +395,6 @@
|
||||
<Directory Id="ApplicationProgramsFolder" Name="PowerToys (Preview)"/>
|
||||
</Directory>
|
||||
<Directory Id="DesktopFolder" Name="Desktop" />
|
||||
<Directory Id="PersonalFolder" Name="UserHomeDocuments" />
|
||||
</Directory>
|
||||
</Fragment>
|
||||
</Wix>
|
||||
|
||||
@@ -142,7 +142,7 @@
|
||||
<Directory Id="UnitConverterPluginFolder" Name="UnitConverter">
|
||||
<Directory Id="UnitConverterImagesFolder" Name="Images" />
|
||||
</Directory>
|
||||
<Directory Id="VSCodeWorkspacesPluginFolder" Name="VSCodeWorkspaces">
|
||||
<Directory Id="VSCodeWorkspacesPluginFolder" Name="VSCodeWorkspace">
|
||||
<Directory Id="VSCodeWorkspaceImagesFolder" Name="Images" />
|
||||
</Directory>
|
||||
<Directory Id="WindowWalkerPluginFolder" Name="WindowWalker">
|
||||
|
||||
@@ -15,12 +15,6 @@
|
||||
</RegistryKey>
|
||||
<File Id="WinUI3AppsMicrosoftUIXamlAssetsFile_NoiseAsset_256x256_PNG.png" Source="$(var.BinDir)WinUI3Apps\Microsoft.UI.Xaml\Assets\NoiseAsset_256x256_PNG.png" />
|
||||
</Component>
|
||||
<Component Id="WinUI3AppsMicrosoftUIXamlAssets_map.html" Win64="yes" Guid="A970464C-A5BC-43DB-ACB3-7D83CF3047B3">
|
||||
<RegistryKey Root="$(var.RegistryScope)" Key="Software\Classes\powertoys\components">
|
||||
<RegistryValue Type="string" Name="WinUI3AppsMicrosoftUIXamlAssets_map" Value="" KeyPath="yes"/>
|
||||
</RegistryKey>
|
||||
<File Id="WinUI3AppsMicrosoftUIXamlAssetsFile_map.html" Source="$(var.BinDir)WinUI3Apps\Microsoft.UI.Xaml\Assets\map.html" />
|
||||
</Component>
|
||||
</DirectoryRef>
|
||||
|
||||
<DirectoryRef Id="WinUI3AppsInstallFolder">
|
||||
@@ -459,7 +453,6 @@
|
||||
<RemoveFolder Id="RemoveFolderWinUI3AppsMicrosoftUIXamlAssetsInstallFolder" Directory="WinUI3AppsMicrosoftUIXamlAssetsInstallFolder" On="uninstall"/>
|
||||
</Component>
|
||||
<ComponentRef Id="WinUI3AppsMicrosoftUIXamlAssets_NoiseAsset_256x256_PNG.png" />
|
||||
<ComponentRef Id="WinUI3AppsMicrosoftUIXamlAssets_map.html" />
|
||||
</ComponentGroup>
|
||||
</Fragment>
|
||||
</Wix>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#include "pch.h"
|
||||
#include "stdafx.h"
|
||||
#include "resource.h"
|
||||
#include "RcResource.h"
|
||||
#include <ProjectTelemetry.h>
|
||||
|
||||
@@ -130,10 +130,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="pch.cpp">
|
||||
<PrecompiledHeader Condition="'$(UsePrecompiledHeaders)' != 'false'">Create</PrecompiledHeader>
|
||||
<ClCompile Include="stdafx.cpp">
|
||||
<PrecompiledHeader Condition="'$(CIBuild)'!='true'">Create</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
@@ -144,7 +150,7 @@
|
||||
<ClInclude Include="DepsFilesLists.h" />
|
||||
<ClInclude Include="RcResource.h" />
|
||||
<ClInclude Include="resource.h" />
|
||||
<ClInclude Include="pch.h" />
|
||||
<ClInclude Include="stdafx.h" />
|
||||
<ClInclude Include="Telemetry\ProjectTelemetry.h" />
|
||||
<ClInclude Include="Telemetry\TraceLoggingDefines.h" />
|
||||
</ItemGroup>
|
||||
|
||||
@@ -2,10 +2,10 @@
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<ClCompile Include="CustomAction.cpp" />
|
||||
<ClCompile Include="pch.cpp" />
|
||||
<ClCompile Include="stdafx.cpp" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="pch.h" />
|
||||
<ClInclude Include="stdafx.h" />
|
||||
<ClInclude Include="Telemetry\ProjectTelemetry.h">
|
||||
<Filter>Telemetry</Filter>
|
||||
</ClInclude>
|
||||
|
||||
@@ -1,5 +0,0 @@
|
||||
// pch.cpp: source file corresponding to the pre-compiled header
|
||||
|
||||
#include "pch.h"
|
||||
|
||||
// When you are using pre-compiled headers, this source file is necessary for compilation to succeed.
|
||||
4
installer/PowerToysSetupCustomActions/stdafx.cpp
Normal file
4
installer/PowerToysSetupCustomActions/stdafx.cpp
Normal file
@@ -0,0 +1,4 @@
|
||||
#include "stdafx.h"
|
||||
|
||||
// TODO: reference any additional headers you need in STDAFX.H
|
||||
// and not in this file
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="Microsoft.MSBuildCache.AzurePipelines" version="0.1.271-preview" />
|
||||
<package id="Microsoft.MSBuildCache.Local" version="0.1.271-preview" />
|
||||
<package id="Microsoft.MSBuildCache.SharedCompilation" version="0.1.271-preview" />
|
||||
<package id="Microsoft.MSBuildCache.AzurePipelines" version="0.1.258-preview" />
|
||||
<package id="Microsoft.MSBuildCache.Local" version="0.1.258-preview" />
|
||||
<package id="Microsoft.MSBuildCache.SharedCompilation" version="0.1.258-preview" />
|
||||
</packages>
|
||||
@@ -26,6 +26,7 @@
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
<AdditionalIncludeDirectories>..\..\..\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
|
||||
@@ -12,12 +12,12 @@ namespace Microsoft.PowerToys.FilePreviewCommon
|
||||
/// <summary>
|
||||
/// Markdown HTML header for light theme.
|
||||
/// </summary>
|
||||
private static readonly string HtmlLightHeader = "<!doctype html><style>body{width:100%;margin:0;font-family:-apple-system,BlinkMacSystemFont,\"Segoe UI\",Roboto,\"Helvetica Neue\",Arial,\"Noto Sans\",sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\",\"Segoe UI Symbol\",\"Noto Color Emoji\";font-size:1rem;font-weight:400;line-height:1.5;color:#212529;text-align:left;background-color:#fff}.container{padding:5%}body img{max-width:100%;height:auto}body h1,body h2,body h3,body h4,body h5,body h6{margin-top:24px;margin-bottom:16px;font-weight:600;line-height:1.25}body h1,body h2{padding-bottom:.3em;border-bottom:1px solid #eaecef}body{font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif,Apple Color Emoji,Segoe UI Emoji}body h3{font-size:1.25em}body h4{font-size:1em}body h5{font-size:.875em}body h6{font-size:.85em;color:#6a737d}pre{font-family:SFMono-Regular,Consolas,Liberation Mono,Menlo,monospace;background-color:#f6f8fa;border-radius:3px;padding:16px;font-size:85%}a{color:#0366d6}strong{font-weight:600}em{font-style:italic}code{padding:.2em .4em;margin:0;font-size:85%;background-color:#f6f8fa;border-radius:3px}hr{border-color:#EEE -moz-use-text-color #FFF;border-style:solid none;border-width:.5px 0;margin:18px 0}table{display:block;width:100%;overflow:auto;border-spacing:0;border-collapse:collapse}tbody{display:table-row-group;vertical-align:middle;border-color:inherit;vertical-align:inherit;border-color:inherit}table tr{background-color:#fff;border-top:1px solid #c6cbd1}tr{display:table-row;vertical-align:inherit;border-color:inherit}table td,table th{padding:6px 13px;border:1px solid #dfe2e5}th{font-weight:600;display:table-cell;vertical-align:inherit;font-weight:bold;text-align:-internal-center}thead{display:table-header-group;vertical-align:middle;border-color:inherit}td{display:table-cell;vertical-align:inherit}code,pre,tt{font-family:SFMono-Regular,Menlo,Monaco,Consolas,\"Liberation Mono\",\"Courier New\",monospace;color:#24292e;overflow-x:auto}pre code{display:block;font-size:inherit;color:inherit;word-break:normal}blockquote{background-color:#fff;border-radius:3px;padding:15px;font-size:14px;display:block;margin-block-start:1em;margin-block-end:1em;margin-inline-start:40px;margin-inline-end:40px;padding:0 1em;color:#6a737d;border-left:.25em solid #dfe2e5}</style><body><div class=\"container\">";
|
||||
private static readonly string HtmlLightHeader = "<!doctype html><style>body{width:100%;margin:0;font-family:-apple-system,BlinkMacSystemFont,\"Segoe UI\",Roboto,\"Helvetica Neue\",Arial,\"Noto Sans\",sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\",\"Segoe UI Symbol\",\"Noto Color Emoji\";font-size:1rem;font-weight:400;line-height:1.5;color:#212529;text-align:left;background-color:#fff}.container{padding:5%}body img{max-width:100%;height:auto}body h1,body h2,body h3,body h4,body h5,body h6{margin-top:24px;margin-bottom:16px;font-weight:600;line-height:1.25}body h1,body h2{padding-bottom:.3em;border-bottom:1px solid #eaecef}body{font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif,Apple Color Emoji,Segoe UI Emoji}body h3{font-size:1.25em}body h4{font-size:1em}body h5{font-size:.875em}body h6{font-size:.85em;color:#6a737d}pre{font-family:SFMono-Regular,Consolas,Liberation Mono,Menlo,monospace;background-color:#f6f8fa;border-radius:3px;padding:16px;font-size:85%}a{color:#0366d6}strong{font-weight:600}em{font-style:italic}code{padding:.2em .4em;margin:0;font-size:85%;background-color:#f6f8fa;border-radius:3px}hr{border-color:#EEE -moz-use-text-color #FFF;border-style:solid none;border-width:.5px 0;margin:18px 0}table{display:block;width:100%;overflow:auto;border-spacing:0;border-collapse:collapse}tbody{display:table-row-group;vertical-align:middle;border-color:inherit;vertical-align:inherit;border-color:inherit}table tr{background-color:#fff;border-top:1px solid #c6cbd1}tr{display:table-row;vertical-align:inherit;border-color:inherit}table td,table th{padding:6px 13px;border:1px solid #dfe2e5}th{font-weight:600;display:table-cell;vertical-align:inherit;font-weight:bold;text-align:-internal-center}thead{display:table-header-group;vertical-align:middle;border-color:inherit}td{display:table-cell;vertical-align:inherit}code,pre,tt{font-family:SFMono-Regular,Menlo,Monaco,Consolas,\"Liberation Mono\",\"Courier New\",monospace;color:#24292e;overflow-x:auto}pre code{font-size:inherit;color:inherit;word-break:normal}blockquote{background-color:#fff;border-radius:3px;padding:15px;font-size:14px;display:block;margin-block-start:1em;margin-block-end:1em;margin-inline-start:40px;margin-inline-end:40px;padding:0 1em;color:#6a737d;border-left:.25em solid #dfe2e5}</style><body><div class=\"container\">";
|
||||
|
||||
/// <summary>
|
||||
/// Markdown HTML header for dark theme.
|
||||
/// </summary>
|
||||
private static readonly string HtmlDarkHeader = "<!doctype html><style>body{width:100%;margin:0;font-family:-apple-system,BlinkMacSystemFont,\"Segoe UI\",Roboto,\"Helvetica Neue\",Arial,\"Noto Sans\",sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\",\"Segoe UI Symbol\",\"Noto Color Emoji\";font-size:1rem;font-weight:400;line-height:1.5;color:#d4d4d4;text-align:left;background-color:#1e1e1e}.container{padding:5%}body img{max-width:100%;height:auto}body h1,body h2,body h3,body h4,body h5,body h6{margin-top:24px;margin-bottom:16px;font-weight:600;line-height:1.25}body h1,body h2{padding-bottom:.3em;border-bottom:1px solid #474747}body{font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif,Apple Color Emoji,Segoe UI Emoji}body h3{font-size:1.25em}body h4{font-size:1em}body h5{font-size:.875em}body h6{font-size:.85em;color:#d4d4d4}pre{font-family:SFMono-Regular,Consolas,Liberation Mono,Menlo,monospace;background-color:#161616;border-radius:3px;padding:16px;font-size:85%}a{color:#0366d6}strong{font-weight:600}em{font-style:italic}code{padding:.2em .4em;margin:0;font-size:85%;background-color:#161616;border-radius:3px}hr{border-color:#EEE -moz-use-text-color #FFF;border-style:solid none;border-width:.5px 0;margin:18px 0}table{display:block;width:100%;overflow:auto;border-spacing:0;border-collapse:collapse}tbody{display:table-row-group;vertical-align:middle;border-color:inherit;vertical-align:inherit;border-color:inherit}table tr{background-color:#1e1e1e;border-top:1px solid #c6cbd1}tr{display:table-row;vertical-align:inherit;border-color:inherit}table td,table th{padding:6px 13px;border:1px solid #474747}th{font-weight:600;display:table-cell;vertical-align:inherit;font-weight:bold;text-align:-internal-center}thead{display:table-header-group;vertical-align:middle;border-color:inherit}td{display:table-cell;vertical-align:inherit}code,pre,tt{font-family:SFMono-Regular,Menlo,Monaco,Consolas,\"Liberation Mono\",\"Courier New\",monospace;color:#d4d4d4;overflow-x:auto}pre code{display:block;font-size:inherit;color:inherit;word-break:normal}blockquote{background-color:#282828;border-radius:3px;padding:15px;font-size:14px;display:block;margin-block-start:1em;margin-block-end:1em;margin-inline-start:40px;margin-inline-end:40px;padding:0 1em;color:#d4d4d4;border-left:.25em solid #d4d4d4}</style><body><div class=\"container\">";
|
||||
private static readonly string HtmlDarkHeader = "<!doctype html><style>body{width:100%;margin:0;font-family:-apple-system,BlinkMacSystemFont,\"Segoe UI\",Roboto,\"Helvetica Neue\",Arial,\"Noto Sans\",sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\",\"Segoe UI Symbol\",\"Noto Color Emoji\";font-size:1rem;font-weight:400;line-height:1.5;color:#d4d4d4;text-align:left;background-color:#1e1e1e}.container{padding:5%}body img{max-width:100%;height:auto}body h1,body h2,body h3,body h4,body h5,body h6{margin-top:24px;margin-bottom:16px;font-weight:600;line-height:1.25}body h1,body h2{padding-bottom:.3em;border-bottom:1px solid #474747}body{font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif,Apple Color Emoji,Segoe UI Emoji}body h3{font-size:1.25em}body h4{font-size:1em}body h5{font-size:.875em}body h6{font-size:.85em;color:#d4d4d4}pre{font-family:SFMono-Regular,Consolas,Liberation Mono,Menlo,monospace;background-color:#161616;border-radius:3px;padding:16px;font-size:85%}a{color:#0366d6}strong{font-weight:600}em{font-style:italic}code{padding:.2em .4em;margin:0;font-size:85%;background-color:#161616;border-radius:3px}hr{border-color:#EEE -moz-use-text-color #FFF;border-style:solid none;border-width:.5px 0;margin:18px 0}table{display:block;width:100%;overflow:auto;border-spacing:0;border-collapse:collapse}tbody{display:table-row-group;vertical-align:middle;border-color:inherit;vertical-align:inherit;border-color:inherit}table tr{background-color:#1e1e1e;border-top:1px solid #c6cbd1}tr{display:table-row;vertical-align:inherit;border-color:inherit}table td,table th{padding:6px 13px;border:1px solid #474747}th{font-weight:600;display:table-cell;vertical-align:inherit;font-weight:bold;text-align:-internal-center}thead{display:table-header-group;vertical-align:middle;border-color:inherit}td{display:table-cell;vertical-align:inherit}code,pre,tt{font-family:SFMono-Regular,Menlo,Monaco,Consolas,\"Liberation Mono\",\"Courier New\",monospace;color:#d4d4d4;overflow-x:auto}pre code{font-size:inherit;color:inherit;word-break:normal}blockquote{background-color:#282828;border-radius:3px;padding:15px;font-size:14px;display:block;margin-block-start:1em;margin-block-end:1em;margin-inline-start:40px;margin-inline-end:40px;padding:0 1em;color:#d4d4d4;border-left:.25em solid #d4d4d4}</style><body><div class=\"container\">";
|
||||
|
||||
/// <summary>
|
||||
/// Markdown HTML footer.
|
||||
|
||||
@@ -50,6 +50,8 @@
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup>
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
|
||||
<PrecompiledHeaderOutputFile>$(IntDir)pch.pch</PrecompiledHeaderOutputFile>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<AdditionalOptions>%(AdditionalOptions) /bigobj</AdditionalOptions>
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
<ClCompile Include="settings_objects.cpp" />
|
||||
<ClCompile Include="FileWatcher.cpp" />
|
||||
<ClCompile Include="pch.cpp">
|
||||
<PrecompiledHeader Condition="'$(UsePrecompiledHeaders)' != 'false'">Create</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(CIBuild)'!='true'">Create</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
|
||||
@@ -36,7 +36,7 @@
|
||||
<ItemGroup>
|
||||
<ClCompile Include="UnitTestsVersionHelper.cpp" />
|
||||
<ClCompile Include="pch.cpp">
|
||||
<PrecompiledHeader Condition="'$(UsePrecompiledHeaders)' != 'false'">Create</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(CIBuild)'!='true'">Create</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Settings.Tests.cpp" />
|
||||
</ItemGroup>
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
|
||||
#include <common/version/version.h>
|
||||
|
||||
|
||||
using namespace System;
|
||||
using namespace System::Runtime::InteropServices;
|
||||
using System::Collections::Generic::List;
|
||||
@@ -39,17 +40,11 @@ public
|
||||
delete _map;
|
||||
}
|
||||
|
||||
String ^ GetKeyName(DWORD key)
|
||||
{
|
||||
String ^ GetKeyName(DWORD key) {
|
||||
return gcnew String(_map->GetKeyName(key).c_str());
|
||||
}
|
||||
|
||||
DWORD GetKeyValue(String ^ name)
|
||||
{
|
||||
return _map->GetKeyFromName(msclr::interop::marshal_as<std::wstring>(name));
|
||||
}
|
||||
|
||||
void Updatelayout()
|
||||
void Updatelayout()
|
||||
{
|
||||
_map->UpdateLayout();
|
||||
}
|
||||
@@ -134,13 +129,13 @@ public
|
||||
}
|
||||
|
||||
static List<String ^> ^ GetAllActiveMicrophoneDeviceNames() {
|
||||
auto names = gcnew List<String ^>();
|
||||
for (const auto& device : MicrophoneDevice::getAllActive())
|
||||
{
|
||||
names->Add(gcnew String(device->name().data()));
|
||||
}
|
||||
return names;
|
||||
auto names = gcnew List<String ^>();
|
||||
for (const auto& device : MicrophoneDevice::getAllActive())
|
||||
{
|
||||
names->Add(gcnew String(device->name().data()));
|
||||
}
|
||||
return names;
|
||||
}
|
||||
|
||||
static List<String ^> ^
|
||||
GetAllVideoCaptureDeviceNames() {
|
||||
|
||||
@@ -27,17 +27,6 @@ std::wstring LayoutMap::GetKeyName(DWORD key)
|
||||
return impl->GetKeyName(key);
|
||||
}
|
||||
|
||||
DWORD LayoutMap::GetKeyFromName(const std::wstring& name)
|
||||
{
|
||||
auto list = impl->GetKeyNameList(false);
|
||||
for (const auto& [value, key] : list)
|
||||
{
|
||||
if (key == name)
|
||||
return value;
|
||||
}
|
||||
return {};
|
||||
}
|
||||
|
||||
std::vector<DWORD> LayoutMap::GetKeyCodeList(const bool isShortcut)
|
||||
{
|
||||
return impl->GetKeyCodeList(isShortcut);
|
||||
|
||||
@@ -11,7 +11,6 @@ public:
|
||||
~LayoutMap();
|
||||
void UpdateLayout();
|
||||
std::wstring GetKeyName(DWORD key);
|
||||
DWORD GetKeyFromName(const std::wstring& name);
|
||||
std::vector<DWORD> GetKeyCodeList(const bool isShortcut = false);
|
||||
std::vector<std::pair<DWORD, std::wstring>> GetKeyNameList(const bool isShortcut = false);
|
||||
|
||||
|
||||
@@ -67,7 +67,7 @@
|
||||
<ClCompile Include="logger.cpp" />
|
||||
<ClCompile Include="logger_settings.cpp" />
|
||||
<ClCompile Include="pch.cpp">
|
||||
<PrecompiledHeader Condition="'$(UsePrecompiledHeaders)' != 'false'">Create</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(CIBuild)'!='true'">Create</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
|
||||
@@ -59,7 +59,7 @@
|
||||
<ItemGroup>
|
||||
<ClCompile Include="dllmain.cpp" />
|
||||
<ClCompile Include="pch.cpp">
|
||||
<PrecompiledHeader Condition="'$(UsePrecompiledHeaders)' != 'false'">Create</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(CIBuild)'!='true'">Create</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
<ClCompile Include="dont_show_again.cpp" />
|
||||
<ClCompile Include="notifications.cpp" />
|
||||
<ClCompile Include="pch.cpp">
|
||||
<PrecompiledHeader Condition="'$(UsePrecompiledHeaders)' != 'false'">Create</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(CIBuild)'!='true'">Create</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
|
||||
@@ -44,7 +44,7 @@
|
||||
<ClCompile Include="updating.cpp" />
|
||||
<ClCompile Include="updateState.cpp" />
|
||||
<ClCompile Include="pch.cpp">
|
||||
<PrecompiledHeader Condition="'$(UsePrecompiledHeaders)' != 'false'">Create</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(CIBuild)'!='true'">Create</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
|
||||
@@ -71,7 +71,7 @@ namespace
|
||||
}
|
||||
|
||||
result = spView->QueryInterface(riid, ppv);
|
||||
if (result != S_OK || ppv == nullptr || *ppv == nullptr)
|
||||
if (result != S_OK || ppv == nullptr || *ppv == nullptr )
|
||||
{
|
||||
Logger::warn(L"Failed to query interface. {}", GetErrorString(result));
|
||||
return false;
|
||||
@@ -83,7 +83,7 @@ namespace
|
||||
inline bool GetDesktopAutomationObject(REFIID riid, void** ppv)
|
||||
{
|
||||
CComPtr<IShellView> spsv;
|
||||
|
||||
|
||||
// Desktop may not be available on startup
|
||||
auto attempts = 5;
|
||||
for (auto i = 1; i <= attempts; i++)
|
||||
@@ -207,34 +207,8 @@ inline bool drop_elevated_privileges()
|
||||
return result;
|
||||
}
|
||||
|
||||
// Run command as different user, returns true if succeeded
|
||||
inline HANDLE run_as_different_user(const std::wstring& file, const std::wstring& params, const wchar_t* workingDir = nullptr, const bool showWindow = true)
|
||||
{
|
||||
Logger::info(L"run_elevated with params={}", params);
|
||||
SHELLEXECUTEINFOW exec_info = { 0 };
|
||||
exec_info.cbSize = sizeof(SHELLEXECUTEINFOW);
|
||||
exec_info.lpVerb = L"runAsUser";
|
||||
exec_info.lpFile = file.c_str();
|
||||
exec_info.lpParameters = params.c_str();
|
||||
exec_info.hwnd = 0;
|
||||
exec_info.fMask = SEE_MASK_NOCLOSEPROCESS;
|
||||
exec_info.lpDirectory = workingDir;
|
||||
exec_info.hInstApp = 0;
|
||||
if (showWindow)
|
||||
{
|
||||
exec_info.nShow = SW_SHOWDEFAULT;
|
||||
}
|
||||
else
|
||||
{
|
||||
// might have limited success, but only option with ShellExecuteExW
|
||||
exec_info.nShow = SW_HIDE;
|
||||
}
|
||||
|
||||
return ShellExecuteExW(&exec_info) ? exec_info.hProcess : nullptr;
|
||||
}
|
||||
|
||||
// Run command as elevated user, returns true if succeeded
|
||||
inline HANDLE run_elevated(const std::wstring& file, const std::wstring& params, const wchar_t* workingDir = nullptr, const bool showWindow = true)
|
||||
inline HANDLE run_elevated(const std::wstring& file, const std::wstring& params)
|
||||
{
|
||||
Logger::info(L"run_elevated with params={}", params);
|
||||
SHELLEXECUTEINFOW exec_info = { 0 };
|
||||
@@ -244,24 +218,15 @@ inline HANDLE run_elevated(const std::wstring& file, const std::wstring& params,
|
||||
exec_info.lpParameters = params.c_str();
|
||||
exec_info.hwnd = 0;
|
||||
exec_info.fMask = SEE_MASK_NOCLOSEPROCESS;
|
||||
exec_info.lpDirectory = workingDir;
|
||||
exec_info.lpDirectory = 0;
|
||||
exec_info.hInstApp = 0;
|
||||
|
||||
if (showWindow)
|
||||
{
|
||||
exec_info.nShow = SW_SHOWDEFAULT;
|
||||
}
|
||||
else
|
||||
{
|
||||
// might have limited success, but only option with ShellExecuteExW
|
||||
exec_info.nShow = SW_HIDE;
|
||||
}
|
||||
exec_info.nShow = SW_SHOWDEFAULT;
|
||||
|
||||
return ShellExecuteExW(&exec_info) ? exec_info.hProcess : nullptr;
|
||||
}
|
||||
|
||||
// Run command as non-elevated user, returns true if succeeded, puts the process id into returnPid if returnPid != NULL
|
||||
inline bool run_non_elevated(const std::wstring& file, const std::wstring& params, DWORD* returnPid, const wchar_t* workingDir = nullptr, const bool showWindow = true)
|
||||
inline bool run_non_elevated(const std::wstring& file, const std::wstring& params, DWORD* returnPid, const wchar_t* workingDir = nullptr)
|
||||
{
|
||||
Logger::info(L"run_non_elevated with params={}", params);
|
||||
auto executable_args = L"\"" + file + L"\"";
|
||||
@@ -327,22 +292,15 @@ inline bool run_non_elevated(const std::wstring& file, const std::wstring& param
|
||||
STARTUPINFOEX siex = { 0 };
|
||||
siex.lpAttributeList = pptal;
|
||||
siex.StartupInfo.cb = sizeof(siex);
|
||||
PROCESS_INFORMATION pi = { 0 };
|
||||
auto dwCreationFlags = EXTENDED_STARTUPINFO_PRESENT;
|
||||
|
||||
if (!showWindow)
|
||||
{
|
||||
siex.StartupInfo.dwFlags = STARTF_USESHOWWINDOW;
|
||||
siex.StartupInfo.wShowWindow = SW_HIDE;
|
||||
dwCreationFlags = CREATE_NO_WINDOW;
|
||||
}
|
||||
PROCESS_INFORMATION pi = { 0 };
|
||||
|
||||
auto succeeded = CreateProcessW(file.c_str(),
|
||||
&executable_args[0],
|
||||
nullptr,
|
||||
nullptr,
|
||||
FALSE,
|
||||
dwCreationFlags,
|
||||
EXTENDED_STARTUPINFO_PRESENT,
|
||||
nullptr,
|
||||
workingDir,
|
||||
&siex.StartupInfo,
|
||||
@@ -383,10 +341,7 @@ inline bool RunNonElevatedEx(const std::wstring& file, const std::wstring& param
|
||||
catch (...)
|
||||
{
|
||||
}
|
||||
if (SUCCEEDED(co_init))
|
||||
{
|
||||
CoUninitialize();
|
||||
}
|
||||
if (SUCCEEDED(co_init)) CoUninitialize();
|
||||
|
||||
return success;
|
||||
}
|
||||
@@ -417,7 +372,7 @@ inline std::optional<ProcessInfo> RunNonElevatedFailsafe(const std::wstring& fil
|
||||
}
|
||||
}
|
||||
|
||||
auto handles = getProcessHandlesByName(std::filesystem::path{ file }.filename().wstring(), PROCESS_QUERY_INFORMATION | SYNCHRONIZE | handleAccess);
|
||||
auto handles = getProcessHandlesByName(std::filesystem::path{ file }.filename().wstring(), PROCESS_QUERY_INFORMATION | SYNCHRONIZE | handleAccess );
|
||||
|
||||
if (handles.empty())
|
||||
return std::nullopt;
|
||||
@@ -430,7 +385,7 @@ inline std::optional<ProcessInfo> RunNonElevatedFailsafe(const std::wstring& fil
|
||||
}
|
||||
|
||||
// Run command with the same elevation, returns true if succeeded
|
||||
inline bool run_same_elevation(const std::wstring& file, const std::wstring& params, DWORD* returnPid, const wchar_t* workingDir = nullptr)
|
||||
inline bool run_same_elevation(const std::wstring& file, const std::wstring& params, DWORD* returnPid)
|
||||
{
|
||||
auto executable_args = L"\"" + file + L"\"";
|
||||
if (!params.empty())
|
||||
@@ -448,7 +403,7 @@ inline bool run_same_elevation(const std::wstring& file, const std::wstring& par
|
||||
FALSE,
|
||||
0,
|
||||
nullptr,
|
||||
workingDir,
|
||||
nullptr,
|
||||
&si,
|
||||
&pi);
|
||||
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
#include <windows.h>
|
||||
#include <string>
|
||||
#include <atlstr.h>
|
||||
|
||||
// Get a string from the resource file
|
||||
inline std::wstring get_resource_string(UINT resource_id, HINSTANCE instance, const wchar_t* fallback)
|
||||
@@ -11,22 +10,7 @@ inline std::wstring get_resource_string(UINT resource_id, HINSTANCE instance, co
|
||||
auto length = LoadStringW(instance, resource_id, reinterpret_cast<wchar_t*>(&text_ptr), 0);
|
||||
if (length == 0)
|
||||
{
|
||||
// Try to load en-us string as the first fallback.
|
||||
WORD english_language = MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US);
|
||||
ATL::CStringW english_string;
|
||||
try
|
||||
{
|
||||
if (!english_string.LoadStringW(instance, resource_id, english_language))
|
||||
{
|
||||
return fallback;
|
||||
}
|
||||
}
|
||||
catch (...)
|
||||
{
|
||||
return fallback;
|
||||
}
|
||||
|
||||
return std::wstring(english_string);
|
||||
return fallback;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -1,23 +0,0 @@
|
||||
properties:
|
||||
resources:
|
||||
# - resource: Microsoft.WinGet.DSC/WinGetPackage
|
||||
# directives:
|
||||
# description: Install PowerToys
|
||||
# allowPrerelease: true
|
||||
# settings:
|
||||
# id: PowerToys (Preview)
|
||||
# source: winget
|
||||
|
||||
- resource: PowerToysConfigure
|
||||
directives:
|
||||
description: Configure PowerToys
|
||||
settings:
|
||||
ShortcutGuide:
|
||||
Enabled: false
|
||||
OverlayOpacity: 50
|
||||
FancyZones:
|
||||
Enabled: true
|
||||
FancyzonesEditorHotkey: "Shift+Ctrl+Alt+F"
|
||||
FileLocksmith:
|
||||
Enabled: false
|
||||
configurationVersion: 0.2.0
|
||||
@@ -1,53 +0,0 @@
|
||||
properties:
|
||||
resources:
|
||||
- resource: PowerToysConfigure
|
||||
directives:
|
||||
description: Configure PowerToys
|
||||
settings:
|
||||
PowerLauncher:
|
||||
Enabled: true
|
||||
Plugins:
|
||||
- Name: "Calculator"
|
||||
Disabled: false
|
||||
- Name: "Folder"
|
||||
Disabled: false
|
||||
- Name: "History"
|
||||
Disabled: false
|
||||
- Name: "Windows Search"
|
||||
Disabled: false
|
||||
- Name: "OneNote"
|
||||
Disabled: false
|
||||
- Name: "PowerToys"
|
||||
Disabled: false
|
||||
- Name: "Program"
|
||||
Disabled: false
|
||||
ActionKeyword: "P:"
|
||||
IsGlobal: false
|
||||
- Name: "Registry Plugin"
|
||||
Disabled: false
|
||||
- Name: "Service"
|
||||
Disabled: false
|
||||
- Name: "Shell"
|
||||
Disabled: false
|
||||
- Name: "Windows System Commands"
|
||||
Disabled: false
|
||||
- Name: "Time and Date"
|
||||
Disabled: false
|
||||
- Name: "Unit Converter"
|
||||
Disabled: false
|
||||
- Name: "URI Handler"
|
||||
Disabled: false
|
||||
- Name: "Value Generator"
|
||||
Disabled: false
|
||||
- Name: "Visual Studio Code Workspaces"
|
||||
Disabled: false
|
||||
- Name: "Web Search"
|
||||
Disabled: false
|
||||
- Name: "Windows settings"
|
||||
Disabled: false
|
||||
- Name: "Windows Terminal"
|
||||
Disabled: false
|
||||
- Name: "Window Walker"
|
||||
Disabled: false
|
||||
|
||||
configurationVersion: 0.2.0
|
||||
@@ -1,70 +0,0 @@
|
||||
properties:
|
||||
resources:
|
||||
- resource: PowerToysConfigure
|
||||
directives:
|
||||
description: Configure PowerToys
|
||||
settings:
|
||||
AlwaysOnTop:
|
||||
Enabled: false
|
||||
Awake:
|
||||
Enabled: false
|
||||
ColorPicker:
|
||||
Enabled: false
|
||||
CropAndLock:
|
||||
Enabled: false
|
||||
EnvironmentVariables:
|
||||
Enabled: false
|
||||
FancyZones:
|
||||
Enabled: false
|
||||
FileLocksmith:
|
||||
Enabled: false
|
||||
ImageResizer:
|
||||
Enabled: false
|
||||
KeyboardManager:
|
||||
Enabled: false
|
||||
FindMyMouse:
|
||||
Enabled: false
|
||||
MouseHighlighter:
|
||||
Enabled: false
|
||||
MouseJump:
|
||||
Enabled: false
|
||||
MousePointerCrosshairs:
|
||||
Enabled: false
|
||||
MouseWithoutBorders:
|
||||
Enabled: false
|
||||
Peek:
|
||||
Enabled: false
|
||||
PowerRename:
|
||||
Enabled: false
|
||||
PowerLauncher:
|
||||
Enabled: false
|
||||
PowerAccent:
|
||||
Enabled: false
|
||||
PowerPreview:
|
||||
EnableSvgPreview: false
|
||||
EnableSvgThumbnail: false
|
||||
EnableMdPreview: false
|
||||
EnableMonacoPreview: false
|
||||
EnablePdfPreview: false
|
||||
EnablePdfThumbnail: false
|
||||
EnableGcodePreview: false
|
||||
EnableGcodeThumbnail: false
|
||||
EnableStlThumbnail: false
|
||||
EnableQoiPreview: false
|
||||
EnableQoiThumbnail: false
|
||||
PowerOcr:
|
||||
Enabled: false
|
||||
ShortcutGuide:
|
||||
Enabled: false
|
||||
VideoConference:
|
||||
Enabled: false
|
||||
MeasureTool:
|
||||
Enabled: false
|
||||
Hosts:
|
||||
Enabled: false
|
||||
PastePlain:
|
||||
Enabled: false
|
||||
RegistryPreview:
|
||||
Enabled: false
|
||||
|
||||
configurationVersion: 0.2.0
|
||||
@@ -1,70 +0,0 @@
|
||||
properties:
|
||||
resources:
|
||||
- resource: PowerToysConfigure
|
||||
directives:
|
||||
description: Configure PowerToys
|
||||
settings:
|
||||
AlwaysOnTop:
|
||||
Enabled: true
|
||||
Awake:
|
||||
Enabled: true
|
||||
ColorPicker:
|
||||
Enabled: true
|
||||
CropAndLock:
|
||||
Enabled: true
|
||||
EnvironmentVariables:
|
||||
Enabled: true
|
||||
FancyZones:
|
||||
Enabled: true
|
||||
FileLocksmith:
|
||||
Enabled: true
|
||||
ImageResizer:
|
||||
Enabled: true
|
||||
KeyboardManager:
|
||||
Enabled: true
|
||||
FindMyMouse:
|
||||
Enabled: true
|
||||
MouseHighlighter:
|
||||
Enabled: true
|
||||
MouseJump:
|
||||
Enabled: true
|
||||
MousePointerCrosshairs:
|
||||
Enabled: true
|
||||
MouseWithoutBorders:
|
||||
Enabled: true
|
||||
Peek:
|
||||
Enabled: true
|
||||
PowerRename:
|
||||
Enabled: true
|
||||
PowerLauncher:
|
||||
Enabled: true
|
||||
PowerAccent:
|
||||
Enabled: true
|
||||
PowerPreview:
|
||||
EnableSvgPreview: true
|
||||
EnableSvgThumbnail: true
|
||||
EnableMdPreview: true
|
||||
EnableMonacoPreview: true
|
||||
EnablePdfPreview: true
|
||||
EnablePdfThumbnail: true
|
||||
EnableGcodePreview: true
|
||||
EnableGcodeThumbnail: true
|
||||
EnableStlThumbnail: true
|
||||
EnableQoiPreview: true
|
||||
EnableQoiThumbnail: true
|
||||
PowerOcr:
|
||||
Enabled: true
|
||||
ShortcutGuide:
|
||||
Enabled: true
|
||||
VideoConference:
|
||||
Enabled: true
|
||||
MeasureTool:
|
||||
Enabled: true
|
||||
Hosts:
|
||||
Enabled: true
|
||||
PastePlain:
|
||||
Enabled: true
|
||||
RegistryPreview:
|
||||
Enabled: true
|
||||
|
||||
configurationVersion: 0.2.0
|
||||
@@ -1,31 +0,0 @@
|
||||
// Copyright (c) Microsoft Corporation
|
||||
// The Microsoft Corporation licenses this file to you under the MIT license.
|
||||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace PowerToys.Settings.DSC.Schema;
|
||||
|
||||
internal sealed class Common
|
||||
{
|
||||
private static string[] TypeParts(string name)
|
||||
{
|
||||
return Regex.Split(name.ToLower(CultureInfo.CurrentCulture), @"(?<!^)(?=[A-Z])|\.");
|
||||
}
|
||||
|
||||
internal static bool InferIsBool(Type propertyInfo)
|
||||
{
|
||||
return TypeParts(propertyInfo.Name).Any(word => word.Equals("Bool", StringComparison.OrdinalIgnoreCase) || word.Equals("Boolean", StringComparison.OrdinalIgnoreCase));
|
||||
}
|
||||
|
||||
internal static bool InferIsInt(Type propertyInfo)
|
||||
{
|
||||
return TypeParts(propertyInfo.Name).Any(word => word.Contains("Int", StringComparison.OrdinalIgnoreCase));
|
||||
}
|
||||
}
|
||||
@@ -1,477 +0,0 @@
|
||||
// Copyright (c) Microsoft Corporation
|
||||
// The Microsoft Corporation licenses this file to you under the MIT license.
|
||||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.Linq;
|
||||
using System.Text.RegularExpressions;
|
||||
using static PowerToys.Settings.DSC.Schema.Introspection;
|
||||
|
||||
namespace PowerToys.Settings.DSC.Schema;
|
||||
|
||||
internal sealed class DSCGeneration
|
||||
{
|
||||
private static readonly string DoubleNewLine = Environment.NewLine + Environment.NewLine;
|
||||
|
||||
private struct AdditionalPropertiesInfo
|
||||
{
|
||||
public string Name;
|
||||
|
||||
public string Type;
|
||||
}
|
||||
|
||||
private static readonly Dictionary<string, AdditionalPropertiesInfo> AdditionalPropertiesInfoPerModule = new Dictionary<string, AdditionalPropertiesInfo> { { "PowerLauncher", new AdditionalPropertiesInfo { Name = "Plugins", Type = "Hashtable[]" } } };
|
||||
|
||||
private static string EmitEnumDefinition(Type type)
|
||||
{
|
||||
var values = string.Empty;
|
||||
|
||||
int i = 0;
|
||||
foreach (var name in Enum.GetNames(type))
|
||||
{
|
||||
values += " " + name;
|
||||
|
||||
// Nullable enums seem to be not supported by winget, so the workaround is to always start with '1', because by default the values are initialized to zero. That allows us to use zero as a "lack of value" indicator.
|
||||
if (i == 0)
|
||||
{
|
||||
values += " = 1";
|
||||
}
|
||||
|
||||
values += Environment.NewLine;
|
||||
i++;
|
||||
}
|
||||
|
||||
return $$"""
|
||||
enum {{type.Name}} {
|
||||
{{values}}}
|
||||
""";
|
||||
}
|
||||
|
||||
private struct PropertyEmitInfo
|
||||
{
|
||||
public string Name;
|
||||
public string Type;
|
||||
public string Initializer;
|
||||
public string EqualityOperator;
|
||||
public string DefaultValue;
|
||||
|
||||
public PropertyEmitInfo(string name, Type property)
|
||||
{
|
||||
Name = name;
|
||||
|
||||
bool intLike = Common.InferIsInt(property);
|
||||
bool boolLike = Common.InferIsBool(property);
|
||||
|
||||
var rawType = "string";
|
||||
var isNullable = true;
|
||||
DefaultValue = "$null";
|
||||
EqualityOperator = "-ne";
|
||||
Initializer = "= $null";
|
||||
|
||||
if (intLike)
|
||||
{
|
||||
rawType = "int";
|
||||
isNullable = false;
|
||||
}
|
||||
else if (boolLike)
|
||||
{
|
||||
rawType = "bool";
|
||||
isNullable = false;
|
||||
}
|
||||
else if (property.IsEnum)
|
||||
{
|
||||
rawType = property.Name;
|
||||
isNullable = true;
|
||||
Initializer = string.Empty;
|
||||
DefaultValue = "0";
|
||||
}
|
||||
|
||||
// For strings
|
||||
else
|
||||
{
|
||||
EqualityOperator = "-notlike";
|
||||
DefaultValue = "''";
|
||||
}
|
||||
|
||||
// We must make all our properties nullable to be able to detect which of them weren't supplied
|
||||
Type = isNullable ? rawType : $"Nullable[{rawType}]";
|
||||
}
|
||||
}
|
||||
|
||||
private static string EmitPropertyDefinition(PropertyEmitInfo info)
|
||||
{
|
||||
return $$"""
|
||||
[DscProperty()] [{{info.Type}}]
|
||||
${{info.Name}} {{info.Initializer}}
|
||||
""";
|
||||
}
|
||||
|
||||
private static string EmitPropertyApplyChangeStatements(string moduleName, PropertyEmitInfo info, string localPropertyName = null)
|
||||
{
|
||||
if (localPropertyName == null)
|
||||
{
|
||||
localPropertyName = info.Name;
|
||||
}
|
||||
|
||||
return $$"""
|
||||
if ($this.{{localPropertyName}} {{info.EqualityOperator}} {{info.DefaultValue}}) {
|
||||
$Changes.Value += "set {{moduleName}}.{{info.Name}} `"$($this.{{localPropertyName}})`""
|
||||
}
|
||||
""";
|
||||
}
|
||||
|
||||
private static string EmitModuleDefinition(SettingsStructure module)
|
||||
{
|
||||
bool generalSettings = module.Name == "GeneralSettings";
|
||||
|
||||
var properties = module.Properties
|
||||
.Where(property => !property.Value.IsIgnored)
|
||||
.Select(property => new PropertyEmitInfo(property.Key, property.Value.Type));
|
||||
|
||||
var propertyDefinitionsBlock = string.Empty;
|
||||
var applyChangesBlock = string.Empty;
|
||||
|
||||
foreach (var property in properties)
|
||||
{
|
||||
var definition = EmitPropertyDefinition(property);
|
||||
var applyChanges = EmitPropertyApplyChangeStatements(module.Name, property);
|
||||
|
||||
propertyDefinitionsBlock += definition + DoubleNewLine;
|
||||
applyChangesBlock += applyChanges + DoubleNewLine;
|
||||
}
|
||||
|
||||
bool hasAdditionalProperties = AdditionalPropertiesInfoPerModule.TryGetValue(module.Name, out var additionalPropertiesInfo);
|
||||
|
||||
// Enabled property of each module is contained in General settings
|
||||
if (!generalSettings)
|
||||
{
|
||||
propertyDefinitionsBlock += $$"""
|
||||
[DscProperty(Key)] [Nullable[bool]]
|
||||
$Enabled = $null
|
||||
|
||||
""";
|
||||
|
||||
if (hasAdditionalProperties)
|
||||
{
|
||||
propertyDefinitionsBlock += $$"""
|
||||
|
||||
[DscProperty()] [{{additionalPropertiesInfo.Type}}]
|
||||
${{additionalPropertiesInfo.Name}} = @()
|
||||
|
||||
|
||||
""";
|
||||
}
|
||||
|
||||
applyChangesBlock += EmitPropertyApplyChangeStatements("General.Enabled", new PropertyEmitInfo($"{module.Name}", typeof(bool)), "Enabled");
|
||||
}
|
||||
|
||||
var additionalPropertiesCheckBlock = string.Empty;
|
||||
if (hasAdditionalProperties)
|
||||
{
|
||||
additionalPropertiesCheckBlock = $$"""
|
||||
if ($this.{{additionalPropertiesInfo.Name}}.Count -gt 0) {
|
||||
$AdditionalPropertiesTmpPath = [System.IO.Path]::GetTempFileName()
|
||||
$this.{{additionalPropertiesInfo.Name}} | ConvertTo-Json | Set-Content -Path $AdditionalPropertiesTmpPath
|
||||
$Changes.Value += "setAdditional {{module.Name}} `"$AdditionalPropertiesTmpPath`""
|
||||
}
|
||||
""";
|
||||
}
|
||||
|
||||
return $$"""
|
||||
class {{module.Name}} {
|
||||
{{propertyDefinitionsBlock}} ApplyChanges([ref]$Changes) {
|
||||
{{applyChangesBlock}}
|
||||
|
||||
{{additionalPropertiesCheckBlock}}
|
||||
}
|
||||
}
|
||||
|
||||
""";
|
||||
}
|
||||
|
||||
public static string EmitModuleFileContents(SettingsStructure[] moduleSettings, SettingsStructure generalSettings, string debugSettingsPath)
|
||||
{
|
||||
var enumsToEmit = new HashSet<Type>();
|
||||
|
||||
var modulesBlock = string.Empty;
|
||||
var modulesResourcePropertiesBlock = string.Empty;
|
||||
var applyModulesChangesBlock = string.Empty;
|
||||
|
||||
foreach (var module in moduleSettings.Append(generalSettings))
|
||||
{
|
||||
enumsToEmit.UnionWith(module.Properties
|
||||
.Where(property => property.Value.Type.IsEnum)
|
||||
.Select(property => property.Value.Type));
|
||||
|
||||
modulesBlock += EmitModuleDefinition(module);
|
||||
|
||||
applyModulesChangesBlock += $$"""
|
||||
$this.{{module.Name}}.ApplyChanges([ref]$ChangesToApply)
|
||||
|
||||
""";
|
||||
|
||||
modulesResourcePropertiesBlock += $$"""
|
||||
[DscProperty()]
|
||||
[{{module.Name}}]${{module.Name}} = [{{module.Name}}]::new()
|
||||
|
||||
|
||||
""";
|
||||
}
|
||||
|
||||
var enumsBlock = string.Join(DoubleNewLine, enumsToEmit.Select(EmitEnumDefinition));
|
||||
var version = interop.CommonManaged.GetProductVersion().Replace("v", string.Empty);
|
||||
var outputResult = string.Empty;
|
||||
|
||||
outputResult += $$"""
|
||||
#region enums
|
||||
enum PowerToysConfigureEnsure {
|
||||
Absent
|
||||
Present
|
||||
}
|
||||
|
||||
{{enumsBlock}}
|
||||
#endregion enums
|
||||
|
||||
#region DscResources
|
||||
{{modulesBlock}}
|
||||
[DscResource()]
|
||||
class PowerToysConfigure {
|
||||
[DscProperty(Key)] [PowerToysConfigureEnsure]
|
||||
$Ensure = [PowerToysConfigureEnsure]::Present
|
||||
|
||||
[bool] $Debug = $false
|
||||
|
||||
{{modulesResourcePropertiesBlock}}
|
||||
|
||||
""";
|
||||
|
||||
#if DEBUG
|
||||
// Only output PowerToysSettings local build for debug builds. No need to expose release build locations.
|
||||
outputResult += $$"""
|
||||
[string] GetPowerToysSettingsPath() {
|
||||
if ($this.Debug -eq $true) {
|
||||
$SettingsExePath = "{{debugSettingsPath}}"
|
||||
} else {
|
||||
$installation = Get-CimInstance Win32_Product | Where-Object {$_.Name -eq "PowerToys (Preview)" -and $_.Version -eq "{{version}}"}
|
||||
|
||||
if ($installation) {
|
||||
$SettingsExePath = Join-Path (Join-Path $installation.InstallLocation WinUI3Apps) PowerToys.Settings.exe
|
||||
$SettingsExePath = "`"$SettingsExePath`""
|
||||
} else {
|
||||
throw "PowerToys installation wasn't found."
|
||||
}
|
||||
}
|
||||
|
||||
return $SettingsExePath
|
||||
}
|
||||
|
||||
""";
|
||||
#else
|
||||
outputResult += $$"""
|
||||
[string] GetPowerToysSettingsPath() {
|
||||
$installation = Get-CimInstance Win32_Product | Where-Object {$_.Name -eq "PowerToys (Preview)" -and $_.Version -eq "{{version}}"}
|
||||
|
||||
if ($installation) {
|
||||
$SettingsExePath = Join-Path (Join-Path $installation.InstallLocation WinUI3Apps) PowerToys.Settings.exe
|
||||
$SettingsExePath = "`"$SettingsExePath`""
|
||||
} else {
|
||||
throw "PowerToys installation wasn't found."
|
||||
}
|
||||
|
||||
return $SettingsExePath
|
||||
}
|
||||
|
||||
""";
|
||||
#endif
|
||||
|
||||
outputResult += $$"""
|
||||
|
||||
[PowerToysConfigure] Get() {
|
||||
$CurrentState = [PowerToysConfigure]::new()
|
||||
$SettingsExePath = $this.GetPowerToysSettingsPath()
|
||||
$SettingsTmpFilePath = [System.IO.Path]::GetTempFileName()
|
||||
|
||||
$SettingsToRequest = @{}
|
||||
foreach ($module in $CurrentState.PSObject.Properties) {
|
||||
$moduleName = $module.Name
|
||||
# Skip utility properties
|
||||
if ($moduleName -eq "Ensure" -or $moduleName -eq "Debug") {
|
||||
continue
|
||||
}
|
||||
|
||||
$moduleProperties = $module.Value
|
||||
$propertiesArray = @()
|
||||
foreach ($property in $moduleProperties.PSObject.Properties) {
|
||||
$propertyName = $property.Name
|
||||
# Skip Enabled properties - they should be requested from GeneralSettings
|
||||
if ($propertyName -eq "Enabled") {
|
||||
continue
|
||||
}
|
||||
|
||||
$propertiesArray += $propertyName
|
||||
}
|
||||
|
||||
$SettingsToRequest[$moduleName] = $propertiesArray
|
||||
}
|
||||
|
||||
$settingsJson = $SettingsToRequest | ConvertTo-Json
|
||||
$settingsJson | Set-Content -Path $SettingsTmpFilePath
|
||||
|
||||
Start-Process -FilePath $SettingsExePath -Wait -Args "get `"$SettingsTmpFilePath`""
|
||||
$SettingsValues = Get-Content -Path $SettingsTmpFilePath -Raw
|
||||
|
||||
if ($this.Debug -eq $true) {
|
||||
$TempFilePath = Join-Path -Path $env:TEMP -ChildPath "PowerToys.DSC.TestConfigure.txt"
|
||||
Set-Content -Path "$TempFilePath" -Value ("Requested:`r`n" + $settingsJson + "`r`n" + "Got:`r`n" + $SettingsValues + "`r`n" + (Get-Date -Format "o")) -Force
|
||||
}
|
||||
|
||||
$SettingsValues = $SettingsValues | ConvertFrom-Json
|
||||
foreach ($module in $SettingsValues.PSObject.Properties) {
|
||||
$moduleName = $module.Name
|
||||
$obtainedModuleSettings = $module.Value
|
||||
$moduleRef = $CurrentState.$moduleName
|
||||
foreach ($property in $obtainedModuleSettings.PSObject.Properties) {
|
||||
$propertyName = $property.Name
|
||||
$moduleRef.$propertyName = $property.Value
|
||||
}
|
||||
}
|
||||
|
||||
Remove-Item -Path $SettingsTmpFilePath
|
||||
|
||||
return $CurrentState
|
||||
}
|
||||
|
||||
[bool] Test() {
|
||||
# NB: we must always assume that the configuration isn't applied, because changing some settings produce external side-effects
|
||||
return $false
|
||||
}
|
||||
|
||||
[void] Set() {
|
||||
$SettingsExePath = $this.GetPowerToysSettingsPath()
|
||||
$ChangesToApply = @()
|
||||
|
||||
{{applyModulesChangesBlock}}
|
||||
if ($this.Debug -eq $true) {
|
||||
$tmp_info = $ChangesToApply
|
||||
# $tmp_info = $this | ConvertTo-Json -Depth 10
|
||||
|
||||
$TempFilePath = Join-Path -Path $env:TEMP -ChildPath "PowerToys.DSC.TestConfigure.txt"
|
||||
Set-Content -Path "$TempFilePath" -Value ($tmp_info + "`r`n" + (Get-Date -Format "o")) -Force
|
||||
}
|
||||
|
||||
# Stop any running PowerToys instances
|
||||
Stop-Process -Name "PowerToys.Settings" -Force -PassThru | Wait-Process
|
||||
$PowerToysProcessStopped = Stop-Process -Name "PowerToys" -Force -PassThru
|
||||
$PowerToysProcessStopped | Wait-Process
|
||||
|
||||
foreach ($change in $ChangesToApply) {
|
||||
Start-Process -FilePath $SettingsExePath -Wait -Args "$change"
|
||||
}
|
||||
|
||||
# If the PowerToys process was stopped, restart it.
|
||||
if ($PowerToysProcessStopped -ne $null) {
|
||||
Start-Process -FilePath $SettingsExePath
|
||||
}
|
||||
}
|
||||
}
|
||||
#endregion DscResources
|
||||
""";
|
||||
|
||||
return outputResult;
|
||||
}
|
||||
|
||||
public static string EmitManifestFileContents()
|
||||
{
|
||||
var version = interop.CommonManaged.GetProductVersion().Replace("v", string.Empty);
|
||||
var generatedDate = DateTime.Now.ToString("dd.MM.yyyy", CultureInfo.InvariantCulture);
|
||||
|
||||
return $$"""
|
||||
#
|
||||
# Module manifest for module 'Microsoft.PowerToys.Configure'
|
||||
#
|
||||
# Generated by: Microsoft Corporation
|
||||
#
|
||||
# Generated on: {{generatedDate}}
|
||||
#
|
||||
|
||||
@{
|
||||
|
||||
# Script module or binary module file associated with this manifest.
|
||||
RootModule = 'Microsoft.PowerToys.Configure.psm1'
|
||||
|
||||
# Version number of this module.
|
||||
ModuleVersion = '{{version}}'
|
||||
|
||||
# ID used to uniquely identify this module
|
||||
GUID = '778ed7a1-489d-4dc9-b0f2-2da3b1fe14cb'
|
||||
|
||||
# Author of this module
|
||||
Author = 'Microsoft Corporation'
|
||||
|
||||
# Company or vendor of this module
|
||||
CompanyName = 'Microsoft'
|
||||
|
||||
# Copyright statement for this module
|
||||
Copyright = '(c) Microsoft Corporation. All rights reserved.'
|
||||
|
||||
# Description of the functionality provided by this module
|
||||
Description = 'The module enables settings configuration for an installed PowerToys application.'
|
||||
|
||||
# Functions to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no functions to export.
|
||||
FunctionsToExport = '*'
|
||||
|
||||
# Cmdlets to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no cmdlets to export.
|
||||
CmdletsToExport = @()
|
||||
|
||||
# Variables to export from this module
|
||||
VariablesToExport = @()
|
||||
|
||||
# Aliases to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no aliases to export.
|
||||
AliasesToExport = @()
|
||||
|
||||
# DSC resources to export from this module
|
||||
DscResourcesToExport = @(
|
||||
'PowerToysConfigure'
|
||||
)
|
||||
|
||||
# Private data to pass to the module specified in RootModule/ModuleToProcess. This may also contain a PSData hashtable with additional module metadata used by PowerShell.
|
||||
PrivateData = @{
|
||||
|
||||
PSData = @{
|
||||
|
||||
# Tags applied to this module. These help with module discovery in online galleries.
|
||||
# Tags = @()
|
||||
|
||||
# A URL to the license for this module.
|
||||
# LicenseUri = ''
|
||||
|
||||
# A URL to the main website for this project.
|
||||
# ProjectUri = ''
|
||||
|
||||
# A URL to an icon representing this module.
|
||||
# IconUri = ''
|
||||
|
||||
# ReleaseNotes of this module
|
||||
# ReleaseNotes = ''
|
||||
|
||||
# Prerelease string of this module
|
||||
# Prerelease = ''
|
||||
|
||||
# Flag to indicate whether the module requires explicit user acceptance for install/update/save
|
||||
# RequireLicenseAcceptance = $false
|
||||
|
||||
# External dependent modules of this module
|
||||
# ExternalModuleDependencies = @()
|
||||
|
||||
} # End of PSData hashtable
|
||||
|
||||
} # End of PrivateData hashtable
|
||||
|
||||
}
|
||||
|
||||
|
||||
""";
|
||||
}
|
||||
}
|
||||
@@ -1,79 +0,0 @@
|
||||
// Copyright (c) Microsoft Corporation
|
||||
// The Microsoft Corporation licenses this file to you under the MIT license.
|
||||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
using System;
|
||||
using System.Linq;
|
||||
using static PowerToys.Settings.DSC.Schema.Introspection;
|
||||
|
||||
namespace PowerToys.Settings.DSC.Schema;
|
||||
|
||||
internal sealed class DocumentationGeneration
|
||||
{
|
||||
private static readonly string IsAvailableSymbol = "✅";
|
||||
private static readonly string IsUnavailableSymbol = "❌";
|
||||
private static readonly string MissingValueIndicator = "—";
|
||||
|
||||
private static readonly string PropertySuffix = "Property";
|
||||
|
||||
private static string SimplifyPropertyType(string typeName)
|
||||
{
|
||||
if (typeName.EndsWith(PropertySuffix, StringComparison.InvariantCulture))
|
||||
{
|
||||
typeName = typeName.Remove(typeName.LastIndexOf(PropertySuffix, StringComparison.InvariantCulture), PropertySuffix.Length);
|
||||
}
|
||||
|
||||
return typeName;
|
||||
}
|
||||
|
||||
private static string EmitPropertyTableLine(string name, ModulePropertyStructure info)
|
||||
{
|
||||
bool isAvailable = !info.IsIgnored;
|
||||
var availabilitySymbol = isAvailable ? IsAvailableSymbol : IsUnavailableSymbol;
|
||||
var documentation = MissingValueIndicator;
|
||||
if (info.Type.IsEnum)
|
||||
{
|
||||
documentation = "Possible values: ";
|
||||
foreach (var enumValue in Enum.GetValues(info.Type))
|
||||
{
|
||||
documentation += enumValue.ToString() + ' ';
|
||||
}
|
||||
}
|
||||
|
||||
var propertyType = isAvailable ? SimplifyPropertyType(info.Type.Name) : MissingValueIndicator;
|
||||
return $"| {name} | {propertyType} | {documentation} | {availabilitySymbol} |";
|
||||
}
|
||||
|
||||
private static string EmitModulePropertiesTable(SettingsStructure module)
|
||||
{
|
||||
bool generalSettings = module.Name == "GeneralSettings";
|
||||
|
||||
var properties = module.Properties
|
||||
.Where(p => !p.Value.IsIgnoredByJsonSerializer)
|
||||
.Select(property => EmitPropertyTableLine(property.Key, property.Value)).Aggregate((acc, line) => string.Join(Environment.NewLine, [acc, line]));
|
||||
|
||||
var propertyDefinitionsBlock = string.Empty;
|
||||
var applyChangesBlock = string.Empty;
|
||||
return $$"""
|
||||
### {{module.Name}}
|
||||
|
||||
| Name | Type | Description | Available |
|
||||
| :--- | :--- | :--- | :--- |
|
||||
{{properties}}
|
||||
|
||||
|
||||
""";
|
||||
}
|
||||
|
||||
public static string EmitDocumentationFileContents(SettingsStructure[] moduleSettings, SettingsStructure generalSettings)
|
||||
{
|
||||
var moduleTables = string.Empty;
|
||||
|
||||
foreach (var module in moduleSettings.Append(generalSettings))
|
||||
{
|
||||
moduleTables += EmitModulePropertiesTable(module);
|
||||
}
|
||||
|
||||
return moduleTables;
|
||||
}
|
||||
}
|
||||
@@ -1,93 +0,0 @@
|
||||
// Copyright (c) Microsoft Corporation
|
||||
// The Microsoft Corporation licenses this file to you under the MIT license.
|
||||
// See the LICENSE file in the project root for more information.
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using System.Text.Json.Serialization;
|
||||
using Settings.UI.Library.Attributes;
|
||||
|
||||
namespace PowerToys.Settings.DSC.Schema;
|
||||
|
||||
public class Introspection
|
||||
{
|
||||
public struct ModulePropertyStructure
|
||||
{
|
||||
public bool IsIgnoredByJsonSerializer;
|
||||
public bool IsIgnoredByCmdConfigureAttribute;
|
||||
|
||||
public bool IsIgnored
|
||||
{
|
||||
get { return IsIgnoredByJsonSerializer || IsIgnoredByCmdConfigureAttribute; }
|
||||
}
|
||||
|
||||
public Type Type;
|
||||
}
|
||||
|
||||
public struct SettingsStructure
|
||||
{
|
||||
public string Name;
|
||||
public Dictionary<string, ModulePropertyStructure> Properties;
|
||||
}
|
||||
|
||||
private static bool IsModuleNameField(FieldInfo info)
|
||||
{
|
||||
return info != null && info.IsLiteral && !info.IsInitOnly
|
||||
&& info.FieldType == typeof(string);
|
||||
}
|
||||
|
||||
private static bool IsSettingsClassType(Type type)
|
||||
{
|
||||
return type.IsClass && type.FullName.EndsWith("Settings", StringComparison.InvariantCulture);
|
||||
}
|
||||
|
||||
private static Dictionary<string, ModulePropertyStructure> ParseProperties(Type propertiesType)
|
||||
{
|
||||
return propertiesType.GetProperties().Select(property =>
|
||||
{
|
||||
var jsonIgnoreAttr = property.GetCustomAttribute<JsonIgnoreAttribute>();
|
||||
var cmdIgnoreAttr = property.GetCustomAttribute<CmdConfigureIgnoreAttribute>();
|
||||
|
||||
return (property.Name, new ModulePropertyStructure
|
||||
{
|
||||
Type = property.PropertyType,
|
||||
IsIgnoredByJsonSerializer = jsonIgnoreAttr != null,
|
||||
IsIgnoredByCmdConfigureAttribute = cmdIgnoreAttr != null,
|
||||
});
|
||||
}).ToDictionary();
|
||||
}
|
||||
|
||||
public static SettingsStructure ParseGeneralSettings(Assembly assembly)
|
||||
{
|
||||
return assembly
|
||||
.GetTypes()
|
||||
.Where(IsSettingsClassType)
|
||||
.Where(type => type.Name == "GeneralSettings")
|
||||
.Select(type => new SettingsStructure
|
||||
{
|
||||
Name = type.Name,
|
||||
Properties = ParseProperties(type),
|
||||
}).FirstOrDefault();
|
||||
}
|
||||
|
||||
public static SettingsStructure[] ParseModuleSettings(Assembly assembly)
|
||||
{
|
||||
return assembly
|
||||
.GetTypes()
|
||||
.Where(IsSettingsClassType)
|
||||
.Select(type => new
|
||||
{
|
||||
Properties = type.GetProperty("Properties"),
|
||||
ModuleNameInfo = type.GetField("ModuleName", BindingFlags.Public | BindingFlags.Static | BindingFlags.FlattenHierarchy),
|
||||
TypeName = type.Name,
|
||||
})
|
||||
.Where(x => x.Properties?.PropertyType.IsClass == true && IsModuleNameField(x.ModuleNameInfo))
|
||||
.Select(x => new SettingsStructure
|
||||
{
|
||||
Name = x.TypeName.Replace("Settings", string.Empty),
|
||||
Properties = ParseProperties(x.Properties.PropertyType),
|
||||
})
|
||||
.ToArray();
|
||||
}
|
||||
}
|
||||
@@ -1,66 +0,0 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<Import Project="..\..\Version.props" />
|
||||
<PropertyGroup>
|
||||
<OutputType>Exe</OutputType>
|
||||
<TargetFramework>net8.0-windows</TargetFramework>
|
||||
<RootNamespace>PowerToys.Settings.DSC.Schema</RootNamespace>
|
||||
<ApplicationManifest>app.manifest</ApplicationManifest>
|
||||
<RuntimeIdentifiers>win-x64;win-arm64</RuntimeIdentifiers>
|
||||
<WindowsPackageType>None</WindowsPackageType>
|
||||
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
|
||||
<AppendRuntimeIdentifierToOutputPath>false</AppendRuntimeIdentifierToOutputPath>
|
||||
<SelfContained>true</SelfContained>
|
||||
</PropertyGroup>
|
||||
|
||||
<!-- SelfContained=true requires RuntimeIdentifier to be set -->
|
||||
<PropertyGroup Condition="'$(Platform)'=='x64'">
|
||||
<RuntimeIdentifier>win-x64</RuntimeIdentifier>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Platform)'=='ARM64'">
|
||||
<RuntimeIdentifier>win-arm64</RuntimeIdentifier>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(Configuration)'=='Debug'">
|
||||
<NoWarn></NoWarn>
|
||||
<TreatWarningsAsErrors>True</TreatWarningsAsErrors>
|
||||
<WarningsNotAsErrors>CA1720</WarningsNotAsErrors>
|
||||
<Optimize>False</Optimize>
|
||||
<DebugType>full</DebugType>
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(Configuration)'=='Release'">
|
||||
<NoWarn></NoWarn>
|
||||
<TreatWarningsAsErrors>True</TreatWarningsAsErrors>
|
||||
<WarningsNotAsErrors>CA1720</WarningsNotAsErrors>
|
||||
<Optimize>true</Optimize>
|
||||
</PropertyGroup>
|
||||
|
||||
<!-- See https://learn.microsoft.com/windows/apps/develop/platform/csharp-winrt/net-projection-from-cppwinrt-component for more info -->
|
||||
<PropertyGroup>
|
||||
<CsWinRTGeneratedFilesDir>$(OutDir)</CsWinRTGeneratedFilesDir>
|
||||
<ErrorOnDuplicatePublishOutputFiles>false</ErrorOnDuplicatePublishOutputFiles>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\common\ManagedCommon\ManagedCommon.csproj" />
|
||||
<ProjectReference Include="..\..\settings-ui\Settings.UI.Library\Settings.UI.Library.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
<GeneratedDSCModule>"$(ProjectDir)..\Microsoft.PowerToys.Configure\Generated\Microsoft.PowerToys.Configure\$(Version)\Microsoft.PowerToys.Configure.psm1"</GeneratedDSCModule>
|
||||
<GeneratedDSCManifest>"$(ProjectDir)..\Microsoft.PowerToys.Configure\Generated\Microsoft.PowerToys.Configure\$(Version)\Microsoft.PowerToys.Configure.psd1"</GeneratedDSCManifest>
|
||||
</PropertyGroup>
|
||||
|
||||
<!-- The following sections assume that the machine we're building on is always x64. That means we won't be able to run/inspect arm64 executables, therefore we must always execute x64 generator. -->
|
||||
|
||||
<Target Name="PostBuildAction" AfterTargets="Build" Outputs="$(GeneratedDSCModule)" Condition="'$(Platform)'!='ARM64'">
|
||||
<Exec Command=""$(OutDir)$(AssemblyName).exe" "$(SolutionDir)x64\$(Configuration)\WinUI3Apps\PowerToys.Settings.UI.Lib.dll" $(GeneratedDSCModule) $(GeneratedDSCManifest)" />
|
||||
</Target>
|
||||
|
||||
<Target Name="PreBuild" BeforeTargets="PreBuildEvent" Condition="'$(Platform)'=='ARM64'">
|
||||
<Exec Command=""$(MSBuildToolsPath)\msbuild.exe" PowerToys.sln -p:Configuration="$(Configuration)" -p:Platform="x64" -verbosity:m -t:DSC\PowerToys_Settings_DSC_Schema_Generator" WorkingDirectory="$(SolutionDir)" />
|
||||
</Target>
|
||||
|
||||
</Project>
|
||||
@@ -1,102 +0,0 @@
|
||||
// Copyright (c) Microsoft Corporation
|
||||
// The Microsoft Corporation licenses this file to you under the MIT license.
|
||||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Reflection;
|
||||
|
||||
namespace PowerToys.Settings.DSC.Schema;
|
||||
|
||||
internal sealed class Program
|
||||
{
|
||||
public static int Main(string[] args)
|
||||
{
|
||||
if (args.Length < 2)
|
||||
{
|
||||
Console.WriteLine("Usage: Generator.exe <PowerToys.Settings.UI.Lib.dll path> <module output path> <manifest output path>");
|
||||
return 1;
|
||||
}
|
||||
|
||||
var dllPath = args[0];
|
||||
var moduleOutputPath = args[1];
|
||||
var manifestOutputPath = string.Empty;
|
||||
|
||||
bool documentationMode = Path.GetExtension(moduleOutputPath) == ".md";
|
||||
bool sampleMode = Path.GetExtension(moduleOutputPath) == ".yaml";
|
||||
|
||||
if (!documentationMode && !sampleMode)
|
||||
{
|
||||
if (args.Length < 3)
|
||||
{
|
||||
Console.WriteLine("Usage: Generator.exe <PowerToys.Settings.UI.Lib.dll path> <module output path> <manifest output path>");
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
manifestOutputPath = args[2];
|
||||
}
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
Directory.CreateDirectory(Path.GetDirectoryName(moduleOutputPath));
|
||||
|
||||
var assembly = Assembly.LoadFrom(dllPath);
|
||||
var moduleSettings = Introspection.ParseModuleSettings(assembly);
|
||||
var generalSettings = Introspection.ParseGeneralSettings(assembly);
|
||||
#if DEBUG
|
||||
PrintUniquePropertyTypes(moduleSettings);
|
||||
#endif
|
||||
var outputFileContents = string.Empty;
|
||||
if (documentationMode)
|
||||
{
|
||||
outputFileContents = DocumentationGeneration.EmitDocumentationFileContents(moduleSettings, generalSettings);
|
||||
}
|
||||
else if (sampleMode)
|
||||
{
|
||||
outputFileContents = SampleGeneration.EmitSampleFileContents(moduleSettings, generalSettings);
|
||||
}
|
||||
else
|
||||
{
|
||||
var manifestFileContents = DSCGeneration.EmitManifestFileContents();
|
||||
File.WriteAllText(manifestOutputPath, manifestFileContents);
|
||||
var debugSettingsPath = Path.Combine(Directory.GetParent(dllPath).FullName, "PowerToys.Settings.exe");
|
||||
outputFileContents = DSCGeneration.EmitModuleFileContents(moduleSettings, generalSettings, debugSettingsPath);
|
||||
}
|
||||
|
||||
File.WriteAllText(moduleOutputPath, outputFileContents);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Console.WriteLine($"Error: {ex.Message}");
|
||||
return 1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
private static void PrintUniquePropertyTypes(Introspection.SettingsStructure[] moduleSettings)
|
||||
{
|
||||
Console.WriteLine("Detected the following module properties types:");
|
||||
var propertyTypes = new HashSet<Type>();
|
||||
foreach (var settings in moduleSettings)
|
||||
{
|
||||
Console.WriteLine($"{settings.Name}");
|
||||
foreach (var (_, property) in settings.Properties)
|
||||
{
|
||||
if (!property.IsIgnored)
|
||||
{
|
||||
propertyTypes.Add(property.Type);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Console.WriteLine("\nDetected the following unique property types:");
|
||||
foreach (var type in propertyTypes)
|
||||
{
|
||||
Console.WriteLine($"{type}");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,80 +0,0 @@
|
||||
// Copyright (c) Microsoft Corporation
|
||||
// The Microsoft Corporation licenses this file to you under the MIT license.
|
||||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
using System;
|
||||
using System.Globalization;
|
||||
using System.Linq;
|
||||
using static PowerToys.Settings.DSC.Schema.Introspection;
|
||||
|
||||
namespace PowerToys.Settings.DSC.Schema;
|
||||
|
||||
internal sealed class SampleGeneration
|
||||
{
|
||||
private const int FixedSeed = 12345;
|
||||
private static readonly Random _random = new Random(FixedSeed);
|
||||
|
||||
private static string EmitPropertySetter(string name, ModulePropertyStructure info)
|
||||
{
|
||||
var randomPropertyValue = "\"<string>\"";
|
||||
if (Common.InferIsBool(info.Type))
|
||||
{
|
||||
randomPropertyValue = _random.Next(2) == 1 ? "true" : "false";
|
||||
}
|
||||
else if (Common.InferIsInt(info.Type))
|
||||
{
|
||||
randomPropertyValue = _random.Next(256).ToString(CultureInfo.InvariantCulture);
|
||||
}
|
||||
else if (info.Type.IsEnum)
|
||||
{
|
||||
var enumValues = Enum.GetValues(info.Type);
|
||||
randomPropertyValue = enumValues.GetValue(_random.Next(enumValues.Length)).ToString();
|
||||
}
|
||||
|
||||
return $" {name}: {randomPropertyValue}";
|
||||
}
|
||||
|
||||
private static string EmitModulePropertiesSection(SettingsStructure module)
|
||||
{
|
||||
bool generalSettings = module.Name == "GeneralSettings";
|
||||
|
||||
var propertiesCollection = module.Properties
|
||||
.Where(p => !p.Value.IsIgnored)
|
||||
.Select(property => EmitPropertySetter(property.Key, property.Value))
|
||||
.ToList();
|
||||
|
||||
string properties = propertiesCollection.Count != 0
|
||||
? propertiesCollection.Aggregate((acc, line) => string.Join(Environment.NewLine, acc, line))
|
||||
: string.Empty;
|
||||
|
||||
var propertyDefinitionsBlock = string.Empty;
|
||||
var applyChangesBlock = string.Empty;
|
||||
return $$"""
|
||||
{{module.Name}}:
|
||||
{{properties}}
|
||||
|
||||
|
||||
""";
|
||||
}
|
||||
|
||||
public static string EmitSampleFileContents(SettingsStructure[] moduleSettings, SettingsStructure generalSettings)
|
||||
{
|
||||
var moduleTables = $$"""
|
||||
properties:
|
||||
resources:
|
||||
- resource: PowerToysConfigure
|
||||
directives:
|
||||
description: Configure PowerToys
|
||||
settings:
|
||||
|
||||
""";
|
||||
|
||||
foreach (var module in moduleSettings.Append(generalSettings))
|
||||
{
|
||||
moduleTables += EmitModulePropertiesSection(module);
|
||||
}
|
||||
|
||||
moduleTables += " configurationVersion: 0.2.0";
|
||||
return moduleTables;
|
||||
}
|
||||
}
|
||||
@@ -1,21 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1">
|
||||
<assemblyIdentity version="1.0.0.0" name="PowerToys.Settings.app"/>
|
||||
|
||||
<application xmlns="urn:schemas-microsoft-com:asm.v3">
|
||||
<windowsSettings>
|
||||
<!-- The combination of below two tags have the following effect:
|
||||
1) Per-Monitor for >= Windows 10 Anniversary Update
|
||||
2) System < Windows 10 Anniversary Update
|
||||
-->
|
||||
<dpiAware xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">true/PM</dpiAware>
|
||||
<dpiAwareness xmlns="http://schemas.microsoft.com/SMI/2016/WindowsSettings">PerMonitorV2, PerMonitor</dpiAwareness>
|
||||
</windowsSettings>
|
||||
</application>
|
||||
<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
|
||||
<application>
|
||||
<!-- Windows 10 -->
|
||||
<supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}" />
|
||||
</application>
|
||||
</compatibility>
|
||||
</assembly>
|
||||
@@ -115,7 +115,7 @@
|
||||
<ClCompile Include="ThumbnailCropAndLockWindow.cpp" />
|
||||
<ClCompile Include="OverlayWindow.cpp" />
|
||||
<ClCompile Include="pch.cpp">
|
||||
<PrecompiledHeader Condition="'$(UsePrecompiledHeaders)' != 'false'">Create</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(CIBuild)'!='true'">Create</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
<ClCompile Include="trace.cpp" />
|
||||
</ItemGroup>
|
||||
|
||||
@@ -84,7 +84,7 @@
|
||||
<ClCompile Include="..\CropAndLock\trace.cpp" />
|
||||
<ClCompile Include="dllmain.cpp" />
|
||||
<ClCompile Include="pch.cpp">
|
||||
<PrecompiledHeader Condition="'$(UsePrecompiledHeaders)' != 'false'">Create</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(CIBuild)'!='true'">Create</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
|
||||
@@ -44,6 +44,7 @@
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
@@ -59,6 +60,7 @@
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
@@ -83,7 +85,7 @@
|
||||
<ClCompile Include="trace.cpp" />
|
||||
<ClCompile Include="dllmain.cpp" />
|
||||
<ClCompile Include="pch.cpp">
|
||||
<PrecompiledHeader Condition="'$(UsePrecompiledHeaders)' != 'false'">Create</PrecompiledHeader>
|
||||
<PrecompiledHeader>Create</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
|
||||
@@ -44,6 +44,7 @@
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;FILELOCKSMITHCONTEXTMENU_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<AdditionalIncludeDirectories>..;../../..;</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
@@ -66,6 +67,7 @@ MakeAppx.exe pack /d . /p $(OutDir)FileLocksmithContextMenuPackage.msix /nv</Com
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;FILELOCKSMITHCONTEXTMENU_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<AdditionalIncludeDirectories>..;../../..;</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
@@ -90,7 +92,7 @@ MakeAppx.exe pack /d . /p $(OutDir)FileLocksmithContextMenuPackage.msix /nv</Com
|
||||
<ItemGroup>
|
||||
<ClCompile Include="dllmain.cpp" />
|
||||
<ClCompile Include="pch.cpp">
|
||||
<PrecompiledHeader Condition="'$(UsePrecompiledHeaders)' != 'false'">Create</PrecompiledHeader>
|
||||
<PrecompiledHeader>Create</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
|
||||
@@ -41,6 +41,7 @@
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;FILELOCKSMITHEXT_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<AdditionalIncludeDirectories>..;../../;../../../;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
@@ -58,6 +59,7 @@
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;FILELOCKSMITHEXT_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<AdditionalIncludeDirectories>..;../../;../../../;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
@@ -89,7 +91,7 @@
|
||||
<ClCompile Include="dllmain.cpp" />
|
||||
<ClCompile Include="ExplorerCommand.cpp" />
|
||||
<ClCompile Include="pch.cpp">
|
||||
<PrecompiledHeader Condition="'$(UsePrecompiledHeaders)' != 'false'">Create</PrecompiledHeader>
|
||||
<PrecompiledHeader>Create</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
<ClCompile Include="PowerToysModule.cpp" />
|
||||
</ItemGroup>
|
||||
|
||||
@@ -90,12 +90,14 @@ public:
|
||||
}
|
||||
|
||||
m_enabled = true;
|
||||
save_settings();
|
||||
}
|
||||
|
||||
virtual void disable() override
|
||||
{
|
||||
Logger::info(L"File Locksmith disabled");
|
||||
m_enabled = false;
|
||||
save_settings();
|
||||
}
|
||||
|
||||
virtual bool is_enabled() override
|
||||
@@ -121,7 +123,7 @@ public:
|
||||
}
|
||||
|
||||
private:
|
||||
bool m_enabled = false;
|
||||
bool m_enabled;
|
||||
bool m_extended_only;
|
||||
|
||||
void init_settings()
|
||||
@@ -134,7 +136,7 @@ private:
|
||||
void save_settings()
|
||||
{
|
||||
auto& settings = FileLocksmithSettingsInstance();
|
||||
m_enabled = FileLocksmithSettingsInstance().GetEnabled();
|
||||
settings.SetEnabled(m_enabled);
|
||||
settings.SetExtendedContextMenuOnly(m_extended_only);
|
||||
|
||||
settings.Save();
|
||||
|
||||
@@ -35,6 +35,7 @@
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<AdditionalIncludeDirectories>../../..;../..;</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
@@ -51,6 +52,7 @@
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<AdditionalIncludeDirectories>../../..;../..;</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
@@ -75,7 +77,7 @@
|
||||
<ClCompile Include="Trace.cpp" />
|
||||
<ClCompile Include="FileLocksmithLib.cpp" />
|
||||
<ClCompile Include="pch.cpp">
|
||||
<PrecompiledHeader Condition="'$(UsePrecompiledHeaders)' != 'false'">Create</PrecompiledHeader>
|
||||
<PrecompiledHeader>Create</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
|
||||
@@ -18,12 +18,10 @@ static bool LastModifiedTime(const std::wstring& filePath, FILETIME* lpFileTime)
|
||||
|
||||
FileLocksmithSettings::FileLocksmithSettings()
|
||||
{
|
||||
generalJsonFilePath = PTSettingsHelper::get_powertoys_general_save_file_location();
|
||||
std::wstring savePath = PTSettingsHelper::get_module_save_folder_location(constants::nonlocalizable::PowerToyKey);
|
||||
std::error_code ec;
|
||||
|
||||
jsonFilePath = savePath + constants::nonlocalizable::DataFilePath;
|
||||
RefreshEnabledState();
|
||||
Load();
|
||||
}
|
||||
|
||||
@@ -31,6 +29,7 @@ void FileLocksmithSettings::Save()
|
||||
{
|
||||
json::JsonObject jsonData;
|
||||
|
||||
jsonData.SetNamedValue(constants::nonlocalizable::JsonKeyEnabled, json::value(settings.enabled));
|
||||
jsonData.SetNamedValue(constants::nonlocalizable::JsonKeyShowInExtendedContextMenu, json::value(settings.showInExtendedContextMenu));
|
||||
|
||||
json::to_file(jsonFilePath, jsonData);
|
||||
@@ -49,32 +48,6 @@ void FileLocksmithSettings::Load()
|
||||
}
|
||||
}
|
||||
|
||||
void FileLocksmithSettings::RefreshEnabledState()
|
||||
{
|
||||
// Load json settings from data file if it is modified in the meantime.
|
||||
FILETIME lastModifiedTime{};
|
||||
if (!(LastModifiedTime(generalJsonFilePath, &lastModifiedTime) &&
|
||||
CompareFileTime(&lastModifiedTime, &lastLoadedGeneralSettingsTime) == 1))
|
||||
return;
|
||||
|
||||
lastLoadedGeneralSettingsTime = lastModifiedTime;
|
||||
|
||||
auto json = json::from_file(generalJsonFilePath);
|
||||
if (!json)
|
||||
return;
|
||||
|
||||
const json::JsonObject& jsonSettings = json.value();
|
||||
try
|
||||
{
|
||||
json::JsonObject modulesEnabledState;
|
||||
json::get(jsonSettings, L"enabled", modulesEnabledState, json::JsonObject{});
|
||||
json::get(modulesEnabledState, L"File Locksmith", settings.enabled, true);
|
||||
}
|
||||
catch (const winrt::hresult_error&)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
void FileLocksmithSettings::Reload()
|
||||
{
|
||||
// Load json settings from data file if it is modified in the meantime.
|
||||
@@ -94,6 +67,11 @@ void FileLocksmithSettings::ParseJson()
|
||||
const json::JsonObject& jsonSettings = json.value();
|
||||
try
|
||||
{
|
||||
if (json::has(jsonSettings, constants::nonlocalizable::JsonKeyEnabled, json::JsonValueType::Boolean))
|
||||
{
|
||||
settings.enabled = jsonSettings.GetNamedBoolean(constants::nonlocalizable::JsonKeyEnabled);
|
||||
}
|
||||
|
||||
if (json::has(jsonSettings, constants::nonlocalizable::JsonKeyShowInExtendedContextMenu, json::JsonValueType::Boolean))
|
||||
{
|
||||
settings.showInExtendedContextMenu = jsonSettings.GetNamedBoolean(constants::nonlocalizable::JsonKeyShowInExtendedContextMenu);
|
||||
|
||||
@@ -16,10 +16,15 @@ public:
|
||||
if (gpoSetting == powertoys_gpo::gpo_rule_configured_disabled)
|
||||
return false;
|
||||
Reload();
|
||||
RefreshEnabledState();
|
||||
return settings.enabled;
|
||||
}
|
||||
|
||||
inline void SetEnabled(bool enabled)
|
||||
{
|
||||
settings.enabled = enabled;
|
||||
Save();
|
||||
}
|
||||
|
||||
inline bool GetShowInExtendedContextMenu() const
|
||||
{
|
||||
return settings.showInExtendedContextMenu;
|
||||
@@ -40,15 +45,12 @@ private:
|
||||
bool showInExtendedContextMenu{ false };
|
||||
};
|
||||
|
||||
void RefreshEnabledState();
|
||||
void Reload();
|
||||
void ParseJson();
|
||||
|
||||
Settings settings;
|
||||
std::wstring generalJsonFilePath;
|
||||
std::wstring jsonFilePath;
|
||||
FILETIME lastLoadedTime{};
|
||||
FILETIME lastLoadedGeneralSettingsTime{};
|
||||
FILETIME lastLoadedTime;
|
||||
};
|
||||
|
||||
FileLocksmithSettings& FileLocksmithSettingsInstance();
|
||||
|
||||
@@ -114,6 +114,7 @@
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>_DEBUG;FILELOCKSMITHLIBINTEROP_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<CompileAsManaged>NetCore</CompileAsManaged>
|
||||
<LanguageStandard>stdcpp17</LanguageStandard>
|
||||
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
|
||||
@@ -131,6 +132,7 @@
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>_DEBUG;FILELOCKSMITHLIBINTEROP_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<CompileAsManaged>NetCore</CompileAsManaged>
|
||||
<LanguageStandard>stdcpp17</LanguageStandard>
|
||||
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
|
||||
@@ -150,6 +152,7 @@
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>NDEBUG;FILELOCKSMITHLIBINTEROP_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<CompileAsManaged>NetCore</CompileAsManaged>
|
||||
<LanguageStandard>stdcpp17</LanguageStandard>
|
||||
<AdditionalOptions>/Zc:twoPhase-</AdditionalOptions>
|
||||
@@ -171,6 +174,7 @@
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>NDEBUG;FILELOCKSMITHLIBINTEROP_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<CompileAsManaged>NetCore</CompileAsManaged>
|
||||
<LanguageStandard>stdcpp17</LanguageStandard>
|
||||
<AdditionalOptions>/Zc:twoPhase-</AdditionalOptions>
|
||||
@@ -186,11 +190,23 @@
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="FileLocksmith.cpp" />
|
||||
<ClCompile Include="Interop.cpp" />
|
||||
<ClCompile Include="Interop.cpp">
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Create</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">Create</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Create</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Create</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Create</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">Create</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
<ClCompile Include="NtdllBase.cpp" />
|
||||
<ClCompile Include="NtdllExtensions.cpp" />
|
||||
<ClCompile Include="pch.cpp">
|
||||
<PrecompiledHeader Condition="'$(UsePrecompiledHeaders)' != 'false'">Create</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Create</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Create</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">Create</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">Create</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Create</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Create</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
|
||||
@@ -195,10 +195,9 @@
|
||||
</Grid>
|
||||
|
||||
<ContentDialog x:Name="SelectedFilesListDialog" x:Uid="SelectedFilesListDialog">
|
||||
<TextBlock
|
||||
IsTextSelectionEnabled="True"
|
||||
Text="{x:Bind ViewModel.PathsToString, Mode=OneWay}"
|
||||
TextWrapping="Wrap" />
|
||||
<ScrollViewer Padding="0,0,16,0">
|
||||
<TextBlock IsTextSelectionEnabled="True" Text="{x:Bind ViewModel.PathsToString, Mode=OneWay}" />
|
||||
</ScrollViewer>
|
||||
</ContentDialog>
|
||||
</Grid>
|
||||
</Page>
|
||||
|
||||
@@ -49,6 +49,12 @@
|
||||
<AdditionalIncludeDirectories>$(SolutionDir)src\;$(SolutionDir)src\modules;$(SolutionDir)src\common\Telemetry;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(CIBuild)'!='true'">
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
|
||||
</ClCompile>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<None Include="packages.config" />
|
||||
<None Include="resource.base.h" />
|
||||
@@ -59,7 +65,7 @@
|
||||
<ItemGroup>
|
||||
<ClCompile Include="trace.cpp" />
|
||||
<ClCompile Include="pch.cpp">
|
||||
<PrecompiledHeader Condition="'$(UsePrecompiledHeaders)' != 'false'">Create</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(CIBuild)'!='true'">Create</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
<ClCompile Include="dllmain.cpp" />
|
||||
</ItemGroup>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="15.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="..\..\..\..\packages\Microsoft.WindowsAppSDK.1.5.240311000\build\native\Microsoft.WindowsAppSDK.props" Condition="Exists('..\..\..\..\packages\Microsoft.WindowsAppSDK.1.5.240311000\build\native\Microsoft.WindowsAppSDK.props')" />
|
||||
<Import Project="..\..\..\..\packages\Microsoft.Windows.SDK.BuildTools.10.0.22621.2428\build\Microsoft.Windows.SDK.BuildTools.props" Condition="Exists('..\..\..\..\packages\Microsoft.Windows.SDK.BuildTools.10.0.22621.2428\build\Microsoft.Windows.SDK.BuildTools.props')" />
|
||||
<Import Project="..\..\..\..\packages\Microsoft.WindowsAppSDK.1.4.231219000\build\native\Microsoft.WindowsAppSDK.props" Condition="Exists('..\..\..\..\packages\Microsoft.WindowsAppSDK.1.4.231219000\build\native\Microsoft.WindowsAppSDK.props')" />
|
||||
<Import Project="..\..\..\..\packages\Microsoft.Windows.CppWinRT.2.0.240111.5\build\native\Microsoft.Windows.CppWinRT.props" Condition="Exists('..\..\..\..\packages\Microsoft.Windows.CppWinRT.2.0.240111.5\build\native\Microsoft.Windows.CppWinRT.props')" />
|
||||
<PropertyGroup Label="Globals">
|
||||
<CppWinRTOptimized>true</CppWinRTOptimized>
|
||||
@@ -59,6 +59,12 @@
|
||||
<AdditionalDependencies>Dbghelp.lib;Shell32.lib;Shcore.lib;dcomp.lib;DXGI.lib;Dwmapi.lib;Gdi32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup>
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
|
||||
</ClCompile>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<Manifest Include="app.manifest" />
|
||||
</ItemGroup>
|
||||
@@ -139,9 +145,9 @@
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
<Import Project="..\..\..\..\packages\Microsoft.Windows.CppWinRT.2.0.240111.5\build\native\Microsoft.Windows.CppWinRT.targets" Condition="Exists('..\..\..\..\packages\Microsoft.Windows.CppWinRT.2.0.240111.5\build\native\Microsoft.Windows.CppWinRT.targets')" />
|
||||
<Import Project="..\..\..\..\packages\Microsoft.WindowsAppSDK.1.4.231219000\build\native\Microsoft.WindowsAppSDK.targets" Condition="Exists('..\..\..\..\packages\Microsoft.WindowsAppSDK.1.4.231219000\build\native\Microsoft.WindowsAppSDK.targets')" />
|
||||
<Import Project="..\..\..\..\packages\Microsoft.Windows.ImplementationLibrary.1.0.231216.1\build\native\Microsoft.Windows.ImplementationLibrary.targets" Condition="Exists('..\..\..\..\packages\Microsoft.Windows.ImplementationLibrary.1.0.231216.1\build\native\Microsoft.Windows.ImplementationLibrary.targets')" />
|
||||
<Import Project="..\..\..\..\packages\Microsoft.Windows.SDK.BuildTools.10.0.22621.2428\build\Microsoft.Windows.SDK.BuildTools.targets" Condition="Exists('..\..\..\..\packages\Microsoft.Windows.SDK.BuildTools.10.0.22621.2428\build\Microsoft.Windows.SDK.BuildTools.targets')" />
|
||||
<Import Project="..\..\..\..\packages\Microsoft.WindowsAppSDK.1.5.240311000\build\native\Microsoft.WindowsAppSDK.targets" Condition="Exists('..\..\..\..\packages\Microsoft.WindowsAppSDK.1.5.240311000\build\native\Microsoft.WindowsAppSDK.targets')" />
|
||||
</ImportGroup>
|
||||
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
|
||||
<PropertyGroup>
|
||||
@@ -149,10 +155,10 @@
|
||||
</PropertyGroup>
|
||||
<Error Condition="!Exists('..\..\..\..\packages\Microsoft.Windows.CppWinRT.2.0.240111.5\build\native\Microsoft.Windows.CppWinRT.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\..\packages\Microsoft.Windows.CppWinRT.2.0.240111.5\build\native\Microsoft.Windows.CppWinRT.props'))" />
|
||||
<Error Condition="!Exists('..\..\..\..\packages\Microsoft.Windows.CppWinRT.2.0.240111.5\build\native\Microsoft.Windows.CppWinRT.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\..\packages\Microsoft.Windows.CppWinRT.2.0.240111.5\build\native\Microsoft.Windows.CppWinRT.targets'))" />
|
||||
<Error Condition="!Exists('..\..\..\..\packages\Microsoft.WindowsAppSDK.1.4.231219000\build\native\Microsoft.WindowsAppSDK.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\..\packages\Microsoft.WindowsAppSDK.1.4.231219000\build\native\Microsoft.WindowsAppSDK.props'))" />
|
||||
<Error Condition="!Exists('..\..\..\..\packages\Microsoft.WindowsAppSDK.1.4.231219000\build\native\Microsoft.WindowsAppSDK.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\..\packages\Microsoft.WindowsAppSDK.1.4.231219000\build\native\Microsoft.WindowsAppSDK.targets'))" />
|
||||
<Error Condition="!Exists('..\..\..\..\packages\Microsoft.Windows.ImplementationLibrary.1.0.231216.1\build\native\Microsoft.Windows.ImplementationLibrary.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\..\packages\Microsoft.Windows.ImplementationLibrary.1.0.231216.1\build\native\Microsoft.Windows.ImplementationLibrary.targets'))" />
|
||||
<Error Condition="!Exists('..\..\..\..\packages\Microsoft.Windows.SDK.BuildTools.10.0.22621.2428\build\Microsoft.Windows.SDK.BuildTools.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\..\packages\Microsoft.Windows.SDK.BuildTools.10.0.22621.2428\build\Microsoft.Windows.SDK.BuildTools.props'))" />
|
||||
<Error Condition="!Exists('..\..\..\..\packages\Microsoft.Windows.SDK.BuildTools.10.0.22621.2428\build\Microsoft.Windows.SDK.BuildTools.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\..\packages\Microsoft.Windows.SDK.BuildTools.10.0.22621.2428\build\Microsoft.Windows.SDK.BuildTools.targets'))" />
|
||||
<Error Condition="!Exists('..\..\..\..\packages\Microsoft.WindowsAppSDK.1.5.240311000\build\native\Microsoft.WindowsAppSDK.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\..\packages\Microsoft.WindowsAppSDK.1.5.240311000\build\native\Microsoft.WindowsAppSDK.props'))" />
|
||||
<Error Condition="!Exists('..\..\..\..\packages\Microsoft.WindowsAppSDK.1.5.240311000\build\native\Microsoft.WindowsAppSDK.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\..\packages\Microsoft.WindowsAppSDK.1.5.240311000\build\native\Microsoft.WindowsAppSDK.targets'))" />
|
||||
</Target>
|
||||
</Project>
|
||||
@@ -3,5 +3,5 @@
|
||||
<package id="Microsoft.Windows.CppWinRT" version="2.0.240111.5" targetFramework="native" />
|
||||
<package id="Microsoft.Windows.ImplementationLibrary" version="1.0.231216.1" targetFramework="native" />
|
||||
<package id="Microsoft.Windows.SDK.BuildTools" version="10.0.22621.2428" targetFramework="native" />
|
||||
<package id="Microsoft.WindowsAppSDK" version="1.5.240311000" targetFramework="native" />
|
||||
<package id="Microsoft.WindowsAppSDK" version="1.4.231219000" targetFramework="native" />
|
||||
</packages>
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user