1
我正在寫一個VB腳本,遞歸地進入一個目錄並創建一個WIX XML文件 我收到一個錯誤Component元素包含一個意外的子元素'目錄'。當我嘗試編譯我的WIX時,有人可以幫忙。wix - 組件元素包含一個意外的子元素'Directory'
<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>
我刪除了部分XML,因爲它太長 – AnnonMan