Executing commend file while BTDF deployment

Topics: Bindings File, Settings Management and SSO, General Questions, Server Deployment, Tips and Tricks
Jun 1, 2015 at 9:49 PM
Edited Jun 2, 2015 at 3:40 AM
Hi All,

I have using below code for run the cmd file while deployment process but did not executing
   <AdditionalFiles Include="CleanCopy.cmd">
<Target Name="CustomDeployTarget">
   <Exec command="..\CleanCopy.cmd $(EnvironmentName)"></Exec>

<Target Name="CustomDeployTarget">
   <Exec command=" CMD.exe &quot;CleanCopy.cmd $(EnvironmentName)&quot;"></Exec>

$(EnvironmentName) is the passing parameter

CleanCopy.cmd :

copy .\FSClean-.xml c:\biztalk\%1\ClenupScript

Please guide me how to resolve this error

Jun 2, 2015 at 5:31 AM
Is the issue during a deployment from Visual Studio, or only when using the MSI? Have you tested a Visual Studio deployment first? Relative paths in the .btdfproj are always relative to the folder that contains the .btdfproj. You have CleanCopy.cmd in ..\CMDFolder, which is fine in a Visual Studio deployment if that's where you keep it. However, on an MSI deployment CleanCopy.cmd will be located at ..\, not ..\CMDFolder, because that's where <AdditionalFiles> drops files for the MSI install.

You should see the output and error messages in your deployment log.

Jun 2, 2015 at 3:14 PM
Edited Jun 2, 2015 at 3:15 PM
Hi Tom,

I have used below code then which executed in the local as well in the server
<Exec command="cmd.exe  /c &quot;..\CleanCopy.cmd &quot;"></Exec>
I need to pass environment name as parameter to the commend file .

how to read the environment name(D1,D2,,U1 etc) from SettingsFileGenerator.xml to Deployment.btdfproj file

I have used $(EnvironmentName) or '$(EnvironmentName' but which returns empty value
<Exec command="cmd.exe  /c &quot;..\CleanCopy.cmd $(EnvironmentName)&quot;"></Exec>

Environment Settings
Environment Name: Local Development Dev D1 D2 Q1 Q2 U1 U2 Production
Jun 2, 2015 at 3:21 PM
You just need to add EnvironmentName to the existing PropsFromEnvSettings ItemGroup, assuming that EnvironmentName is the setting name within the spreadsheet. I think that's all you're missing.

Jun 2, 2015 at 11:31 PM
Thank you tom.

I have added in the PropsFromEnvSettings then my issue got resolved .
Jun 4, 2015 at 4:50 PM
I have set the environment tag in the PropsFromEnvSettings then its worked.

Thank you Tom for your help .