我正在编写一个 VB 脚本,它递归地进入一个目录并创建一个 WIX XML 文件我收到一个错误组件元素包含一个意外的子元素“目录”。当我尝试编译我的 WIX 时,有人可以帮忙。
<Media Id="1" Cabinet="simple.cab" EmbedCab="yes" />
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="ProgramFilesFolder" Name="PFiles">
<Directory Id="MSI" Name="MSI">
<Component Id="first.txt" DiskId="1" Guid="*">
<File Id="first.txt" Name="first.txt" Source="C:\Users\xxxx\Desktop\MSI\first.txt" />
</Component>
<Component Id="TestProduct" DiskId="1" Guid="*">
<Directory Id="TestProduct" Name="TestProduct">
<Component Id="snet" DiskId="1" Guid="*">
<Directory Id="snet" Name="snet">
<Component Id="file1.txt" DiskId="1" Guid="*">
<File Id="file1.txt" Name="file1.txt" Source="C:\Users\xxxx\Desktop\MSI\TestProduct\snet\file1.txt" />
</Component>
<Component Id="custom" DiskId="1" Guid="*">
<Directory Id="custom" Name="custom">
<Component Id="file2.txt" DiskId="1" Guid="*">
<File Id="file2.txt" Name="file2.txt" Source="C:\Users\xxxx\Desktop\MSI\TestProduct\snet\custom\file2.txt" />
</Component>
</Directory>
</Component>
</Directory>
</Component>
</Directory>
</Component>
</Directory>
</Directory>
</Directory>
<Feature Id="TestProductFeature" Title="Test" Level="1">
<ComponentRef Id="first.txt" />
<ComponentRef Id="TestProduct" />
<ComponentRef Id="snet" />
<ComponentRef Id="file1.txt" />
<ComponentRef Id="custom" />
<ComponentRef Id="file2.txt" />
</Feature>
<UI />
</Product>