/* Copyright (c) Oracle Corporation 1996.  All Rights Reserved */
/*****************************************************************************
  NAME
    pj60.ins - V3 installation script for Developer Control Panel 6.0

  DESCRIPTION
    This script installs Developer Control Panel 6.0.

  MODIFIED    MM/DD/YY  Reason
    anmanian  01/25/99  Changed to make Language Supplement Files as an 
                        installable component.
    pgupta    11/07/97  Created
*****************************************************************************/
{
    if (doit)
    {
        /*****************************
        Set the VRF-INS script ratchet
        ******************************/
        ins_ratchet = "6.0.0.0.1";

        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/pj60.exe"))
        {
          D2K60_GROUP = D2K60_GROUP_OLD;
          windows_delete_icons(exe);
          D2K60_GROUP = D2K60_GROUP_NEW;
        }
        /************************************************************/
        ui_action(instantiate(install_exe));
        copy(exe);

        ui_action(instantiate(install_dll));
        copy(dll);

        ui_action(instantiate(install_files));
        copy(setup);
        copy(upd);
        copy(msg);
        copy(res);
         /******************/

        permit_retry_operations = FALSE;
         /*************************** Installer 3.2 *****************************
         Need to indicate group for dlls
        ************************************************************************/

        /*************************************
        Set the install_variable in Registry
        **************************************/
        if(modify_oracle_ini)
        {
            modify(install_variable, PJ60, ora_config, product_filename(current_product));
            win32_register_key("$ORACLE","",install_variable,'REPLICATE);
        }

        /***************************************************************
         Registering map variables except Installer_home and oracle_home
        ****************************************************************/
         win32_register_map_variable("PJ60");
         win32_register_map_variable("D2K60_GROUP");
        /****************************
        /******************************************
        Install all the components of the PARENT
        *******************************************/
        EXECUTE_SCRIPT = "INSTALL_COMPONENTS";
        execute("%installer_home%%dir_separator%d2kr2ins.usr");

        /*******************
        Install dependencies
        ********************/
        EXECUTE_SCRIPT = "INSTALL_DEPENDENCIES";
        execute("%installer_home%%dir_separator%d2kr2ins.usr");
        /*******************/

        permit_retry_operations = TRUE;

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

        /*********************
        Reference dependencies
        **********************/
        ui_action(instantiate(reference_dependencies));

        while(not(empty(dependency_list)))
        {
            current_dependency = first(dependency_list);
            dependency_list = rest(dependency_list);
            {reference(current_dependency, current_product);}
            ['UNREGISTERED_PRODUCT: continue();]
        }
        /*********************/

        permit_retry_operations = FALSE;


        /*********************************
         Register the Dev/2000 file types
        *********************************/
        registry_file = "%installer_home%%dir_separator%temp.reg";            /* create a temporary file, temp.reg, to write the oracle home location. This is used when spawning .reg files */
        QUOTED_ORACLE_HOME = "%oracle_home%";
        QUOTED_ORACLE_HOME = replace( QUOTED_ORACLE_HOME,"\","\\" );

        if (not(exists(registry_file)))
           create_file(registry_file);

        instantiate_file("%PJ60%%dir_separator%d2ktype.reg", "%INSTALLER_HOME%%dir_separator%TEMP.REG");

        {win32_asynchronous_spawn("%REGEXE% /s %INSTALLER_HOME%%dir_separator%TEMP.REG");}
        ['NO_RESPONSE, 'FILE_NOT_FOUND, 'MEMORY_ERROR: continue();]
  /*    remove_file("%INSTALLER_HOME%%dir_separator%TEMP.REG");    */
        /********************************/

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

}
