diff --git a/.github/actions/spell-check/expect.txt b/.github/actions/spell-check/expect.txt index 91e6888bbe..8104477280 100644 --- a/.github/actions/spell-check/expect.txt +++ b/.github/actions/spell-check/expect.txt @@ -108,6 +108,7 @@ Attribs attrs aumid Aut +Authenticode AUTHN autogenerated autogenerates diff --git a/.pipelines/ESRPSigning_core.json b/.pipelines/ESRPSigning_core.json index 62e2659787..8287bc864f 100644 --- a/.pipelines/ESRPSigning_core.json +++ b/.pipelines/ESRPSigning_core.json @@ -7,7 +7,6 @@ "*.resources.dll", "PowerToysSetupCustomActions.dll", - "PowerToys.ActionRunner.exe", "PowerToys.Update.exe", @@ -24,6 +23,9 @@ "PowerToys.Common.UI.dll", "PowerToys.Settings.UI.Lib.dll", + "modules\\AlwaysOnTop\\PowerToys.AlwaysOnTop.exe", + "modules\\AlwaysOnTop\\PowerToys.AlwaysOnTopModuleInterface.dll", + "modules\\ColorPicker\\ColorPicker.dll", "modules\\ColorPicker\\ColorPickerUI.dll", "modules\\ColorPicker\\ColorPickerUI.exe", @@ -32,9 +34,6 @@ "modules\\ColorPicker\\PowerToys.ColorPickerUI.dll", "modules\\ColorPicker\\PowerToys.ColorPickerUI.exe", - "modules\\AlwaysOnTop\\PowerToys.AlwaysOnTop.exe", - "modules\\AlwaysOnTop\\PowerToys.AlwaysOnTopModuleInterface.dll", - "modules\\Awake\\PowerToys.AwakeModuleInterface.dll", "modules\\Awake\\PowerToys.Awake.exe", "modules\\Awake\\PowerToys.Awake.dll", diff --git a/.pipelines/release.yml b/.pipelines/release.yml index 878d26773e..693c309bf3 100644 --- a/.pipelines/release.yml +++ b/.pipelines/release.yml @@ -217,6 +217,20 @@ jobs: clean: true maximumCpuCount: true + - task: CmdLine@2 + displayName: 'Extracting MSI to verify contents' + inputs: + script: | + .\installer\packages\WiX.3.11.2\tools\dark.exe -x $(build.sourcesdirectory)\extractedMsi installer\PowerToysSetup\$(BuildPlatform)\$(BuildConfiguration)\PowerToysSetup-${{ parameters.versionNumber }}-$(BuildPlatform).msi + dir $(build.sourcesdirectory)\extractedMsi + +# Did we sign all files + - task: PowerShell@1 + displayName: Verifying entire build is signed and version set + inputs: + scriptName: .pipelines/versionAndSignCheck.ps1 + arguments: -targetDir '$(build.sourcesdirectory)\extractedMsi\File' + - task: SFP.build-tasks.custom-build-task-1.EsrpCodeSigning@1 displayName: Sign MSI inputs: diff --git a/.pipelines/versionAndSignCheck.ps1 b/.pipelines/versionAndSignCheck.ps1 new file mode 100644 index 0000000000..508f11af55 --- /dev/null +++ b/.pipelines/versionAndSignCheck.ps1 @@ -0,0 +1,53 @@ +[CmdletBinding()] +# todo: send in arch / conf, could send in actual path +Param( + [Parameter(Mandatory=$True,Position=1)] + [AllowEmptyString()] + [string]$targetDir = $PSScriptRoot + '/../extractedMsi/File' +) + +$DirPath = $targetDir; #this file is in pipeline, we need root. +$items = Get-ChildItem -Path $DirPath -File -Include *.exe,*.dll -Recurse -Force -ErrorAction SilentlyContinue +$totalFailure = 0; + +Write-Host $DirPath; + +if(-not (Test-Path $DirPath)) +{ + Write-Host "Folder does not exist!" +} + +Write-Host "Total items: " $items.Count + +if($items.Count -eq 0) +{ + # no items means something bad happened. We should fail ASAP + exit 1; +} + +$items | ForEach-Object { + if($_.VersionInfo.FileVersion -eq "1.0.0.0" ) + { + if(-not $_.Name.EndsWith("Microsoft.Search.Interop.dll")) + { + Write-Host "Version not set: " + $_.FullName + $totalFailure++; + } + } +} + +$items | ForEach-Object { + $auth = Get-AuthenticodeSignature $_.FullName + if($auth.SignerCertificate -eq $null) + { + Write-Host "Not Signed: " + $_.FullName + $totalFailure++; + } +} + +if($totalFailure -gt 0) +{ + exit 1 +} + +exit 0 diff --git a/src/modules/colorPicker/UnitTest-ColorPickerUI/UnitTest-ColorPickerUI.csproj b/src/modules/colorPicker/UnitTest-ColorPickerUI/UnitTest-ColorPickerUI.csproj index 221149baef..3526efba07 100644 --- a/src/modules/colorPicker/UnitTest-ColorPickerUI/UnitTest-ColorPickerUI.csproj +++ b/src/modules/colorPicker/UnitTest-ColorPickerUI/UnitTest-ColorPickerUI.csproj @@ -1,5 +1,6 @@  - + + netcoreapp3.1 {090CD7B7-3B0C-4D1D-BC98-83EB5D799BC1} @@ -11,6 +12,7 @@ x64 x64 true + $(Version).0 diff --git a/src/settings-ui/Settings.UI.UnitTests/Settings.UI.UnitTests.csproj b/src/settings-ui/Settings.UI.UnitTests/Settings.UI.UnitTests.csproj index a1927f6066..7471707675 100644 --- a/src/settings-ui/Settings.UI.UnitTests/Settings.UI.UnitTests.csproj +++ b/src/settings-ui/Settings.UI.UnitTests/Settings.UI.UnitTests.csproj @@ -1,9 +1,10 @@  - + netcoreapp3.1 false x64 + $(Version).0 true