/*****************************************************************************
  NAME
    owm.ins - installation script for Oracle Wallet Manager 2.1 

  
*****************************************************************************/
{
 if (doit)
    {
      ins_ratchet = "3.0.0.0.0";

/*****************************************************************************
   Check for SQL*Net Client
*****************************************************************************/
 netc80_ok = FALSE;
 owm_netc80_version_ok = FALSE;

   /*
    * Now decide if SQL*Net Client is available for Oracle Wallet Manager,
    * and if it is, that it's the right version
    */
   if (not(registered(product_name(w32netclt80))) &&
       not(member(selected_products,w32netclt80)))
   {
     /* we can't install without SQL*Net Client */
     netc80_ok = FALSE;
   }
   else
   {
     /*
      * We have , or maybe just SQL*Net Client on the install list
      * BUT - if we're here because SQL*Net Client is already installed
      * then we must still make sure that its the right version.
      *
      * If however, we're here and SQL*Net Client is on the install list, then
      * we're fine.
      */
     if ( registered(product_name(w32netclt80)) &&
          not(member(selected_products,w32netclt80))
        )
     {
       netc_registration = registration("w32netclt80");
       netc_version = registry_version(netc_registration);
       netc80_ok = (not(earlier_version(netc_version, "8.0.6.0.0")));
     }
     else
     {
       /*
        * If we're here then SQL*Net Client was a member of selected products
        * for this install, so dont worry about the version
        */
       netc80_ok = TRUE;
     }
   }

   /*
    * Now decide if SQL*Net Client Support Files are available for Oracle Wallet Manager,
    * and if it is, that it's the right version
    */
   if (not(registered(product_name(w32rsf80))) &&
       not(member(selected_products,w32rsf80)))
   {
     /* we can't install without SQL*Net Client */
     rsf80_ok = FALSE;
   }
   else
   {
     /*
      * We have , or maybe just SQL*Net Client Support Files on the install list
      * BUT - if we're here because SQL*Net Client Support Files are already installed
      * then we must still make sure that its the right version.
      *
      * If however, we're here and SQL*Net Client Support Files are on the install list, then
      * we're fine.
      */
     if ( registered(product_name(w32rsf80)) &&
          not(member(selected_products,w32rsf80))
        )
     {
       rsf_registration = registration("w32rsf80");
       rsf_version = registry_version(rsf_registration);
       rsf80_ok = (not(earlier_version(rsf_version, "8.0.6.0.0")));
     }
     else
     {
       /*
        * If we're here then SQL*Net Client was a member of selected products
        * for this install, so dont worry about the version
        */
       rsf80_ok = TRUE;
     }
   }

 /*
  * If SQL*Net Client not installed and not selected for installation
  */

 /***************************
 if(not(netc80_ok))
 {
   information_dialog(owm_netc80_req_msg,owm_netc80_req_content,owm_netc80_req_help);
 }

 if (not(rsf80_ok))
 {
   information_dialog(owm_rsf80_req_msg,owm_rsf80_req_content,owm_rsf80_req_help);
 }
 *******************************/

      owm_backup_dir = "%ORACLE_HOME%\OWM";
      know_alias = FALSE;

      ui_product(product_label);
      copy(deinstl);

      /*
      ** Copy everthing, under $ORACLE_HOME
      */
      ui_action("Installing %product_label% Installation Scripts...");
      copy(deinstl,nls_abbreviation);
      ui_action("Installing %product_label% Libraries...");
      copy(dlls,nls_abbreviation);
      copy(libs,nls_abbreviation);
      ui_action("Installing %product_label% Executables...");
      copy(exes,nls_abbreviation);
      ui_action("Installing %product_label% Wallet Help files...");
      copy(help);
      register(product,"Installed Oracle Wallet Manager");

      register(current_product);

      if (member(selected_products,current_product))
        reference(current_product);

      installation_complete
       = instantiate
         (nls("installation_complete",
              "Installation of %%product_label%% completed successfully."));

      ui_action(installation_complete);
    }
}
