As far as I know, agent requirements work simply by checking for either the presence or the value specified in the agent parameter. As you say, this requires editing the <agent home>/conf/buildAgent.properties configuration file either manually or in some automatic way.
In terms of automation, you can use the build configuration approach, which acts as the agent boot agent; that is, an assembly that runs for all agents (scheduled overnight / manually) and supports assembly agent settings in the <agent home>/conf/buildAgent.properties depending on the specific conditions of the agent. Something like (pseudo):
if [ exists /path/to/MSDeploy ] then echo MSDeployExists to buildAgent.properties
This is due to a large disclaimer; I have not tried this myself, and I believe that the agent will automatically restart depending on the changes to this file, so there may be problems editing this file automatically. But this is a potential solution to maintain your requirements in a centralized way, and if it works then it works fine. I use a similar approach for self-customizing custom assembly scripts for all agents to increase the already rich feature set in TeamCity.
Stevechapman
source share