I was having one requirement for running some exe after the deployment of BizTalk application. I have added the script accordingly in btdf proj file:
<Target Name="CustomPostDeployTarget" AfterTargets="Installer">
<Exec Command="DocAutomation.exe" WorkingDirectory="..\DocAutomation\bin\Debug"></Exec>
</Target>
This is working fine for single server deployment. Now i want to run this script only on last server or first server in multi server deployment as for now it will run on every server. How can i do that?
In the wizard when deploying or undeploying on a server, the checkbox that asks if you're on the first or last server corresponds to setting the environment variable BT_DEPLOY_MGMT_DB to 'true' or 'false'.
You can add an attribute to the target to use the same setting for your EXE.
Condition="'$(BT_DEPLOY_MGMT_DB)' == 'true'"
It will be true for the last server in the group when deploying, and for the first server in the group when undeploying.
If that doesn't do what you need, you can make it conditional on something else, such as the computer name $(COMPUTERNAME).