<div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Apr 5, 2019 at 5:25 AM Cook, Steven (G&I) <<a href="mailto:Steven.Cook@riotinto.com">Steven.Cook@riotinto.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div lang="EN-AU">
<div class="gmail-m_9002933464974250658WordSection1">
<p class="MsoNormal">Hi all,<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">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:<u></u><u></u></p>
<p class="MsoNormal"><a href="https://github.com/ngladitz/cmake-wix-testsuite/tree/master/properties" target="_blank">https://github.com/ngladitz/cmake-wix-testsuite/tree/master/properties</a><u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">Typically something like this:<u></u><u></u></p>
<p class="MsoNormal"><span style="font-family:"Courier New""> set_property(INSTALL<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-family:"Courier New""> empty_directory_with_property<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-family:"Courier New""> non_empty_directory_with_property<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-family:"Courier New""> PROPERTY CPACK_WIX_ACL “Everyone=GenericRead,GenericWrite,CreateFile”<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-family:"Courier New""> )<u></u><u></u></span></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">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.</p></div></div></blockquote><div><br></div><div>Been a while since I looked at this but it still seems to work for me in 3.14.0. <br></div><div>Corresponding <Permission> elements are generated in files.wxs:</div><div><br></div><div>
</div><div> <DirectoryRef Id="CM_DP_empty_directory_with_property"><br> <Component Id="CM_C_EMPTY_CM_DP_empty_directory_with_property" Guid="3D2461E6-022E-462E-BE97-3DE14D7DFEBE"><br> <CreateFolder><br> <Permission User="Everyone" GenericRead="yes" GenericWrite="yes" CreateFile="yes"/><br> </CreateFolder><br> </Component><br> </DirectoryRef><br><br> <DirectoryRef Id="CM_DP_non_empty_directory_with_property"><br> <Component Id="CM_C_EMPTY_CM_DP_non_empty_directory_with_property" Guid="20B69238-5353-4C30-A001-3A106A0B1737"><br> <CreateFolder><br> <Permission User="Everyone" GenericRead="yes" GenericWrite="yes" CreateFile="yes"/><br> </CreateFolder><br> </Component><br> </DirectoryRef></div><div><br></div><div>Nils<br></div></div></div></div></div>