Amit Sharma
Amit Sharma

Reputation: 1

WIX : Merge Module Issue

When I try to use merge module feature in VS2010, I am getting an issue "Multiple Section entery"

Why i am getting this error?

I have done googling but I did not get any thread where i got my answer.

<?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 file

<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>

Upvotes: 0

Views: 2540

Answers (1)

Christopher Painter
Christopher Painter

Reputation: 55571

The MyModuleDirectory directory element shouldn't have a name attribute. Also your Merge element should probably be nested underneath the ApplicationProgramsFolder directory. Where it's now it'll go to [ProgramFilesFolder].

Take a look at Industrial Strength Windows Installer XML.

Even if you don't want to use the tool, it's own installer is setup exactly the way you are setting up yours with merge modules consumed by a product.

Upvotes: 1

Related Questions