# CPACK\_INSTALL\_SCRIPTS executed without the files being present

**URL:** https://discourse.cmake.org/t/cpack-install-scripts-executed-without-the-files-being-present/1822
**Category:** Development
**Created:** [September 11, 2020, 6:27pm UTC](https://discourse.cmake.org/t/cpack-install-scripts-executed-without-the-files-being-present/1822 "2020-09-11T18:27:06Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![mistaZ](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/m/73ab20/32.png) [@mistaZ](https://discourse.cmake.org/u/mistaZ)
#### Post date: [September 11, 2020, 6:27pm UTC](https://discourse.cmake.org/t/cpack-install-scripts-executed-without-the-files-being-present/1822/1 "2020-09-11T18:27:06Z")

</div>

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.

`SET( CPACK_INSTALL_SCRIPTS "${CMAKE_CURRENT_LIST_DIR}/signcert.cmake")`

Inside the signcert.cmake, I have:

```
execute_process(
    COMMAND cmd /c signtool sign /debug /v /sm /fd sha256 /tr http://timestamp.comodoca.com /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

```
file(GLOB MY_FILES_TO_SIGN
     LIST_DIRECTORIES false
    ${CMAKE_INSTALL_PREFIX}applications/bin/*.exe)
message(FATAL_ERROR ${MY_FILES_TO_SIGN} ${CMAKE_INSTALL_PREFIX}applications/bin/)

```

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?

---

<div class="post-metadata">

### Author: ![craig.scott](https://discourse.cmake.org/user_avatar/discourse.cmake.org/craig.scott/32/20_2.png) [@craig.scott](https://discourse.cmake.org/u/craig.scott)
#### Post date: [November 2, 2020, 3:55am UTC](https://discourse.cmake.org/t/cpack-install-scripts-executed-without-the-files-being-present/1822/2 "2020-11-02T03:55:39Z")

</div>

This seems pretty close to the issue described in [#19077](https://gitlab.kitware.com/cmake/cmake/-/issues/19077). The capabilities you need look like they have been provided by [merge request 4846](https://gitlab.kitware.com/cmake/cmake/-/merge_requests/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](https://gitlab.kitware.com/cmake/cmake/-/merge_requests/5454).
