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

/****************************************************************************
  NAME
    D2OI60.ins - installation script for Windows Open/2000 Interfaces package

  DESCRIPTION
    This script installs the Open/2000 Interfaces package.

  MODIFIED  MM/DD/YY    Reason
  pgupta    10/01/97    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);
        /******************/

        permit_retry_operations = FALSE;

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

        /******************************************
        Install all the components of the PARENT
        *******************************************/
        EXECUTE_SCRIPT = "INSTALL_COMPONENTS";
        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 all the components of the PARENT
        *********************************************************************/
        if(parent_in_control)
        {
            child_products_to_reference = all_child_products(current_product);
            /*********************
            Reference child products
            **********************/
            while(not(empty(child_products_to_reference)))
            {
                current_child_to_reference = first(child_products_to_reference);
                reference(current_child_to_reference,product_parent(current_child_to_reference));
                child_products_to_reference = rest(child_products_to_reference);
            }
            /*********************/
        }
        /********************************************************************/

        win32_register_OCSM_group(deinst,'MINMODE);
        /*********************
        Reference dependencies
        **********************/
        ui_action(instantiate(reference_dependencies));

        while(not(empty(dependency_list)))
        {
            {reference(first(dependency_list), current_product);}
            ['UNREGISTERED_PRODUCT: continue();]

            dependency_list = rest(dependency_list);
        }
        /*********************/

        permit_retry_operations = FALSE;

    } /*END if doit*/
    [
        'UNREGISTERED_PRODUCT: continue();
            'CANCEL: signal('FAILURE, instantiate(halt_installation));
    ]
} /*END D2OI60.ins*/
