?? RIGHT := 110 ??
?? NEWTITLE := 'INSTALL_SOFTWARE UTILITY: INSTALL_SOFTWARE Utility Command.' ??
MODULE ram$install_software;

{ PURPOSE:
{   This module contains the command interface to set up and control the
{   software installation process.
{
{ DESIGN:
{   The compiled module resides in RAF$LIBRARY.
{
{ NOTES:
{

?? NEWTITLE := 'Global Declarations Referenced by This Module', EJECT ??
?? PUSH (LISTEXT := ON) ??
*copyc rat$installation_defaults
?? POP ??
*copyc clp$begin_utility
*copyc clp$end_utility
*copyc clp$evaluate_parameters
*copyc clp$include_file

?? TITLE := 'Global Declarations Declared by This Module', EJECT ??

  VAR
    rav$inss_utility_name: [XDCL] clt$utility_name := 'INSTALL_SOFTWARE';

?? FMT (FORMAT := OFF) ??

  VAR
    rav$installation_defaults: [XDCL] rat$installation_defaults := [
          {correction_bases}      [54, ':$SYSTEM.$SYSTEM.SOFTWARE_MAINTENANCE.CORRECTION_BASES'],
          {correction_packages}   [57, ':$SYSTEM.$SYSTEM.SOFTWARE_MAINTENANCE.CORRECTION_PACKAGES'],
          {installation_database} [59, ':$SYSTEM.$SYSTEM.SOFTWARE_MAINTENANCE.INSTALLATION_DATABASE'],
          {installation_logs}     [55, ':$SYSTEM.$SYSTEM.SOFTWARE_MAINTENANCE.INSTALLATION_LOGS'],
          {system_catalog}        [0, ''],
          {ignore_storage_class}  FALSE,
          {relax_ring_settings}   FALSE];

?? FMT (FORMAT := ON) ??

?? TITLE := '[XDCL] rap$install_software', EJECT ??

{ PURPOSE:
{   This command interface sets up the INSTALL_SOFTWARE utility
{   session.
{
{ DESIGN:
{   This follows standard utility design.
{
{ NOTES:
{

  PROCEDURE [XDCL] rap$install_software
    (    parameter_list: clt$parameter_list;
     VAR status: ost$status);


{ PROCEDURE inss_pdt (
{   status)

?? PUSH (LISTEXT := ON) ??

    VAR
      pdt: [STATIC, READ, cls$declaration_section] record
        header: clt$pdt_header,
        names: array [1 .. 1] of clt$pdt_parameter_name,
        parameters: array [1 .. 1] of clt$pdt_parameter,
        type1: record
          header: clt$type_specification_header,
        recend,
      recend := [[1, [88, 5, 2, 14, 51, 41, 64], clc$command, 1, 1, 0, 0, 0, 0, 1, 'INSS_PDT'],
            [['STATUS                         ', clc$nominal_entry, 1]], [
{ PARAMETER 1
      [1, clc$normal_usage_entry, clc$non_secure_parameter, $clt$parameter_spec_methods [clc$specify_by_name],
            clc$pass_by_reference, clc$immediate_evaluation, clc$standard_parameter_checking, 3,
            clc$optional_parameter, 0, 0]],
{ PARAMETER 1
      [[1, 0, clc$status_type]]];

?? POP ??

    CONST
      p$status = 1;

    VAR
      pvt: array [1 .. 1] of clt$parameter_value;

{ table n=inss_command_table t=command s=xdcl
{ command n=(activate_product, activate_products, actp) p=rap$activate_product_command cm=xref a=hidden
{ command n=(apply_all_corrections, appac)  p=rap$apply_all_corrections_cmd cm=xref
{ command n=(change_installation_defaults, change_installation_default, chaid)                            ..
{               p=rap$change_installation_default cm=xref
{ command n=(change_installation_path, chaip) p=rap$change_installation_path cm=xref
{ command n=(delete_packing_list, delpl) p=rap$delete_packing_list cm=xref
{ command n=(display_installed_software, disis) p=rap$display_installed_software cm=xref
{ command n=(display_packing_list, displ) p=rap$display_packing_list_inss cm=xref
{ command n=(display_processing_summary, disps) p=rap$display_process_summary cm=xref a=hidden
{ command n=(execute_installer_procedure, exeip) p=rap$execute_installer_procs_cmd cm=xref a=hidden
{ command n=(install_correction, install_corrections, insc) p=rap$install_correction_command cm=xref
{ command n=(install_product, install_products, insp) p=rap$install_product_cmd_inss cm=xref
{ command n=(load_packing_list, loapl) p=rap$load_packing_list_inss_cmd cm=xref
{ command n=(quit, qui) p=rap$quit_inss cm=xref
{ command n=(rap$perform_installation) p=rap$perform_installation cm=xref a=hidden
{ tablend

?? PUSH (LISTEXT := ON) ??

VAR
  inss_command_table: [XDCL, READ] ^clt$command_table := ^inss_command_table_entries,

  inss_command_table_entries: [STATIC, READ] array [1 .. 31] of clt$command_table_entry := [
  {} ['ACTIVATE_PRODUCT               ', clc$nominal_entry, clc$hidden_entry, 1,
        clc$automatically_log, clc$linked_call, ^rap$activate_product_command],
  {} ['ACTIVATE_PRODUCTS              ', clc$alias_entry, clc$hidden_entry, 1, clc$automatically_log,
        clc$linked_call, ^rap$activate_product_command],
  {} ['ACTP                           ', clc$abbreviation_entry, clc$hidden_entry, 1,
        clc$automatically_log, clc$linked_call, ^rap$activate_product_command],
  {} ['APPAC                          ', clc$abbreviation_entry, clc$normal_usage_entry, 2,
        clc$automatically_log, clc$linked_call, ^rap$apply_all_corrections_cmd],
  {} ['APPLY_ALL_CORRECTIONS          ', clc$nominal_entry, clc$normal_usage_entry, 2,
        clc$automatically_log, clc$linked_call, ^rap$apply_all_corrections_cmd],
  {} ['CHAID                          ', clc$abbreviation_entry, clc$normal_usage_entry, 3,
        clc$automatically_log, clc$linked_call, ^rap$change_installation_default],
  {} ['CHAIP                          ', clc$abbreviation_entry, clc$normal_usage_entry, 4,
        clc$automatically_log, clc$linked_call, ^rap$change_installation_path],
  {} ['CHANGE_INSTALLATION_DEFAULT    ', clc$alias_entry, clc$normal_usage_entry, 3,
        clc$automatically_log, clc$linked_call, ^rap$change_installation_default],
  {} ['CHANGE_INSTALLATION_DEFAULTS   ', clc$nominal_entry, clc$normal_usage_entry, 3,
        clc$automatically_log, clc$linked_call, ^rap$change_installation_default],
  {} ['CHANGE_INSTALLATION_PATH       ', clc$nominal_entry, clc$normal_usage_entry, 4,
        clc$automatically_log, clc$linked_call, ^rap$change_installation_path],
  {} ['DELETE_PACKING_LIST            ', clc$nominal_entry, clc$normal_usage_entry, 5,
        clc$automatically_log, clc$linked_call, ^rap$delete_packing_list],
  {} ['DELPL                          ', clc$abbreviation_entry, clc$normal_usage_entry, 5,
        clc$automatically_log, clc$linked_call, ^rap$delete_packing_list],
  {} ['DISIS                          ', clc$abbreviation_entry, clc$normal_usage_entry, 6,
        clc$automatically_log, clc$linked_call, ^rap$display_installed_software],
  {} ['DISPL                          ', clc$abbreviation_entry, clc$normal_usage_entry, 7,
        clc$automatically_log, clc$linked_call, ^rap$display_packing_list_inss],
  {} ['DISPLAY_INSTALLED_SOFTWARE     ', clc$nominal_entry, clc$normal_usage_entry, 6,
        clc$automatically_log, clc$linked_call, ^rap$display_installed_software],
  {} ['DISPLAY_PACKING_LIST           ', clc$nominal_entry, clc$normal_usage_entry, 7,
        clc$automatically_log, clc$linked_call, ^rap$display_packing_list_inss],
  {} ['DISPLAY_PROCESSING_SUMMARY     ', clc$nominal_entry, clc$hidden_entry, 8,
        clc$automatically_log, clc$linked_call, ^rap$display_process_summary],
  {} ['DISPS                          ', clc$abbreviation_entry, clc$hidden_entry, 8,
        clc$automatically_log, clc$linked_call, ^rap$display_process_summary],
  {} ['EXECUTE_INSTALLER_PROCEDURE    ', clc$nominal_entry, clc$hidden_entry, 9,
        clc$automatically_log, clc$linked_call, ^rap$execute_installer_procs_cmd],
  {} ['EXEIP                          ', clc$abbreviation_entry, clc$hidden_entry, 9,
        clc$automatically_log, clc$linked_call, ^rap$execute_installer_procs_cmd],
  {} ['INSC                           ', clc$abbreviation_entry, clc$normal_usage_entry, 10,
        clc$automatically_log, clc$linked_call, ^rap$install_correction_command],
  {} ['INSP                           ', clc$abbreviation_entry, clc$normal_usage_entry, 11,
        clc$automatically_log, clc$linked_call, ^rap$install_product_cmd_inss],
  {} ['INSTALL_CORRECTION             ', clc$nominal_entry, clc$normal_usage_entry, 10,
        clc$automatically_log, clc$linked_call, ^rap$install_correction_command],
  {} ['INSTALL_CORRECTIONS            ', clc$alias_entry, clc$normal_usage_entry, 10,
        clc$automatically_log, clc$linked_call, ^rap$install_correction_command],
  {} ['INSTALL_PRODUCT                ', clc$nominal_entry, clc$normal_usage_entry, 11,
        clc$automatically_log, clc$linked_call, ^rap$install_product_cmd_inss],
  {} ['INSTALL_PRODUCTS               ', clc$alias_entry, clc$normal_usage_entry, 11,
        clc$automatically_log, clc$linked_call, ^rap$install_product_cmd_inss],
  {} ['LOAD_PACKING_LIST              ', clc$nominal_entry, clc$normal_usage_entry, 12,
        clc$automatically_log, clc$linked_call, ^rap$load_packing_list_inss_cmd],
  {} ['LOAPL                          ', clc$abbreviation_entry, clc$normal_usage_entry, 12,
        clc$automatically_log, clc$linked_call, ^rap$load_packing_list_inss_cmd],
  {} ['QUI                            ', clc$abbreviation_entry, clc$normal_usage_entry, 13,
        clc$automatically_log, clc$linked_call, ^rap$quit_inss],
  {} ['QUIT                           ', clc$nominal_entry, clc$normal_usage_entry, 13,
        clc$automatically_log, clc$linked_call, ^rap$quit_inss],
  {} ['RAP$PERFORM_INSTALLATION       ', clc$nominal_entry, clc$hidden_entry, 14,
        clc$automatically_log, clc$linked_call, ^rap$perform_installation]];

  PROCEDURE [XREF] rap$activate_product_command
    (    parameter_list: clt$parameter_list;
     VAR status: ost$status);

  PROCEDURE [XREF] rap$apply_all_corrections_cmd
    (    parameter_list: clt$parameter_list;
     VAR status: ost$status);

  PROCEDURE [XREF] rap$change_installation_default
    (    parameter_list: clt$parameter_list;
     VAR status: ost$status);

  PROCEDURE [XREF] rap$change_installation_path
    (    parameter_list: clt$parameter_list;
     VAR status: ost$status);

  PROCEDURE [XREF] rap$delete_packing_list
    (    parameter_list: clt$parameter_list;
     VAR status: ost$status);

  PROCEDURE [XREF] rap$display_installed_software
    (    parameter_list: clt$parameter_list;
     VAR status: ost$status);

  PROCEDURE [XREF] rap$display_packing_list_inss
    (    parameter_list: clt$parameter_list;
     VAR status: ost$status);

  PROCEDURE [XREF] rap$display_process_summary
    (    parameter_list: clt$parameter_list;
     VAR status: ost$status);

  PROCEDURE [XREF] rap$execute_installer_procs_cmd
    (    parameter_list: clt$parameter_list;
     VAR status: ost$status);

  PROCEDURE [XREF] rap$install_correction_command
    (    parameter_list: clt$parameter_list;
     VAR status: ost$status);

  PROCEDURE [XREF] rap$install_product_cmd_inss
    (    parameter_list: clt$parameter_list;
     VAR status: ost$status);

  PROCEDURE [XREF] rap$load_packing_list_inss_cmd
    (    parameter_list: clt$parameter_list;
     VAR status: ost$status);

  PROCEDURE [XREF] rap$perform_installation
    (    parameter_list: clt$parameter_list;
     VAR status: ost$status);

  PROCEDURE [XREF] rap$quit_inss
    (    parameter_list: clt$parameter_list;
     VAR status: ost$status);

?? POP ??

{ table inss_function_table t=function s=xdcl
{ function n=$deferred_subproducts p=rap$deferred_subproducts_func cm=xref a=hidden
{ tablend

?? PUSH (LISTEXT := ON) ??

VAR
  inss_function_table: [XDCL, READ] ^clt$function_processor_table := ^inss_function_table_entries,

  inss_function_table_entries: [STATIC, READ] array [1 .. 1] of clt$function_proc_table_entry := [
  {} ['$DEFERRED_SUBPRODUCTS          ', clc$nominal_entry, clc$hidden_entry, 1, clc$linked_call,
        ^rap$deferred_subproducts_func]];

  PROCEDURE [XREF] rap$deferred_subproducts_func
    (    parameter_list: clt$parameter_list;
     VAR work_area {input, output} : ^clt$work_area;
     VAR result: ^clt$data_value;
     VAR status: ost$status);

?? POP ??

    CONST
      prompt_size = 4,
      prompt_value = 'INSS';

    VAR
      utility_attributes_p: ^clt$utility_attributes;


    status.normal := TRUE;

    clp$evaluate_parameters (parameter_list, #SEQ (pdt), NIL, ^pvt, status);
    IF NOT status.normal THEN
      RETURN;
    IFEND;

    PUSH utility_attributes_p: [1 .. 4];
    utility_attributes_p^ [1].key := clc$utility_command_search_mode;
    utility_attributes_p^ [1].command_search_mode := clc$global_command_search;
    utility_attributes_p^ [2].key := clc$utility_command_table;
    utility_attributes_p^ [2].command_table := inss_command_table;
    utility_attributes_p^ [3].key := clc$utility_function_proc_table;
    utility_attributes_p^ [3].function_processor_table := inss_function_table;
    utility_attributes_p^ [4].key := clc$utility_prompt;
    utility_attributes_p^ [4].prompt.size := prompt_size;
    utility_attributes_p^ [4].prompt.value := prompt_value;

    clp$begin_utility (rav$inss_utility_name, utility_attributes_p^, status);
    IF NOT status.normal THEN
      RETURN;
    IFEND;

    clp$include_file (clc$current_command_input, prompt_value, rav$inss_utility_name, status);
    IF NOT status.normal THEN
      RETURN;
    IFEND;

    clp$end_utility (rav$inss_utility_name, status);

  PROCEND rap$install_software;
MODEND ram$install_software;
