I am working on defining a general-purpose build template for all our projects -- which I have placed at the \"root project\" level (thanks to this new feature of TeamCity 8
I've been researching this use case as I have a very similar problem to solve. The best solution I've found so far is the one stated in fwise's answer - to include all possible steps you might need within your template, but then on a case-by-case basis disable the unrequired steps for each project.
So in your case you would include your 'installer' build step at the root level, but disable it for any projects which inherit this template and don't have an installer.
For a single optional step this feels like a good approach but admittedly it wouldn't scale very well to large complex templates with many optional steps.
I picked this up from the TeamCity documentation here: