2011-03-07 119 views
0

當我嘗試在VS2010中使用合併模塊功能時,出現「Multiple Section entery」問題WIX:合併模塊問題

爲什麼我收到此錯誤?

我已經完成了谷歌搜索,但我沒有得到任何線程,我得到了我的答案。

<?xml version="1.0" encoding="UTF-8"?> 

<Wix xmlns='http://schemas.microsoft.com/wix/2006/wi'> 
    <Module Id="ModuleTest" Language="1033" Version="1.0.0.0"> 

    <Package Id='94290AA7-50E3-414E-A1BD-FC3C2B0C47D8' Description='My first Merge Module' 
       Comments='This is my first attempt at creating a Windows Installer Merge Module' 
       Manufacturer='TravelPort Private Limited' InstallerVersion='200' /> 

    <Directory Id='TARGETDIR' Name='SourceDir'> 
     <Directory Id='MyModuleDirectory' Name='.'> 

     <Component Id='MyModuleComponent' Guid='93F36B4B-B6E0-4000-8174-2660C0AE9D6A'> 
      <File Id='readme' Name='ReadMeModule' Source='ReadMergeModule.txt' DiskId='1' KeyPath='yes' Checksum='yes'></File> 
     </Component> 

     </Directory> 
    </Directory> 

    </Module> 

</Wix> 

product.wxs文件

<Product Id="ec20ec5e-bb50-45d0-9190-156cf146c8f3" Name="WinDemoApp" Language="1033" Version="1.0.0.0" Manufacturer="WinDemoApp" UpgradeCode="979e03f4-3b50-43c1-9dde-dd675f726fde"> 
    <Package InstallerVersion="200" Compressed="yes" /> 

    <Media Id="1" Cabinet="media1.cab" EmbedCab="yes" /> 

    <Directory Id="TARGETDIR" Name="SourceDir"> 
     <Directory Id="ProgramFilesFolder"> 
      <Directory Id="APPLICATIONROOTDIRECTORY" Name="WinDemoApp"> 
       <!-- TODO: Remove the comments around this Component element and the ComponentRef below in order to add resources to this installer. --> 
      </Directory> 

    <Directory Id ="ProgramMenuFolder"> 
     <Directory Id="ApplicationProgramsFolder" Name="WinDemoApp"></Directory> 
    </Directory> 

    <!--<Merge Id='MyModule' Language='1033' SourceFile='Module.msm' DiskId='1' />--> 
     </Directory> 
    </Directory> 
<DirectoryRef Id="APPLICATIONROOTDIRECTORY"> 
    <Component Id="MyApp.exe" Guid="36AA7C63-ED57-40C6-8B14-843B9355C265"> 
    <File Id="MyApp.exe" Source="D:\WIXDemo\WinDemoApp\MyApp\bin\Debug\MyApp.exe" KeyPath="yes" Checksum="yes"></File> 
    </Component> 
</DirectoryRef> 

<DirectoryRef Id="ApplicationProgramsFolder"> 
    <Component Id="ApplicationShortcut" Guid="EA549460-4D98-4B09-B621-D4F1AA12A617"> 
    <Shortcut Id="ApplicationStartMenuShortcut" Name="WinDemoApp" 
       Description="My Win Installer sample" 
       Target="[APPLICATIONROOTDIRECTORY]MyApp.exe" 
       WorkingDirectory="APPLICATIONROOTDIRECTORY"/> 
    <RemoveFolder Id ="ApplicationProgramsFolder" On="uninstall"/> 
    <RegistryValue Root="HKCU" Key="Software\Microsoft\WinDemoApp" Name="installed" Type="integer" Value="1" KeyPath="yes"/> 
    </Component> 


</DirectoryRef> 
<!--<Icon Id="bug.ico" SourceFile="bug.ico"/> 
<Property Id="ARPPRODUCTICON" Value="bug.ico" />--> 

<Feature Id="MyApplication" Title="WinDemoApp" Level="1"> 
     <!-- TODO: Remove the comments around this ComponentRef element and the Component above in order to add resources to this installer. --> 
    <ComponentRef Id="MyApp.exe"/> 
    <ComponentRef Id="ApplicationShortcut"/> 
    <!--<MergeRef Id="MyModule"/>--> 
     <!-- Note: The following ComponentGroupRef is required to pull in generated authoring from project references. --> 
    </Feature> 
</Product> 

回答

1

的MyModuleDirectory目錄元素不應該有一個name屬性。你的Merge元素也應該嵌套在ApplicationProgramsFolder目錄下面。現在它會轉到[ProgramFilesFolder]。

看看Industrial Strength Windows Installer XML

即使您不想使用該工具,它自己的安裝程序也會按照您設置產品所使用的合併模塊的方式設置。