Geeks With Blogs
Koushal Deshpande kd

This is a post which I did on MSDN. I have not been comfortable using BTDF somehow, I always liked to have things done better using simple ways. This is one of the generalised script which I came up with for my recent project.


I too wanted to avoid BTDF, I wanted to have something simple which can be adapted to different projects easily. I had came up with generalised MSBuild script few months back. Currently I am using just a batch file, which does all work for me. Just giving you sample in case anyone want to use....

Build:

@ECHO.
@ECHO Building the project...
@SET BuildConf=Release

SET MSBUILDINSTALL=
for /D %%D in (%SYSTEMROOT%\Microsoft.NET\Framework\v4*) DO SET MSBUILDINSTALL=%%D
echo %MSBUILDINSTALL%

%MSBUILDINSTALL%\msbuild.exe ".\Bts.MyProject\Bts.MyProject.sln" /t:Build /p:Configuration=%BuildConf% 
MKDIR Bin
SET BIZINSTALLATION=
FOR /F "tokens=2* delims= " %%A IN ('REG QUERY "HKLM\SOFTWARE\Microsoft\BizTalk Server\3.0" /v InstallPath') DO SET BIZINSTALLATION=%%B
echo %BIZINSTALLATION%

@ECHO Copy DLLs to Bin Directory...
@SET SourcePath=".\Bts.MyProject\Bts.MyProject.Components\bin\%BuildConf%\Bts.MyProject.Components.dll" 
@Set DestinationPath=Bin
XCOPY %SourcePath% %DestinationPath% /Y
@SET SourcePath=".\Bts.MyProject\Bts.MyProject.PipelineComponents\bin\%BuildConf%\Bts.MyProject.PipelineComponents.dll" 
XCOPY %SourcePath% %DestinationPath% /Y
@Set DestinationPath="%BIZINSTALLATION%\Pipeline Components"
XCOPY %SourcePath% %DestinationPath% /Y
@Set DestinationPath=Bin
@SET SourcePath=".\Bts.MyProject\Bts.MyProject.Schemas\bin\%BuildConf%\Bts.MyProject.Schemas.dll" 
XCOPY %SourcePath% %DestinationPath% /Y
@SET SourcePath=".\Bts.MyProject\Bts.MyProject.Transforms\bin\%BuildConf%\Bts.MyProject.Transforms.dll" 
XCOPY %SourcePath% %DestinationPath% /Y
@SET SourcePath=".\Bts.MyProject\Bts.MyProject.Pipelines\bin\%BuildConf%\Bts.MyProject.Pipelines.dll" 
XCOPY %SourcePath% %DestinationPath% /Y
@SET SourcePath=".\Bts.MyProject\Bts.MyProject.Orchestrations\bin\%BuildConf%\Bts.MyProject.Orchestrations.dll" 
XCOPY %SourcePath% %DestinationPath% /Y

pause;

Deployment:

@ECHO.

@SET DllSourcePath=Bin
@SET ApplicationName=Bts.MyProject
@SET PaymentsHubRoot=Bts.MyProject
@SET SolutionName=Bts.MyProject.sln
@SET ComponentsName=Bts.MyProject.Components
@SET OrchestrationsName=Bts.MyProject.Orchestrations
@SET PipelineComponentsName=Bts.MyProject.PipelineComponents
@SET PipelinesName=Bts.MyProject.Pipelines
@SET SchemasName=Bts.MyProject.Schemas
@SET TransformsName=Bts.MyProject.Transforms

@btstask AddApp -ApplicationName:%ApplicationName%

SET GACUTILPATH=
FOR /F "tokens=2* delims= " %%A IN ('REG QUERY "HKLM\SOFTWARE\Microsoft\Microsoft SDKs\Windows\v7.0A\WinSDK-NetFx40Tools-x86" /v InstallationFolder') DO SET GACUTILPATH=%%B
echo %GACUTILPATH%

"%GACUTILPATH%\gacutil.exe" /i ".\%DllSourcePath%\%ComponentsName%.dll" 
"%GACUTILPATH%\gacutil.exe" /i ".\%DllSourcePath%\%PipelineComponentsName%.dll" 
"%GACUTILPATH%\gacutil.exe" /i ".\%DllSourcePath%\%SchemasName%.dll" 
"%GACUTILPATH%\gacutil.exe" /i ".\%DllSourcePath%\%TransformsName%.dll" 
"%GACUTILPATH%\gacutil.exe" /i ".\%DllSourcePath%\%PipelinesName%.dll" 
"%GACUTILPATH%\gacutil.exe" /i ".\%DllSourcePath%\%OrchestrationsName%.dll" 

@btstask -ApplicationName:%ApplicationName% AddResource -Type:System.BizTalk:Assembly  -Source:".\%DllSourcePath%\%ComponentsName%.dll" -Options:GacOnAdd -Overwrite
@btstask -ApplicationName:%ApplicationName% AddResource -Type:System.BizTalk:Assembly  -Source:".\%DllSourcePath%\%PipelineComponentsName%.dll" -Options:GacOnAdd -Overwrite

@btstask -ApplicationName:%ApplicationName% AddResource -Type:System.BizTalk:BizTalkAssembly  -Source:".\%DllSourcePath%\%SchemasName%.dll" -Options:GacOnAdd -Overwrite
@btstask -ApplicationName:%ApplicationName% AddResource -Type:System.BizTalk:BizTalkAssembly  -Source:".\%DllSourcePath%\%TransformsName%.dll" -Options:GacOnAdd -Overwrite
@btstask -ApplicationName:%ApplicationName% AddResource -Type:System.BizTalk:BizTalkAssembly  -Source:".\%DllSourcePath%\%PipelinesName%.dll" -Options:GacOnAdd -Overwrite
@btstask -ApplicationName:%ApplicationName% AddResource -Type:System.BizTalk:BizTalkAssembly  -Source:".\%DllSourcePath%\%OrchestrationsName%.dll" -Options:GacOnAdd -Overwrite

pause;

Packaging:

@ECHO.

@Set PackagePath=Package
@SET ApplicationName=Bts.MyProject
@SET MSIName=Bts.MyProject

SET GACUTILPATH=
FOR /F "tokens=2* delims= " %%A IN ('REG QUERY "HKLM\SOFTWARE\Microsoft\Microsoft SDKs\Windows\v7.0A\WinSDK-NetFx40Tools-x86" /v InstallationFolder') DO SET GACUTILPATH=%%B
echo %GACUTILPATH%

MKDIR %PackagePath%
@btstask ExportApp -ApplicationName:%ApplicationName% -Package:%PackagePath%\%MSIName%.msi

pause;
 
Posted on Tuesday, October 22, 2013 5:00 PM BizTalk , Batch file , Build & Deployment | Back to top


Comments on this post: BizTalk Project Build, Deployment and Packaging

No comments posted yet.
Your comment:
 (will show your gravatar)


Copyright © Koushal Deshpande | Powered by: GeeksWithBlogs.net