To close the loop on this, I finally got it working..
I now have the following for the BeforeBuild Target

<Target Name="BeforeBuild">
  <MSBuild Projects="%(ProjectReference.FullPath)" Targets="Package" 
               Properties="Configuration=$(Configuration);Platform=AnyCPU"
               Condition="'(ProjectReference.WebProject)'=='True'" />
  <ItemGroup>
    <LinkerBindInputPaths
Condition="'%(ProjectReference.WebProject)'=='True'"
          
Include="%(ProjectReference.RootDir)%(ProjectReference.Directory)obj\$(Configuration)\Package\PackageTmp\"
/>
    <WebPackageDirs Condition="'%(ProjectReference.WebProject)'=='True'"
          
Include="%(ProjectReference.Name).WebPackageDir=%(ProjectReference.RootDir)%(ProjectReference.Directory)obj\$(Configuration)\Package\PackageTmp"
/>
  </ItemGroup>

  <PropertyGroup>
    <DefineConstants>@(DefineConstants);@(WebPackageDirs)</DefineConstants>
  </PropertyGroup>
  <HeatDirectory OutputFile="%(ProjectReference.Filename).wxs"
                
Directory="%(ProjectReference.RootDir)%(ProjectReference.Directory)obj\$(Configuration)\Package\PackageTmp"
                 DirectoryRefId="%(ProjectReference.RefTargetDir)"
                 ComponentGroupName="%(ProjectReference.Filename)_Project"
                 AutogenerateGuids="true"
                 SuppressCom="true"
                 SuppressFragments="true"
                 SuppressRegistry="true"
                 SuppressRootDirectory="true"
                 ToolPath="$(WixToolPath)"
                
PreprocessorVariable="var.%(ProjectReference.Name).WebPackageDir"
                 Condition="'%(ProjectReference.WebProject)'=='True'" />
</Target>

I hope this information can help someone else that might try to deploy
multiple Web Apps using WiX.


Regards,
Bevan Weiss


Thanks Blair,
That's what I'm now trying to do.  However I guess this has become a bit of
an MSBuild type issue in that I'm trying to dynamically create the Candle
defines, but struggling.

Is there any good guidance available on this?


Thanks again,
Bevan


Blair Murri-3 wrote
> The PreprocessorVariable can be set to var.MyVarForThisDir as well as
> wix.MyVarForThisDir. The former needs to be passed to candle, the later
> can be either passed to light or defined in one of your other WXS sources.
> http://stackoverflow.com/questions/1773830/wix-how-to-handle-project-references-when-using-heats-output-with-candleprovides
> a couple of tips.
>> From: Bevan Weiss
>> Subject: Re: [WiX-users] Web.config file issues when using Heat with
>> multiple Web Application Projects
>> 
>> Hi Blair,Thanks for the reply.My DirectoryRefId for each WebApp is
>> different, and they are then located in different directories in the
>> final install (this part is working ok, all the other files for the
>> WebApps are installing correctly)
>> After install I am getting four Web.config files installed in different
>> directories, but they are all the same (whilst in the source they are all
>> different).I understand this is related to the Source being set
>> identically (by Heat).  But I'm not sure how to get Heat to output a
>> different Source format.  Other than using the PreprocessorVariable, but
>> this only seems to allow Wix Variables to be introduced, and then I'm
>> struggling to find a way to get all the additional wix variables defined
>> in the Candle command line (from within msbuild).
>> If I change the Directory for Heat then it starts to Harvest too many
>> files, and inserts extra Directory elements in the wxs that I don't want
>> (and it seems wrong to have to post-process the Heat output).
>> How would people normally do this?Would it be more common to do this
>> deployment from individual msi files, and then running an overall msi
>> which just 'bootloads' these other installers?
>> 
>> Regards,Bevan Weiss





--
View this message in context: 
http://windows-installer-xml-wix-toolset.687559.n2.nabble.com/Web-config-file-issues-when-using-Heat-with-multiple-Web-Application-Projects-tp7588913p7588979.html
Sent from the wix-users mailing list archive at Nabble.com.

------------------------------------------------------------------------------
LIMITED TIME SALE - Full Year of Microsoft Training For Just $49.99!
1,500+ hours of tutorials including VisualStudio 2012, Windows 8, SharePoint
2013, SQL 2012, MVC 4, more. BEST VALUE: New Multi-Library Power Pack includes
Mobile, Cloud, Java, and UX Design. Lowest price ever! Ends 9/20/13. 
http://pubads.g.doubleclick.net/gampad/clk?id=58041151&iu=/4140/ostg.clktrk
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users

Reply via email to