1

I want to create a trivial merge module that contains all the files of a directory called "build" and installs them to the program files folder. I will use heat to generate a wxs file with all these files, and I want this to be separated from the wxs file I edit manually for the merge module. How do I reference the heat generated file from my other merge module wxs file?

I generate my heat wxs file like this:

heat dir build -cg heatComponent -gg -var var.buildFolder -dr ProgramFilesFolder -srd -out heatComponent.wxs

I know how to create an msi file of this:

<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
    <Product Name='product' Id='9f6edf70-539a-11e4-916c-0800200c9a66' UpgradeCode='bb651370-539a-11e4-916c-0800200c9a66'
        Language='1033' Codepage='1252' Version='1.0.0' Manufacturer='Test'>
        <Package Id='*' Description="A product" InstallerVersion='301' Languages='1033'       Compressed='yes' SummaryCodepage='1252' Platform='x64'/>

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

        <Directory Id='TARGETDIR' Name='SourceDir'>
            <Directory Id='ProgramFilesFolder'/>
        </Directory>

        <Feature Id="Files" Title="Main Feature" Level="1">
            <ComponentGroupRef Id="heatComponent"/>
        </Feature>
    </Product>
</Wix>

But how do I do reference the ComponentGroup when I want to output a merge module? If I change the Product element to a Module element it complaints about the Feature element. If I remove that it works, but I do not get any files in my msm.

toftis
  • 1,070
  • 9
  • 26

1 Answers1

3

Based on the heat command you posted, try making your module definition (module1.wxs) look something like this:

<?xml version="1.0" encoding="utf-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
  <Module Id="Mod1" Language="0" Version="1.0.0">
    <Package Id="YOUR-GUID" Manufacturer="Acme" />
    <Directory Id="TARGETDIR" Name="SourceDir">
      <Directory Id="ProgramFilesFolder" />
    </Directory>
    <ComponentGroupRef Id="heatComponent"/>
  </Module>
</Wix>

Then you can call candle like so:

candle module1.wxs heatComponent.wxs -dbuildFolder="FOLDER-CONTAINING-FILES-HERE"

Followed by light like so:

light module.wixobj heatComponent.wixobj -o Module1.msm
Seth
  • 112
  • 9
  • The xml I have posted worked. I can create a msi file from it. To execute it I simply run candle with both wxs files, the generated heatComponent.wxs and the one I pasted above. After that I run light and get my .msi. However, I do want to create an .msm file, a merge module. – toftis Oct 16 '14 at 15:53
  • Sorry, I didn't quite get the crux of the issue. Hopefully my revised answer does the trick. – Seth Oct 16 '14 at 18:32
  • Thanks. The trick was that the ComponentGroupRef element is directly under the Module element in a merge module, and inside a feature element in a normal msi as described here: http://wixtoolset.org/documentation/manual/v3/xsd/wix/componentgroupref.html – toftis Oct 17 '14 at 10:40