Question

The following will apply (modify) permissions recursively, and respect current permissions:

<util:PermissionEx User="[MYUSER]" Domain="[NT_DOMAIN]" GenericRead="yes" GenericWrite="yes" GenericExecute="yes" Delete="yes" DeleteChild="yes" />

But, I don't want to apply it recursively!

I want it non-recursively, i.e. just that folder and no children.

(I believe that the older element clears the inheritance of permissions from the parent folder, which means it is no good for my purposes, as I must preserve existing permissions).

Is there any way to tell PermissionsEx not to apply the permissions recursively? Can I combine PermissionEx and Permission nodes in some way to get the desired effect? Or is my only option to issue a custom action command line call to cacls.exe?

Was it helpful?

Solution

I'm not sure any of the three built-in patterns ( two from MSI and one from WiX extension ) handle this scenario. FWIW, I think it's not really a function of the object that you are setting permissions on rather a function of all the child objects that have choosen to inherit. In other words, the parent doesn't enforce propogation the childen opt into inheritance.

So you might have to do some reflection of all the children and then set them to block propogation. The effort and risk is high so I'd wonder why this is actually needed and if you couldn't just create your own new child directory and set the permissions there that way you didn't have to worry about this problem.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top