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,
ApplicationFolder– Name of the deployable folder that contains the segment.
Package Intermediate Directory – The folder in which the generated application MSI files are located. This value must correspond to the Package Intermediate Directory configuration setting in the deployable Element.
userCode =<uuu> – <uuu> is the Application User account's name that is used as the deployed application's identity.
domain=<ddd> – <ddd> is the Application User account's domain that is used as the deployed application's identity.
password=<ppp> – <ppp> is the Application User account's password that is used as the deployed application's identity
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,
ReportsFolder – Name of the report folder in the Application Folder.
ReportsMsiPath – The folder in which the generated report MSI files are located. This value must correspond to the path where the report MSI files are located.
userCode =<uuu> –<uuu> is the Application User account's name that is used as the deployed application's identity.
domain=<ddd> – <ddd> is the Application User account's domain that is used as the deployed application's identity.
password=<ppp> –<ppp> is the Application User account's password that is used as the deployed application's identity
To execute either of the scripts given above, perform the following:
Create a text file, paste the code for deploying a system, and save the file with extension .vbs.
Change the directory paths used in the script to the directory paths and MSI names as applicable for your machines.
From the command prompt, navigate to the path where the script file is saved.
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.