Skip to content

Commit ac99885

Browse files
committed
Improving post build to only sign once
1 parent 185896a commit ac99885

File tree

3 files changed

+21
-6
lines changed

3 files changed

+21
-6
lines changed

Robot/Robot.csproj

+7-2
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,12 @@
243243
SET SignToolPath2="C:\Program Files (x86)\Microsoft SDKs\Windows\v7.1A\Bin\signtool.exe"
244244
SET CertPath=C:\MouseRobot.pfx
245245

246-
IF EXIST %25CertPath%25 IF EXIST %25SignToolPath%25 %25SignToolPath%25 sign /fd SHA512 /a /f %25CertPath%25 /p test "$(ProjectDir)bin/$(ConfigurationName)/$(TargetFileName)"
247-
IF EXIST %25CertPath%25 IF EXIST %25SignToolPath2%25 %25SignToolPath2%25 sign /fd SHA512 /a /f %25CertPath%25 /p test "$(ProjectDir)bin/$(ConfigurationName)/$(TargetFileName)"</PostBuildEvent>
246+
IF EXIST %25CertPath%25 (
247+
IF EXIST %25SignToolPath%25 (
248+
%25SignToolPath%25 sign /fd SHA512 /a /f %25CertPath%25 /p %25CertPassword%25 "$(ProjectDir)bin/$(ConfigurationName)/$(TargetFileName)"
249+
) ELSE IF EXIST %25SignToolPath2%25 (
250+
%25SignToolPath2%25 sign /fd SHA512 /a /f %25CertPath%25 /p %25CertPassword%25 "$(ProjectDir)bin/$(ConfigurationName)/$(TargetFileName)"
251+
)
252+
)</PostBuildEvent>
248253
</PropertyGroup>
249254
</Project>

RobotEditor/RobotEditor.csproj

+7-2
Original file line numberDiff line numberDiff line change
@@ -490,8 +490,13 @@
490490
SET SignToolPath2="C:\Program Files (x86)\Microsoft SDKs\Windows\v7.1A\Bin\signtool.exe"
491491
SET CertPath=C:\MouseRobot.pfx
492492

493-
IF EXIST %25CertPath%25 IF EXIST %25SignToolPath%25 %25SignToolPath%25 sign /fd SHA512 /a /f %25CertPath%25 /p test "$(ProjectDir)bin/$(ConfigurationName)/$(TargetFileName)"
494-
IF EXIST %25CertPath%25 IF EXIST %25SignToolPath2%25 %25SignToolPath2%25 sign /fd SHA512 /a /f %25CertPath%25 /p test "$(ProjectDir)bin/$(ConfigurationName)/$(TargetFileName)"</PostBuildEvent>
493+
IF EXIST %25CertPath%25 (
494+
IF EXIST %25SignToolPath%25 (
495+
%25SignToolPath%25 sign /fd SHA512 /a /f %25CertPath%25 /p %25CertPassword%25 "$(ProjectDir)bin/$(ConfigurationName)/$(TargetFileName)"
496+
) ELSE IF EXIST %25SignToolPath2%25 (
497+
%25SignToolPath2%25 sign /fd SHA512 /a /f %25CertPath%25 /p %25CertPassword%25 "$(ProjectDir)bin/$(ConfigurationName)/$(TargetFileName)"
498+
)
499+
)</PostBuildEvent>
495500
</PropertyGroup>
496501
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
497502
<PropertyGroup>

RobotRuntime/RobotRuntime.csproj

+7-2
Original file line numberDiff line numberDiff line change
@@ -334,8 +334,13 @@
334334
SET SignToolPath2="C:\Program Files (x86)\Microsoft SDKs\Windows\v7.1A\Bin\signtool.exe"
335335
SET CertPath=C:\MouseRobot.pfx
336336

337-
IF EXIST %25CertPath%25 IF EXIST %25SignToolPath%25 %25SignToolPath%25 sign /fd SHA512 /a /f %25CertPath%25 /p test "$(ProjectDir)bin/$(ConfigurationName)/$(TargetFileName)"
338-
IF EXIST %25CertPath%25 IF EXIST %25SignToolPath2%25 %25SignToolPath2%25 sign /fd SHA512 /a /f %25CertPath%25 /p test "$(ProjectDir)bin/$(ConfigurationName)/$(TargetFileName)"</PostBuildEvent>
337+
IF EXIST %25CertPath%25 (
338+
IF EXIST %25SignToolPath%25 (
339+
%25SignToolPath%25 sign /fd SHA512 /a /f %25CertPath%25 /p %25CertPassword%25 "$(ProjectDir)bin/$(ConfigurationName)/$(TargetFileName)"
340+
) ELSE IF EXIST %25SignToolPath2%25 (
341+
%25SignToolPath2%25 sign /fd SHA512 /a /f %25CertPath%25 /p %25CertPassword%25 "$(ProjectDir)bin/$(ConfigurationName)/$(TargetFileName)"
342+
)
343+
)</PostBuildEvent>
339344
</PropertyGroup>
340345
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
341346
Other similar extension points exist, see Microsoft.Common.targets.

0 commit comments

Comments
 (0)