CPACK_INSTALL_SCRIPTS executed without the files being present

I’m trying to make a .msi installation package using CMake, CPack, and Wix. The issue is I’m trying to sign the executables and DLLs that are going to be installed.


Inside the signcert.cmake, I have:

    COMMAND cmd /c signtool sign /debug /v /sm /fd sha256 /tr /td sha256 /sha1 ${THUMBPRINT} "${CMAKE_INSTALL_PREFIX}applications/bin/*"

However, this does not execute properly. To debug the issue, I put the following lines inside signcert.cmake


When the program exits, I expect to see files inside ${CMAKE_INSTALL_PREFIX}applications/bin/, however no files were observed and the folder was not created. the message also indicated that ${MY_FILES_TO_SIGN} was empty (no .exe file was found in that folder).

If I comment out message(FATA_ERROR …), files inside the directory were observed, does this mean that CPACK_INSTALL_SCRIPTS actually called the script before the .exe and .dll were locally installed?

This seems pretty close to the issue described in #19077. The capabilities you need look like they have been provided by merge request 4846, which is part of CMake 3.19. You should be able to test this out with the 3.19 release candidates, which are already available. The docs are also being clarified in merge request 5454.

1 Like