我在 WiX 脚本中有一个目录元素的层次结构。
我还有一个创建虚拟目录的组件(使用 IIS:WebVirtualDir),它指向我的目录层次结构的根。
如何更改虚拟目录的子文件夹的属性(例如 AnonymousAccess),例如
MyVirtualDir <<<这是虚拟目录根
MyVirtualDir\MySubFolder <<<这是我希望使用 WebDirProperties 更改其属性的子文件夹。
请注意,我不希望为该子文件夹创建新的虚拟目录。我只想更改一些安全设置。
当前的脚本太大,无法在此处发布,但请查看 WiX 教程: 5.3 Web 目录。假设在该示例中,有另一个名为“MySubFolder”的 Directory 元素嵌套在“InstallDir”元素中。那么,为了设置“MySubFolder”的属性而不将其转换为虚拟目录,下一步是什么?
I have a hierarchy of Directory elements in a WiX script.
I also have a component that creates a virtual directory (using IIS:WebVirtualDir), which points to the root of my Directory hierarchy.
How do I change a property (e.g. AnonymousAccess) of a subfolder of the virtual directory, e.g.
MyVirtualDir <<< this is the virtual directory root
MyVirtualDir\MySubFolder <<< this is the subfolder for which I wish to change a property using WebDirProperties
Please note that I do not wish to create a new virtual directory for the subfolder. I only wish to change a few security settings.
The current script is too big to post here, but take a look at the WiX tutorial: 5.3 Web Directory. Suppose in that example that there was another Directory element named "MySubFolder" nested within the "InstallDir" element. What would then be the next step in order to set properties for "MySubFolder" without turning it into a virtual directory?
发布评论
评论(1)
IIS:Web 元素的示例代码似乎很难获得,但经过一番尝试和错误,我想我找到了一个解决方案:
在目录层次结构中正常创建文件夹:
创建一个 IIS:WebDirProperties 元素(在本例中) ,一些用于测试的随机值):
创建一个指向文件夹和 WebDirProperties 元素的 IIS:WebDir 组件:
改编自 WiX 教程的整个示例可以在下面找到:
Sample code for the IIS:Web element seems to be hard to come by, but after some trial and error, I think I found a solution:
Create the folder as normal in the Directory hierarchy:
Create an IIS:WebDirProperties element (in this case, some random values for testing):
Create an IIS:WebDir component pointing to the folder and the WebDirProperties element:
The entire sample, adapted from the WiX tutorial, can be found below: