Compare commits

..

3 Commits

Author SHA1 Message Date
Jaime Bernardo
5259a1ba5e Update README.md
Co-authored-by: Heiko <61519853+htcfreek@users.noreply.github.com>
2024-12-16 19:25:00 +00:00
Jaime Bernardo
e314fc75df Fix spellcheck 2024-12-13 16:04:29 +00:00
Jaime Bernardo
a38c4c8353 0.87 changelog 2024-12-13 15:57:09 +00:00
41 changed files with 186 additions and 937 deletions

View File

@@ -12,6 +12,7 @@ properties:
id: vsPackage
directives:
description: Install Visual Studio 2022 Community (Any edition will work)
allowPrerelease: true
settings:
id: Microsoft.VisualStudio.2022.Community
source: winget

View File

@@ -12,6 +12,7 @@ properties:
id: vsPackage
directives:
description: Install Visual Studio 2022 Enterprise (Any edition will work)
allowPrerelease: true
settings:
id: Microsoft.VisualStudio.2022.Enterprise
source: winget

View File

@@ -12,6 +12,7 @@ properties:
id: vsPackage
directives:
description: Install Visual Studio 2022 Professional (Any edition will work)
allowPrerelease: true
settings:
id: Microsoft.VisualStudio.2022.Professional
source: winget

View File

@@ -78,14 +78,7 @@ sinclairinat
stylecop
uipi
yinwang
myaccess
onmicrosoft
aep
epsf
howto
onefuzzconfig
oip
onefuzzingestionpreparationtool
# KEYS
@@ -253,12 +246,3 @@ pwa
AOT
Aot
# YML
onefuzz
# NameInCode
leilzh
#Tools
OIP

View File

@@ -46,8 +46,6 @@ betsegaw
bricelam
bsky
CCcat
chenmy
chemwolf
Chinh
chrdavis
Chrzan
@@ -65,7 +63,6 @@ Deondre
DHowett
ductdo
Essey
Feng
ethanfangg
ferraridavide
frankychen
@@ -81,7 +78,6 @@ gordon
grzhan
Guo
hanselman
haoliuu
Harmath
Heiko
Hemmerlein
@@ -113,7 +109,6 @@ Markovic
martinchrzan
martinmoene
Melman
Mengyuan
Mikhayelyan
msft
Mykhailo
@@ -126,13 +121,11 @@ oldnewthing
onegreatworld
palenshus
pedrolamas
Peiyao
peteblois
phoboslab
Ponten
Pooja
Pylyp
Qingpeng
quachpas
Quriz
randyrants
@@ -161,23 +154,14 @@ Taras
TBM
tilovell
Triet
urnotdfs
waaverecords
wang
Whuihuan
Xiaofeng
Xpg
Yaqing
yaqingmi
ycv
yeelam
Yuniardi
yuyoyuppe
Zeol
Zhao
Zhaopeng
zhaopy
zhaoqpcn
Zoltan
Zykova

View File

@@ -740,7 +740,6 @@ LExit
lhwnd
LIBID
lindex
linkid
LINKOVERLAY
LINQTo
listview
@@ -754,7 +753,7 @@ lnks
LOADFROMFILE
LOBYTE
LOCALDISPLAY
localpackage
LOCALPACKAGE
LOCALSYSTEM
LOCATIONCHANGE
LOGFONT
@@ -1722,7 +1721,6 @@ WIC
wifi
wil
winapi
winappsdk
wincodec
Wincodecsdk
wincolor
@@ -1847,3 +1845,5 @@ zonable
zoneset
Zoneszonabletester
zzz

View File

@@ -1,130 +0,0 @@
Param(
# Using the default value of 1.6 for winAppSdkVersionNumber and useExperimentalVersion as false
[Parameter(Mandatory=$False,Position=1)]
[string]$winAppSdkVersionNumber = "1.6",
# When the pipeline calls the PS1 file, the passed parameters are converted to string type
[Parameter(Mandatory=$False,Position=2)]
[boolean]$useExperimentalVersion = $False
)
function Update-NugetConfig {
param (
[string]$filePath = "nuget.config"
)
Write-Host "Updating nuget.config file"
[xml]$xml = Get-Content -Path $filePath
# Add localpackages source into nuget.config
$packageSourcesNode = $xml.configuration.packageSources
$addNode = $xml.CreateElement("add")
$addNode.SetAttribute("key", "localpackages")
$addNode.SetAttribute("value", "localpackages")
$packageSourcesNode.AppendChild($addNode) | Out-Null
# Remove <packageSourceMapping> tag and its content
$packageSourceMappingNode = $xml.configuration.packageSourceMapping
if ($packageSourceMappingNode) {
$xml.configuration.RemoveChild($packageSourceMappingNode) | Out-Null
}
# print nuget.config after modification
$xml.OuterXml
# Save the modified nuget.config file
$xml.Save($filePath)
}
$sourceLink = "https://microsoft.pkgs.visualstudio.com/ProjectReunion/_packaging/Project.Reunion.nuget.internal/nuget/v3/index.json"
# Execute nuget list and capture the output
if ($useExperimentalVersion) {
# The nuget list for experimental versions will cost more time
# So, we will not use -AllVersions to wast time
# But it can only get the latest experimental version
Write-Host "Fetching WindowsAppSDK with experimental versions"
$nugetOutput = nuget list Microsoft.WindowsAppSDK `
-Source $sourceLink `
-Prerelease
# Filter versions based on the specified version prefix
$escapedVersionNumber = [regex]::Escape($winAppSdkVersionNumber)
$filteredVersions = $nugetOutput | Where-Object { $_ -match "Microsoft.WindowsAppSDK $escapedVersionNumber\." }
$latestVersions = $filteredVersions
} else {
Write-Host "Fetching stable WindowsAppSDK versions for $winAppSdkVersionNumber"
$nugetOutput = nuget list Microsoft.WindowsAppSDK `
-Source $sourceLink `
-AllVersions
# Filter versions based on the specified version prefix
$escapedVersionNumber = [regex]::Escape($winAppSdkVersionNumber)
$filteredVersions = $nugetOutput | Where-Object { $_ -match "Microsoft.WindowsAppSDK $escapedVersionNumber\." }
$latestVersions = $filteredVersions | Sort-Object { [version]($_ -split ' ')[1] } -Descending | Select-Object -First 1
}
Write-Host "Latest versions found: $latestVersions"
# Extract the latest version number from the output
$latestVersion = $latestVersions -split "`n" | `
Select-String -Pattern 'Microsoft.WindowsAppSDK\s*([0-9]+\.[0-9]+\.[0-9]+-*[a-zA-Z0-9]*)' | `
ForEach-Object { $_.Matches[0].Groups[1].Value } | `
Sort-Object -Descending | `
Select-Object -First 1
if ($latestVersion) {
$WinAppSDKVersion = $latestVersion
Write-Host "Extracted version: $WinAppSDKVersion"
Write-Host "##vso[task.setvariable variable=WinAppSDKVersion]$WinAppSDKVersion"
} else {
Write-Host "Failed to extract version number from nuget list output"
exit 1
}
# Update packages.config files
Get-ChildItem -Recurse packages.config | ForEach-Object {
$content = Get-Content $_.FullName -Raw
if ($content -match 'package id="Microsoft.WindowsAppSDK"') {
$newVersionString = 'package id="Microsoft.WindowsAppSDK" version="' + $WinAppSDKVersion + '"'
$oldVersionString = 'package id="Microsoft.WindowsAppSDK" version="[-.0-9a-zA-Z]*"'
$content = $content -replace $oldVersionString, $newVersionString
Set-Content -Path $_.FullName -Value $content
Write-Host "Modified " $_.FullName
}
}
# Update Directory.Packages.props file
$propsFile = "Directory.Packages.props"
if (Test-Path $propsFile) {
$content = Get-Content $propsFile -Raw
if ($content -match '<PackageVersion Include="Microsoft.WindowsAppSDK"') {
$newVersionString = '<PackageVersion Include="Microsoft.WindowsAppSDK" Version="' + $WinAppSDKVersion + '" />'
$oldVersionString = '<PackageVersion Include="Microsoft.WindowsAppSDK" Version="[-.0-9a-zA-Z]*" />'
$content = $content -replace $oldVersionString, $newVersionString
Set-Content -Path $propsFile -Value $content
Write-Host "Modified " $propsFile
}
}
# Update .vcxproj files
Get-ChildItem -Recurse *.vcxproj | ForEach-Object {
$content = Get-Content $_.FullName -Raw
if ($content -match '\\Microsoft.WindowsAppSDK.') {
$newVersionString = '\Microsoft.WindowsAppSDK.' + $WinAppSDKVersion + '\'
$oldVersionString = '\\Microsoft.WindowsAppSDK.[-.0-9a-zA-Z]*\\'
$content = $content -replace $oldVersionString, $newVersionString
Set-Content -Path $_.FullName -Value $content
Write-Host "Modified " $_.FullName
}
}
# Update .csproj files
Get-ChildItem -Recurse *.csproj | ForEach-Object {
$content = Get-Content $_.FullName -Raw
if ($content -match 'PackageReference Include="Microsoft.WindowsAppSDK"') {
$newVersionString = 'PackageReference Include="Microsoft.WindowsAppSDK" Version="'+ $WinAppSDKVersion + '"'
$oldVersionString = 'PackageReference Include="Microsoft.WindowsAppSDK" Version="[-.0-9a-zA-Z]*"'
$content = $content -replace $oldVersionString, $newVersionString
Set-Content -Path $_.FullName -Value $content
Write-Host "Modified " $_.FullName
}
}
Update-NugetConfig

