Skip to content

Commit

Permalink
build: make signing certificate path configurable at build time
Browse files Browse the repository at this point in the history
Also change the message about no certificate being found from a warning to a
message. The warning annoys developers who don't have a certificate, and
I make sure to test if updates work properly before every release.
  • Loading branch information
brliron committed Jul 8, 2024
1 parent 727c6e0 commit 8b831e9
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions Base.props
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@
<PropertyGroup>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup>
<SigningCertPath>$(SolutionDir)cert.pfx</SigningCertPath>
</PropertyGroup>
<ItemDefinitionGroup>
<ClCompile>
<AdditionalIncludeDirectories>$(SolutionDir)libs\external_deps\include\;$(ProjectDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
Expand All @@ -60,8 +63,8 @@
<BuildDependsOn>$(BuildDependsOn);SignBuild</BuildDependsOn>
</PropertyGroup>
<Target Name="SignBuild" Condition="'$(ConfigurationType)'!='StaticLibrary' And '$(SkipSign)'!='true'">
<Exec Condition="Exists('$(SolutionDir)cert.pfx')" Command='signtool sign /v /f "$(SolutionDir)cert.pfx" /d "$(ProjectTitle)" /du "$(ProjectURL)" "$(TargetPath)"' />
<Warning Condition="!Exists('$(SolutionDir)cert.pfx')" Text="$(SolutionDir)cert.pfx not found. Binaries won't be digitally signed, and thcrap won't be able to automatically update itself.%0APlease see README.md for instructions on how to generate this file." />
<Exec Condition="Exists('$(SigningCertPath)')" Command='signtool sign /v /f "$(SigningCertPath)" /d "$(ProjectTitle)" /du "$(ProjectURL)" "$(TargetPath)"' />
<Message Condition="!Exists('$(SigningCertPath)')" Importance="high" Text="$(SigningCertPath) not found. Binaries won't be digitally signed, and thcrap won't be able to automatically update itself.%0APlease see README.md for instructions on how to generate this file." />
</Target>
<PropertyGroup>
<GASPath>$(SolutionDir)libs\external_deps\</GASPath>
Expand Down

0 comments on commit 8b831e9

Please sign in to comment.