wix - How can I use bind.FileVersion when harvesting using Heat? -
i've used...
<?define productversion="!(bind.fileversion.mylibrary.dll)" ?>
... define version variable use in installers. first time i'm using heat.exe harvest files/folders need in installer (which includes mylibrary.dll) file called source.wxs.
if try build installer following error:
unresolved bind-time variable !(bind.fileversion.mylibrary.dll)
it's product.wxs file productversion
declared can't see source.wxs file has details of mylibrary.dll, know isn't true since if set productversion="1.0.0.0"
installer builds , files installed correctly.
how can bind.fileversion
'see' mylibrary.dll?
edit
i can work if use non-human friendly file id source.wxs (see below), best solution?
<?define productversion="!(bind.fileversion.fil023e197261ed7268770dde64994c4a55)" ?>
you can edit output generated heat using xsl. way can transform id fil023e197261ed7268770dde64994c4a55
more readable can referenced in project. apply transform heatdirectory
task have specify transforms
attribute , set value file name of xsl file have create.
in xsl file you'll have manipulate xml generated heat. rename id
attribute of file
element can use following code:
<?xml version="1.0" encoding="utf-8"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/xsl/transform" xmlns:wix="http://schemas.microsoft.com/wix/2006/wi" xmlns:msxsl="urn:schemas-microsoft-com:xslt" exclude-result-prefixes="msxsl"> <xsl:template match="//wix:file"> <xsl:variable name="filepath" select="@source" /> <xsl:variable name="filename" select="substring-after($filepath,'\')" /> <xsl:copy> <xsl:attribute name="id"> <xsl:choose> <xsl:when test="contains($filename,'\')"> <xsl:value-of select="substring-after($filename,'\')"/> </xsl:when> <xsl:otherwise> <xsl:value-of select="$filename"/> </xsl:otherwise> </xsl:choose> </xsl:attribute> </xsl:copy> </xsl:template> </xsl:stylesheet>
read xsl @ w3schools , check out documentation of heatdirectory task.
Comments
Post a Comment