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
It seems TC does not support conditional runner step execution at their level except the execution policy (only if build status is successful, if all previous steps finished successfully, even if some prev steps failed, always) but that is not what you want.
So it seems you need to provide a custom system build param for your installer generator powershell build step like system.Generate which should be a bool (you can make it hidden, prompt, get its value based a on a config param, etc), and then in your powershell runner, add this:
param([int]$Generate)
if ($Generate) {
Write-Host "generating installer..."
# call your func()
} else {
Write-Host "skip installer"
}
In your runner config, add -Generate %system.Generate% as a script argument (careful, not additional command argument!). %system.Generate% should expand to 1 or 0 based on its runtime value.