Having problems with your account or logging in?
A lot of changes are happening in the community right now. Some may affect you. READ MORE HERE

Visual COBOL R4 Installer Technology

Visual COBOL R4 Installer Technology

Visual COBOL R4 Installer Technology

For the Visual COBOL R3 product set a new shell script and pax file installer was created.  This revolutionised the installation of the UNIX product making the process simple for users and resolving a lot of technical debt, maintainability and limitations found in the Server Express installers.

For the release of Visual COBOL R4 we wanted to push the install technology even further.  One downside of the R3 installer was that it consisted of two files:  the shell script installer and the product pax file.  This meant two files had to be copied about and kept together.

New for R4

For the R4 release a new binary wrapper has been created.  This wraps the install script
and product pax file into a single file.  This means that only one file now needs to be downloaded or copied to the destination machine.  The wrapper has the ability to check the installation environment and make sure the product is being installed on the correct platform.  When run, it extracts the product from its payload and starts the installation process.

The other major change is the introduction of a web installer for Unix/Linux.  The web installer is a small 400Kb download compared to the 60-200Mb for the standalone installer.  When run, it contacts the Micro Focus download servers and pulls down the product to be installed.

How it works

Part of the approach to this work was to maintain the ideal of keeping it simple, keeping it maintainable and making it testable.  So the binary part of the installer would be a simple program that could be used for both the standalone installer and the web installer.   As both would perform similar tasks, like checking the platform, checking files exist and checking the installation completed correctly, this seemed sensible.  It also meant the build and test process would be kept simple and   only one set of files would need testing each time a change was made.  Another key part of the design was to ensure the binary installer was product independent.  This would keep it portable and make it easy to use with other products.

Standalone installer

The core function of the standalone installer is to extract the payload attached to the binary file.  When the product is packaged up an install.sh script is created along with the product pax file.  These are then archived into an install.pax file.  The standalone installer is compiled up and the install.pax file is concatenated onto the end of the file.  When the installer is run it opens itself and reads the data stream.  At the start of the attached install.pax is a delimiter that tells the installer the rest of the data steam is in the install.pax.  This is then written
to disc.  Once this process is complete the install.pax file can be extracted and the install process started.

Web Installer

For the web installer the core function is downloading the standalone installer from the Micro Focus download site.  The web installer works out that it’s a web installer by checking to see if it has a payload.  If the install.pax is missing then it knows it has to download it.  The download code uses the open source tool libcurl.   This deals with all the actions needed to download a file from a web server.  The download process is controlled by an xml file.  The web installer downloads this first from a fixed location burnt into the program.  It downloads this file and parses the xml tags.  The file details what product to download and where to get it from.  The file also details how the product is installed, any special install actions or options
that are needed.  Once the standalone installer file is down loaded its run and the product install process begins.

The web installer has the option to taking an URL on the command line.   This allows the installer to be tested but it can also be used to host the download files internally where
external downloads are not allowed.

webinstaller_viscobolr5_runtime –url “http://myserver/mfproduct/webinstaller_viscobolr5_runtime.xml

Product.xml contains the following.

<?xml version="1.0" encoding="utf-8"?>
<microfocus>
   <lastupdated>2011-06-07.14:28:39</lastupdated>

   <platform>
      <id>redhat_x86_64</id>
      <location>http://myserver/mfproduct</location>
      <product>Micro Focus Visual COBOL R5 - COBOL 2010 Runtime</product>
      <selfxp>setup_viscobolr5_runtime</selfxp>
      <size>107844</size>
      <cmdline>chmod +x setup_viscobolr5_runtime; ./setup_viscobolr5_runtime</cmdline>

    </platform>
</microfocus>

This tells the web installer where to get the files from, what to down load and how to run the installer.

ISV Products

As part of this technology an ISV option has been added into the installer.  This allows an ISV to package and install their product with Micro Focus’s.  When the –ISV command line option is used the standalone installer runs as normal and installs the Micro Focus product.  Once this stage is complete and successful the installer looks for an ISV xml file, which should be present in the current directory.

setup_viscobolr4_runtime -ISV

The xml file uses the name of the install file, for example setup_viscobolr4_runtime, and appends ISV.xml.  If the installer is renamed the XML file should be updated to match.  So if setup_viscobolr4_runtime is changed to MFCobol_runtime then the XML file has to be renamed to MFCobol_runtimeISV.xml.

The XML file contains the following information.

<?xml version="1.0" encoding="utf-8"?>
<microfocus>
    
<lastupdated>YYYY-MM-DD.hh:mm:ss</lastupdated>
   <platform>
      <id>redhat_x86_64</id>
      <location>current</location>
      <product>Product Name</product>
      <selfxp>installISV.pax</selfxp>
      <size>Product_Size_In_KB</size>
      <cmdline>pax -rf installISV.pax; sh ./installISV.sh</cmdline>
   </platform>
</microfocus>

The wizard script $COBDIR/bin/CreateISVxml.sh can be used to create this file and fill in and validate the contents.

Once the file has been created it can be put in a directory with the following files:

     setup_viscobolr4_runtime
     setup_viscobolr4_runtimeISV.xml
     installISV.pax

 

Then when the installer is run with the -ISV command it will
install the Micro Focus COBOL 2010 Runtime and then look for the ISV.xml file
associated with the installer and run the commands defined in the XML.

The installISV.sh script contains the following to install the ISV package.

#-=-====================================================-=-
#                    S C R I P T   S T A R T S  H E R E
# -=-====================================================-=-

test `uname -s` = Linux && echocmd="echo -e" || echocmd="echo"

# -=-----------------------------------------------------
#   Script settings.
          scriptname="installISV.sh"
# -=-----------------------------------------------------

$echocmd "   -=-########################################=-=-"
$echocmd "                                ISV Install Script"
$echocmd "   -=-#########################################=-=-\n"

$echocmd "This is a test install script to check ISV install option.\n"
$echocmd "   Script will install product."
$echocmd "   mkdir directories and stuff."
$echocmd "   Put files were they need to be.\n"

$echocmd "   -=-#########################################=-=-"
$echocmd "                           ISV Install Script - Complete"
$echocmd "   -=-#########################################=-=-\n\n"

# -=-==================================================-=-
#                              E N D   O F   S C R I P T
# -=-==================================================-=-

DISCLAIMER:

Some content on Community Tips & Information pages is not officially supported by Micro Focus. Please refer to our Terms of Use for more detail.
Version history
Revision #:
1 of 1
Last update:
‎2012-06-21 18:35
Updated by:
 
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.