I ended up resolving this by doing as I had suggested in the edit above. I harvested the single file using HeatFile
and excluded the file from the HeatDirectory
harvest by using an xslt transform.
I had the following in my project file:
<HeatDirectory OutputFile="%(ProjectReference.Filename).wxs"
Directory="..\ExactaMobilePublish\"
DirectoryRefId="INSTALLFOLDER"
Transforms="ExcludeExactaDatabaseAccess.xslt"
ComponentGroupName="%(ProjectReference.Filename)"
SuppressUniqueIds="true"
SuppressCom="true"
SuppressFragments="true"
SuppressRegistry="true"
SuppressRootDirectory="true"
AutoGenerateGuids="false"
GenerateGuidsNow="true"
ToolPath="$(WixToolPath)"
PreprocessorVariable="var.BasePath" />
<HeatFile OutputFile="ExactaDatabaseAccess.wxs"
File="..\ExactaMobilePublish\bin\ExactaDatabaseAccess.dll"
DirectoryRefId="MOBILEBIN"
ComponentGroupName="ExactaDatabaseAccess"
SuppressUniqueIds="true"
SuppressCom="false"
SuppressFragments="true"
SuppressRegistry="false"
SuppressRootDirectory="true"
AutoGenerateGuids="false"
GenerateGuidsNow="true"
ToolPath="$(WixToolPath)"
PreprocessorVariable="var.ExactaMobileBinBasePath" />
I used the following xslt transform:
<?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">
<!-- Copy all attributes and elements to the output. -->
<xsl:template match="@*|*">
<xsl:copy>
<xsl:apply-templates select="@*" />
<xsl:apply-templates select="*" />
</xsl:copy>
</xsl:template>
<xsl:output method="xml" indent="yes" />
<!-- Search directories for the components that will be removed. -->
<xsl:key name="dll-search" match="wix:Component[@Id = 'ExactaDatabaseAccess.dll']" use="descendant::wix:File/@Id"/>
<!-- Remove components. -->
<xsl:template match="wix:Component[@Id='ExactaDatabaseAccess.dll']" />
<!-- Remove componentsrefs referencing components in those directories. -->
<xsl:template match="wix:ComponentRef[key('dll-search', @Id)]" />
</xsl:stylesheet>