How to add Stop Application in btdfproj file

Topics: Server Deployment
Jun 15, 2011 at 8:44 PM

Is there any way I can have "Stop Application" in btdfproj file?

I have manual deployment scripts that use MSBUIILD.exe to do all the deployment. I tried the following in btdfproj file

    <Target Name="StopApplication-XXX" Condition="'$(SkipUndeploy)' == 'false'">
        <!-- Remove BizTalk 2006 application definition -->

        <GetBizTalkAppExists ApplicationName="ApplicationXXX">
            <Output TaskParameter="AppExists" PropertyName="AppExists" />
        </GetBizTalkAppExists>

        <CheckForServiceInstances Application="ApplicationXXX" Condition="'$(AppExists)' == 'true'" />

        <ControlBizTalkApp ApplicationName="ApplicationXXX" StopOption="DisableAllReceiveLocations,UndeployAllPolicies,UnenlistAllOrchestrations,UnenlistAllSendPortGroups,UnenlistAllSendPorts" Condition="'$(AppExists)' == 'true'" ContinueOnError="true" />
    </Target>

 

I am calling following command from batch file

-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

C:\Windows\Microsoft.NET\Framework\v2.0.50727\msbuild.exe ApplicationXXX.Deployment.btdfproj /t:StopApplication-XXX /p:Configuration=Server

-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Getting the following Error while running the batch file

Microsoft (R) Build Engine Version 2.0.50727.3053
[Microsoft .NET Framework, Version 2.0.50727.3619]
Copyright (C) Microsoft Corporation 2005. All rights reserved.

C:\Program Files (x86)\ApplicationXXX\Deployment\ApplicationXXX.Deployment.btdfproj(129,11): error MSB4019: The imported project "C:\Program Files (x86)\ApplicationXXX\Deployment\BizTalkDeploymentFramework.targets" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk.

Coordinator
Jun 16, 2011 at 3:59 AM

I'm a bit confused.  Are you trying to use parts of the Deployment Framework without fully implementing it?  On a development machine you should install the Deployment Framework with the MSI here.  Use the Add New Project wizard in Visual Studio to create a new Deployment Framework project in your BizTalk solution.  Configure the .btdfproj and test the deployment locally on your dev machine.  When you're ready to move to a server, use the Build Server MSI command to build an MSI that's ready to be installed on your BizTalk server.

Are you trying to manually execute parts of the script for some reason?

Thanks,
Tom

Jun 16, 2011 at 4:03 AM

Thanks Tom. And apologize for the confusion.

 

I have everything you mentioned. I just gave the snipped of my btdfproj file. I actually got solution working.

 

Regards,

Tushar

Coordinator
Jun 16, 2011 at 4:44 AM

OK, great!  Please feel free to post any other questions if you run into any trouble.

Thanks,
Tom

Jun 22, 2011 at 10:34 PM
Edited Jun 22, 2011 at 10:35 PM

Hello tom,

 

I have a 4 app servers environment. I am using your script and it deploys to all 4 servers and updates mgmt db 4 times. I can see from the logs that it is doing Target DeployBizTalkMgmtDB_true all 4 times. How can I make this run only on 1 server?What I mean is - It does GAC on 3 servers and on the 4th , deploys and GACs.

I am not using 2 step procedure as explained in documentation. I am not using wizard on the start->programs (menu). I am using MSBUILD.EXE to deploy.

 

Thanks

Tushar

Coordinator
Jun 23, 2011 at 3:53 AM

The deploy wizard that runs on a server deployment reads in the InstallWizard.xml from your project folder.  Inside that file are a number of EnvironmentVarName elements.  The wizard is presenting a UI for each one of those to collect the value from the user.  When the wizard completes, it creates a series of environment variables (named by EnvironmentVarName values) and assigns the values collected from the user.

Net result, when the wizard launches MSBuild it has prepared the environment with a number of those environment variables.  You are not completing that step since you are directly scripting the installs.  There are some lengthy discussion posts here that have fully discussed the process to script everything as you are doing.  However, the key environment variable (which you can alternatively pass to MSBuild with /p) is BT_DEPLOY_MGMT_DB, which at deployment should be false for the initial servers and true for the last server.  Reverse at undeployment.  Another one that you must set is ENV_SETTINGS, to point to the settings XML file for the current environment (assuming that you are taking advantage of the settings spreadsheet).

Thanks,
Tom

Jun 24, 2011 at 2:24 PM

Thanks Tom. Your ServerDeploy.bat file has these details. I forgot to see that file.

One more question - How do you suppress installation to show up in Start->programs.

Coordinator
Jun 24, 2011 at 5:45 PM

You cannot remove the Start menu item without customizing Developer\generate-install-script.js in your BTDF install directory.  I'd recommend not to remove it because it has shortcuts to utility functions like the SSO editor tool, host restart, etc. besides just deploy and undeploy.

Thanks,
Tom

Jun 24, 2011 at 6:25 PM

That helps. Thanks a lot for your help.

Coordinator
Jun 24, 2011 at 7:15 PM

You're welcome Tushar!

Jul 3, 2011 at 11:43 AM

Hi Tom,

In the discussion

Re: Jun 15 at 9:44 PM-How to add Stop Application in btdfproj file

A question was asked how you could suppress the installation to show up in Start->programs.

I noted your response that changes to Developer\generate-install-script.js would be required and was probably not a good idea.

