Wix:如何设置文件夹和所有子文件夹的权限
我知道如何设置文件夹的权限:
<DirectoryRef Id="ProgramFilesFolder">
<Directory Id="PHPFolder" Name="PHP">
<Component Id="PHP_comp" DiskId="1" Guid="*">
<CreateFolder>
<Permission User="Everyone" GenericAll="yes" />
</CreateFolder>
但是我也需要将权限应用于所有子文件夹。如果不列出所有文件夹,这可能吗?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
首先,我建议您使用 PermissionEx 代替。它是一个标准的 WiX 扩展,与 Permission 相比,它有一个巨大的优势 - 它不会覆盖,但会修改 ACL。默认情况下,它将权限应用于该文件夹及其所有后代文件和文件夹,因此您无需指定任何额外内容。
希望这有帮助。
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.
我解决了:Wix 和 Util 架构中定义了不同的 PermissionEx(Wix PermissionEx 和 Util Extension PermissionEx)
我使用了 Util 版本:
I solved: different PermissionEx are defined in Wix and Util schema (Wix PermissionEx and Util Extension PermissionEx)
I used the Util version:
上面的答案是正确的,您将设置该文件夹中所有文件夹和文件的权限。
请注意:CreateFolder 标签应该位于组件中,并且该组件必须添加到功能中。
另外,您必须将其添加到编译器和链接器的命令行中:
The answer above is correct, and you will set the permissions to all the folders and files in this folder.
Please note: The CreateFolder tag should be in a component, and this component must be added to a Feature.
Also, you have to add this to the command line of the compiler and the linker: