On Fri, Apr 5, 2019 at 5:25 AM Cook, Steven (G&I) <[email protected]>
wrote:

> 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.
>

Been a while since I looked at this but it still seems to work for me in
3.14.0.
Corresponding <Permission> elements are generated in files.wxs:

        <DirectoryRef Id="CM_DP_empty_directory_with_property">
            <Component Id="CM_C_EMPTY_CM_DP_empty_directory_with_property"
Guid="3D2461E6-022E-462E-BE97-3DE14D7DFEBE">
                <CreateFolder>
                    <Permission User="Everyone" GenericRead="yes"
GenericWrite="yes" CreateFile="yes"/>
                </CreateFolder>
            </Component>
        </DirectoryRef>

        <DirectoryRef Id="CM_DP_non_empty_directory_with_property">
            <Component
Id="CM_C_EMPTY_CM_DP_non_empty_directory_with_property"
Guid="20B69238-5353-4C30-A001-3A106A0B1737">
                <CreateFolder>
                    <Permission User="Everyone" GenericRead="yes"
GenericWrite="yes" CreateFile="yes"/>
                </CreateFolder>
            </Component>
        </DirectoryRef>

Nils
-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
https://cmake.org/mailman/listinfo/cmake

Reply via email to