/* Copyright (c) Oracle Corporation 1996.  All Rights Reserved */

/*****************************************************************************
  NAME
    btrieve60.dei - Deinstallation script for Intersolv DataDirect Drivers

  DESCRIPTION
    This script removes the Intersolv Datadirect Drivers package.

    Main Logic:
    Section I:     De-installation from the parent product
    Section II:  De-installation from a selected child product; remove parent if no other children are installed

  MODIFIED    MM/DD/YY    Reason
   pgupta     09/29/97    Created
*****************************************************************************/

{

    /*****************************************
    Set necessary variables for deinstallation
    ******************************************/
    EXECUTE_SCRIPT = "SET_DEINSTALL_VARIABLES";
    execute("%installer_home%\d2kr2dei.usr");
    /*****************************************/

    doit = TRUE;    /*not making normal call to <os>.dei because referencing does not matter here - don't want dialog to show*/
        registry_label = registry_interface_label(current_registry);

    if (doit)
    {

        /************************************************
        Create a label with the product name, and version
        *************************************************/
        EXECUTE_SCRIPT = "CREATE_LABEL";
        execute("%installer_home%%dir_separator%d2kr2dei.usr");
        /************************************************/

        /******************
        Bind OCA60 variable
        *******************/
        OCA60 = "%oracle_home%%dir_separator%OCA60";
        windows_sys_dir = windows_system_directory();

        /****************************
        Set up product name variables
        *****************************/
        PARENT_PRODUCT              = registry_parent(current_registry);
        PARENT_REGISTRY_NAME        = registry_name(PARENT_PRODUCT);
        /****************************/
        permit_retry_operations  = TRUE;
        permit_ignore_operations = TRUE;
        permit_process_operations= TRUE;


        {unreference(registration(PARENT_REGISTRY_NAME), current_registry);}        /* Unreference Parent */
        ['UNREGISTERED_PRODUCT: continue();]
        /*********************
        Unregister the product
        **********************/
        ui_product(instantiate(display_registry_label));
        ui_action(instantiate(deinstall_unregister));
        unregister(current_registry);
        /*********************/
        /************************************************
        Deinstall parent if no other child product exists
        *************************************************/
        EXECUTE_SCRIPT = "DEINSTALL_PARENT";
        execute("%installer_home%%dir_separator%d2kr2dei.usr");
        /************************************************/
        /********************
         Remove product files
         *********************/
         ui_action(instantiate(deinstall_files));
         remove(paradox);
         remove(shrdll);
         remove(deinst);

        permit_retry_operations = FALSE;

    }   /*end if doit */

} /*end intsol60.dei */
