WIX 捆绑包创建

问题描述:

我尝试创建一个 MSI,其中包含 和 exe.在 WIX 中使用了捆绑选项.这样做时出错.有人可以帮我解决这个问题.代码如下:

I tried to create an MSI which is having and exe in it. Used the Bundle option in WIX. While doing that getting an error. Can somebody help me fix this issue. Below is the code:

<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"  
     xmlns:util="http://schemas.microsoft.com/wix/UtilExtension">
  <Bundle Version="1.0.0.0" UpgradeCode="7AE2E358-B5A0-44B1-9B29-FDD275992993">
    <Chain>
      <ExePackage Id="Netfx4Full" Compressed="no" PerMachine="yes" Permanent="yes" Vital="yes" 
                  SourceFile="ca\dotNetFx40_Full_x86_x64.exe"              
                  DownloadUrl="http://go.microsoft.com/fwlink/?LinkId=164193"            
                  DetectCondition="Netfx4FullVersion AND (NOT VersionNT64 OR Netfx4x64FullVersion)" />
    </Chain>
 </Bundle>

错误

错误 LGHT0089:发现多个条目部分{A1B42CCE-8AFE-11E2-AC8C-B3456288709B}"和{8E644424-3113-462E-9197-32DF7​​40AEB78}".单个目标中只能出现一个条目部分.

error LGHT0089: Multiple entry sections '{A1B42CCE-8AFE-11E2-AC8C-B3456288709B}' and '{8E644424-3113-462E-9197-32DF740AEB78}' found. Only one entry section may be present in a single target.

该错误表明您的项目正在使用包含多个以下元素的文件进行构建:ProductModule补丁PatchCreationBundle.在您的情况下,听起来您将带有 Bundle 元素的文件添加到已经具有 Product 元素的项目中.今天的 WiX 工具集不支持这点.您需要将 Bundle 元素放在一个单独的项目中.

That error indicates that your project is building with files that contain more than one of these elements: Product, Module, Patch, PatchCreation, Bundle. In your case, it sounds like you added a file with a Bundle element to a project that already had a Product element. That isn't supported in the WiX toolset today. You need to put the Bundle element in a separate project.

因此,在创建引导程序和 MSI 时,您将拥有两个 .wixproj 文件.第一个 .wixproj 将包含您的 Product 信息.第二个 .wixproj 将包含您的 Bundle 信息,并具有对第一个 .wixproj 的项目引用,以便构建顺序正确.

Thus, when creating a bootstrapper and MSI, you'll have two .wixproj files. The first .wixproj will contain your Product information. The second .wixproj will contain your Bundle information and have a project reference to the first .wixproj so that the build order is correct.