Wix: How to set permissions for folder and all sub folders

Mike picture Mike · Nov 25, 2010 · Viewed 30.7k times · Source

I know how to set the permissions for a folder:

<DirectoryRef Id="ProgramFilesFolder">
  <Directory Id="PHPFolder" Name="PHP">
    <Component Id="PHP_comp" DiskId="1" Guid="*">
      <CreateFolder>
        <Permission User="Everyone" GenericAll="yes" />
      </CreateFolder>

However I need the permissions to be applied to all subfolders as well. Is this possible with out listing all the folders?

Answer

Yan Sklyarenko picture Yan Sklyarenko · Nov 25, 2010

First of all, I would recommend you using PermissionEx instead. It is a standard WiX extension and it has one really huge advantage over Permission - it doesn't overwrite, but modifies ACLs. And by default, it applies permissions to the folder and all its descendant files and folders, so you don't have to specify anything extra.

Hope this helps.