I am building a file with a high temperature, and I would really like to give it a decent identifier, and not the usual "filXXXXXXXX", mainly because I need to reference it in other parts of the installer. I know that Id is always the same, on different machines and for different contents of the file, apparently, so I can use it with the confidence that it will not change when building, say, on the CI server.
Of course, it would be much better if this value was more convenient for a person. Heat doesn't seem to have a command line option for creating file identifiers (EDIT: apparently there is a -suid option that will stop generating numeric identifiers and just use the file name as an identifier, which is not possible in many scenarios anyway), therefore I am experiencing the pain of writing XSLT but can't achieve what I want, can anyone help?
This is the fragment file:
<?xml version="1.0" encoding="utf-8"?> <Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"> <Fragment> <DirectoryRef Id="DBScripts" /> </Fragment> <Fragment> <ComponentGroup Id="CSInstallerConfig"> <Component Id="cmpD6BAFC85C2660BE8744033953284AB03" Directory="DBScripts" Guid="{A39BABF5-2BAC-46EE-AE01-3B47D6C1C321}"> <File Id="filB31AC19B3A3E65393FF9059147CDAF60" KeyPath="yes" Source="$(var.CONFIG_PATH)\CSInstaller.config" /> </Component> </ComponentGroup> </Fragment> </Wix>
And this is XSLT:
<?xml version="1.0" encoding="utf-8"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:msxsl="urn:schemas-microsoft-com:xslt" exclude-result-prefixes="msxsl"> <xsl:output method="xml" indent="yes"/> <xsl:template match="@*|*"> <xsl:copy> <xsl:apply-templates select="@*|*" /> </xsl:copy> </xsl:template> <xsl:template match="File"> <xsl:attribute name="Id"> <xsl:value-of select="123"/> </xsl:attribute> </xsl:template> </xsl:stylesheet>
Now Iβm a real noob with XSL, so maybe the file above is complete nonsense, but in any case, the File element is copied immediately without changing the identifier.
Any idea?
source share