View File

@@ -1,42 +0,0 @@
trigger: none
pr: none
schedules:
- cron: "0 0 * * *" # every day at midnight
displayName: "Daily midnight Build"
branches:
include:
- main
always: false # only run if there's code changes!
name: $(BuildDefinitionName)_$(date:yyMM).$(date:dd)$(rev:rrr)
parameters:
- name: buildPlatforms
type: object
default:
- x64
- arm64
- name: enableMsBuildCaching
type: boolean
displayName: "Enable MSBuild Caching"
default: false
- name: runTests
type: boolean
displayName: "Run Tests"
default: true
- name: useVSPreview
type: boolean
displayName: "Build Using Visual Studio Preview"
default: false
- name: useLatestWebView2
type: boolean
default: false
extends:
template: templates/pipeline-ci-build.yml
parameters:
buildPlatforms: ${{ parameters.buildPlatforms }}
enableMsBuildCaching: ${{ parameters.enableMsBuildCaching }}
runTests: ${{ parameters.runTests }}
useVSPreview: ${{ parameters.useVSPreview }}
useLatestWebView2: ${{ parameters.useLatestWebView2 }}

View File

@@ -1,50 +0,0 @@
trigger: none
pr: none
schedules:
- cron: "0 0 * * *" # every day at midnight
displayName: "Daily midnight Build"
branches:
include:
- main
always: false # only run if there's code changes!
name: $(BuildDefinitionName)_$(date:yyMM).$(date:dd)$(rev:rrr)
parameters:
- name: buildPlatforms
type: object
default:
- x64
- arm64
- name: enableMsBuildCaching
type: boolean
displayName: "Enable MSBuild Caching"
default: false
- name: runTests
type: boolean
displayName: "Run Tests"
default: true
- name: useVSPreview
type: boolean
displayName: "Build Using Visual Studio Preview"
default: false
- name: useLatestWinAppSDK
type: boolean
default: true
- name: winAppSDKVersionNumber
type: string
default: 1.6
- name: useExperimentalVersion
type: boolean
default: false
extends:
template: templates/pipeline-ci-build.yml
parameters:
buildPlatforms: ${{ parameters.buildPlatforms }}
enableMsBuildCaching: ${{ parameters.enableMsBuildCaching }}
runTests: ${{ parameters.runTests }}
useVSPreview: ${{ parameters.useVSPreview }}
useLatestWinAppSDK: ${{ parameters.useLatestWinAppSDK }}
winAppSDKVersionNumber: ${{ parameters.winAppSDKVersionNumber }}
useExperimentalVersion: ${{ parameters.useExperimentalVersion }}

View File

@@ -1,55 +0,0 @@
pr: none
trigger: none
schedules:
- cron: "0 0 * * 1"
displayName: Weekly fuzzing submission
branches:
include:
- main
always: true
name: $(BuildDefinitionName)_$(date:yyMM).$(date:dd)$(rev:rrr)
parameters:
- name: platform
type: string
default: x64 # for fuzzing, we only use x64 for now
- name: enableMsBuildCaching
type: boolean
displayName: "Enable MSBuild Caching"
default: false
- name: useVSPreview
type: boolean
displayName: "Build Using Visual Studio Preview"
default: false
stages:
- stage: Build_${{ parameters.platform }}
displayName: Build ${{ parameters.platform }}
jobs:
- template: templates/job-build-project.yml
parameters:
pool:
${{ if eq(variables['System.CollectionId'], 'cb55739e-4afe-46a3-970f-1b49d8ee7564') }}:
name: SHINE-INT-L
${{ else }}:
name: SHINE-OSS-L
${{ if eq(parameters.useVSPreview, true) }}:
demands: ImageOverride -equals SHINE-VS17-Preview
buildPlatforms:
- ${{ parameters.platform }}
buildConfigurations: [Release]
enablePackageCaching: true
enableMsBuildCaching: ${{ parameters.enableMsBuildCaching }}
runTests: true
useVSPreview: ${{ parameters.useVSPreview }}
- stage: OneFuzz
displayName: Fuzz ${{ parameters.platform }}
dependsOn:
- Build_${{parameters.platform}}
jobs:
- template: templates/job-fuzz.yml
parameters:
platform: ${{ parameters.platform }}
configuration: Release

View File

