From 3f3f3440ace67dee69e5b601ed18d36679682ccf Mon Sep 17 00:00:00 2001 From: Owen Smith Date: Fri, 18 Nov 2022 10:06:10 +0000 Subject: [PATCH] Pass SignMode to MSBuild Allows overriding of SignMode to "Off" to prevent signing binaries with the PFX file. This is useful if wrapper builds sign binaries with alternative signatures or when signing is not required. Signed-off-by: Owen Smith Small whitespace fix. Signed-off-by: Paul Durrant --- build.ps1 | 10 +++++++--- msbuild.ps1 | 5 ++++- vs2019/package/package.vcxproj | 14 ++++++++++---- vs2022/package/package.vcxproj | 14 ++++++++++---- 4 files changed, 31 insertions(+), 12 deletions(-) diff --git a/build.ps1 b/build.ps1 index 5689107..27efa38 100644 --- a/build.ps1 +++ b/build.ps1 @@ -6,6 +6,7 @@ param( [Parameter(Mandatory = $true)] [string]$Type, [string]$Arch, + [string]$SignMode = "TestSign", [switch]$CodeQL, [switch]$Sdv ) @@ -28,7 +29,8 @@ Function Build { SolutionDir = $solutiondir[$visualstudioversion]; ConfigurationBase = $configurationbase[$visualstudioversion]; Arch = $Arch; - Type = $Type + Type = $Type; + SignMode = $SignMode } & ".\msbuild.ps1" @params if ($LASTEXITCODE -ne 0) { @@ -47,7 +49,8 @@ Function SdvBuild { SolutionDir = $solutiondir[$visualstudioversion]; ConfigurationBase = $configurationbase[$visualstudioversion]; Arch = $arch; - Type = "sdv" + Type = "sdv"; + SignMode = $SignMode } & ".\msbuild.ps1" @params } @@ -62,7 +65,8 @@ function CodeQLBuild { SolutionDir = $solutiondir[$visualstudioversion]; ConfigurationBase = $configurationbase[$visualstudioversion]; Arch = $arch; - Type = "codeql" + Type = "codeql"; + SignMode = $SignMode } & ".\msbuild.ps1" @params } diff --git a/msbuild.ps1 b/msbuild.ps1 index 0983083..d46ee48 100644 --- a/msbuild.ps1 +++ b/msbuild.ps1 @@ -7,7 +7,8 @@ param( [Parameter(Mandatory = $true)] [string]$Arch, [Parameter(Mandatory = $true)] - [string]$Type + [string]$Type, + [string]$SignMode = "TestSign" ) Function Run-MSBuild { @@ -25,6 +26,7 @@ Function Run-MSBuild { $c += " /m:4" $c += [string]::Format(" /p:Configuration=""{0}""", $Configuration) $c += [string]::Format(" /p:Platform=""{0}""", $Platform) + $c += [string]::Format(" /p:SignMode=""{0}""", $SignMode) $c += [string]::Format(" /t:""{0}"" ", $Target) if ($Inputs) { $c += [string]::Format(" /p:Inputs=""{0}"" ", $Inputs) @@ -99,6 +101,7 @@ Function Run-CodeQL { $a += " /t:Build" $a += [string]::Format(" /p:Configuration=""{0}""", $Configuration) $a += [string]::Format(" /p:Platform=""{0}""", $Platform) + $a += [string]::Format(" /p:SignMode=""{0}""", $SignMode) $a += " " $a += Join-Path $projpath $project $a | Set-Content $bat diff --git a/vs2019/package/package.vcxproj b/vs2019/package/package.vcxproj index 6210729..612938f 100644 --- a/vs2019/package/package.vcxproj +++ b/vs2019/package/package.vcxproj @@ -61,10 +61,16 @@ - + + SourceFiles="@(PackageFiles)" + DestinationFiles="@(PackageFiles->'$(ArchiveDir)\%(FileName)%(Extension)')" + /> + + + diff --git a/vs2022/package/package.vcxproj b/vs2022/package/package.vcxproj index 6210729..9f836b7 100644 --- a/vs2022/package/package.vcxproj +++ b/vs2022/package/package.vcxproj @@ -61,10 +61,16 @@ - + + SourceFiles="@(PackageFiles)" + DestinationFiles="@(PackageFiles->'$(ArchiveDir)\%(FileName)%(Extension)')" + /> + + + -- 2.39.5