tags:

views:

73

answers:

2

I want to generate a fragment using T4 but after adding a .tt file to the Wix project there is no "Custom Tool" option for this file. And there is no menu item "Run custom tool" when right clicking on the .tt file.

Is there a hack for this ? I'm using VS 2010 and latest Wix 3.5

A: 

I've never used T4 let alone with WiX, but a google of it turns up several interesting hits including the last one asking what you are asking but no one ever knew the answer.

T4 template to generate Wix scripts to generate WCF MSIs in MSBuild

How to use MSBuild and Wix to create msi package...

[WiX-users] WiX 3.0 Support for T4 Templates in Visual Studio 2008]3

Christopher Painter
-1 For not really answering the question.
GarethJ
Well at least I attempted to do some research for the poster with out saying something rude like "Let Me Google That For You". The question of T4 with WiX is soo obsecure that the chances of anyone ever providing a real answer is slim to none and slim just left town.
Christopher Painter
A: 

The Wix VS project system unfortunately doesn't support single file generators, so you won't get the default T4 experience.

You have a couple of choices. Oleg Sych's T4Toolbox has tools to run templates that target other projects, so you could run them in one project and target the output to your WiX project.

Alternatively, T4 has a simple service API STextTemplating. You could write a small VS add-in that does whatever generation you want in your Wix Project.

GarethJ
Hey Mr "Developer Architect in Visual Studio Ultimate, responsible for T4 Text Templating" why don't you get together with Rob Mensching and write one?
Christopher Painter