-
-
Notifications
You must be signed in to change notification settings - Fork 55
/
Directory.Build.targets
28 lines (26 loc) · 2.18 KB
/
Directory.Build.targets
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
<Project>
<Target Name="SignAssemblies"
Condition="Exists($(CertificatePath)) AND '$(CertificatePassword)'!=''"
BeforeTargets="CopyFilesToOutputDirectory"
DependsOnTargets="ComputeIntermediateSatelliteAssemblies">
<PropertyGroup>
<SignToolPath>$(ProgramFiles)\Windows Kits\10\bin\x64\signtool.exe</SignToolPath>
<SignToolPath Condition="!Exists($(SignToolPath))">$(ProgramFiles)\Windows Kits\10\bin\10.0.22000.0\x64\signtool.exe</SignToolPath>
<SignToolPath Condition="!Exists($(SignToolPath))">$(ProgramFiles)\Windows Kits\10\bin\10.0.19041.0\x64\signtool.exe</SignToolPath>
<SignToolPath Condition="!Exists($(SignToolPath))">$(ProgramFiles)\Windows Kits\10\bin\10.0.18362.0\x64\signtool.exe</SignToolPath>
<SignToolPath Condition="!Exists($(SignToolPath))">$(ProgramFiles)\Windows Kits\10\bin\10.0.17134.0\x64\signtool.exe</SignToolPath>
<SignToolPath Condition="!Exists($(SignToolPath))">$(WindowsSDK80Path)bin\x64\signtool.exe</SignToolPath>
<SignToolPath Condition="!Exists($(SignToolPath))">signtool.exe</SignToolPath> <!-- fallback to use PATH environment -->
</PropertyGroup>
<ItemGroup>
<FilesToSign Include="@(IntermediateAssembly)" />
<FilesToSign Include="@(IntermediateRefAssembly)" />
<FilesToSign Include="@(IntermediateSatelliteAssembliesWithTargetPath)" />
<FilesToSignFiltered Include="@(FilesToSign)" Condition="Exists(%(FilesToSign.Identity))" />
</ItemGroup>
<Exec Condition="'@(FilesToSignFiltered->Count())' > 0" Command=""$(SignToolPath)" sign /v /fd SHA1 /f "$(CertificatePath)" /p "$(CertificatePassword)" /tr http://timestamp.digicert.com /td SHA1 "%(FilesToSignFiltered.Identity)""
WorkingDirectory="$(ProjectDir)" EchoOff="true" />
<Exec Condition="'@(FilesToSignFiltered->Count())' > 0" Command=""$(SignToolPath)" sign /v /as /d "Authorization Summary" /fd SHA256 /f "$(CertificatePath)" /p "$(CertificatePassword)" /tr http://timestamp.digicert.com /td SHA256 "%(FilesToSignFiltered.Identity)""
WorkingDirectory="$(ProjectDir)" EchoOff="true" />
</Target>
</Project>