Programmatic use of Deployment Server Component

In certain circumstances, direct use of the deployment server through its COM interface is preferable over the use of Developer when deploying systems and reports. The deployment server can be invoked to deploy generated application MSI files, and requires the creation of the DeploymentServer object. A DeplomentServer object is used to access properties and methods on the server. Following example explains the creation of a DeploymentServer object

An AB Suite system contains an OuterFolder, an InnerFolder (including all the ispecs), and ReportFolder with all the reports.

If you do a generate-install, the system is deployed and two MSIs are created in the Package Intermediate Directory if specified or in the packages folder of the Builder output directory. Now, if you make any changes to the ispecs in the painter and do a generate-generate on the OuterFolder, MSIs are created in the Builder Output directory. To make these changes made to the ispecs available without affecting the reports, you can use the following VB script.

Deploying a System

To determine the PROGID of the deployment server, use the Administrative Tool and locate the Prog id for the DeploymentServer object.

dim SIretcode
‘Create an object of Deployment Server’
set DSobj = CreateObject(DEPLOYMENTSERVER_PROGID)
SIretcode = DSobj.StartInstall(ApplicationFolder, <Package Intermediate
Directory>\ApplicationFolder.msi, userCode=uuu domain=ddd password=ppppp dropBS=TRUE, nothing)
If SIretcode = 0 then
   WScript.Echo Deployment Success
Else
   WScript.Echo Deployment Failed with error code & SIretcode
End If

where,

If changes are made to the reports (adding a label) and ReportFolder is built, an MSI for reports, ReportsFolder.MSI is created. Use the following VB script to deploy the reports MSI (without affecting the application folder).

Deploying a Report

To determine the PROGID of the deployment server, use the Administration Tool and locate the Prog id for the DeploymentServer object.

dim SIretcode
‘Create an object of Deployment Server’
set DSobj = CreateObject(DEPLOYMENTSERVER_PROGID)
SIretcode = DSobj.StartInstall(ReportsFolder,
<ReportsMsiPath>\ReportsFolder.msi, userCode=uuu domain=ddd
password=ppp, nothing)
If SIretcode = 0 then
   WScript.Echo Deployment Success
Else
   WScript.Echo Deployment Failed with error code & SIretcode
End If

where,

To execute either of the scripts given above, perform the following:

  1. Create a text file, paste the code for deploying a system, and save the file with extension .vbs.

  2. Change the directory paths used in the script to the directory paths and MSI names as applicable for your machines.

  3. From the command prompt, navigate to the path where the script file is saved.

  4. Execute the script with the following command:

    C:\>cscript myVBScript.vbs

The deployment server script determines whether to make a partial or full installation, and accordingly execute MSIEXEC command by passing suitable parameters.