/* Copyright (c) Oracle Corporation 1992.  All Rights Reserved */
/*****************************************************************************
  NAME
    reprpt61.ins - V3.1.2 installation script for
                   Oracle Repository Reports V1.0.9.0.0

  DESCRIPTION
    This script installs Oracle Repository Reports V1.0.9.0.0

  OWNER
    Jeremy Williams

  MODIFIED    DD-MMM-YY  Reason
    jewillia  03-JUL-95  Different oracle.ini groups for shared oracle
    jewillia  07-NOV-94  Created

*****************************************************************************/
{
  {
  start_ins_list = list(current_script, 'DEBUG_REPRPT61, "reprpt61.bmp");
  EXECUTE_SCRIPT = "START.INS";
  execute("%product_home%\des2k_72.ins");

  if (doit)
    {
      ui_product(product_label);
      ui_action(instantiate(installing_product));

      ins_ratchet = "7.2.96.5.6";

      EXECUTE_SCRIPT = "INSTALL_DEPENDENCIES.INS";
      execute("%product_home%\des2k_72.ins");

      case_graphics_file = "reprpt61.bmp";
      EXECUTE_SCRIPT = "DES2_BB.DIS";
      execute("%product_home%\des2k_72.ins");

      EXECUTE_SCRIPT = "DES2_START_COPY.INS";
      execute("%product_home%\des2k_72.ins");

      ui_action(instantiate(removing_old));
      EXECUTE_SCRIPT = "DES2_OLD.INS";
      execute("%product_home%\des2k_72.ins");

      if (case_install_files)
        {
          ui_action(instantiate(installing_deinstl));
          copy(deinstl,nls_abbreviation);
          copy(product);

          if (patch_installation)
            {
              ui_action(instantiate(installing_patchset));
              copy(patchset);
              copy(bin);
              copy(ldll,"%language_subgroup%");
              copy(ldll_ja,"%language_subgroup%");
            }
          else if (not(case_registry_only_install))
            {
              ui_action(instantiate(installing_msb));
              copy(msb);

              ui_action(instantiate(installing_bin));
              copy(bin);
              copy(ldll,"%language_subgroup%");
              copy(ldll_ja,"%language_subgroup%");

              ui_action(instantiate(installing_main));
              copy(main);

              ui_action(instantiate(installing_srw));
              copy(srw,"%language_subgroup%");
              copy(srw_ja,"%language_subgroup%");
            }
        }

      if (case_install_patch_files)
        {
          EXECUTE_SCRIPT = "INSPATCH.INS";
          execute("%product_home%\des2k_72.ins");
        }

      EXECUTE_SCRIPT = "DES2_END_COPY.INS";
      execute("%product_home%\des2k_72.ins");

      EXECUTE_SCRIPT = "INSTALL_CHILDREN.INS";
      execute("%product_home%\des2k_72.ins");

      ui_action(instantiate(modify_environment));
      ini_section = product_filename(current_product);

      {
        /* simple variable modification */
        case_modify_list = list();

        /* remove old variables */

        /* new variables */

        add(case_modify_list,list("REPRPT61",                           "%REPRPT61%",                                    ora_config, ini_section, 'INI_SECTION, 'TOP_LEVEL));

        /* These are set in the user.avf */
        add(case_modify_list,list("REPOS_R10_GROUP",                        "%REPOS_R10_GROUP%",                                 ora_config, ini_section, 'INI_SECTION, 'TOP_LEVEL));
        add(case_modify_list,list("REPOS_R10_BULLETINS",                    "%REPOS_R10_BULLETINS%",                             ora_config, ini_section, 'INI_SECTION, 'TOP_LEVEL));

        add(case_modify_list,list("SERVER_API_REPOSITORY_REPORTS61",    "4.0.12.96.16",                                     ora_config, ini_section));

        EXECUTE_SCRIPT = "MODIFY_VARIABLES.CMN";
        execute("%product_home%\des2k_72.ins");
      }

      {
        /* execute_variables */
        case_execute_list = list();

        add(case_execute_list,list("EXECUTE_REPOSITORY_REPORTS61",       "rpt",                bin, ora_config, ini_section));

        EXECUTE_SCRIPT = "MODIFY_EXECUTE.INS";
        execute("%product_home%\des2k_72.ins");
      }

      {
        /* broadcast variables */
        case_broadcast_list = list();

        EXECUTE_SCRIPT = "MODIFY_BROADCAST.INS";
        execute("%product_home%\des2k_72.ins");
      }

      {
        /* path modification */
        case_add_list = list();

        {
          report60_registration = registration(report60_registry_name);
          report60_ini_section = registry_filename(report60_registration);
        }
        ['UNBOUND_VARIABLE, 'UNBOUND_ENVIRONMENT_VARIABLE, 'UNREGISTERED_PRODUCT:
          report60_ini_section = report60_registry_filename;
        ]

        /* other tools that modify ORACLE_PATH will now have done so - it's our turn */
        add(case_add_list,list("ORACLE_PATH", "%REPRPT61%\SRW", ora_config, report60_ini_section,'TOP_LEVEL));

        /* other tools that modify REP30_USEREXIT/REPORTS60_USEREXIT will now have done so - it's our turn */
        execute_id = "reports";
        execute_list = group_files(bin,execute_id);
        if (not(empty(execute_list)))
          {
            execute_name = first(execute_list);
            add(case_add_list,list("REPORTS60_USEREXIT", execute_name, ora_config, report60_ini_section, 'TOP_LEVEL));
          }

        EXECUTE_SCRIPT = "MODIFY_ADD.INS";
        execute("%product_home%\des2k_72.ins");
      }

      case_dependency_msg_list = list(evaluate("case_install_dev2000_runtime_dependencies",'GLOBAL), reprpt61_dev2000_runtime_dependency_list, case_dependency_msg_message);
      EXECUTE_SCRIPT = "DEPENDENCY_MSG.INS";
      /* execute("%product_home%\des2k_72.ins"); */ /* this message no longer required */

      case_dependency_msg_list = list(evaluate("case_install_dev2000_dependencies",'GLOBAL), reprpt61_dev2000_dependency_list, case_dependency_msg_message);
      EXECUTE_SCRIPT = "DEPENDENCY_MSG.INS";
      /* execute("%product_home%\des2k_72.ins"); */ /* this message no longer required */

      ui_action(instantiate(registering_product));
      EXECUTE_SCRIPT = "DES2_REF.INS";
      execute("%product_home%\des2k_72.ins");

      case_graphics_file = "reprpt61.bmp";
      EXECUTE_SCRIPT = "DES2_BB.REM";
      execute("%product_home%\des2k_72.ins");

    }

  }
  [
    'UNREGISTERED_PRODUCT: continue();
    'CANCEL: signal('FAILURE, instantiate(halt_installation));
  ]

  EXECUTE_SCRIPT = "END.INS";
  execute("%product_home%\des2k_72.ins");

}
