Guruprasad
Guruprasad

Reputation: 1

WIX - Heat.exe - Does Heat.exe support multiple multiple harvest type

I would like to build a WIX file (.wxs) using Heat.exe command. I would like to know if heat supports multiple harvest type like (file and reg) in the same command.

I tried the following command, but it is not adding entry of both the harvest type in the generated output :

"C:\Program Files (x86)\WiX Toolset v3.11\bin\heat.exe" file "C:\Users\ragh.jenkins\jobs\ODBC\workspace\bin\Win32\Debug\driver.dll" -reg "C:\DIS\master_latest\odbc\DEBUG_64.reg" -cg RegistryEntries -out "C:\Users\ragh\Documents\Visual Studio 2013\Projects\SetupProject1\SetupProject1\jenkinsprod.wxs"

Current Output :

<?xml version="1.0" encoding="utf-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
    <Fragment>
        <ComponentGroup Id="RegistryEntries">
          <Component Id="cmpD31B63367AF259550643AC8C1AB78978"  
            Directory="TARGETDIR" Guid="PUT-GUID-HERE" KeyPath="yes">
           <RegistryKey Key="SOFTWARE\ODBC\ODBCINST.INI\ODBC Drivers" 
                Root="HKLM">
            <RegistryValue Name="NelDriver64" Value="Installed" Type="string" />
           </RegistryKey>
         </Component>
         <Component Id="cmp56B0ADF81BA4CE92E17B4BF179176FCE" 
           Directory="TARGETDIR" Guid="PUT-GUID-HERE" KeyPath="yes">
           <RegistryKey Key="SOFTWARE\ODBC\ODBCINST.INI\NelDriver64" 
               Root="HKLM">
              <RegistryValue Name="UsageCount" Value="1" Type="integer" />
              <RegistryValue Name="Driver" Value="C:\
                 {PROJECT_FOLDER}\bin\x64\Debug\driver.dll" Type="string" />
              <RegistryValue Name="Setup" Value="C:\
                 {PROJECT_FOLDER}\bin\x64\Debug\driver.dll" Type="string" />
              </RegistryKey>
         </Component>
        </ComponentGroup>
    </Fragment>
</Wix>

Expected Output :

<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
  <Product Id="*" Name="SetupProject1" Language="1033" Version="1.0.0.0" 
      Manufacturer="Test" UpgradeCode="fc444cfd-b871-44c5-a920-8b7fc99674c1">
   <Package InstallerVersion="200" Compressed="yes" InstallScope="perMachine" />
     <MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is 
       already installed." />
     <MediaTemplate />
     <Feature Id="ProductFeature" Title="SetupProject1" Level="1">
        <ComponentGroupRef Id="ProductComponents" />
     </Feature>
  </Product>
  <Fragment>
        <Directory Id="TARGETDIR" Name="SourceDir">
            <Directory Id="ProgramFilesFolder">
                <Directory Id="INSTALLFOLDER" Name="SetupProject1" />
            </Directory>
        </Directory>
    </Fragment>
    <Fragment>
        <ComponentGroup Id="ProductComponents" Directory="INSTALLFOLDER">
        <Component Id="driver.dll" Guid="*">
        <File Id="driver.dll" KeyPath="yes" 
Source="C:\Users\ragh\.jenkins\jobs\ODBC\workspace\bin\Win32\Debug\driver.dll">
        </File>
      </Component>
      <Component Id="RegistryEntries" Guid="*">
        <RegistryKey Root="HKLM"
                     Key="Software\Wow6432Node\ODBC\ODBCINST.INI\ODBC Drivers" >
          <RegistryValue Type="string" Name="NelDriver" Value="Installed"/>
        </RegistryKey>
        <RegistryKey Root="HKLM"
                     Key="Software\Wow6432Node\ODBC\ODBCINST.INI\NelDriver" >
          <RegistryValue Type="string" Name="UsageCount" Value="dword:00000001"/>
        </RegistryKey>
        <RegistryKey Root="HKLM"
                     Key="Software\Wow6432Node\ODBC\ODBCINST.INI\NelDriver" >
          <RegistryValue Type="string" Name="Driver" Value="[INSTALLFOLDER]\driver.dll"/>
        </RegistryKey>
        <RegistryKey Root="HKLM"
                     Key="Software\Wow6432Node\ODBC\ODBCINST.INI\NelDriver" >
          <RegistryValue Type="string" Name="Setup" Value="[INSTALLFOLDER]\driver.dll" />
        </RegistryKey>
      </Component>
        </ComponentGroup>
    </Fragment>
</Wix>

Upvotes: 0

Views: 1572

Answers (2)

Tiger Galo
Tiger Galo

Reputation: 351

Did you try using the 'dir' option of the heat, it will harvest all files within the specified directory and I'd assume registry files with a 'reg' option and regular files with a 'file' option correspondingly. And if you need to massage the output or exclude some components out from the output then you can always use the XSL transform option you can feed the heat with.

Upvotes: 0

Tom Blodget
Tom Blodget

Reputation: 20812

Heat is not going to create your expected output. It creates one ComponentGroup and doesn't create a Product. Therefore, you will have multiple files. So, there is no advantage for heat to process multiple inputs.

Here's what you can do:

  1. Run heat for each input, creating a named ComponentGroup.
  2. In appropriate places, include a ComponentGroupRef for each. You could create a parent ComponentGroup if you wanted (e.g, ProductComponents).

Upvotes: 1

Related Questions