%BTAD_InstallDir% not working in AddResource Command (BTSTask.exe)

Posted on Updated on

The global environment variable %BTAD_InstallDir% does not translate as you would expect when you AddResource using BTSTask.exe

in a batch command or in build event of assemblies.

A command such as :

BTSTask AddResource -Source:”$(TargetPath)” -ApplicationName:AppName -Type:System.BizTalk:Assembly -Overwrite  -Destination:”%BTAD_InstallDir%\$(TargetFileName)” -Options:GacOnInstall

is executed successfully but when you see the same in BizTalk admin console you find that its translates only to \$(TargetFileName) and the environment variable is skipped.

MSDN link suggests the same but that does not work.

Capture

 

To make this working use the below.

BTSTask AddResource -Source:”$(TargetPath)” -ApplicationName:AppName -Type:System.BizTalk:Assembly -Overwrite  -Destination:”%%BTAD_InstallDir%%\$(TargetFileName)” -Options:GacOnInstall

Note the two % symbols. This is because single % is skipped in evaluation.

 

Advertisements

One thought on “%BTAD_InstallDir% not working in AddResource Command (BTSTask.exe)

    Biz said:
    April 24, 2014 at 10:53 am

    Nice post. I was struggling to get this working..

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s