#
# $Header: doccommon.dei.pp 1.2 96/08/06 14:19:02 <unix> $ Copyr (c) 1992 Oracle
#

/***************************************************************************
NAME
    doccommon.dei.pp

FUNCTION
    Deinstalls the documentation for product .      

NOTES

CREATED
    GBARSKAY		08/01/96

MODIFIED 
***************************************************************************/
{mark{ 
#include <ss_pp.h>
#include <macros.dei>
#include <macros.vrf>


LOG_MSG("Entering dcommon.dei", "")

RM_html = "Removing html documents ...";
RM_oin  = "Removing OIN files ...";

    product_registry = registration("dcommon");

#include <pinit.dei>

/* This needs to be done in case a path different from
   "Install Doc Only" was selected and therefore ORACLE_DOC
   directory is not defined.
*/
  
odoc_prompt=nls("odoc_prompt","Enter the pathname for your $ORACLE_DOC directory:");
odoc_content=nls("odoc_content","ORACLE_DOC");
odoc_help=nls("odoc_help", "ORACLE_DOC is a directory where you installed all Product Documentation.");
odoc_info1=nls("odoc_info1","You must specify $ORACLE_DOC.");
odoc_info6=nls("odoc_info6","You have entered the wrong ORACLE_DOC directory.");

   	{
	   test=OD;
	}
	[ 'UNBOUND_VARIABLE: 
	{
	  if( empty(odoc_list) )
	  {
	{
            Oracle_Base=translate("ORACLE_BASE");
        }
        [ 'UNBOUND_ENVIRONMENT_VARIABLE: {
                Oracle_Base=""; }  ]
 
    /* Prompt for Oracle Doc directory */
    {
      odoc_dflt=translate("ORACLE_DOC");
      if (odoc_dflt == "")
      {
        if(Oracle_Base != "")
           odoc_dflt = "%Oracle_Base%/doc";
        else
           odoc_dflt = "%Oracle_Home%/doc";
      }
    }
    [ 'UNBOUND_ENVIRONMENT_VARIABLE: {
      if(Oracle_Base != "")
         odoc_dflt="%Oracle_Base%/doc";
      else
         odoc_dflt="%Oracle_Home%/doc"; } ]

         Oracle_Doc = "";

    while (Oracle_Doc == "")
    {
        TEXT_DLG(odoc_prompt, odoc_dflt, odoc_content, odoc_help, "unix.Oracle_Doc", Oracle_Doc )

        if (Oracle_Doc == "")
            information_dialog(odoc_info1);
        else
        {
		if(not(exists("%Oracle_Doc%/products.htm")))
		{
                      information_dialog(instantiate(odoc_info6));
                      Oracle_Doc="";
		}
	}
     }          
 

		OD = Oracle_Doc;
		add(odoc_list, Oracle_Doc);
	  }
	  else
		OD= first(odoc_list);
	}
	]

    if (doit)
    {

	UNREG_PROD

	RM(Rm_html, htmldoc)
	RM2(Rm_Admin, base, instal)
        RM(Rm_oin, oin)
     }

LOG_MSG("Leaving dcommon.dei", "")
}}
