4

What I'm Doing

I have an ASP.Net Web Application and a WiX Setup Project in Visual Studio 2010. I can explicitly harvest the web application with the following HEAT command set as a pre-build event for the setup project:

“%WIX%\bin\heat.exe” project "$(SolutionDir)Application.WebUI\Application.WebUI.vbproj" -o "$(ProjectDir)ProjectOutputContent.wxs" -pog Content -ag -template fragment -nologo -directoryid RUNTIMEFOLDER

“%WIX%\bin\heat.exe” project "$(SolutionDir)Application.WebUI\Application.WebUI.vbproj" -o "$(ProjectDir)ProjectOutputBinariesAndSymbols.wxs" -pog Binaries -pog Symbols -ag -template fragment -nologo -directoryid BINFOLDER

Keep in mind that RUNTIME folder and BINFOLDER are directories I declaratively setup in my main product WXS file.

Why I Don't Like It

This approach is annoying because I need the HEAT generated fragment WXS files checked out before I can build the setup project. Another consideration is that it is a web application and I need to drop the binaries and symbols into a different directory (bin) than the content.

What I'm Aiming For

I would rather use a project reference within the Wix Setup Project and simply set the Harvest property to True. I could then harvest the BinariesContentSatellites to get the items I need in my fragment and then set a single Directory Id that I can reference in the main product WXS. The problem is that this will put the content, binaries and symbols in the same folder where I need the latter two in a nested bin folder. I can't add this project reference twice, each with different harvest options.

My Question

Is there a way to do what I'm after or do I need to keep with the pre-build event? As an aside, I have considered manually harvesting the fragment once, without a build event, and then re-harvesting as needed. I would prefer to avoid that approach.

Community
  • 1
  • 1
Matt Poland
  • 398
  • 4
  • 9

1 Answers1

3

Answering your topic "Why I Don't Like It" : I too had same problem but then i found the solution. You dont need to check-in the fragment file. Just add the file physically and then include in your project

Note : Don't add the fragment file from the project.

Sunil Agarwal
  • 4,097
  • 5
  • 44
  • 80
  • I like what you're thinking. If someone first pulled this down from source control, the project would look like it was missing files but it would build successfully. After a build Visual Studio won't immediately show those files as there, but they are. Re-opening the project again will have them there. – Matt Poland Aug 11 '11 at 14:55
  • I am thinking about going with a variation on this approach. I have added "ProjectOutputBinariesAndSymbols.wxs" and "ProjectOutputContent.wxs" to my compiler additional parameters. I also added "obj\Debug\ProjectOutputBinariesAndSymbols.wixobj" and "obj\Debug\ProjectOutputContent.wixobj" to my linker additional parameters under Tool Settings for the Wix Setup Project properties screen. – Matt Poland Aug 11 '11 at 14:57
  • You can also exclude a file explicitly from source control. Select the file, click File -> Source Control -> (Advanced, in VS2012) -> Exclude ProjectOutputContent.wxs from Source Control. See: http://img15.imageshack.us/img15/2189/69468689.png – riezebosch Jul 12 '12 at 12:44