@@ -56,15 +56,6 @@ parameters:
- name: versionNumber
type: string
default: '0.0.1'
- name: useLatestWinAppSDK
type: boolean
default: false
- name: winAppSDKVersionNumber
type: string
default: 1.6
- name: useExperimentalVersion
type: boolean
default: false
- name: csProjectsToPublish
type: object
default:
@@ -111,10 +102,6 @@ jobs:
${{ else }}:
MSBuildMainBuildTargets: Build
${{ insert }}: ${{ parameters.variables }}
${{ if eq(parameters.useLatestWinAppSDK, true) }}:
RestoreAdditionalProjectSourcesArg: '/p:RestoreAdditionalProjectSources="$(Build.SourcesDirectory)\localpackages\NugetPackages"'
${{ else }}:
RestoreAdditionalProjectSourcesArg: ''
displayName: Build
timeoutInMinutes: 240
cancelTimeoutInMinutes: 1
@@ -147,11 +134,6 @@ jobs:
sdk: true
version: '6.0'
- template: steps-ensure-dotnet-version.yml
parameters:
sdk: true
version: '8.0'
- template: steps-ensure-dotnet-version.yml
parameters:
sdk: true
@@ -195,15 +177,8 @@ jobs:
"packages.config" | "$(Agent.OS)"
"packages.config"
path: packages
- ${{ if eq(parameters.useLatestWinAppSDK, true)}}:
- template: .\steps-update-winappsdk-and-restore-nuget.yml
parameters:
versionNumber: ${{ parameters.winAppSDKVersionNumber }}
useExperimentalVersion: ${{ parameters.useExperimentalVersion }}
- ${{ if eq(parameters.useLatestWinAppSDK, false)}}:
- template: .\steps-restore-nuget.yml
- template: .\steps-restore-nuget.yml
- pwsh: |-
& "$(build.sourcesdirectory)\.pipelines\verifyAndSetLatestVCToolsVersion.ps1"
@@ -234,7 +209,6 @@ jobs:
${{ parameters.additionalBuildOptions }}
$(MSBuildCacheParameters)
/t:$(MSBuildMainBuildTargets)
$(RestoreAdditionalProjectSourcesArg)
platform: $(BuildPlatform)
configuration: $(BuildConfiguration)
msbuildArchitecture: x64
@@ -259,11 +233,10 @@ jobs:
inputs:
solution: '**\HostsUILib.csproj'
vsVersion: 17.0
msbuildArgs: >-
/p:CIBuild=true;NoBuild=true -t:pack
/bl:$(LogOutputDirectory)\build-hosts.binlog
/p:NoWarn=NU5104
$(RestoreAdditionalProjectSourcesArg)
${{ if eq(parameters.useVSPreview, true) }}:
msbuildArgs: /p:CIBuild=true;NoBuild=true -t:pack /bl:$(LogOutputDirectory)\build-hosts.binlog /p:NoWarn=NU5104
${{ else }}:
msbuildArgs: /p:CIBuild=true;NoBuild=true -t:pack /bl:$(LogOutputDirectory)\build-hosts.binlog
configuration: $(BuildConfiguration)
msbuildArchitecture: x64
maximumCpuCount: true
@@ -276,11 +249,10 @@ jobs:
inputs:
solution: '**\EnvironmentVariablesUILib.csproj'
vsVersion: 17.0
msbuildArgs: >-
/p:CIBuild=true;NoBuild=true -t:pack
/bl:$(LogOutputDirectory)\build-env-var-editor.binlog
/p:NoWarn=NU5104
$(RestoreAdditionalProjectSourcesArg)
${{ if eq(parameters.useVSPreview, true) }}:
msbuildArgs: /p:CIBuild=true;NoBuild=true -t:pack /bl:$(LogOutputDirectory)\build-env-var-editor.binlog /p:NoWarn=NU5104
${{ else }}:
msbuildArgs: /p:CIBuild=true;NoBuild=true -t:pack /bl:$(LogOutputDirectory)\build-env-var-editor.binlog
configuration: $(BuildConfiguration)
msbuildArchitecture: x64
maximumCpuCount: true
@@ -293,11 +265,10 @@ jobs:
inputs:
solution: '**\RegistryPreviewUILib.csproj'
vsVersion: 17.0
msbuildArgs: >-
/p:CIBuild=true;NoBuild=true -t:pack
/bl:$(LogOutputDirectory)\build-registry-preview.binlog
/p:NoWarn=NU5104
$(RestoreAdditionalProjectSourcesArg)
${{ if eq(parameters.useVSPreview, true) }}:
msbuildArgs: /p:CIBuild=true;NoBuild=true -t:pack /bl:$(LogOutputDirectory)\build-registry-preview.binlog /p:NoWarn=NU5104
${{ else }}:
msbuildArgs: /p:CIBuild=true;NoBuild=true -t:pack /bl:$(LogOutputDirectory)\build-registry-preview.binlog
configuration: $(BuildConfiguration)
msbuildArchitecture: x64
maximumCpuCount: true
@@ -352,7 +323,6 @@ jobs:
/bl:$(LogOutputDirectory)\build-bug-report.binlog
${{ parameters.additionalBuildOptions }}
$(MSBuildCacheParameters)
$(RestoreAdditionalProjectSourcesArg)
platform: $(BuildPlatform)
configuration: $(BuildConfiguration)
msbuildArchitecture: x64
@@ -373,7 +343,6 @@ jobs:
/bl:$(LogOutputDirectory)\build-webcam-report.binlog
${{ parameters.additionalBuildOptions }}
$(MSBuildCacheParameters)
$(RestoreAdditionalProjectSourcesArg)
platform: $(BuildPlatform)
configuration: $(BuildConfiguration)
msbuildArchitecture: x64
@@ -394,7 +363,6 @@ jobs:
/bl:$(LogOutputDirectory)\build-styles-report.binlog
${{ parameters.additionalBuildOptions }}
$(MSBuildCacheParameters)
$(RestoreAdditionalProjectSourcesArg)
platform: $(BuildPlatform)
configuration: $(BuildConfiguration)
msbuildArchitecture: x64
@@ -417,7 +385,6 @@ jobs:
/p:PowerToysRoot=$(Build.SourcesDirectory)
/p:PublishProfile=InstallationPublishProfile.pubxml
/bl:$(LogOutputDirectory)\publish-${{ join('_',split(project, '/')) }}.binlog
$(RestoreAdditionalProjectSourcesArg)
platform: $(BuildPlatform)
configuration: $(BuildConfiguration)
msbuildArchitecture: x64
@@ -447,11 +414,9 @@ jobs:
& '.pipelines/verifyPossibleAssetConflicts.ps1' -targetDir '$(build.sourcesdirectory)\$(BuildPlatform)\$(BuildConfiguration)\WinUI3Apps'
displayName: Audit WinAppSDK applications path asset conflicts
# To streamline the pipeline and prevent errors, skip this step during compatibility tests with the latest WinAppSDK.
- ${{ if eq(parameters.useLatestWinAppSDK, false) }}:
- pwsh: |-
& '.pipelines/verifyNoticeMdAgainstNugetPackages.ps1' -path '$(build.sourcesdirectory)\'
displayName: Verify NOTICE.md and NuGet packages match
- pwsh: |-
& '.pipelines/verifyNoticeMdAgainstNugetPackages.ps1' -path '$(build.sourcesdirectory)\'
displayName: Verify NOTICE.md and NuGet packages match
- ${{ if eq(parameters.runTests, true) }}:
# Publish test results which ran in MSBuild

View File

