I just saw the -template product parameter specified. That causes heat to 
generate the <Product/> element.

The -var parameter still works as shown previously in this case.

You could use the -t parameter to specify a XSLT transform to use to modify the 
generated XML. You could author the XSLT transform to set those attributes to 
dereference a preprocessor variable:

<xsl:transform version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform";>

    <xsl:output method="xml" version="1.0" encoding="utf-8" indent="yes"/>

    <xsl:template match="@Manufacturer">
        <xsl:attribute name="Manufacturer">$(var.Manufacturer)</xsl:attribute>
    </xsl:template>

    <xsl:template match="node() | @*">
        <xsl:copy>
            <xsl:apply-templates select="@* | node()"/>
        </xsl:copy>
    </xsl:template>

</xsl:transform>

You can define similar templates for other attributes.

Edwin G. Castro
Software Developer - Staff
Electronic Banking Services
Fiserv
Office: 503-746-0643
Fax: 503-617-0291
www.fiserv.com
Please consider the environment before printing this e-mail


> -----Original Message-----
> From: Castro, Edwin G. (Hillsboro) [mailto:edwin.cas...@fiserv.com]
> Sent: Wednesday, December 08, 2010 1:58 PM
> To: General discussion for Windows Installer XML toolset.
> Subject: Re: [WiX-users] Heat.exe - How to pass Product Manufacturer,
> Name, Title, version
> 
> Heat does not generate a <Product/> element.
> 
> Heat /? shows the following documentation for -var:
> 
>    -var <VariableName>  substitute File/@Source="SourceDir" with a
> preprocessor or a wix variable (e.g. -var var.MySource will become
> File/@Source="$(var.MySource)\myfile.txt" and -var wix.MySource will
> become File/@Source="!(wix.MySource)\myfile.txt"
> 
> This does text transformation on the generated output wxs file. I created an
> empty text file called test.txt and used the following command line to
> harvest it using heat.exe:
> 
> heat file test.txt -out test.wxs
> 
> Here are the contents of test.wxs:
> 
> <?xml version="1.0" encoding="utf-8"?>
> <Wix xmlns="http://schemas.microsoft.com/wix/2006/wi";>
>     <Fragment>
>         <DirectoryRef Id="TARGETDIR">
>             <Directory Id="dir22FE4E6795D49A83D8CC3F97AEACA344"
> Name="code" />
>         </DirectoryRef>
>     </Fragment>
>     <Fragment>
>         <DirectoryRef Id="dir22FE4E6795D49A83D8CC3F97AEACA344">
>             <Component Id="cmp5BA64E6B74419477D4B75A1E802397FC"
> Guid="PUT-GUID-HERE">
>                 <File Id="fil67D465DE6C69EA3B3CD0B7487E6132B6" KeyPath="yes"
> Source="SourceDir\code\test.txt" />
>             </Component>
>         </DirectoryRef>
>     </Fragment>
> </Wix>
> 
> Notice that File/@Source="SourceDir\code\test.txt"
> 
> If use -var like this:
> 
> heat file test.txt -out test.wxs -var var.CodeDir
> 
> Then I get this:
> 
> <?xml version="1.0" encoding="utf-8"?>
> <Wix xmlns="http://schemas.microsoft.com/wix/2006/wi";>
>     <Fragment>
>         <DirectoryRef Id="TARGETDIR">
>             <Directory Id="dir22FE4E6795D49A83D8CC3F97AEACA344"
> Name="code" />
>         </DirectoryRef>
>     </Fragment>
>     <Fragment>
>         <DirectoryRef Id="dir22FE4E6795D49A83D8CC3F97AEACA344">
>             <Component Id="cmp5BA64E6B74419477D4B75A1E802397FC"
> Guid="PUT-GUID-HERE">
>                 <File Id="fil67D465DE6C69EA3B3CD0B7487E6132B6" KeyPath="yes"
> Source="$(var.CodeDir)\code\test.txt" />
>             </Component>
>         </DirectoryRef>
>     </Fragment>
> </Wix>
> 
> Notice that File/@Source="$(var.CodeDir)\code\test.txt" just like the
> documentation says.
> 
> In a <Product/> element is *not* generated in either example.
> 
> Edwin G. Castro
> Software Developer - Staff
> Electronic Banking Services
> Fiserv
> Office: 503-746-0643
> Fax: 503-617-0291
> www.fiserv.com
> P Please consider the environment before printing this e-mail
> 
> 
> > -----Original Message-----
> > From: sangeeta1 [mailto:snmsn...@gmail.com]
> > Sent: Wednesday, December 08, 2010 12:25 PM
> > To: wix-users@lists.sourceforge.net
> > Subject: [WiX-users] Heat.exe - How to pass Product Manufacturer,
> > Name, Title, version
> >
> >
> > Hi all,
> >
> >    I am trying to generate a wxs source file using Heat.exe and wanted
> > to check if I can pass values for Manufacturer, Name, Title and
> > version to heat.exe? I tried using -var argument, but does nt seem to
> > update it to the source file
> >
> > heat.exe dir c:\temp\Configuration\Files -ag -cg MyComp -ag -gg -g1
> > -ke -var Product/@Manufacturer="
> <Product/@Manufacturer=%22>ABCD" -
> > template product -out c:\temp\Configuration\wixauto\mainsource.wxs
> >
> >
> > thanks!
> >
> > --
> > View this message in context: http://windows-installer-xml-wix-
> > toolset.687559.n2.nabble.com/Heat-exe-How-to-pass-Product-
> > Manufacturer-Name-Title-version-tp5816654p5816654.html
> > Sent from the wix-users mailing list archive at Nabble.com.
> > ----------------------------------------------------------------------
> > -------- This SF Dev2Dev email is sponsored by:
> >
> > WikiLeaks The End of the Free Internet
> > http://p.sf.net/sfu/therealnews-com
> > _______________________________________________
> > WiX-users mailing list
> > WiX-users@lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/wix-users
> ------------------------------------------------------------------------------
> This SF Dev2Dev email is sponsored by:
> 
> WikiLeaks The End of the Free Internet
> http://p.sf.net/sfu/therealnews-com
> _______________________________________________
> WiX-users mailing list
> WiX-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/wix-users
------------------------------------------------------------------------------
This SF Dev2Dev email is sponsored by:

WikiLeaks The End of the Free Internet
http://p.sf.net/sfu/therealnews-com
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users

Reply via email to