Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>The problem was the absence of the HeatDirectory PreprocessorVariable property. I fixed the issue with the following additions to my wixproj file:</p> <pre><code>&lt;PropertyGroup&gt; &lt;DefineConstants&gt;BasePath=%(ProjectReference.RootDir)%(ProjectReference.Directory);&lt;/DefineConstants&gt; &lt;/PropertyGroup&gt; &lt;HeatDirectory OutputFile="%(ProjectReference.Filename).wxs" DirectoryRefId="INSTALLFOLDER" Directory="%(ProjectReference.RootDir)%(ProjectReference.Directory)" ComponentGroupName="%(ProjectReference.Filename)_Project" SuppressCom="true" SuppressFragments="true" SuppressRegistry="true" SuppressRootDirectory="true" AutoGenerateGuids="false" GenerateGuidsNow="true" ToolPath="$(WixToolPath)" Condition="'%(ProjectReference.ContentProject)'=='True'" PreprocessorVariable="var.BasePath"/&gt; </code></pre> <p>As you can see, I needed to first define a constant variable for local use. I set the variable equal to the root path of my WCF project. Secondly I used that variable as my PreprocessorVariable. Finally I'm able to dynamically/recursively harvest the files generated from MsBuild. Next step: exclude the unnecessary files. I will refer to this <a href="http://www.chrissurfleet.co.uk/post/Using-Packaged-Project-Output-in-WiX-and-Visual-Studio.aspx" rel="noreferrer">link</a>.</p> <p>See below my complete wixproj:</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"&gt; &lt;PropertyGroup&gt; &lt;Configuration Condition=" '$(Configuration)' == '' "&gt;Debug&lt;/Configuration&gt; &lt;Platform Condition=" '$(Platform)' == '' "&gt;x86&lt;/Platform&gt; &lt;ProductVersion&gt;3.5&lt;/ProductVersion&gt; &lt;ProjectGuid&gt;{4005592f-cc0e-41a3-8e64-33b2824e7fd9}&lt;/ProjectGuid&gt; &lt;SchemaVersion&gt;2.0&lt;/SchemaVersion&gt; &lt;OutputName&gt;MyWCF.WCF.Webservice&lt;/OutputName&gt; &lt;OutputType&gt;Package&lt;/OutputType&gt; &lt;WixTargetsPath Condition=" '$(WixTargetsPath)' == '' AND '$(MSBuildExtensionsPath32)' != '' "&gt;$(MSBuildExtensionsPath32)\Microsoft\WiX\v3.x\Wix.targets&lt;/WixTargetsPath&gt; &lt;WixTargetsPath Condition=" '$(WixTargetsPath)' == '' "&gt;$(MSBuildExtensionsPath)\Microsoft\WiX\v3.x\Wix.targets&lt;/WixTargetsPath&gt; &lt;/PropertyGroup&gt; &lt;PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' "&gt; &lt;OutputPath&gt;bin\$(Configuration)\&lt;/OutputPath&gt; &lt;IntermediateOutputPath&gt;obj\$(Configuration)\&lt;/IntermediateOutputPath&gt; &lt;/PropertyGroup&gt; &lt;PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' "&gt; &lt;OutputPath&gt;bin\$(Configuration)\&lt;/OutputPath&gt; &lt;IntermediateOutputPath&gt;obj\$(Configuration)\&lt;/IntermediateOutputPath&gt; &lt;/PropertyGroup&gt; &lt;ItemGroup&gt; &lt;Compile Include="MyWCF.WcfService.wxs" /&gt; &lt;Compile Include="IISConfig.wxs" /&gt; &lt;Compile Include="InstallUi.wxs" /&gt; &lt;Compile Include="Product.wxs" /&gt; &lt;Compile Include="UIDialogs.wxs" /&gt; &lt;/ItemGroup&gt; &lt;ItemGroup&gt; &lt;ProjectReference Include="..\MyWCF.WcfService\MyWCF.WcfService.csproj"&gt; &lt;Name&gt;MyWCF.WcfService&lt;/Name&gt; &lt;Project&gt;{8e528b38-2826-4793-a66d-f6ff181e1139}&lt;/Project&gt; &lt;Private&gt;True&lt;/Private&gt; &lt;RefProjectOutputGroups&gt;Binaries;Content;Satellites&lt;/RefProjectOutputGroups&gt; &lt;RefTargetDir&gt;INSTALLFOLDER&lt;/RefTargetDir&gt; &lt;ContentProject&gt;True&lt;/ContentProject&gt; &lt;DoNotHarvest&gt;True&lt;/DoNotHarvest&gt; &lt;PackageThisProject&gt;True&lt;/PackageThisProject&gt; &lt;/ProjectReference&gt; &lt;/ItemGroup&gt; &lt;ItemGroup&gt; &lt;WixExtension Include="WixIIsExtension"&gt; &lt;HintPath&gt;$(WixExtDir)\WixIIsExtension.dll&lt;/HintPath&gt; &lt;Name&gt;WixIIsExtension&lt;/Name&gt; &lt;/WixExtension&gt; &lt;WixExtension Include="WixUtilExtension"&gt; &lt;HintPath&gt;$(WixExtDir)\WixUtilExtension.dll&lt;/HintPath&gt; &lt;Name&gt;WixUtilExtension&lt;/Name&gt; &lt;/WixExtension&gt; &lt;WixExtension Include="WixUIExtension"&gt; &lt;HintPath&gt;$(WixExtDir)\WixUIExtension.dll&lt;/HintPath&gt; &lt;Name&gt;WixUIExtension&lt;/Name&gt; &lt;/WixExtension&gt; &lt;WixExtension Include="WixNetFxExtension"&gt; &lt;HintPath&gt;$(WixExtDir)\WixNetFxExtension.dll&lt;/HintPath&gt; &lt;Name&gt;WixNetFxExtension&lt;/Name&gt; &lt;/WixExtension&gt; &lt;/ItemGroup&gt; &lt;ItemGroup&gt; &lt;Content Include="ConfigurationInitialize.wxi" /&gt; &lt;/ItemGroup&gt; &lt;Import Project="$(WixTargetsPath)" /&gt; &lt;PropertyGroup&gt; &lt;PreBuildEvent /&gt; &lt;/PropertyGroup&gt; &lt;Target Name="BeforeBuild"&gt; &lt;MSBuild Projects="%(ProjectReference.FullPath)" Targets="Package" Properties="Configuration=$(Configuration);Platform=$(Platform)" Condition="'%(ProjectReference.PackageThisProject)'=='True'" /&gt; &lt;PropertyGroup&gt; &lt;DefineConstants&gt;BasePath=%(ProjectReference.RootDir)%(ProjectReference.Directory)obj\$(Platform)\$(Configuration)\Package\PackageTmp\&lt;/DefineConstants&gt; &lt;/PropertyGroup&gt; &lt;HeatDirectory OutputFile="%(ProjectReference.Filename).wxs" Directory="%(ProjectReference.RootDir)%(ProjectReference.Directory)obj\$(Platform)\$(Configuration)\Package\PackageTmp" DirectoryRefId="INSTALLFOLDER" ComponentGroupName="%(ProjectReference.Filename)_Project" SuppressCom="true" SuppressFragments="true" SuppressRegistry="true" SuppressRootDirectory="true" AutoGenerateGuids="false" GenerateGuidsNow="true" ToolPath="$(WixToolPath)" Condition="'%(ProjectReference.PackageThisProject)'=='True'" PreprocessorVariable="var.BasePath" /&gt; &lt;/Target&gt; &lt;/Project&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload