/* Copyright (c) Oracle Corporation 1992.  All Rights Reserved */
/*****************************************************************************
  NAME
    tracesvr.dei - Winodows NT V3 de-installation script for Windows NT
    Oracle Trace Server

  DESCRIPTION
    This script removes the Windows NT Oracle Trace Server files and un-registers the
    product.

  OWNER    Oracle Trace Server

  MODIFIED      MM/DD/YY    Reason
  mhclau        09/22/97    Remove NLS resources.
  LPRATT        7/08/97     NLS changes
  pschwart      5/10/96     Enable removal of trace subdirectory
  JMR           02/15/96    Expert Beta 5
*****************************************************************************/
{
   { doit = execute("%installer_home%\%operating_system%.dei"); }
   [
     'UNNBOUND_VARIABLE: signal('failure,instantiate(nls("instver_too_early2","The version of the Installer currently running is %%installer_version%%. The product(s) you have chosen to deinstall were installed with a later version of the Installer. Please use a later version of the Installer to deinstall these product(s).")));
   ]

   registry = registration("w32traceSvr");
   registry_label = registry_interface_label(registry);
   ui_product(registry_label);

   /*****************************************************************************
      Bind all nls strings here...
   *****************************************************************************/
   unregistering = nls("unregistering","Unregistering %%registry_label%%...");
   modifying_config = nls("modifying_config","Modifying NT Registry...");

   deinst_exe = nls("deinst_exe","Deinstalling %%registry_label%% Executables...");
   deinst_sql = nls("deinst_sql", "Deinstalling %%registry_label%% SQL files...");
   deinst_reg = nls("deinst_reg", "Deinstalling %%registry_label%% OLE registry files...");
   deinst_scripts = nls("deinst_scripts", "Deinstalling %%regsitry_label%% scripts...");

   if (doit)
   {
      ui_product(registry_label);

      /* Stop all Oracle services that may be affected by this. */
      {winnt_stop_service("oraclestartorcl");}
      ['DEFAULT: continue();]

      {winnt_stop_service("oracleserviceorcl");}
      ['DEFAULT: continue();]

      {winnt_stop_service("oracleTNSlistener");}
      ['DEFAULT: continue();]

      {winnt_stop_service("OracleNamesService");}
      ['DEFAULT: continue();]
      /* end of stopping services. */

      ui_action(instantiate(deinst_sql));
      { remove(sql); }
      [ 'INVALID_FILE_NAME, 'OS_ERROR, 'WRITE_ERROR, 'PERMISSION_DENIED : continue(); ]

      ui_action(instantiate(deinst_exe));
      {
         remove(exe);
         remove(mesg);
         remove(ini);
      }
      [ 'INVALID_FILE_NAME, 'OS_ERROR, 'WRITE_ERROR, 'PERMISSION_DENIED : continue(); ]

      ui_action(instantiate(deinst_scripts));
      {
         remove(deinstl, nls_abbreviation);
      }
      [ 'INVALID_FILE_NAME, 'OS_ERROR, 'WRITE_ERROR, 'PERMISSION_DENIED : continue(); ]

      ui_action(instantiate(unregistering));
      unregister(registry);
   }
}







