Multiple Bundle Support Files for WiX Burn

I have a third party MSI that was provided to me by the vendor. However, MSI doesn't stand alone, it needs multiple support files (DLLs, config files, device drivers ...) to complete the installation. I tried to install without these files present in the MSI directory and it complains about missing files during installation. This seems to be a weird way to create an installer. Anyway, I would like to combine this "setup" that Burn will use. I used to use MSIPackage, but this works for a single file. How can I specify this group of files? I'm tempted to make a new MSI that includes a third-person MSI plus additional files, but then I end up with phantom installed, which really isn't what I want.

Thanks in advance for your help.

EDIT with solution :

Many thanks to Tom for clues to this problem. For those who are curious, this is the code and steps I used to solve this issue in WiX 3.8.

First, prepare the directory where the third-party installer was stored.

"%WIX%bin\heat.exe" dir "$(ProjectDir)..\ThirdParty\AppDirectory" -dr Dir_AppName -cg PAYGROUP_AppName -ag -sreg -scom -srd -var "var.AppNameDir" -t "$(ProjectDir)\ComponentToPayload.xsl" -out "$(ProjectDir)AppNamePayloadGroup.wxs"

      

Where AppNameDir is a preprocessor variable that refers to the location of the application installation files.

My transform file was slightly different from the one associated with Tom, but not much. I created a component group in my original heat file and then used that as my PayloadGroup later, not DirectoryRef.

<xsl:stylesheet version="1.0"
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  xmlns:wix="http://schemas.microsoft.com/wix/2006/wi"
  xmlns="http://schemas.microsoft.com/wix/2006/wi">

  <xsl:template match="/">
    <Wix>
      <Fragment>
        <xsl:apply-templates select="*" />
      </Fragment>
    </Wix>
  </xsl:template>

  <xsl:template match="//wix:ComponentGroup">
    <PayloadGroup>
      <xsl:attribute name="Id">
        <xsl:value-of select="@Id"/>
      </xsl:attribute>
      <xsl:apply-templates select="*" />
    </PayloadGroup>
  </xsl:template>

  <xsl:template match="//wix:File">
    <Payload>
      <xsl:attribute name="SourceFile">
        <xsl:value-of select="@Source"/>
      </xsl:attribute>
    </Payload>
  </xsl:template>

</xsl:stylesheet>

      

Then I created a snippet for the component and referenced the payload group

  <Fragment>
    <PackageGroup Id="PCKGRP_AppName">
      <MsiPackage
        SourceFile="$(var.AppNameDir)\app.msi">
        <MsiProperty Name="PropertyName1" ="Value1"/>
        <MsiProperty Name="PropertyName2" ="Value2"/>
        <MsiProperty Name="PropertyName3" ="Value3"/>
        <PayloadGroupRef Id="PAYGROUP_AppName"/>
      </MsiPackage>
    </PackageGroup>
  </Fragment>

      

And then finally a link to the group in the chain

    <Chain>
...
      <PackageGroupRef Id="PCKGRP_AppName"/>
...
    </Chain>   

      

+3


source to share


2 answers


Inside the MsiPackage element, use a bunch of payload elements (or put the payload elsewhere and use PayloadGroupRef ).



As a compensation, your bootloader may get better compression as MsiPackage starts to explode because double compression can be inefficient over time and space.

+3


source


Thanks for this answer. With the help of other posts (especially this one ) I came up with an xslt to also include the Name attribute (with subfolders) and break empty lines.

<xsl:stylesheet version="1.0"
 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
 xmlns:wix="http://schemas.microsoft.com/wix/2006/wi"
 xmlns="http://schemas.microsoft.com/wix/2006/wi">

<xsl:strip-space elements="*"/>

<xsl:template match="/">
<Wix>
  <Fragment>
    <xsl:apply-templates select="*" />
  </Fragment>
</Wix>
</xsl:template>

<xsl:template match="//wix:ComponentGroup">
<PayloadGroup>
  <xsl:attribute name="Id">
    <xsl:value-of select="@Id"/>
  </xsl:attribute>
  <xsl:apply-templates select="*" />
</PayloadGroup>
</xsl:template>

<xsl:template match="//wix:File">
<Payload>
  <xsl:attribute name="SourceFile">
    <xsl:value-of select="@Source"/>
  </xsl:attribute>
  <xsl:attribute name="Name">
    <xsl:call-template name="string-replace-all">
      <xsl:with-param name="text" select="@Source"/>
      <xsl:with-param name="replace" select="'$(var.SourceDir)\'"/>
      <xsl:with-param name="by" select="''"/>
    </xsl:call-template>
  </xsl:attribute>
</Payload>
</xsl:template>

<xsl:template name="string-replace-all">
<xsl:param name="text" />
<xsl:param name="replace" />
<xsl:param name="by" />
<xsl:choose>
  <xsl:when test="contains($text, $replace)">
    <xsl:value-of select="substring-before($text,$replace)" />
    <xsl:value-of select="$by" />
    <xsl:call-template name="string-replace-all">
      <xsl:with-param name="text"
      select="substring-after($text,$replace)" />
      <xsl:with-param name="replace" select="$replace" />
      <xsl:with-param name="by" select="$by" />
    </xsl:call-template>
  </xsl:when>
  <xsl:otherwise>
    <xsl:value-of select="$text" />
  </xsl:otherwise>
</xsl:choose>
</xsl:template>
</xsl:stylesheet>

      



Hopefully this helps you automate Wix bootstapper builds.

+1


source







All Articles