Deploying AdditionalFiles to specific destination folders

Topics: Server Deployment
May 8, 2014 at 4:14 PM
So I have looked at the multitude of threads here regarding deploying and running custom scripts and additional files via BTDF but cannot get it to work appropriately.

I have created an ItemGroup for the file I want to include in the deployment package as such:

<ItemGroup>
<AdditionalFiles Include="HL7V2XEDHighUtilEmailSummary.xsl" Label="EmailXSLT">
  <LocationPath>..\..\Assets\AdditionalFiles</LocationPath>
</AdditionalFiles>
</ItemGroup>

And I have created the following Target to tell the deployment packages where to put the file during deploy as such:

<Target Name="CustomeDeployTarget">
<Copy SourceFiles="..\HL7V2XEDHighUtilEmailSummary.xsl" DestinationFolder="C:\Program Files (x86)\Microsoft BizTalk Server 2010\Pipeline Components" />
</Target>

When I try to deploy via VS2010 (using BTDF 5.5) I don't get any errors but it doesn't create the file in the directory either. What am I doing wrong?
May 8, 2014 at 4:18 PM
Woops, just realized I had a typo. I changed the code to reflect the correct spelling:

<Target Name="CustomDeployTarget">
<Copy SourceFiles="$(EmailXSLT)" DestinationFolder="C:\Program Files (x86)\Microsoft BizTalk Server 2010\Pipeline Components" />
</Target>

Still not copying the file though
Coordinator
May 8, 2014 at 10:05 PM
For the Visual Studio deploy, the SourceFiles path is ....\Assets\AdditionalFiles\HL7V2XEDHighUtilEmailSummary.xsl and for the MSI deploy, the SourceFiles path is ..\HL7V2XEDHighUtilEmailSummary.xsl. You can create an ItemGroup for each case inside the CustomDeployTarget like:
<ItemGroup Condition="'$(Configuration)' != 'Server'">
  <XslToCopy Include="..\..\Assets\AdditionalFiles\HL7V2XEDHighUtilEmailSummary.xsl" />
</ItemGroup>
<ItemGroup Condition="'$(Configuration)' == 'Server'">
  <XsltoCopy Include="..\HL7V2XEDHighUtilEmailSummary.xsl" />
</ItemGroup>
Then use SourceFiles="@(XslToCopy)" in the Copy task. You can use "$(BtsDir)Pipeline Components" in the DestinationFolder.

Thanks,
Tom
May 9, 2014 at 1:59 PM
Edited May 9, 2014 at 7:27 PM
Still not copying the file. Everything else works as expected. I checked the deployment log and I see no mention of that xsl file or the path, or the customdeploytarget.

