I have a VS2010 WiX project with a main .wxs file and an empty .wxs file. The empty .wxs is overwritten in the prebuild event of the project, using heat.exe to harvest everything from a console exe. The exe has InstallUtil hooks, and in the days of VS setup project the exe was installed as a Service.
I tried to use the <ServiceInstall>
bits in WiX, but when I specified the executable and other elements to get the Service installed, light complained of a collision between the .exe in the main .wxs and the .exe in the heat-generated .wxs.
I think Custom Action is not the best way to do the service installation, so I am attempting XSL transformation to get the file out that I don't want (it's a single file out of 100).
My XSL must have a problem, because it is not matching/filtering. Here it is:
<?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"
xmlns:Wix="http://schemas.microsoft.com/wix/2006/wi">
<xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes" />
<xsl:template match="@* | node()">
<xsl:copy>
<xsl:apply-templates select="@* | node()" />
</xsl:copy>
</xsl:template>
<xsl:template match="
Component[File/@Source='$(var.bindir)\servicehost.exe']"/
</xsl:stylesheet>
The parts of the .wxs I need to rip out look like this:
....
<Component Id="cmpD64BE1790BFAF0F05DA37558F5D72572" Guid="{6C70DDC8-349B-4B66-A415-DE08E302C2A8}">
<File Id="fil24DFDFCA765C9A8BBB8854CE66AED0E8" KeyPath="yes" Source="$(var.bindir)\servicehost.exe" />
</Component>
....
<ComponentRef Id="cmpD64BE1790BFAF0F05DA37558F5D72572" />
....
What is the best way to make this work?
Thanks.