@@ -1,36 +0,0 @@
parameters:
- name: configuration
type: string
default: "Release"
- name: platform
type: string
default: ""
- name: inputArtifactStem
type: string
default: ""
jobs:
- job: OneFuzz
pool:
vmImage: windows-2022
variables:
ArtifactName: build-${{ parameters.platform }}-${{ parameters.configuration }}${{ parameters.inputArtifactStem }}
steps:
- checkout: self
submodules: false
clean: true
fetchDepth: 1
fetchTags: false
- download: current
displayName: Download artifacts
artifact: $(ArtifactName)
patterns: |-
**/tests/*.FuzzTests/**
- task: onefuzz-task@0
inputs:
onefuzzOSes: Windows
env:
onefuzzDropDirectory: $(Pipeline.Workspace)\$(ArtifactName)\x64\Release\x64\Release\tests
SYSTEM_ACCESSTOKEN: $(System.AccessToken)

View File

@@ -8,9 +8,6 @@ parameters:
- name: inputArtifactStem
type: string
default: ""
- name: useLatestWebView2
type: boolean
default: false
jobs:
- job: Test${{ parameters.platform }}${{ parameters.configuration }}
@@ -37,29 +34,6 @@ jobs:
fetchDepth: 1
fetchTags: false
- ${{ if eq(parameters.useLatestWebView2, true) }}:
- powershell: |
$edge_url = 'https://go.microsoft.com/fwlink/?linkid=2084649&Channel=Canary&language=en'
$timeout = New-TimeSpan -Minutes 6
$timeoutSeconds = [int]$timeout.TotalSeconds
$command = {
Invoke-WebRequest -Uri $using:edge_url -OutFile $(Pipeline.Workspace)\MicrosoftEdgeSetup.exe
Write-Host "##[command]Installing Canary channel of Microsoft Edge"
Start-Process $(Pipeline.Workspace)\MicrosoftEdgeSetup.exe -ArgumentList '/silent /install' -Wait
}
$job = Start-Job -ScriptBlock $command
Wait-Job $job -Timeout $timeoutSeconds
if ($job.State -eq "Running") {
Stop-Job $job
Write-Host "##[warning]The job was stopped because it exceeded the time limit."
}
displayName: "Install the latest MSEdge Canary"
- script:
reg add "HKLM\Software\Policies\Microsoft\Edge\WebView2\ReleaseChannels" /v PowerToys.exe /t REG_SZ /d "3"
displayName: "Enable WebView2 Canary Channel"
- download: current
displayName: Download artifacts
artifact: build-${{ parameters.platform }}-${{ parameters.configuration }}${{ parameters.inputArtifactStem }}

View File

@@ -22,18 +22,6 @@ parameters:
- name: useVSPreview
type: boolean
default: false
- name: useLatestWebView2
type: boolean
default: false
- name: useLatestWinAppSDK
type: boolean
default: false
- name: winAppSDKVersionNumber
type: string
default: 1.6
- name: useExperimentalVersion
type: boolean
default: false
stages:
# Allow manual builds to skip pre-check
@@ -67,10 +55,6 @@ stages:
enableMsBuildCaching: ${{ parameters.enableMsBuildCaching }}
runTests: ${{ parameters.runTests }}
useVSPreview: ${{ parameters.useVSPreview }}
useLatestWinAppSDK: ${{ parameters.useLatestWinAppSDK }}
${{ if eq(parameters.useLatestWinAppSDK, true) }}:
winAppSDKVersionNumber: ${{ parameters.winAppSDKVersionNumber }}
useExperimentalVersion: ${{ parameters.useExperimentalVersion }}
- ${{ if eq(parameters.runTests, true) }}:
- stage: Test_${{ platform }}
@@ -82,4 +66,3 @@ stages:
parameters:
platform: ${{ platform }}
configuration: Release
useLatestWebView2: ${{ parameters.useLatestWebView2 }}

View File

@@ -16,10 +16,6 @@ parameters:
steps:
- pwsh: |-
curl.exe -J -L -O "https://dot.net/v1/dotnet-install.ps1"
if (-not (Test-Path dotnet-install.ps1)) {
Write-Error "Failed to download dotnet-install.ps1"
exit 1
}
$NEW_DOTNET_ROOT = "$(Agent.ToolsDirectory)\dotnet"
& ./dotnet-install.ps1 -Channel "${{parameters.version}}" -InstallDir $NEW_DOTNET_ROOT
Write-Host "##vso[task.setvariable variable=DOTNET_ROOT]${NEW_DOTNET_ROOT}"
@@ -29,4 +25,3 @@ steps:
displayName: "Install .NET ${{parameters.version}} SDK"
${{ else }}:
displayName: "Install .NET ${{parameters.version}}"
retryCountOnTaskFailure: 3

View File

@@ -1,56 +0,0 @@
parameters:
- name: versionNumber
type: string
default: 1.6
- name: useExperimentalVersion
type: boolean
default: false
steps:
- task: NuGetAuthenticate@1
displayName: 'NuGet Authenticate'
- task: PowerShell@2
displayName: Update WinAppSDK Versions
inputs:
filePath: '$(build.sourcesdirectory)\.pipelines\UpdateVersions.ps1'
arguments: >
-winAppSdkVersionNumber ${{ parameters.versionNumber }}
-useExperimentalVersion $${{ parameters.useExperimentalVersion }}
- script: echo $(WinAppSDKVersion)
displayName: 'Display WinAppSDK Version Found'
- task: DownloadPipelineArtifact@2
displayName: 'Download WindowsAppSDK'
inputs:
buildType: 'specific'
project: '55e8140e-57ac-4e5f-8f9c-c7c15b51929d'
definition: '104083'
buildVersionToDownload: 'latestFromBranch'
branchName: 'refs/heads/release/${{ parameters.versionNumber }}-stable'
artifactName: 'WindowsAppSDK_Nuget_And_MSIX'
targetPath: '$(Build.SourcesDirectory)\localpackages'
- script: dir $(Build.SourcesDirectory)\localpackages\NugetPackages
displayName: 'List downloaded packages'
- task: NuGetCommand@2
displayName: 'Install WindowsAppSDK'
inputs:
command: 'custom'
arguments: >
install "Microsoft.WindowsAppSDK"
-Source "$(Build.SourcesDirectory)\localpackages\NugetPackages"
-Version "$(WinAppSDKVersion)"
-OutputDirectory "$(Build.SourcesDirectory)\localpackages\output"
-FallbackSource "https://microsoft.pkgs.visualstudio.com/ProjectReunion/_packaging/Project.Reunion.nuget.internal/nuget/v3/index.json"
- task: NuGetCommand@2
displayName: 'Restore NuGet packages'
inputs:
command: 'restore'
feedsToUse: 'config'
nugetConfigPath: '$(build.sourcesdirectory)\nuget.config'
restoreSolution: '$(build.sourcesdirectory)\**\*.sln'
includeNuGetOrg: false

View File

@@ -15,7 +15,7 @@ Param(
$referencedFileVersionsPerDll = @{}
$totalFailures = 0
Get-ChildItem $targetDir -Recurse -Filter *.deps.json -Exclude UITests-FancyZones*,MouseJump.Common.UnitTests*,AdvancedPaste.FuzzTests* | ForEach-Object {
Get-ChildItem $targetDir -Recurse -Filter *.deps.json -Exclude UITests-FancyZones*,MouseJump.Common.UnitTests* | ForEach-Object {
# Temporarily exclude FancyZones UI tests because of Appium.WebDriver dependencies
$depsJsonFullFileName = $_.FullName
$depsJsonFileName = $_.Name

View File

@@ -181,13 +181,6 @@ Other contributors:
- [@shuaiyuanxx](https://github.com/shuaiyuanxx) - Shawn Yuan - Dev
- [@moooyo](https://github.com/moooyo) - Yu Leng - Dev
- [@haoliuu](https://github.com/haoliuu) - Hao Liu - Dev
- [@chenmy77](https://github.com/chenmy77) - Mengyuan Chen - Dev
- [@chemwolf6922](https://github.com/chemwolf6922) - Feng Wang - Dev
- [@yaqingmi](https://github.com/yaqingmi) - Yaqing Mi - Dev
- [@zhaoqpcn](https://github.com/zhaoqpcn) - Qingpeng Zhao - Dev
- [@urnotdfs](https://github.com/urnotdfs) - Xiaofeng Wang - Dev
- [@zhaopy536](https://github.com/zhaopy536) - Peiyao Zhao - Dev
- [@wang563681252](https://github.com/wang563681252) - Zhaopeng Wang - Dev
# Former PowerToys core team members

View File

@@ -637,8 +637,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "NewPlus.ShellExtension.win1
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AdvancedPaste.UnitTests", "src\modules\AdvancedPaste\AdvancedPaste.UnitTests\AdvancedPaste.UnitTests.csproj", "{D5E5F5EA-1B6C-4A73-88BE-304F36C9E4EE}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AdvancedPaste.FuzzTests", "src\modules\AdvancedPaste\AdvancedPaste.FuzzTests\AdvancedPaste.FuzzTests.csproj", "{7F5B9557-5878-4438-A721-3E28296BA193}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|ARM64 = Debug|ARM64
@@ -2823,18 +2821,6 @@ Global
{D5E5F5EA-1B6C-4A73-88BE-304F36C9E4EE}.Release|x64.Build.0 = Release|x64
{D5E5F5EA-1B6C-4A73-88BE-304F36C9E4EE}.Release|x86.ActiveCfg = Release|x64
{D5E5F5EA-1B6C-4A73-88BE-304F36C9E4EE}.Release|x86.Build.0 = Release|x64
{7F5B9557-5878-4438-A721-3E28296BA193}.Debug|ARM64.ActiveCfg = Debug|ARM64
{7F5B9557-5878-4438-A721-3E28296BA193}.Debug|ARM64.Build.0 = Debug|ARM64
{7F5B9557-5878-4438-A721-3E28296BA193}.Debug|x64.ActiveCfg = Debug|x64
{7F5B9557-5878-4438-A721-3E28296BA193}.Debug|x64.Build.0 = Debug|x64
{7F5B9557-5878-4438-A721-3E28296BA193}.Debug|x86.ActiveCfg = Debug|x64
{7F5B9557-5878-4438-A721-3E28296BA193}.Debug|x86.Build.0 = Debug|x64
{7F5B9557-5878-4438-A721-3E28296BA193}.Release|ARM64.ActiveCfg = Release|ARM64
{7F5B9557-5878-4438-A721-3E28296BA193}.Release|ARM64.Build.0 = Release|ARM64
{7F5B9557-5878-4438-A721-3E28296BA193}.Release|x64.ActiveCfg = Release|x64
{7F5B9557-5878-4438-A721-3E28296BA193}.Release|x64.Build.0 = Release|x64
{7F5B9557-5878-4438-A721-3E28296BA193}.Release|x86.ActiveCfg = Release|x64
{7F5B9557-5878-4438-A721-3E28296BA193}.Release|x86.Build.0 = Release|x64
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@@ -3069,7 +3055,6 @@ Global
{89D0E199-B17A-418C-B2F8-7375B6708357} = {A2221D7E-55E7-4BEA-90D1-4F162D670BBF}
{0DB0F63A-D2F8-4DA3-A650-2D0B8724218E} = {CA716AE6-FE5C-40AC-BB8F-2C87912687AC}
{D5E5F5EA-1B6C-4A73-88BE-304F36C9E4EE} = {9873BA05-4C41-4819-9283-CF45D795431B}
{7F5B9557-5878-4438-A721-3E28296BA193} = {9873BA05-4C41-4819-9283-CF45D795431B}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {C3A2F9D1-7930-4EF4-A6FC-7EE0A99821D0}

View File

@@ -2,7 +2,6 @@
<!-- Look at Directory.Build.props in root for common stuff as well -->
<Import Project="..\..\Common.Dotnet.CsWinRT.props" />
<Import Project="..\..\Monaco.props" />
<Import Project="..\..\Common.Dotnet.AotCompatibility.props" />
<PropertyGroup>
<Description>PowerToys FilePreviewCommon</Description>

View File

@@ -1,14 +0,0 @@
// Copyright (c) Microsoft Corporation
// The Microsoft Corporation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using System.Text.Json;
using System.Text.Json.Serialization;
namespace Microsoft.PowerToys.FilePreviewCommon.Monaco.Formatters;
[JsonSourceGenerationOptions(WriteIndented = true)]
[JsonSerializable(typeof(JsonDocument))]
internal sealed partial class FilePreviewJsonSerializerContext : JsonSerializerContext
{
}

View File

@@ -14,6 +14,7 @@ namespace Microsoft.PowerToys.FilePreviewCommon.Monaco.Formatters
private static readonly JsonSerializerOptions _serializerOptions = new JsonSerializerOptions
{
WriteIndented = true,
Encoder = JavaScriptEncoder.UnsafeRelaxedJsonEscaping,
};
@@ -27,8 +28,7 @@ namespace Microsoft.PowerToys.FilePreviewCommon.Monaco.Formatters
using (var jDocument = JsonDocument.Parse(value, new JsonDocumentOptions { CommentHandling = JsonCommentHandling.Skip }))
{
FilePreviewJsonSerializerContext context = new(_serializerOptions);
return JsonSerializer.Serialize(jDocument, context.JsonDocument);
return JsonSerializer.Serialize(jDocument, _serializerOptions);
}
}
}

View File

@@ -6,7 +6,9 @@ using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Reflection;
using System.Text.Json;
using Microsoft.PowerToys.FilePreviewCommon.Monaco.Formatters;
namespace Microsoft.PowerToys.FilePreviewCommon
@@ -36,15 +38,15 @@ namespace Microsoft.PowerToys.FilePreviewCommon
private static string GetRuntimeMonacoDirectory()
{
string baseDirectory = AppContext.BaseDirectory ?? string.Empty;
string exePath = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) ?? string.Empty;
// If the executable is within "WinUI3Apps", correct the path first.
if (Path.GetFileName(baseDirectory) == "WinUI3Apps")
if (Path.GetFileName(exePath) == "WinUI3Apps")
{
baseDirectory = Path.Combine(baseDirectory, "..");
exePath = Path.Combine(exePath, "..");
}
string monacoPath = Path.Combine(baseDirectory, "Assets", "Monaco");
string monacoPath = Path.Combine(exePath, "Assets", "Monaco");
return Directory.Exists(monacoPath) ?
monacoPath :

View File

@@ -1,26 +0,0 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net8.0-windows10.0.19041.0</TargetFramework>
<LangVersion>latest</LangVersion>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
<PropertyGroup>
<OutputPath>..\..\..\..\$(Platform)\$(Configuration)\tests\AdvancedPaste.FuzzTests\</OutputPath>
</PropertyGroup>
<ItemGroup>
<Compile Include="..\AdvancedPaste\Helpers\JsonHelper.cs" Link="JsonHelper.cs" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="MSTest" />
</ItemGroup>
<ItemGroup>
<Using Include="Microsoft.VisualStudio.TestTools.UnitTesting" />
</ItemGroup>
<ItemGroup>
<Content Include="OneFuzzConfig.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
</ItemGroup>
</Project>

View File

@@ -1,45 +0,0 @@
# Fuzzing .NET Code with OneFuzz
This document explains the purpose of the project, the rationale for using specific technologies, and key instructions for fuzz testing .NET code using OneFuzz.
## Overview
This project demonstrates fuzz testing for .NET applications. It uses a `.NET 8 (Windows)` project where a code file is linked to the project. The linked file contains the functions required for fuzz testing.
## Why Use .NET 8 (Windows)?
1. **Current Support**: At the time of writing, OneFuzz supports only .NET 8 projects. The Fuzz team is actively working on .NET 9 support.
2. **Interim Solution**: Until .NET 9 support is available, .NET 8 serves as a robust and temporary solution for fuzz testing, enabling direct code linking for efficient development.
## Requesting Access
To log into the production instance of OneFuzz with the CLI, you **must request access**. Visit the internal [OneFuzz Access Request Page](https://myaccess.microsoft.com/@microsoft.onmicrosoft.com#/access-packages/6df691eb-e3d1-444b-b4b2-9e944dc794be) for details.
## How to Fuzz .NET Code
To set up and run fuzz testing on .NET code, follow the detailed guide available [Fuzz .NET Code](https://eng.ms/docs/cloud-ai-platform/azure-edge-platform-aep/aep-security/epsf-edge-and-platform-security-fundamentals/the-onefuzz-service/onefuzz/howto/fuzzing-dotnet-code).
## Running a .NET Fuzz Target Locally
Testing a .NET fuzz target locally requires specific configurations. For a step-by-step guide, see the section on [Running a .NET Fuzz Target Locally](https://eng.ms/docs/cloud-ai-platform/azure-edge-platform-aep/aep-security/epsf-edge-and-platform-security-fundamentals/the-onefuzz-service/onefuzz/howto/fuzzing-dotnet-code#extra-running-a-net-fuzz-target-locally).
## Writing a Good OneFuzzConfig.json
The `OneFuzzConfig.json` file provides critical information for deploying fuzzing jobs using the OneFuzz Ingestion Preparation Tool and Ingestion Service.
### Structure
The primary structure is an array of configuration entries. Outside the array, the `configVersion` field is used to track changes to the configuration schema.
For more details on how to write and structure this file, see the [OneFuzzConfig V3 Documentation](https://eng.ms/docs/cloud-ai-platform/azure-edge-platform-aep/aep-security/epsf-edge-and-platform-security-fundamentals/the-onefuzz-service/onefuzz/onefuzzconfig/onefuzzconfigv3).
## Tools
### OneFuzz Ingestion Preparation (OIP) Tool
The OIP tool helps prepare data for ingestion and fuzz testing. Learn more about [OneFuzz Ingestion Preparation (OIP) Tool](https://eng.ms/docs/cloud-ai-platform/azure-edge-platform-aep/aep-security/epsf-edge-and-platform-security-fundamentals/the-onefuzz-service/onefuzz/oip/onefuzzingestionpreparationtool).
### OneFuzz CLI
The CLI provides commands to manage and execute fuzzing jobs. Download and set up the CLI by following this [guide](https://eng.ms/docs/cloud-ai-platform/azure-edge-platform-aep/aep-security/epsf-edge-and-platform-security-fundamentals/the-onefuzz-service/onefuzz/howto/downloading-cli).

View File

@@ -1,32 +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 AdvancedPaste.Helpers;
using Windows.ApplicationModel.DataTransfer;
// OneFuzz currently does not support .NET 9 code testing, so this is a temporary solution.
// Create a .NET 8 project and use a file link to include the code for testing first.
namespace AdvancedPaste.FuzzTests
{
public class FuzzTests
{
public static void FuzzToJsonFromXmlOrCsv(ReadOnlySpan<byte> input)
{
try
{
var dataPackage = new DataPackage();
dataPackage.SetText(input.ToString());
_ = Task.Run(async () => await JsonHelper.ToJsonFromXmlOrCsvAsync(dataPackage.GetView())).Result;
}
catch (Exception ex) when (ex is ArgumentException)
{
// This is an example. It's important to filter out any *expected* exceptions from our code here.
// However, catching all exceptions is considered an anti-pattern because it may suppress legitimate
// issues, such as a NullReferenceException thrown by our code. In this case, we still re-throw
// the exception, as the ToJsonFromXmlOrCsvAsync method is not expected to throw any exceptions.
throw;
}
}
}
}

View File

@@ -1,46 +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.Text;
using System.Threading.Tasks;
// This is used for fuzz testing and ensures that the project links only to JsonHelper,
// avoiding unnecessary connections to additional files
namespace ManagedCommon
{
public static class Logger
{
// An empty method to simulate logging information
public static void LogTrace()
{
// Do nothing
}
// An empty method to simulate logging information
public static void LogInfo(string message)
{
// Do nothing
}
// An empty method to simulate logging warnings
public static void LogWarning(string message)
{
// Do nothing
}
// An empty method to simulate logging errors
public static void LogError(string message, Exception? ex = null)
{
// Do nothing
}
public static void LogDebug(string message, Exception? ex = null)
{
// Do nothing
}
}
}

View File

@@ -1,5 +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.
[assembly: Parallelize(Scope = ExecutionScope.MethodLevel)]

View File

@@ -1,47 +0,0 @@
{
"configVersion": 3,
"entries": [
{
"fuzzer": {
"$type": "libfuzzerDotNet",
"dll": "AdvancedPaste.FuzzTests.dll",
"class": "AdvancedPaste.FuzzTests.FuzzTests",
"method": "FuzzToJsonFromXmlOrCsv",
"FuzzingTargetBinaries": [
"PowerToys.AdvancedPaste.dll"
]
},
"adoTemplate": {
// supply the values appropriate to your
// project, where bugs will be filed
"org": "microsoft",
"project": "OS",
"AssignedTo": "leilzh@microsoft.com",
"AreaPath": "OS\\Windows Client and Services\\WinPD\\DEEP-Developer Experience, Ecosystem and Partnerships\\SHINE\\PowerToys",
"IterationPath": "OS\\Future"
},
"jobNotificationEmail": "leilzh@microsoft.com",
"skip": false,
"rebootAfterSetup": false,
"oneFuzzJobs": [
// at least one job is required
{
"projectName": "AdvancedPaste",
"targetName": "AdvancedPaste-dotnet-fuzzer"
}
],
"jobDependencies": [
// this should contain, at minimum,
// the DLL and PDB files
// you will need to add any other files required
// (globs are supported)
"AdvancedPaste.FuzzTests.dll",
"AdvancedPaste.FuzzTests.pdb",
"Microsoft.Windows.SDK.NET.dll",
"Newtonsoft.Json.dll",
"WinRT.Runtime.dll"
],
"SdlWorkItemId": 49911822
}
]
}

View File

@@ -263,7 +263,7 @@ namespace AdvancedPaste
if (disposing)
{
EtwTrace?.Dispose();
window?.Dispose();
window.Dispose();
}
disposedValue = true;

View File

@@ -5,7 +5,6 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text.Json;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
using System.Xml;
@@ -34,19 +33,6 @@ namespace AdvancedPaste.Helpers
private static readonly Regex CsvRemoveStartAndEndQuotationMarksRegex = new Regex(@"^""(?=(""{2})+)|(?<=(""{2})+)""$");
private static readonly Regex CsvReplaceDoubleQuotationMarksRegex = new Regex(@"""{2}");
private static bool IsJson(string text)
{
try
{
_ = JsonDocument.Parse(text);
return true;
}
catch (Exception)
{
return false;
}
}
internal static async Task<string> ToJsonFromXmlOrCsvAsync(DataPackageView clipboardData)
{
Logger.LogTrace();
@@ -60,12 +46,6 @@ namespace AdvancedPaste.Helpers
var text = await clipboardData.GetTextAsync();
string jsonText = string.Empty;
// If the text is already JSON, return it
if (IsJson(text))
{
return text;
}
// Try convert XML
try
{

View File

@@ -154,8 +154,8 @@ namespace AdvancedPaste.Settings
{
if (disposing)
{
_cancellationTokenSource?.Dispose();
_watcher?.Dispose();
_cancellationTokenSource.Dispose();
_watcher.Dispose();
}
_disposedValue = true;

View File

@@ -14,7 +14,7 @@ using Microsoft.UI.Dispatching;
namespace HostsUILib.Helpers
{
public partial class DuplicateService : IDuplicateService, IDisposable
public class DuplicateService : IDuplicateService, IDisposable
{
private record struct Check(string Address, string[] Hosts);

View File

@@ -21,7 +21,7 @@ using Microsoft.Win32;
namespace HostsUILib.Helpers
{
public partial class HostsService : IHostsService, IDisposable
public class HostsService : IHostsService, IDisposable
{
private const string _backupSuffix = $"_PowerToysBackup_";
private const int _defaultBufferSize = 4096; // From System.IO.File source code

View File

@@ -1,7 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<!-- Look at Directory.Build.props in root for common stuff as well -->
<Import Project="..\..\..\Common.Dotnet.CsWinRT.props" />
<Import Project="..\..\..\Common.Dotnet.AotCompatibility.props" />
<PropertyGroup>
<OutputType>Library</OutputType>

View File

@@ -27,111 +27,109 @@
WindowStartupLocation="Manual"
WindowStyle="None"
mc:Ignorable="d">
<Border x:Name="MainBorder" BorderBrush="{DynamicResource {x:Static SystemColors.ActiveBorderBrushKey}}">
<Grid x:Name="RootGrid" MouseDown="OnMouseDown">
<Grid x:Name="RootGrid" MouseDown="OnMouseDown">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="*" MaxHeight="{Binding Results.MaxHeight}" />
</Grid.RowDefinitions>
<Border
x:Name="SearchBoxBorder"
Grid.Row="0"
Padding="12,4,12,3">
<local:LauncherControl x:Name="SearchBox" />
</Border>
<!-- Have to use a Grid instead of a StackPanel for scrolling to work? -->
<Grid
x:Name="KeywordsOverviewGrid"
Grid.Row="1"
MaxHeight="{Binding Results.MaxHeight}"
Visibility="{Binding PluginsOverviewVisibility}">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="*" MaxHeight="{Binding Results.MaxHeight}" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<Border
x:Name="SearchBoxBorder"
Grid.Row="0"
Padding="12,4,12,3">
<local:LauncherControl x:Name="SearchBox" />
</Border>
<Rectangle
Height="1"
VerticalAlignment="Top"
Fill="{DynamicResource DividerStrokeColorDefaultBrush}" />
<TextBlock
Margin="22,12,0,4"
FontWeight="SemiBold"
Foreground="{DynamicResource TextFillColorSecondaryBrush}"
Style="{StaticResource CaptionTextBlockStyle}"
Text="{x:Static p:Resources.PluginKeywords}" />
<!-- Have to use a Grid instead of a StackPanel for scrolling to work? -->
<Grid
x:Name="KeywordsOverviewGrid"
<ListView
x:Name="pluginsHintsList"
Grid.Row="1"
MaxHeight="{Binding Results.MaxHeight}"
Visibility="{Binding PluginsOverviewVisibility}">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<Rectangle
Height="1"
VerticalAlignment="Top"
Fill="{DynamicResource DividerStrokeColorDefaultBrush}" />
<TextBlock
Margin="22,12,0,4"
FontWeight="SemiBold"
Foreground="{DynamicResource TextFillColorSecondaryBrush}"
Style="{StaticResource CaptionTextBlockStyle}"
Text="{x:Static p:Resources.PluginKeywords}" />
<ListView
x:Name="pluginsHintsList"
Grid.Row="1"
Background="Transparent"
BorderBrush="Transparent"
ItemContainerStyle="{StaticResource PluginsListViewItemStyle}"
ItemsSource="{Binding Plugins}"
PreviewMouseLeftButtonUp="PluginsHintsList_PreviewMouseLeftButtonUp"
ScrollViewer.HorizontalScrollBarVisibility="Disabled"
ScrollViewer.VerticalScrollBarVisibility="Auto"
SelectedItem="{Binding SelectedPlugin, Mode=TwoWay}"
SelectionMode="Single">
<ListView.ItemsPanel>
<ItemsPanelTemplate>
<VirtualizingStackPanel
Margin="16,0"
IsVirtualizing="{TemplateBinding VirtualizingPanel.IsVirtualizing}"
VirtualizationMode="{TemplateBinding VirtualizingPanel.VirtualizationMode}" />
</ItemsPanelTemplate>
</ListView.ItemsPanel>
<ListView.ItemTemplate>
<DataTemplate>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Border
Width="32"
Height="32"
Padding="2,0,2,0"
Background="{DynamicResource ControlFillColorDefaultBrush}"
BorderBrush="{DynamicResource CardStrokeColorDefaultBrush}"
BorderThickness="1"
CornerRadius="4"
ToolTipService.ToolTip="{Binding Metadata.ActionKeyword}">
<TextBlock
HorizontalAlignment="Center"
VerticalAlignment="Center"
FontWeight="SemiBold"
Foreground="{DynamicResource TextFillColorPrimaryBrush}"
Text="{Binding Metadata.ActionKeyword}"
TextAlignment="Left"
TextTrimming="WordEllipsis" />
</Border>
Background="Transparent"
BorderBrush="Transparent"
ItemContainerStyle="{StaticResource PluginsListViewItemStyle}"
ItemsSource="{Binding Plugins}"
PreviewMouseLeftButtonUp="PluginsHintsList_PreviewMouseLeftButtonUp"
ScrollViewer.HorizontalScrollBarVisibility="Disabled"
ScrollViewer.VerticalScrollBarVisibility="Auto"
SelectedItem="{Binding SelectedPlugin, Mode=TwoWay}"
SelectionMode="Single">
<ListView.ItemsPanel>
<ItemsPanelTemplate>
<VirtualizingStackPanel
Margin="16,0"
IsVirtualizing="{TemplateBinding VirtualizingPanel.IsVirtualizing}"
VirtualizationMode="{TemplateBinding VirtualizingPanel.VirtualizationMode}" />
</ItemsPanelTemplate>
</ListView.ItemsPanel>
<ListView.ItemTemplate>
<DataTemplate>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Border
Width="32"
Height="32"
Padding="2,0,2,0"
Background="{DynamicResource ControlFillColorDefaultBrush}"
BorderBrush="{DynamicResource CardStrokeColorDefaultBrush}"
BorderThickness="1"
CornerRadius="4"
ToolTipService.ToolTip="{Binding Metadata.ActionKeyword}">
<TextBlock
Grid.Column="1"
Margin="12,0,0,0"
HorizontalAlignment="Center"
VerticalAlignment="Center"
FontWeight="SemiBold"
Foreground="{DynamicResource TextFillColorPrimaryBrush}"
Text="{Binding Plugin.Description}"
TextTrimming="CharacterEllipsis"
TextWrapping="Wrap" />
</Grid>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
</Grid>
<local:ResultList
x:Name="ListBox"
Grid.Row="2"
VerticalAlignment="Stretch"
BorderBrush="{DynamicResource DividerStrokeColorDefaultBrush}"
BorderThickness="0,1,0,0"
PreviewMouseDown="ListBox_PreviewMouseDown"
Visibility="{Binding Results.Visibility}" />
Text="{Binding Metadata.ActionKeyword}"
TextAlignment="Left"
TextTrimming="WordEllipsis" />
</Border>
<TextBlock
Grid.Column="1"
Margin="12,0,0,0"
VerticalAlignment="Center"
Foreground="{DynamicResource TextFillColorPrimaryBrush}"
Text="{Binding Plugin.Description}"
TextTrimming="CharacterEllipsis"
TextWrapping="Wrap" />
</Grid>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
</Grid>
</Border>
<local:ResultList
x:Name="ListBox"
Grid.Row="2"
VerticalAlignment="Stretch"
BorderBrush="{DynamicResource DividerStrokeColorDefaultBrush}"
BorderThickness="0,1,0,0"
PreviewMouseDown="ListBox_PreviewMouseDown"
Visibility="{Binding Results.Visibility}" />
</Grid>
<Window.InputBindings>
<KeyBinding Key="Escape" Command="{Binding EscCommand}" />
<KeyBinding Key="Enter" Command="{Binding OpenResultWithKeyboardCommand}" />

View File

@@ -200,11 +200,6 @@ namespace PowerLauncher
DWM_WINDOW_CORNER_PREFERENCE preference = DWM_WINDOW_CORNER_PREFERENCE.DWMWCP_ROUND;
DwmSetWindowAttribute(hWnd, attribute, ref preference, sizeof(uint));
}
else
{
// On Windows10 ResizeMode="NoResize" removes the border so we add a new one.
MainBorder.BorderThickness = new System.Windows.Thickness(0.5);
}
}
private void OnLoaded(object sender, RoutedEventArgs e)

View File

@@ -238,10 +238,7 @@ namespace PowerLauncher.Plugin
}
catch (Exception e)
{
// After updating to .NET 9, calling MethodBase.GetCurrentMethod() started crashing when trying
// to log methods called from within the OneNote plugin, so we've replaced this instance with typeof(PluginManager).
// This should be revised in the future.
Log.Exception($"Exception for plugin <{pair.Metadata.Name}> when query <{query}>", e, typeof(PluginManager));
Log.Exception($"Exception for plugin <{pair.Metadata.Name}> when query <{query}>", e, MethodBase.GetCurrentMethod().DeclaringType);
return new List<Result>();
}

View File

@@ -1,8 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">
<!-- Look at Directory.Build.props in root for common stuff as well -->
<Import Project="..\..\..\Common.Dotnet.CsWinRT.props" />
<Import Project="..\..\..\Common.SelfContained.props" />
<Import Project="..\..\..\Common.Dotnet.AotCompatibility.props" />
<PropertyGroup>
<ImplicitUsings>enable</ImplicitUsings>

View File

@@ -20,7 +20,7 @@ namespace Microsoft.PowerToys.PreviewHandler.Markdown
/// <summary>
/// Win Form Implementation for Markdown Preview Handler.
/// </summary>
public partial class MarkdownPreviewHandlerControl : FormHandlerControl
public class MarkdownPreviewHandlerControl : FormHandlerControl
{
private static readonly IFileSystem FileSystem = new FileSystem();
private static readonly IPath Path = FileSystem.Path;
@@ -66,7 +66,7 @@ namespace Microsoft.PowerToys.PreviewHandler.Markdown
{
get
{
string codeBase = AppContext.BaseDirectory;
string codeBase = Assembly.GetExecutingAssembly().Location;
UriBuilder uri = new UriBuilder(codeBase);
string path = Uri.UnescapeDataString(uri.Path);
return Path.GetDirectoryName(path);

View File

@@ -281,62 +281,60 @@
IsPrimaryButtonEnabled="False"
IsSecondaryButtonEnabled="True"
PrimaryButtonStyle="{StaticResource AccentButtonStyle}">
<ScrollViewer VerticalScrollBarVisibility="Auto">
<Grid RowSpacing="24">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Image Margin="-24,-24,-24,0" Source="{ThemeResource DialogHeaderImage}" />
<TextBlock
Grid.Row="1"
Foreground="{ThemeResource TextFillColorSecondaryBrush}"
TextWrapping="Wrap">
<Run x:Uid="AdvancedPaste_EnableAIDialog_Description" />
<Hyperlink NavigateUri="https://openai.com/policies/terms-of-use" TabIndex="3">
<Run x:Uid="TermsLink" />
</Hyperlink>
<Run x:Uid="AIFooterSeparator" Foreground="{ThemeResource TextFillColorSecondaryBrush}">|</Run>
<Hyperlink NavigateUri="https://openai.com/policies/privacy-policy" TabIndex="3">
<Run x:Uid="PrivacyLink" />
<Grid RowSpacing="24">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Image Margin="-24,-24,-24,0" Source="{ThemeResource DialogHeaderImage}" />
<TextBlock
Grid.Row="1"
Foreground="{ThemeResource TextFillColorSecondaryBrush}"
TextWrapping="Wrap">
<Run x:Uid="AdvancedPaste_EnableAIDialog_Description" />
<Hyperlink NavigateUri="https://openai.com/policies/terms-of-use" TabIndex="3">
<Run x:Uid="TermsLink" />
</Hyperlink>
<Run x:Uid="AIFooterSeparator" Foreground="{ThemeResource TextFillColorSecondaryBrush}">|</Run>
<Hyperlink NavigateUri="https://openai.com/policies/privacy-policy" TabIndex="3">
<Run x:Uid="PrivacyLink" />
</Hyperlink>
</TextBlock>
<StackPanel Grid.Row="2" Orientation="Vertical">
<TextBlock x:Uid="AdvancedPaste_EnableAIDialog_ConfigureOpenAIKey" FontWeight="SemiBold" />
<TextBlock Grid.Row="2" TextWrapping="Wrap">
<Run x:Uid="AdvancedPaste_EnableAIDialog_LoginIntoText" />
<Hyperlink NavigateUri="https://platform.openai.com/api-keys">
<Run x:Uid="AdvancedPaste_EnableAIDialog_OpenAIApiKeysOverviewText" />
</Hyperlink>
<LineBreak />
<Run x:Uid="AdvancedPaste_EnableAIDialog_CreateNewKeyText" />
<LineBreak />
<Run x:Uid="AdvancedPaste_EnableAIDialog_NoteAICreditsText" />
</TextBlock>
</StackPanel>
<StackPanel Grid.Row="2" Orientation="Vertical">
<TextBlock x:Uid="AdvancedPaste_EnableAIDialog_ConfigureOpenAIKey" FontWeight="SemiBold" />
<TextBlock Grid.Row="2" TextWrapping="Wrap">
<Run x:Uid="AdvancedPaste_EnableAIDialog_LoginIntoText" />
<Hyperlink NavigateUri="https://platform.openai.com/api-keys">
<Run x:Uid="AdvancedPaste_EnableAIDialog_OpenAIApiKeysOverviewText" />
</Hyperlink>
<LineBreak />
<Run x:Uid="AdvancedPaste_EnableAIDialog_CreateNewKeyText" />
<LineBreak />
<Run x:Uid="AdvancedPaste_EnableAIDialog_NoteAICreditsText" />
</TextBlock>
</StackPanel>
<Grid Grid.Row="3" ColumnSpacing="8">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<TextBlock
x:Uid="AdvancedPaste_EnableAIDialogOpenAIApiKey"
VerticalAlignment="Center"
TextWrapping="Wrap" />
<TextBox
x:Name="AdvancedPaste_EnableAIDialogOpenAIApiKey"
Grid.Column="1"
MinWidth="248"
HorizontalAlignment="Stretch"
HorizontalContentAlignment="Stretch"
TextChanged="AdvancedPaste_EnableAIDialogOpenAIApiKey_TextChanged" />
</Grid>
<Grid Grid.Row="3" ColumnSpacing="8">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<TextBlock
x:Uid="AdvancedPaste_EnableAIDialogOpenAIApiKey"
VerticalAlignment="Center"
TextWrapping="Wrap" />
<TextBox
x:Name="AdvancedPaste_EnableAIDialogOpenAIApiKey"
Grid.Column="1"
MinWidth="248"
HorizontalAlignment="Stretch"
HorizontalContentAlignment="Stretch"
TextChanged="AdvancedPaste_EnableAIDialogOpenAIApiKey_TextChanged" />
</Grid>
</ScrollViewer>
</Grid>
</ContentDialog>
<ContentDialog
x:Name="CustomActionDialog"