[CMake] Setting permissions with CPack/WiX installer
Cook, Steven (G&I)
Steven.Cook at riotinto.com
Thu Apr 4 23:25:48 EDT 2019
Hi all,
I would like to set the permissions on some files and directories in my WiX installer. It looks like the CPACK_WIX_ACL property should be suitable, but I can't get it to work. There are examples of its usage in this project:
https://github.com/ngladitz/cmake-wix-testsuite/tree/master/properties
Typically something like this:
set_property(INSTALL
empty_directory_with_property
non_empty_directory_with_property
PROPERTY CPACK_WIX_ACL "Everyone=GenericRead,GenericWrite,CreateFile"
)
but this example doesn't work for me with cmake 3.14.0. None of the .wxs files that are produced contain the expected Permission property. After adding some debugging to cmake, I found that cmCPackWIXGenerator::AddDirectoryAndFileDefinitions calls GetInstalledFile, which always returns NULL. This prevents the ACL from being applied.
As an alternative, I've tried to use CPACK_WIX_PATCH_FILE to specify the Permission property for the relevant fragments, but the patch does not get applied to the fragments where directories are created. In any case, I think CPACK_WIX_ACL would be preferable if I could get it to work.
Can anyone provide a minimal working example that uses CPACK_WIX_ACL?
Thanks
Steve
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://cmake.org/pipermail/cmake/attachments/20190405/db9ee290/attachment-0001.html>
More information about the CMake
mailing list