Mapping Issues When running Install Silently from Powershell script

Topics: General Questions, Getting Started/Beginner
Feb 18, 2015 at 3:51 PM
I am using Powershell scripts to call the .msi that I created using the BT Deployment Framework.
However, I am having an issue with errors coming back with the paths to some of the things that the msi is doing. I am doing my installation in the path of "C:\HTTU.BizTalk" so in otherwords the installdir = "C:\HTTU.BizTalk".

I was able to change the deploymentframeworkstargetpath to the following

"DeploymentFrameworkTargetsPath=C:\HTTU.BizTalk\Install\Deployment\Framework\" and pass that as an argument to the msi
so that fixed one issue.

However, I am getting an error because the xmlpreprocess.exe cannot be found - it is looking for it in the (Folder where I am running the deployment)\framework\deploytools folder whereas I really want to run it under where the msi has been installed - under "C:\HTTU.BizTalk". Is there a default property that can be set within the *.btdfproj file so that every single thing that runs during the deployment will always look for it somewhere in the installation directory? I have InstallDir set correctly but the msi always looks for things in terms of where you run the build and not where the build is actually installed. It's frustrating and that's why I had to set the "DeploymentFrameworkTargetsPath" in the Powershell script to point to the install folder. How do I do the same now to tell the msi where to look for xmlpreprocess.exe?

Do I use some sort of variabilized setting and pass it as an argument like I am doing with the "DeploymentFrameworkTargetsPath". The variable DeploymentFrameworkTargetsPath" is already part of the framework but now I am unsure how to change the path in the Powershell script so it knows to look for the xmlpreprocess.exe in what is the equivalent of (installdir)\Install\Deployment\Framework\DeployTools.

Thanks
Coordinator
Feb 20, 2015 at 5:18 AM
You should not need to do any path overrides or changing DeploymentFrameworkTargetsPath. When you run a deployment using the Start menu items, the current working directory is always the location of the .btdfproj. Have you looked at Randy Paulo's PowerShell scripts? They're not perfect, but a very good foundation.

Thanks,
Tom
Feb 20, 2015 at 1:22 PM
But that is considering that you have Visual Studio available on every environment that you do an install from and run from the same path within each VS environment when calling the MSI which is not practical because you will not want VS installed on production servers. I am actually using Randy Paulo's script. I build the MSI using the BizTalk Development Framework and then I bundle it with the bindings and the PortBindingsMaster,xml into a zip file that can be copied from machine to machine. If you are not running from within the BizTalk path of VS then the DeploymentFrameworkTargetsPath will need to be changed as well as the path to the folder called "\obj\Debug\redist\Deployment\Framework\DeployTools" which is where the XmlPreprocess.exe runs.

DeploymentFrameworkTargetsPath is easy enough to change since it is already a built-in variable that is part of the framework. I just pass it as a variable in the params to the MSI. However, how would I go about changing the path to the Tools folder (\obj\Debug\redist\Deployment\Framework\DeployTools)?
I'd like to do it in such a way as I can pass a variable in the path to the MSI build like I am doing with the DeploymentFrameworkTargetsPath variable and be able to run the build from both within VS without having problems and also do the same if I pass it as an argument.

I have the following in my .btdfproj file and it works fine if I compile or deploy from within VS or from the command line passing DeploymentFrameworkTargetsPath as an argument. I want to be able to do the same thing for the "Tools" folder. How can I can do this and allow the project to be able to compile successfully within VS?
This works

<Import Project="$(DeploymentFrameworkTargetsPath)BizTalkDeploymentFramework.targets" />

I tried creating my own variable like the following and it does not work. How can I do this?
<Import Project="$(PathToXMLPreProcess)XmlPreprocess.exe" />

thanks
Tim
Coordinator
Feb 20, 2015 at 5:24 PM
The Deployment Framework would serve no purpose if it only worked in Visual Studio. I'm not sure why you're creating a ZIP file with the bindings XML files, when they are already packaged into the MSI created by the Deployment Framework. When you install the MSI, the bindings files will be there.

Have you tried installing and deploying with the MSI manually, without a PowerShell script, or are you jumping directly to scripting?

Randy's script is missing the /t:Deploy parameter to MSBuild, and you also have to pass /p:Configuration=Server. All of the overrides you're attempting are unnecessary. You might want to take a step back and get your .btdfproj back in sync with the default property values. Take a look at the sample applications or just create a new temporary project with Add New Project.

Since you are mentioning a path that is relevant only to the MSI build process -- \obj\Debug\redist\Deployment\Framework\DeployTools -- maybe it's just /t:Deploy that you are missing.

Thanks,
Tom