/* Copyright (c) Oracle Corporation 1992.  All Rights Reserved */
/*****************************************************************************
  NAME
    CGEN72.ins - Windows V3 root installation script for all DES/2000 Generators client
                products.

  DESCRIPTION
    This script installs the selected DES/2000 Generators client products.

  OWNER
    Jeremy Williams

  MODIFIED    DD-MMM-YY Reason
    jewillia  03-NOV-94 Created.

*****************************************************************************/
{
  {
  start_ins_list = list(current_script, 'DEBUG_CGEN72, "cgen72.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 = "cgen72.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);
          copy(product);

          ui_action(instantiate(installing_registry));
          copy(regfile);

          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_bin));
              copy(bin);
              copy(ldll,"%language_subgroup%");
              copy(ldll_ja,"%language_subgroup%");

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

              ui_action(instantiate(installing_msb));
              copy(msb);
            }
        }

      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 */
        add(case_modify_list,list("DES2K_BULLETINS",           "", ora_config, ini_section));

        /* new variables */

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

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

        add(case_modify_list,list("DOM_OFG.HELP.FUNCTION",             "cvfh_main",                    ora_config, ini_section, 'INI_SECTION, 'DES2_72_SECTION));

        add(case_modify_list,list("CVU_UTILITY_MSG_DATA",               "CDG,CGEN72",                                  ora_config, ini_section, 'REPCOM61_SECTION));
        add(case_modify_list,list("CFU_UTILITY_MSG_DATA",               "CDG,CGEN72",                                  ora_config, ini_section, 'REPCOM61_SECTION));
        add(case_modify_list,list("OLG_UTILITY_MSG_DATA",               "CDG,CGEN72",                                  ora_config, ini_section, 'REPCOM61_SECTION));
        add(case_modify_list,list("CVX_UTILITY_MSG_DATA",               "CDG,CGEN72",                                  ora_config, ini_section, 'REPCOM61_SECTION));

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

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

        add(case_execute_list,list("DOM_OFG.HELP.DLL",             "hp",                           bin, ora_config, ini_section, 'INI_SECTION, 'DES2_72_SECTION));

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

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

      {
        forms60_registration = registration(forms60_registry_name);
        forms60_ini_section = registry_filename(forms60_registration);
      }
      ['UNBOUND_VARIABLE, 'UNBOUND_ENVIRONMENT_VARIABLE, 'UNREGISTERED_PRODUCT:
        forms60_ini_section = forms60_registry_filename;
      ]
      add(case_add_list,list("GRAPHICS60_PATH",  "%CGEN72%", ora_config, forms60_ini_section,'TOP_LEVEL));
      add(case_add_list,list("ORAPLSQLLOADPATH", "%CGEN72%", ora_config, forms60_ini_section,'TOP_LEVEL));

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

      if (not(CGEN72_REGISTRY_FILE == ""))
      {
        case_regedit_list = list(CGEN72_REGISTRY_FILE);
        EXECUTE_SCRIPT = "DES2_REGEDIT.INS";
        execute("%product_home%\des2k_72.ins");
      }

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

      case_graphics_file = "cgen72.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");

}
