[CMake] How to codesign .msi from WIX/CPack?

Eric Wing ewmailing at gmail.com
Tue Sep 6 19:52:12 EDT 2016


I'm finally trying the WIX/CPack MSI generator. Pretty nice!

One thing I need to do is instruct the build process to codesign via
signtool.exe. I've managed to figure out how to codesign my .exe via a
POST_BUILD add_custom_command step.

But now I would like to make sure the .msi that gets generated also
gets code signed. But I can't figure out how to do it.


I seem to need at least two things:

1) A post-build hook into the PACKAGE target (add_custom_command
doesn't seem to do anything when I try to refer to this target).

2) The name and location of the .msi that CPack/WIX generated so I can
refer to it with the signtool command.


Any advice?

Thanks,
Eric


More information about the CMake mailing list