Here is my entire btdfproj (the &39's are just single quotes, this forums auto formatted that)
<?xml version="1.0" encoding="utf-8"?>
<!-- 
  Deployment Framework for BizTalk 5.0
  Copyright (C) 2004-2012 Thomas F. Abraham and Scott Colestock
-->
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003" DefaultTargets="Installer" ToolsVersion="4.0">
  <PropertyGroup>
    <Configuration Condition="'$(Configuration)' == ''">Debug</Configuration>
    <Platform Condition="'$(Platform)' == ''">x86</Platform>
    <SchemaVersion>1.0</SchemaVersion>
    <ProjectName>CHN.HL7.V2X</ProjectName>
    <ProjectVersion>1.0</ProjectVersion>
    <IncludePipelines>True</IncludePipelines>
    <IncludeTransforms>True</IncludeTransforms>
    <IncludeComponents>True</IncludeComponents>
    <IncludeOrchestrations>True</IncludeOrchestrations>
    <IncludeSchemas>True</IncludeSchemas>
    <IncludeSSO>True</IncludeSSO>
    <UsingMasterBindings>True</UsingMasterBindings>
    <SkipIISReset>True</SkipIISReset>
    <StartReferencedApplicationsOnDeploy>False</StartReferencedApplicationsOnDeploy>
    <RequireXmlPreprocessDirectives>False</RequireXmlPreprocessDirectives>
    <IncludeCompsAndVDirsAsResources>True</IncludeCompsAndVDirsAsResources>
  </PropertyGroup>
  <PropertyGroup>
    <!-- Properties related to building an MSI for server deployments -->
    <!-- BizTalk App Version Upgrade -->
    <!--   For each new product release to be deployed to your BizTalk servers: -->
    <!--     1) Increment ProductVersion -->
    <!--     2) Generate a new GUID and update ProductId with the new GUID -->
    <!--   This allows the new MSI to automatically uninstall (not undeploy!) the old MSI and install the new one. -->
    <ProductVersion>1.0.0</ProductVersion>
    <ProductId>25bbe5ac-9f86-4b9f-803c-42f8bb39c8fa</ProductId>
    <!-- BizTalk App Version Upgrade -->
    <ProductName>CHN.HL7.V2X for BizTalk</ProductName>
    <Manufacturer>Deployment Framework User</Manufacturer>
    <PackageDescription>CHN.HL7.V2X</PackageDescription>
    <PackageComments>CHN.HL7.V2X</PackageComments>
    <!-- NEVER change the ProductUpgradeCode. -->
    <ProductUpgradeCode>6bdcb828-2063-4f34-86fc-0a8965aa1518</ProductUpgradeCode>
  </PropertyGroup>
  <!-- Under TFS Team Build, set CustomizableOutDir property to true in TFS 2005/2008/2010 UpgradeTemplate. -->
  <!-- With a workflow build, copy the default template then modify the MSBuild task for the solution build. Set OutDir to blank and -->
  <!-- CommandLineArguments to String.Format("/p:SkipInvalidConfigurations=true;TeamBuildOutDir=""{0}"" {1}", BinariesDirectory, MSBuildArguments). -->
  <PropertyGroup Condition="'$(Configuration)' == 'Debug'">
    <DeploymentFrameworkTargetsPath>$(MSBuildExtensionsPath)\DeploymentFrameworkForBizTalk\5.0\</DeploymentFrameworkTargetsPath>
    <OutputPath Condition="'$(TeamBuildOutDir)' == ''">bin\Debug\</OutputPath>
    <OutputPath Condition="'$(TeamBuildOutDir)' != ''">$(TeamBuildOutDir)</OutputPath>
    <DeployPDBsToGac>false</DeployPDBsToGac>
  </PropertyGroup>
  <PropertyGroup Condition="'$(Configuration)' == 'Release'">
    <DeploymentFrameworkTargetsPath>$(MSBuildExtensionsPath)\DeploymentFrameworkForBizTalk\5.0\</DeploymentFrameworkTargetsPath>
    <OutputPath Condition="'$(TeamBuildOutDir)' == ''">bin\Release\</OutputPath>
    <OutputPath Condition="'$(TeamBuildOutDir)' != ''">$(TeamBuildOutDir)</OutputPath>
    <DeployPDBsToGac>false</DeployPDBsToGac>
  </PropertyGroup>
  <PropertyGroup Condition="'$(Configuration)' == 'Server'">
    <DeploymentFrameworkTargetsPath>Framework\</DeploymentFrameworkTargetsPath>
    <!-- Get our PDBs into the GAC so we get file/line number information in stack traces. -->
    <DeployPDBsToGac>true</DeployPDBsToGac>
  </PropertyGroup>
  <ItemGroup>
    <PropsFromEnvSettings Include="SsoAppUserGroup;SsoAppAdminGroup" />
  </ItemGroup>
  <!-- !!! TODO !!! -->
  <!-- Add ItemGroup elements that contain one or more Schemas, Orchestrations, Transforms, etc. elements that describe -->
  <!-- the specific artifacts in your solution that need to be deployed. Use IntelliSense as a guide. -->
  <ItemGroup>
    <Components Include="CHN.HL7.V2X.Components.dll">
      <LocationPath>..\$(ProjectName).Components\bin\$(Configuration)</LocationPath>
    </Components>
  </ItemGroup>
  <ItemGroup>
    <Pipelines Include="BTAHL72XMLPipelines.dll">
      <LocationPath>..\..\Assets\Libraries\</LocationPath>
    </Pipelines>
  </ItemGroup>
  <ItemGroup>
    <Pipelines Include="BTAHL72XPipelines.dll">
      <LocationPath>..\..\Assets\Libraries\</LocationPath>
    </Pipelines>
  </ItemGroup>
  <ItemGroup>
    <Schemas Include="Microsoft.Solutions.BTAHL7.HL7Schemas.dll">
      <LocationPath>..\..\Assets\Libraries\</LocationPath>
    </Schemas>
  </ItemGroup>
  <ItemGroup>
    <Schemas Include="CHN.HL7.V2X.Common.Schemas.dll">
      <LocationPath>..\$(ProjectName).Common.Schemas\bin\$(Configuration)</LocationPath>
    </Schemas>
  </ItemGroup>
  <ItemGroup>
    <Schemas Include="CHN.HL7.V24.Common.Schemas.dll">
      <LocationPath>..\CHN.HL7.V24.Common.Schemas\bin\$(Configuration)</LocationPath>
    </Schemas>
  </ItemGroup>
  <ItemGroup>
    <Schemas Include="CHN.HL7.V2X.HCCN.Schemas.dll">
      <LocationPath>..\$(ProjectName).HCCN.Schemas\bin\$(Configuration)</LocationPath>
    </Schemas>
  </ItemGroup>
  <ItemGroup>
    <Schemas Include="CHN.HL7.V2X.Yale.Schemas.dll">
      <LocationPath>..\$(ProjectName).Yale.Schemas\bin\$(Configuration)</LocationPath>
    </Schemas>
  </ItemGroup>
  <ItemGroup>
    <Transforms Include="CHN.HL7.V2X.Yale.Maps.dll">
      <LocationPath>..\$(ProjectName).Yale.Maps\bin\$(Configuration)</LocationPath>
    </Transforms>
  </ItemGroup>
  <ItemGroup>
    <Transforms Include="CHN.HL7.V2X.HCCN.Maps.dll">
      <LocationPath>..\$(ProjectName).HCCN.Maps\bin\$(Configuration)</LocationPath>
    </Transforms>
  </ItemGroup>
  <ItemGroup>
    <Transforms Include="CHN.HL7.V2X.Common.Maps.dll">
      <LocationPath>..\$(ProjectName).Common.Maps\bin\$(Configuration)</LocationPath>
    </Transforms>
  </ItemGroup>
  <ItemGroup>
    <Pipelines Include="CHN.HL7.V2X.Common.Pipelines.dll">
      <LocationPath>..\$(ProjectName).Common.Pipelines\bin\$(Configuration)</LocationPath>
    </Pipelines>
  </ItemGroup>
  <ItemGroup>
    <Orchestrations Include="CHN.HL7.V2X.Common.Orchs.dll">
      <LocationPath>..\$(ProjectName).Common.Orchs\bin\$(Configuration)</LocationPath>
    </Orchestrations>
  </ItemGroup>
  <ItemGroup>
    <AppsToReference Include="CHN.ASO.Shared" />
  </ItemGroup>
  <!-- !!! TODO !!! -->
  <Import Project="$(DeploymentFrameworkTargetsPath)BizTalkDeploymentFramework.targets" />
  <!--
    The Deployment Framework automatically packages most files into the server install MSI.
    However, if there are special folders that you need to include in the MSI, you can
    copy them to the folder $(RedistDir) in the CustomRedist target.
    To include individual files, add an ItemGroup with AdditionalFiles elements.
  -->
  <Target Name="CustomDeployTarget">
    <ItemGroup Condition="'$(Configuration)' != 'Server'">
      <XslToCopy Include="..\..\Assets\AdditionalFiles\HL7V2XEDHighUtilEmailSummary.xsl" />
    </ItemGroup>
    <ItemGroup Condition="'$(Configuration)' == 'Server'">
      <XsltoCopy Include="..\HL7V2XEDHighUtilEmailSummary.xsl" />
    </ItemGroup>
    <Copy SourceFiles="$(@XslToCopy)" DestinationFolder="$(BtsDir)Pipeline Components" />
  </Target>
</Project>
Coordinator
May 9, 2014 at 7:43 PM
There is a syntax issue in the Copy task. Try this:
<Copy SourceFiles="@(XslToCopy)" DestinationFolder="$(BtsDir)Pipeline Components" />
May 10, 2014 at 1:48 PM
Works perfectly, thanks for the help.