[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [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 <owen.smith@xxxxxxxxxx> --- build.ps1 | 10 +++++++--- msbuild.ps1 | 5 ++++- vs2019/package/package.vcxproj | 12 +++++++++--- vs2022/package/package.vcxproj | 12 +++++++++--- 4 files changed, 29 insertions(+), 10 deletions(-) diff --git a/build.ps1 b/build.ps1 index 88d57a6..08b9715 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 846abd2..1ec8508 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 00af1a3..f1e0919 100644 --- a/vs2019/package/package.vcxproj +++ b/vs2019/package/package.vcxproj @@ -70,10 +70,16 @@ <ItemGroup> <PackageFiles Include="$(OutDir)\$(ProjectName)\*" /> </ItemGroup> - <Target Name="Archive" AfterTargets="TestSign"> + <Target Name="ArchiveUnsigned" AfterTargets="Inf2Cat" Condition="('$(SignMode)' != 'TestSign') AND ('$(SignMode)' != 'ProductionSign')"> <Copy - SourceFiles="@(PackageFiles)" - DestinationFiles="@(PackageFiles->'$(ArchiveDir)\%(FileName)%(Extension)')" + SourceFiles="@(PackageFiles)" + DestinationFiles="@(PackageFiles->'$(ArchiveDir)\%(FileName)%(Extension)')" + /> + </Target> + <Target Name="ArchiveSigned" AfterTargets="TestSign;ProductionSign" Condition="('$(SignMode)' == 'TestSign' or '$(SignMode)' == 'ProductionSign')"> + <Copy + SourceFiles="@(PackageFiles)" + DestinationFiles="@(PackageFiles->'$(ArchiveDir)\%(FileName)%(Extension)')" /> </Target> </Project> diff --git a/vs2022/package/package.vcxproj b/vs2022/package/package.vcxproj index 00af1a3..f1e0919 100644 --- a/vs2022/package/package.vcxproj +++ b/vs2022/package/package.vcxproj @@ -70,10 +70,16 @@ <ItemGroup> <PackageFiles Include="$(OutDir)\$(ProjectName)\*" /> </ItemGroup> - <Target Name="Archive" AfterTargets="TestSign"> + <Target Name="ArchiveUnsigned" AfterTargets="Inf2Cat" Condition="('$(SignMode)' != 'TestSign') AND ('$(SignMode)' != 'ProductionSign')"> <Copy - SourceFiles="@(PackageFiles)" - DestinationFiles="@(PackageFiles->'$(ArchiveDir)\%(FileName)%(Extension)')" + SourceFiles="@(PackageFiles)" + DestinationFiles="@(PackageFiles->'$(ArchiveDir)\%(FileName)%(Extension)')" + /> + </Target> + <Target Name="ArchiveSigned" AfterTargets="TestSign;ProductionSign" Condition="('$(SignMode)' == 'TestSign' or '$(SignMode)' == 'ProductionSign')"> + <Copy + SourceFiles="@(PackageFiles)" + DestinationFiles="@(PackageFiles->'$(ArchiveDir)\%(FileName)%(Extension)')" /> </Target> </Project> -- 2.32.0.windows.1
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |