/* Copyright (c) Oracle Corporation 1992.  All Rights Reserved */
/*****************************************************************************
  NAME
    orainst.ins - V3.0.9.2 version analysis/product configuration
		  script for DOS Oracle Installer.

  DESCRIPTION
    This script checks dependencies and environment settings for the
    installation of the DOS Oracle Installer.

  OWNER
    Kush Deepak Jain

  MODIFIED    DD-MMM-YY	 Reason
    kjain     10-JAN-93	 Permitted Oracle Home migration.  Made NLS compliant.
    kjain     08-OCT-92	 Forced a separate Oracle Home.
    ekabatch  28-JAN-92	 Created.
*****************************************************************************/
{
  if (doit)
    {
      ui_product(product_label);

      ui_action(instantiate(installing_scripts));
      copy(deinstl);

      ui_action(instantiate(installing_executables));
      copy(orainst);

      ui_action(instantiate(installing_resources));
      copy(res,nls_abbreviation);

      ui_action(recording_name);

      {
        {
	  if (exists("%oracle_home%\dbs\oi%nls_abbreviation%.res"))
            save_customer_name(the_customer_name,
			       "%oracle_home%\dbs\oi%nls_abbreviation%.res");
        }
	  [ 'WRITE_PROTECTED: signal('WRITE_ERROR); ]
      }
	[ 'WRITE_ERROR: signal('FAILURE,instantiate(recording_name_error1)); ]

      {
	{
	  if (nls_abbreviation != "us")
	    save_customer_name(the_customer_name,
			       "%oracle_home%\dbs\oius.res");
	}
	  [ 'WRITE_PROTECTED: signal('WRITE_ERROR); ]
      }
	[ 'WRITE_ERROR: signal('FAILURE,instantiate(recording_name_error2)); ]


      register(current_product);
      reference(current_product);
   }

   if (bootstrap)
     { 
       if (autoexec_needs_change)
	 if (config_needs_change)
	   if (autoexec_has_been_changed)
	     if (config_has_been_changed)
	       information_dialog(need_reboot_prompt,  
			          need_reboot_content,
				  need_reboot_help);	
  	         else
  	           information_dialog(need_config_changes_prompt,
			              need_config_changes_content,
			              need_config_changes_help);
	   else if (config_has_been_changed)
  	     information_dialog(need_autoexec_changes_prompt,
		                need_autoexec_changes_content,
			        need_autoexec_changes_help);
		else
                  information_dialog(need_con_auto_changes_prompt,
				     need_con_auto_changes_content,
				     need_con_auto_changes_help);
	  else if (autoexec_has_been_changed)
		 information_dialog(need_reboot_prompt,  
			          need_reboot_content,need_reboot_help);
	       else
   	         information_dialog(need_autoexec_changes_prompt,
		                    need_autoexec_changes_content,
			            need_autoexec_changes_help);
       else if (config_needs_change)
	      {
  	        if (config_has_been_changed)
		  information_dialog(need_reboot_prompt,  
				     need_reboot_content,
			             need_reboot_help);	   
		 else
  	           information_dialog(need_config_changes_prompt,
			              need_config_changes_content,
			              need_config_changes_help);

	      }
       else if ( path_needs_change || config_is_wrong || oraconfig_is_wrong )
              {  help_prompt ="";
                 if (path_needs_change)
		   help_prompt ="%help_prompt%%path_problem_prompt%

";
		 if (config_is_wrong)
		   help_prompt ="%help_prompt%%autoexec_problem_prompt%

";
		 if (oraconfig_is_wrong)
		  help_prompt ="%help_prompt%%oraconfig_problem_prompt%
";
                 information_dialog(need_reboot_prompt,
				    need_reboot_content,
				    help_prompt
				    );
	      }
       else
	 modify("BOOT","%oracle_home%\XBIN\ORAINST.EXE",".\BOOT.ORA");
     }
      [ 'CANCEL : continue(); ]
}