The client I am currently working for has the potential for hundreds of BizTalk Applications each relating to a business partner. The applications are really only place holders for Schemas and maps a controlling application/s dynamically perform the transformations. This new design pattern will allow us to make changes to a single partner without affecting outage to other partners. The issue here is that we could potentially have hundreds of entries under Start->programs, which may be viewed by some as unnecessary and a little over the top.

Therefore have you ever had to make changes to the .js file and if so do you have any pointers/sample files that might help me carry out this task, also am I correct in assuming it would be global, affecting all built msi’s? Alternatively should I just suggest to the client to live with it.

Although I have only really started re-factoring my clients BizTalk Applications, I have a LONG way to go and I am sure I will have many more hurdles to cross but in the first instance it would appear that BTDF is once again proving itself as one of the best deployment frameworks for BizTalk.

 Cheers

Jim

Coordinator
Jul 5, 2011 at 6:18 AM

Thanks Jim!  I agree, under that design you don't want hundreds of Start menu folders.  You're correct -- changing the Developer\generate-install-script.js file has a global impact to MSI's generated on that machine.  The short answer is to find any line in the .js that references BizShortCuts and BizShortCutsTools and remove it (being mindful of matching XML tags).  Along with the app-specific deploy/undeploy shortcuts, you'll lose the "tooling" shortcuts for rule policy deployment, SSO editing, etc.

You mentioned "changes to a single partner without affecting outage to other partners", but by default a deploy or undeploy will bounce the host instances.  While that behavior can be overridden, BizTalk does like to hang onto stuff in memory until the host instances restart.

I'm curious how BizTalk Admin will scale in that situation.  I wonder if Microsoft has tested with hundreds of apps, even in Enterprise Edition.

Thanks,
Tom

Aug 23, 2011 at 9:43 AM

Hi Tom,

Sorry I didn't follow up on your last reply on this topic but I have another question.

How could we change the Msi Installs to install each BizTalk app under a group in Start>All Programs e.g. Start>All Programs>BizTalk Apps>App1, App2

Cheers

Jim

 

Coordinator
Aug 23, 2011 at 6:36 PM

Hi Jim,

To do that you'd have to modify Developer\generate-install-script.js (a global change).  See the BizShortCuts Directory element.  You'd have to insert another Directory around that one.

Thanks,
Tom

Jul 3, 2013 at 7:26 AM
Edited Jul 3, 2013 at 7:27 AM
Hi ,
I am new to BTDF. I am using Biztalk 2013 along with BTDF 5_1 Beta2 . I want to do deploy the MSI with BizTalk app under a group in Start>All Programs e.g. Start>All Programs>BizTalk Apps>App1, App2 .I donot find this Developer\generate-install-script.js .Could you please help me with this ?
Coordinator
Jul 8, 2013 at 5:25 AM
Please see the documentation installed with V5.1. The topic is Deploying to a BizTalk Server Group\Packaging an Application for Deployment, subsection Customizing the Default WiX Template.

Here is a snippet:

To customize the Start menu shortcuts:

1) Copy the file RedistComponentGroup.xslt from the Deployment Framework for BizTalk install folder, Developer subfolder into your deployment project folder (where the .btdfproj is located). If you wish, rename the file but keep the .xslt extension.

2) In your .btdfproj, set the WixHeatTransformFile property to RedistComponentGroup.xslt or your custom name. The property may be included in any PropertyGroup, but is commonly placed in the PropertyGroup that includes ProductId and ProductVersion.

<PropertyGroup>
...
<WixHeatTransformFile>RedistComponentGroup.xslt</WixHeatTransformFile>
...
</PropertyGroup>

3) Modify the XSLT file as desired. Your local copy of the XSLT will be used when generating an MSI for server deployment.

Thanks,
Tom
Jul 9, 2013 at 11:44 AM
Hi,
I am unable to find the sepcified .js file and also not getting exactly where to change in xslt to get the subfolder. Please help.
Coordinator
Jul 9, 2013 at 4:05 PM
Hi abhishek1301,

Are you referring to my previous response? There is no mention of a .js file. Are you using v5.1?

If you want to add a folder in the Start menu, it must be done in the wxs file. Here is another snippet from the documentation:

To customize the MSI definition:

1) Copy the file GenericBizTalkMSI.wxs from the Deployment Framework for BizTalk install folder, Developer subfolder into your deployment project folder (where the .btdfproj is located). If you wish, rename the file but keep the .wxs extension as it is a WiX convention.

2) In your .btdfproj, set the WixProjectFile property to GenericBizTalkMSI.wxs or your custom name. The property may be included in any PropertyGroup, but is commonly placed in the PropertyGroup that includes ProductId and ProductVersion.

<PropertyGroup>
...
<WixProjectFile>GenericBizTalkMSI.wxs</WixProjectFile>
...
</PropertyGroup>

3) Modify the WXS file as desired. Your local copy of the WXS will be used when generating an MSI for server deployment.

Thanks,
Tom
Jul 10, 2013 at 7:35 AM
Thanks tfabraham. It works using the below method. I just wonder why we do not get rid of shortcuts from startmenu when we undeploy from the startmenu ?
All the shortcuts are removed only when we uninstall it from the control panel. Is there a way where we can remove the shortcuts from startmenu when we uninstall the application.


Coordinator
Jul 10, 2013 at 4:17 PM
Deployment is a two-step process: install the MSI, deploy the app. Undeployment is a two-step process: undeploy the app, uninstall the MSI. When you say "when we uninstall the application" you mean "when we undeploy the application." The answer to that is no, because the application is not fully removed until you undeploy it and uninstall the MSI. [Documentation]

Thanks,
Tom