PROCEDURE install_cdcnet_software, inscs (
  status)

  "$FORMAT=OFF
  VAR
    actual_catalog: file
    cdcnet_catalog: file
    command_file: file = $unique($local)
    dcv$execution_path: (XDCL) string
    ignore_status: status
    installer_procedure_library: file
    local_status: status

    rav$subproduct_information: (XREF) rat$subproduct_information
    rav$installation_defaults: (XREF) rat$installation_defaults
    rav$installation_environment: (XREF) rat$installation_environment

  VAREND
  "$FORMAT=ON"


*IF $variable(wev$proc_doc,declared)<>'UNKNOWN'
"
"  This routine is the installer procedure for CDCNET.
"
*IFEND


  $system.put_line ' Installing CDCNET files ...' o=$job_log

  install_block: ..
    BLOCK


*IF $variable(wev$proc_doc,declared)<>'UNKNOWN'
"
"  Determine path to the library containing the installer
"  and miscellaneous procedures.
"
*IFEND

  rap$remove_elements_from_path p=rav$subproduct_information.installer_procedure ..
    noe=1 np=installer_procedure_library status=local_status
  EXIT install_block WHEN NOT local_status.normal
  actual_catalog = rav$subproduct_information.actual_installation_path


*IF $variable(wev$proc_doc,declared)<>'UNKNOWN'
"
"  Remove the VERSION_xxxx portion of the actual installation path.
"
*IFEND

  rap$remove_elements_from_path p=actual_catalog noe=1 np=cdcnet_catalog status=local_status
  EXIT install_block WHEN NOT local_status.normal
  dcv$execution_path = $string(cdcnet_catalog)


*IF $variable(wev$proc_doc,declared)<>'UNKNOWN'
"
"  UPDATE_LIBRARY if DI_OBJECT already exists; ie. a correction is being re-installed.
"  Otherwise, call INSTALL_FILE to install the base DI_OBJECT from the copy found in
"  the DI_PRODUCTS subcatalog
"
*IFEND

  IF $file(actual_catalog.DI_OBJECT permanent) THEN
    update_library f=actual_catalog.DI_PRODUCTS.BASE_DI_OBJECT ..
      l=actual_catalog.DI_OBJECT status=local_status
  ELSE
    install_file f=actual_catalog.DI_PRODUCTS.BASE_DI_OBJECT ..
      t=actual_catalog.DI_OBJECT status=local_status
  IFEND
  EXIT install_block WHEN NOT local_status.normal


*IF $variable(wev$proc_doc,declared)<>'UNKNOWN'
"
"  Install the version independent catalog.
"
*IFEND

  installer_procedure_library.install_version_independent ..
    cc=cdcnet_catalog vc=actual_catalog status=local_status
  EXIT install_block WHEN NOT local_status.normal

*IF $variable(wev$proc_doc,declared)<>'UNKNOWN'
"
"  If this is a release (not a correction) installation, install the
"  site controlled catalog.  If in addition to being a release, if the
"  subproduct name is cdcnet open shop (internal development subproduct),
"  install the npa database catalog.  If this is a correction installation,
"  locate and bring forward any uncorrected tips from the base version
"  subcatalog, and update the actual di object library with them.
"
*IFEND


  IF rav$subproduct_information.subproduct_type = RELEASE THEN
    installer_procedure_library.install_site_controlled ..
      cc=cdcnet_catalog vc=actual_catalog status=local_status
    EXIT install_block WHEN NOT local_status.normal

    IF rav$subproduct_information.subproduct_name <> CDCNET_OPEN_SHOP THEN
      installer_procedure_library.install_npa_databases ..
        cc=cdcnet_catalog vc=actual_catalog status=local_status
      EXIT install_block WHEN NOT local_status.normal
    IFEND

  ELSEIF rav$subproduct_information.subproduct_type = CORRECTION THEN
    installer_procedure_library.rap$bring_forward_uncor_tips
    EXIT install_block WHEN NOT local_status.normal

  IFEND

  $system.put_line ' CDCNET files installed.' o=$job_log

  BLOCKEND install_block

  EXIT procedure WITH local_status WHEN NOT local_status.normal

PROCEND install_cdcnet_software
