[wix-users] Pointing Heat at Referenced Project Output Folder

Bryan Dam bryand at recastsoftware.com
Wed Dec 15 11:27:23 PST 2021


We're reorganizing our code in a way that put the Wix 3.11 installation projects in the same solution as the project we want it to install.  We already use Heat but it's pointed it at what I call 'magic folders' where the build pipeline had to put together the binaries into that magic folder by downloading them different pipelines.  I've been reading and trying different tactics for a couple of days but nothing seems to work.

I've avoided using HeatProject since avoiding it seems to be the widely accepted suggestion, by Rob himself.  But maybe that's dated?
In theory, I have a referenced project that gives me preprocessor variables that I should be able to pass to HeatDirectory but nothing I've tried has seemed to work.

Below is a one of the many things I've tried and high-level what I think needs to happen but I'm clearly missing some concept or syntactical sugar to make it actually work. I've tried every variation on this theme that I can think of but each time either the project won't load, it complains that Heat wasn't passed a Directory value, or the directory points at the installation project's output folder instead of the reference project.

Would love any feedback/guidance on how to point Heat at a referenced project and consume the entirety of its output.



<PropertyGroup>
                <DefineConstants>GatewayFolder=%(var.ProductAgentGateway.TargetDir)</DefineConstants>
</PropertyGroup>

...

<ItemGroup>
                <ProjectReference Include="..\Product.AgentGateway\Product.AgentGateway.csproj">
                  <Name>ProductAgentGateway</Name>
                  <Project>{70d701d1-1909-4cca-936e-0dd641ad0dba}</Project>
                  <Private>True</Private>
                  <DoNotHarvest>True</DoNotHarvest>
                  <RefProjectOutputGroups>Binaries;Content;Satellites</RefProjectOutputGroups>
                  <RefTargetDir>INSTALLFOLDER</RefTargetDir>
                </ProjectReference>
</ItemGroup>

 ...

<Target Name="BeforeBuild">
<HeatDirectory
                AutogenerateGuids="true"
                ComponentGroupName="ProductAgentGateway"
                Directory="$(GatewayFolder)"
                DirectoryRefId="INSTALLFOLDER"
                NoLogo="true"
                OutputFile="$(ProjectDir)\Files.wxs"
                PreprocessorVariable="var.GatewayFolder"
                SuppressCom="true"
                SuppressRegistry="true"
                SuppressRootDirectory="true"
                ToolPath="$(WixToolPath)"
                Transforms="Filter.xsl"
/>


More information about the wix-users mailing list