/* Copyright (c) Oracle Corporation 1994.  All Rights Reserved */

/*****************************************************************************
  NAME
    cdesql15.ins - V3 installation script for Windows Forms/Reports Developer
                   Database Tables

  DESCRIPTION
    This script copies the main scripts, creates the program items for each of
    the Database Tables administration script

  MODIFIED    MM/DD/YY    Reason
  aharriso  08/29/95    Removed prompts for install location. Externalized
                          common code.
      bsabol    03/21/94    Created
*****************************************************************************/

{
    if (doit)
    {  
        /*****************************
        Set the VRF-INS script ratchet
        ******************************/
        ins_ratchet = "6.0.0.0.0";

        execute("%installer_home%%dir_separator%%operating_system%.ins");

        permit_retry_operations  = TRUE;
        permit_ignore_operations = TRUE;
        permit_process_operations= TRUE;

        win32_register_OCSM_product();
        /******************
        Install the product
        *******************/
        ui_product(instantiate(display_product_label));
        ui_action(instantiate(install_files));
        copy(deinst);

        /************************************************************
        Delete the Old Program Group if present and Install the new
        Program Group
        *************************************************************/

        if(exists("%ORACLE_HOME%/bin/ifrun60.exe"))
        {
          D2K60_ADMINISTRATION = D2K60_ADMINISTRATION_OLD;
          windows_delete_icons(sqlb);
          D2K60_ADMINISTRATION = D2K60_ADMINISTRATION_NEW;
        }
        /************************************************************/

        copy(sqlb);
        copy(sql);

        /******************/
        permit_retry_operations = FALSE;
        /******************/

        /******************************************
        Install all the components of the PARENT
        *******************************************/
        EXECUTE_SCRIPT = "INSTALL_COMPONENTS";
        execute("%installer_home%%dir_separator%d2kr2ins.usr");

        /****************************************************************/

         /**************** 
          Setting SQLPATH
         *****************/
         /* if(set_sqlpath)
          {
             {
              modify("SQLPATH", SQLPATH, ora_config);
             }
              [ 'UNBOUND_ENVIRONMENT_VARIABLE, 'FILE_NOT_FOUND: continue(); ]
              win32_register_key("$ORACLE","","SQLPATH",'REPLICATE);
          }*/


        /*******************
        Install SQL*PLUS
        ********************/
        /*if (install_required_product)
            install(REQUIRED_PRODUCT);*/
        /*******************/

        permit_retry_operations = TRUE;

        /***************************************************************
         Registering map variables except Installer_home and oracle_home
        ****************************************************************/
        win32_register_map_variable("D2K60_ADMINISTRATION");
        /****************************
         Registering map file groups
        *****************************/
        win32_register_OCSM_group(sqlb,'MEDMODE);
        win32_register_OCSM_group(sql,'MAXMODE);
        win32_register_OCSM_group(deinst,'MINMODE);

        /*********************************
        Register and Reference the product
        and remove delold.
        **********************************/
        EXECUTE_SCRIPT = "REGISTER_REFERENCE_PRODUCT";
        execute("%installer_home%%dir_separator%d2kr2ins.usr");

        /********************************************************************
        Reference all the components of the PARENT
        *********************************************************************/
        child_products_to_reference = all_child_products(current_product);
        EXECUTE_SCRIPT = "REFERENCE_COMPONENTS";
        execute("%installer_home%%dir_separator%d2kr2ins.usr");
        /********************************************************************/
        /*********************
        Reference Dependencies
        **********************/
        ui_action(instantiate(reference_dependencies));

  /**    {reference(REQUIRED_PRODUCT, current_product);}
        ['UNREGISTERED_PRODUCT: continue();] **/
        /*********************/

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