Welcome, Guest
Username Password: Remember me
  • Page:
  • 1

TOPIC: Use of Merge Module

Use of Merge Module 2 years, 4 months ago #1108

  • InstallerExpert
Reposting this question :
Is it possible to use the same merge module twice in the same source file.

<Directory Id="TARGETDIR" Name="SourceDir">
  <Directory Id="ProgramFilesFolder">
    <Directory Id="MergeModuleSample" Name="Merge Module Sample">
      <Directory Id="INSTALLDIR" Name="Merge Mod32">
            <Directory Id="F1" Name="F1"/>
            <Directory Id="F2" Name="F2"/>
        </Directory>
      </Directory>
</Directory>
</Directory>

<DirectoryRef Id="F1">
      <Merge Id="merge1" Language="1033" DiskId="1" SourceFile="abc.msm">
      </Merge>
</DirectoryRef>

<DirectoryRef Id="F2">
      <Merge Id="merge2" Language="1033" DiskId="1" SourceFile="abc.msm">
      </Merge>
</DirectoryRef>

<Feature Id="ProductFeature2" Title="MergeMod322" Level="1">
      <MergeRef Id="merge1"/>
</Feature>
<Feature Id="ProductFeature1" Title="MergeMod321" Level="1">
      <MergeRef Id="merge2"/>
</Feature>
The above code is giving error:
Error 1 The merge module &#039;merge2&#039; contains a file identifier, &#039;m&#039;, that is duplicated either in another merge module or in a File/@Id attribute.  File identifiers must be unique.  Please change one of the file identifiers to a different value.


Code in the merge module:

<Directory Id="TARGETDIR" Name="SourceDir">
            <Directory Id="Folder1">
                <Component Id="Comp1" Guid="">
                    <File Id="m" Name="file1.txt" KeyPath="yes" Vital="no"
Checksum="yes" Source="F:\file1.txt" />
                </Component>
            </Directory>
  </Directory>

Basically i want to copy the file (file1.txt) in F1 and F2 using the mereg module.How can it be done?

Re: Use of Merge Module 2 years, 4 months ago #1109

  • InstallerGeek
You can&#039;t merge a Merge Module twice. You can connect the Merge Module to multiple Features but that won&#039;t get what you want. I think in your case, you&#039;ll have to use a CopyFile element to copy the decorated File/@Id from the Merge Module.
  • Page:
  • 1
Time to create page: 0.55 seconds

     
    
Home Forum