Skip to content

Commit

Permalink
Enable Integrity check (#46)
Browse files Browse the repository at this point in the history
IB-1448

Signed-off-by: Raul Metsma <[email protected]>
  • Loading branch information
metsma authored Sep 4, 2020
1 parent 5767c40 commit b0fc36f
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,9 @@ else()
set_target_properties( ${PROGNAME} PROPERTIES
AUTOMOC TRUE
COMPILE_DEFINITIONS "UNICODE;CONFIG_URL=\"${CONFIG_URL}\";COMMON_STATIC;NO_CACHE"
COMPILE_FLAGS "/Zc:wchar_t-" # required for task scheduler BSTR type
COMPILE_OPTIONS "/Zc:wchar_t-;/guard:cf" # required for task scheduler BSTR type
LINK_OPTIONS "/guard:cf"
INTERPROCEDURAL_OPTIMIZATION YES
)
target_link_libraries( ${PROGNAME} Qt5::Widgets Qt5::Network qtsingleapplication OpenSSL::Crypto
msi Mstask Userenv wintrust Crypt32 taskschd comsupp ws2_32 Setupapi winscard Wtsapi32
Expand Down Expand Up @@ -153,10 +155,14 @@ else()
-dWixUIBannerBmp=${CMAKE_SOURCE_DIR}/cmake/modules/banner.bmp
)
if(SIGNCERT)
if(CROSSSIGNCERT)
target_link_options(${PROGNAME} PRIVATE "/INTEGRITYCHECK")
endif()
list(APPEND SIGNCMD signtool.exe sign /a /v /s MY /n "${SIGNCERT}" /fd SHA256
/du http://installer.id.ee /tr http://sha256timestamp.ws.symantec.com/sha256/timestamp /td SHA256)
add_custom_command(TARGET ${PROGNAME} POST_BUILD
COMMAND ${SIGNCMD} $<TARGET_FILE:${PROGNAME}>
COMMAND ${SIGNCMD} "$<$<BOOL:${CROSSSIGNCERT}>:/ph;/ac;${CROSSSIGNCERT}>" $<TARGET_FILE:${PROGNAME}>
COMMAND_EXPAND_LISTS
)
add_custom_command(TARGET installer POST_BUILD
COMMAND ${SIGNCMD} "${MSI_FILE}.msi"
Expand Down

0 comments on commit b0fc36f

Please sign in to comment.