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

/***************************************************************************
NAME
    o8srvr.805.dei.pp

FUNCTION
    Deinstalls the documentation for product .      

NOTES

CREATED
    GBARSKAY		08/01/96

MODIFIED
    NORMSETH		04/17/97 
    NORMSETH		05/13/97
***************************************************************************/
{mark{ 
/* Define USE_ULIMIT for ports which have file size restrictions imposed  */
/* by ulimit.  These are usually System V ports. */
/* Define NO_DEVSYS for ports which don't require Software Development System */
/* for installing Oracle */
/* Define OFF_SERVER_ONLY for Office Server only systems. */
/* Define GEN_AS to generate assembly code instead of c code in gen scripts */
/*  The SYSTEM_CHECK macro causes install/system.check, the pre-installation */
/*  configuration test, to be included in INSTALL.DIST.  The intent is that */
/*  this macro will be defined for all platforms (eventually). */
/*  The INCLUDE_CORE macro causes install/CORE.DIST to be included in  */
/*  install/INSTALL.DIST.  CORE.DIST contains a list of files which are  */
/*  required by all products.  They are especially important in the case */
/*  of sites which do not have an RDBMS license but link and use network */
/*  user tools (like SQL*Forms) from a "client" platform.  At some point */
/*  base development will "define" a CORE product and it can replace this */
/*  psydo-product.  */
/*  In 6.0.27.6, USE_BIGORALIB and USE_LIBKNL have been obsoleted.   */
/*  Both libora.a and libknl.a are now used for all ports.  This is  */
/*  done to clean up the suffix makefiles and to separate user and   */
/*  kernel libraries. */
/*  USE_BIGFRMLIB causes the the big forms library libforms.a to be made, */
/*  which is composed of libtm.a, libomm.a and libram.a */
/* Define USE_ROFIX if you want to rofix certain modules for your port.  */
/* Modules to be rofixed are designated in the make suffix files in the  */
/* source directories.  Rofixing (read-only fix) a module means compiling */
/* it in such a way as to move all data in the module from data space into */
/* text space.  Modules to be rofixed should be chosen with care since */
/* rofixing read/write data causes segmentation violations at run time. */
/*  Define LIBMEM if the make command on your port understands library    */
/*  dependency on object files, i.e. the rule: lib.a(obj1.o obj2.o).      */
/*  Define LIBSEP as well if each object file has to be listed separately,*/
/*  i.e. the rule: lib.a(obj1.o) lib.a(obj2.o).  For LIBSEP to be         */
/*  effective, LIBMEM has to be defined first.                            */
/* Define USE_RANLIB if "ranlib" is required after re-archiving the   */
/* library.  This affects the makefiles we ship out to the customers, */
/* not the makefiles in the development system.                       */
/* If you are using GNU make. */
/* Pro*Cobol Macros : Define the appropriate BUILD_* macros for your port. */
/* The code for the macro included below may require some port specific    */
/* modification.                                                           */
/* 8/10/95 - For client Side shared lib support */
/* 2/4/97 - For Intelligent Agent support */
/*
 * $Header: macros.dei 3090000.1 95/09/05 15:17:18 wyim Generic<base> $ Copyr (c) 1992 Oracle
 */
/***************************************************************************
 NAME
    macros.dei
 FUNCTION
    Definitions of macros commonly used in *.dei scripts.
 NOTES
 CREATED
    PKu		07/26/92
 MODIFIED 
***************************************************************************/
/*
 * $Header: misc.ins.pp 3090000.1 95/09/05 15:17:24 wyim Generic<base> $ Copyr (c) 1992 Oracle
 */








problem_error_info=nls( "problem_error_info","A problem occured trying to process the last error." );
problem_error_info_help=nls( "problem_error_info_help","?html problem_error_info_help" );
problem_error_info_content=nls( "problem_error_info_content","Error Processing Problem" );

problem_dlg_help=nls( "problem_dlg_help","?html problem_dlg_help" );

problem_header_dflt=nls( "problem_header_dflt", "
Platform:	%%operating_system%%
Release:	%%rel_version%%
Product: 	%%pname%%
Version:	%%current_version%%

Area:		(Installation)	

Install information:

	Installer Version:  %%installer_version%%
	Installer Script:   %%_line%% 
	Install Action:     %%Inst_Action%%

	Stage Home	    %%Stage_Home%%
	Oracle_Base	    %%Oracle_Base%%	(%%OFA_Compliant%%)
	Oracle Home	    %%Oracle_Home%%
	Owner		    %%Owner%%
	Log		    %%Install_Log%%

	During installation of the above product the error below is
	encountered:
");




Sys_Macro_Holdfile="%%Oracle_Home%%/orainst/holdfile.log";
Sys_Macro_Help=nls("Sys_Macro_Help", "?html Sys_Macro_Help" );
Sys_Macro_Content=nls( "Sys_Macro_Content", "O/S Error" );
Sys_Macro_Prompt=nls("Sys_Macro_Prompt", "
Error during action '%%_com%%'.

Command:  %%_cmd%%

");
Sys_Macro_Cancel_Prompt=nls("Sys_Macro_Cancel_Prompt", "Installation terminated at user request." );




  /*
  ** DEPENDENCY:
  ** - product_registry must be defined before using the following macros.
  */
  /*
  ** UNREG_PROD
  ** - this macro should be used to unregister a product from the product
  **   registry.  It should only be used AFTER dependencies on other
  **   products have been removed.
  */
  /*
  ** DEINSTALL_DEPEND(depend_product_string)
  ** - depend_product_string is the string equivalent of the product
  **   descriptor as specified in <OS>.prd
  ** - this macro should be used to remove a dependency on another product
  **   during deinstallation.  All dependencies should be removed BEFORE
  **   the product being deinstalled is unregistered.
  */
  /*
  ** NO_INST_CD_DOC
  */
/*
 * $Header: macros.vrf.pp 3090000.1 95/09/05 15:17:19 wyim Generic<base> $ Copyr (c) 1992 Oracle
 */

/*
 * $Header: misc.ins.pp 3090000.1 95/09/05 15:17:24 wyim Generic<base> $ Copyr (c) 1992 Oracle
 */



/* Install Merge Changes */
/* Changed SIZE_DLG to SIZE_DLG_MAX */

/* Install Merge Changes */
/* Added the #ifdef KEEP_COMMENTS block */


/* Install Merge Changes */


/* Galina  

 \
	{ 
 \
	   if (exists(User_Dflt_File)) 
 \
	   { 
 \
	     { _tmp_var=translate(dflt_idx, User_Dflt_File, "="); 
 \
	       _dflt_str="%_tmp_var%"; 
 \
	     } 
 \
	     [ 'UNBOUND_ENVIRONMENT_VARIABLE: _dflt_str=list_dflt; ] 
 \
	   } 
 \
	   else 
 \
	     _dflt_str=list_dflt; 
 \
	   if (Default_Install) 
 \
	     output = _dflt_str; 
 \
  else \ 

	     output=MULTIPLE_TEXT_DIALOG(prompt, _dflt_str, content, help); 
 \
  if (exists(User_Dflt_File)) modify(dflt_idx, output, User_Dflt_File, "=");\ 
	   LOG_HDR("MULTIPLE_TEXT") 
 \
	   _prompt=prompt; _answer=output; 
 \
	   first_log=first(_answer); _answer1=rest(_answer); 
 \
	   second_log=first(answer1); _answer=rest(answer1); 
 \
	   third_log=first(answer); answer1=rest(answer); forth_log=first(answer1); 
 \
	   _dummy="       Q> %_prompt%"; modify("", _dummy, Install_Log); 
 \
	   _dummy="       A> %first_log%"; modify("", _dummy, Install_Log); 
 \
	   _dummy="       A> %second_log%"; modify("", _dummy, Install_Log); 
 \
	   _dummy="       A> %third_log%"; modify("", _dummy, Install_Log); 
 \
	   _dummy="       A> %forth_log%"; modify("", _dummy, Install_Log); 
 \
	}
  Galina */



















	{/*_LOG_MSG("Entering o8srvr.805.dei", "")*/ 
	   _msg="Entering o8srvr.805.dei"; 
	   _logfile= ""; 
	   if(_logfile == "") 
	   { 
	     modify("", ">>> %_msg%", Install_Log); 
	     modify("", ">>> %_msg%", Sql_Log); 
	     modify("", ">>> %_msg%", Make_Log); 
	     modify("", ">>> %_msg%", OS_Log); 
	     if(ORCA_Debug) 
	       modify("",">>> %_msg%",Debug_Log); 
	   } 
	   else if(_logfile == Install_Log) 
	     modify("", "     - %_msg%", Install_Log); 
	   else if(_logfile == Sql_Log) 
	     modify("", "     - %_msg%", Sql_Log); 
	   else if(_logfile == Make_Log) 
	     modify("", "     - %_msg%", Make_Log); 
	   else if(_logfile == OS_Log) 
	     modify("", "     - %_msg%", OS_Log); 
	   else if(_logfile == Debug_Log) 
	     if(ORCA_Debug) 
	       modify("","     - %_msg%", Debug_Log); 
	   else 
	     information_dialog("Bad Log file name"); 
	}

RM_html = "Removing html documents";
RM_pdf  = "Removing PDF files ...";

    product_registry = registration("server_doc");

/*
 * $Header: pinit.dei 3090000.1 95/09/05 15:17:13 wyim Generic<base> $ Copyr (c) 1992 Oracle
 */
/***************************************************************************
NAME
    pinit.dei
FUNCTION
    Contains common initialization code for *.dei scripts.  Determines,
    based on the reference info, whether to deinstall the product.
NOTES
    References the following globol variables:
	Confirm_Deinst_Msg
    References the following variables local to product name space:
	product_registry
    Initializes the following variables local to product name space:
        product_label
        do_it
CREATED
    PKu		07/26/92
MODIFIED 
***************************************************************************/
   { /* pinit.dei */
    Confirm_Deinst_Msg_content = nls ("Confirm_Deinst_Msg_content",  "Product Dependencies");
    Confirm_Deinst_Msg_help = nls ("Confirm_Deinst_Msg_help",  "?html Confirm_Deinst_Msg_help");
    product_label = registry_interface_label(product_registry);
    ui_product(product_label);
    doit = false;
    if (unreferenced(product_registry))
        doit = TRUE;
    else if (not(internally_called))
        if (uniquely_self_referenced(product_registry))
            doit = TRUE;
        else
/* These changes cause wierd problems.
           {
		depend_list = list();
                all_name = "";
		depend_list = registry_references(product_registry);
		while(not(empty(depend_list)))
                {
	   		pr1 = first(depend_list);
			depend_list = rest(depend_list);
			name1 = registry_interface_label(pr1);
			all_name = instantiate("%name1%, %all_name%");
		}
		doit = yesno_dialog(instantiate("The installer has detected that the product you are attempting to de-install(%product_label%) is relied upon by the following products:  %all_name% de-installation of this product could resault in these other products being rendered unusable.  Select "No" to abort the de-installation process.  Select "Yes" if you wish to complete de-installation of this product"),  false, Confirm_Deinst_Msg_content, Confirm_Deinst_Msg_help);
	   }
*/
            doit = yesno_dialog(instantiate(Confirm_Deinst_Msg), false, Confirm_Deinst_Msg_content, Confirm_Deinst_Msg_help); 
    if (not(doit))
	ui_action(instantiate(Not_Deinstall_Msg));
   } /* end of 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 (exists(User_Dflt_File)) 
	   { 
	     { _tmp_var=translate( "unix.Oracle_Doc", User_Dflt_File, "="); 
	       _dflt_str="%_tmp_var%"; 
	     } 
	     [ 'UNBOUND_ENVIRONMENT_VARIABLE: _dflt_str= odoc_dflt; ] 
	   } 
	   else 
	     _dflt_str= odoc_dflt; 
	   if (Default_Install) 
	      Oracle_Doc = _dflt_str; 
	   else 
	      Oracle_Doc =TEXT_DIALOG(odoc_prompt, _dflt_str, odoc_content, odoc_help); 
	   if (exists(User_Dflt_File)) modify( "unix.Oracle_Doc", Oracle_Doc , User_Dflt_File, "="); 
	   
	{/*_LOG_HDR("TEXT")*/ 
	   _dlg_type="TEXT"; 
	   modify("","       ", Install_Log); 
	   if(_dlg_type == "YESNO") 
	     _dummy="-[ YESNO ]--------------------------------------------------------------------"; 
	   else if (_dlg_type == "TEXT") 
	     _dummy="-[ TEXT ]---------------------------------------------------------------------"; 
	   else if (_dlg_type == "SINGLE_SELECT") 
	     _dummy="-[ SINGLE_SELECT ]------------------------------------------------------------"; 
	   else if (_dlg_type == "MULTI_SELECT") 
	     _dummy="-[ MULTI_SELECT ]-------------------------------------------------------------"; 
	   else if (_dlg_type == "GET_FILE") 
	     _dummy="-[ GET_FILE ]-----------------------------------------------------------------"; 
	   else if (_dlg_type == "PASSWD") 
	     _dummy="-[ PASSWD ]-------------------------------------------------------------------"; 
	   else if (_dlg_type == "MULTI_TEXT") 
	   { 
	     divider="############################################################"; 
	     dummy   ="#                     INSTALL LOG FILE                       #"; 
	     linespace = "                     "; 
	     modify("", divider, Install_Log); 
	     modify("", dummy, Install_Log); 
	     modify("", divider, Install_Log); 
	     spawn("echo %Install_Log%", Install_Log, Install_Log); 
	     spawn("echo `date` - `id`", Install_Log, Install_Log); 
	     modify("",linespace, Install_Log); 
	     dummy   ="#                     SQL LOG FILE                           #"; 
	     modify("", divider, Sql_Log); 
	     modify("", dummy, Sql_Log); 
	     modify("", divider, Sql_Log); 
	     spawn("echo %Sql_Log%", Sql_Log, Sql_Log); 
	     spawn("echo `date` - `id`", Sql_Log, Sql_Log); 
	     modify("", linespace, Sql_Log); 
	     dummy   ="#                     MAKE LOG FILE                         #"; 
	     modify("", divider, Make_Log); 
	     modify("", dummy, Make_Log); 
	     modify("", divider, Make_Log); 
	     spawn("echo %Make_Log%", Make_Log, Make_Log); 
	     spawn("echo `date` - `id`", Make_Log, Make_Log); 
	     modify("", linespace, Make_Log); 
	     dummy   ="#                     OS LOG FILE                           #"; 
	     modify("", divider, OS_Log); 
	     modify("", dummy, OS_Log); 
	     modify("", divider, OS_Log); 
	     spawn("echo %OS_Log%", OS_Log, OS_Log); 
	     spawn("echo `date` - `id`", OS_Log, OS_Log); 
	     modify("", linespace, OS_Log); 
	     _dummy="-[ MULTI_TEXT ]-------------------------------------------------------------"; 
	   } 
	   modify("", _dummy, Install_Log); 
	} 
	   _prompt=odoc_prompt; _answer= Oracle_Doc ; 
	   _dummy="       Q> %_prompt%"; modify("", _dummy, Install_Log); 
	   _dummy="       A> %_answer%"; modify("", _dummy, Install_Log); 
	}

        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)
    {


	{ unregister(product_registry); }

	
	{/*_RM(Rm_html, htmldoc)*/ 
	   
	{/*_ACTION(instantiate(Rm_html))*/ 
	   _com=instantiate(Rm_html); 
	   ui_action("%_com%"); 
	   
	{/*_LOG_MSG("%_com%",   Install_Log)*/ 
	   _msg="%_com%"; 
	   _logfile= Install_Log; 
	   if(_logfile == "") 
	   { 
	     modify("", ">>> %_msg%", Install_Log); 
	     modify("", ">>> %_msg%", Sql_Log); 
	     modify("", ">>> %_msg%", Make_Log); 
	     modify("", ">>> %_msg%", OS_Log); 
	     if(ORCA_Debug) 
	       modify("",">>> %_msg%",Debug_Log); 
	   } 
	   else if(_logfile == Install_Log) 
	     modify("", "     - %_msg%", Install_Log); 
	   else if(_logfile == Sql_Log) 
	     modify("", "     - %_msg%", Sql_Log); 
	   else if(_logfile == Make_Log) 
	     modify("", "     - %_msg%", Make_Log); 
	   else if(_logfile == OS_Log) 
	     modify("", "     - %_msg%", OS_Log); 
	   else if(_logfile == Debug_Log) 
	     if(ORCA_Debug) 
	       modify("","     - %_msg%", Debug_Log); 
	   else 
	     information_dialog("Bad Log file name"); 
	} 
	} 
	   remove( htmldoc); 
	}
        crindex_cmd = "%OD%/install/crindex.sh %OD%";
        
	{/*_SYSTEM(crindex_cmd, "Index file wasn't created", status)*/ 
	   _cmd=crindex_cmd; _com= "Index file wasn't created"; 
	   
	{/*_LOG_SEL(_cmd,   outfile)*/ 
	     outfile = OS_Log; 
	   if(contains(_cmd, "bin/sqldba") || contains(_cmd, "bin/sqlplus") || contains(_cmd, "bin/svrmgrl") || contains(_cmd, "migrate")) 
	       outfile = Sql_Log; 
	   if(contains(_cmd, "make ")) 
	       outfile = Make_Log; 
	} 
	   _out=outfile; _err=outfile; 
	   modify("", log_divider(), outfile); 
	   modify("", "Action:   %_com%", _out); 
	   modify("", "Command: (%_cmd%), Out=%_out%, Err=%_err%", _out); 
	   modify("", "{", _out); 
	   _stat = spawn(_cmd, _out, _err); 
	   modify("", "}", _out); 
	   modify("", "Status:   %_stat%", _out); 
	   if (_stat!=0) { 
	   modify("","(( OIERR-SYSTEM: %_cmd% ))",_out); 
	   if(_out!=Install_Log) 
	   modify("","(( OIERR-SYSTEM: %_cmd% ))",Install_Log); 
	   } 
	    status=_stat; 
	   modify("", log_divider(), _out); 
	}/*End SYSTEM*/

        
	{/*_RM(Rm_pdf, pdf)*/ 
	   
	{/*_ACTION(instantiate(Rm_pdf))*/ 
	   _com=instantiate(Rm_pdf); 
	   ui_action("%_com%"); 
	   
	{/*_LOG_MSG("%_com%",   Install_Log)*/ 
	   _msg="%_com%"; 
	   _logfile= Install_Log; 
	   if(_logfile == "") 
	   { 
	     modify("", ">>> %_msg%", Install_Log); 
	     modify("", ">>> %_msg%", Sql_Log); 
	     modify("", ">>> %_msg%", Make_Log); 
	     modify("", ">>> %_msg%", OS_Log); 
	     if(ORCA_Debug) 
	       modify("",">>> %_msg%",Debug_Log); 
	   } 
	   else if(_logfile == Install_Log) 
	     modify("", "     - %_msg%", Install_Log); 
	   else if(_logfile == Sql_Log) 
	     modify("", "     - %_msg%", Sql_Log); 
	   else if(_logfile == Make_Log) 
	     modify("", "     - %_msg%", Make_Log); 
	   else if(_logfile == OS_Log) 
	     modify("", "     - %_msg%", OS_Log); 
	   else if(_logfile == Debug_Log) 
	     if(ORCA_Debug) 
	       modify("","     - %_msg%", Debug_Log); 
	   else 
	     information_dialog("Bad Log file name"); 
	} 
	} 
	   remove( pdf); 
	}
	
	{/*_RM2(Rm_Admin, base, instal)*/ 
	   
	{/*_ACTION(instantiate(Rm_Admin))*/ 
	   _com=instantiate(Rm_Admin); 
	   ui_action("%_com%"); 
	   
	{/*_LOG_MSG("%_com%",   Install_Log)*/ 
	   _msg="%_com%"; 
	   _logfile= Install_Log; 
	   if(_logfile == "") 
	   { 
	     modify("", ">>> %_msg%", Install_Log); 
	     modify("", ">>> %_msg%", Sql_Log); 
	     modify("", ">>> %_msg%", Make_Log); 
	     modify("", ">>> %_msg%", OS_Log); 
	     if(ORCA_Debug) 
	       modify("",">>> %_msg%",Debug_Log); 
	   } 
	   else if(_logfile == Install_Log) 
	     modify("", "     - %_msg%", Install_Log); 
	   else if(_logfile == Sql_Log) 
	     modify("", "     - %_msg%", Sql_Log); 
	   else if(_logfile == Make_Log) 
	     modify("", "     - %_msg%", Make_Log); 
	   else if(_logfile == OS_Log) 
	     modify("", "     - %_msg%", OS_Log); 
	   else if(_logfile == Debug_Log) 
	     if(ORCA_Debug) 
	       modify("","     - %_msg%", Debug_Log); 
	   else 
	     information_dialog("Bad Log file name"); 
	} 
	} 
	   remove( base); 
	   remove( instal); 
	}
     }


	{/*_LOG_MSG("Leaving o8srvr.805.dei", "")*/ 
	   _msg="Leaving o8srvr.805.dei"; 
	   _logfile= ""; 
	   if(_logfile == "") 
	   { 
	     modify("", ">>> %_msg%", Install_Log); 
	     modify("", ">>> %_msg%", Sql_Log); 
	     modify("", ">>> %_msg%", Make_Log); 
	     modify("", ">>> %_msg%", OS_Log); 
	     if(ORCA_Debug) 
	       modify("",">>> %_msg%",Debug_Log); 
	   } 
	   else if(_logfile == Install_Log) 
	     modify("", "     - %_msg%", Install_Log); 
	   else if(_logfile == Sql_Log) 
	     modify("", "     - %_msg%", Sql_Log); 
	   else if(_logfile == Make_Log) 
	     modify("", "     - %_msg%", Make_Log); 
	   else if(_logfile == OS_Log) 
	     modify("", "     - %_msg%", OS_Log); 
	   else if(_logfile == Debug_Log) 
	     if(ORCA_Debug) 
	       modify("","     - %_msg%", Debug_Log); 
	   else 
	     information_dialog("Bad Log file name"); 
	}
}}
 
