home *** CD-ROM | disk | FTP | other *** search
/ Winzipper / Winzipper_ISO.iso / programming / oracle7 7.2 / INSTALL / PO7PATH.VRF < prev    next >
Encoding:
Text File  |  1995-10-19  |  6.1 KB  |  130 lines

  1. /* Copyright (c) Oracle Corporation 1993.  All Rights Reserved */
  2.  
  3. /*****************************************************************************
  4.   NAME
  5.     po7path.vrf - PO7 add-to-path script for Windows 95
  6.  
  7.   DESCRIPTION
  8.     This script adds 'path_to_add' to the path variable in AUTOEXEC.BAT.
  9.     If the path becomes too long with the addition of 'path_to_add',
  10.     An information dialog is displayed.  Assuming there is no signal,
  11.     this script returns TRUE if the path was modified or FALSE if it wasn't
  12.     (i.e., if 'path_to_add' was already on the path).
  13.  
  14.   MODIFIED   MM/DD/YY REASON
  15.   LMurphy    09/27/95 Modified for specific PO7 use
  16.   EKhor         09/26/95 Modified for use with PO7 for Win95
  17.   zzerhoun   09/17/95 Ported to 32 bit installer 
  18.   zzerhoun   01/10/95 Create path_file if does not exist
  19.   dgalatin   12/17/93 Created.
  20. *****************************************************************************/
  21.  
  22. {
  23.  
  24.   identifying_boot_drive = nls("identifying_boot_drive",
  25.                            "Identifying the Boot Drive...");
  26.   yesr_prompt = nls("yesr_prompt", "Yes (Recommended)");
  27.   yes_prompt = nls("yes_prompt", "Yes");
  28.   no_prompt = nls("no_prompt", "No");
  29.   ynprompt = list(yes_prompt, no_prompt);
  30.   ynrprompt = list(yesr_prompt, no_prompt);
  31.  
  32.   { evaluate("boot_drive"); }
  33.     [ 'UNBOUND_VARIABLE:
  34.     {
  35.         ui_action(identifying_boot_drive);
  36.         boot_drive = dos_boot_drive();
  37.     }
  38.     ]
  39.  
  40.   reboot_msg = nls("reboot_msg", "The addition made to your Windows 95 path variable will not take effect until you restart the system.");
  41.  
  42.   set_path_long_prompt = instantiate(nls("set_path_long_prompt", "In order for Personal Oracle7's console programs and third party applications to function properly with Personal Oracle7 for Windows 95, the following system modification should be made:
  43.  
  44. Add '%%oracle_home%%\BIN' to the PATH statement in your '%%boot_drive%%:\AUTOEXEC.BAT' file.
  45.  
  46. Note that adding '%%oracle_home%%\BIN' will cause the PATH statement to exceed 128 characters.  Some older DOS programs may fail with a PATH length in excess of 128 characters.
  47.  
  48. Would you like this modification to be made automatically?"));
  49.   set_path_long_content = nls("set_path_long_content", "Path Configuration");
  50.   set_path_long_help = instantiate(nls("set_path_long_help", "Personal Oracle7 for Windows 95 console (MS-DOS Prompt) programs, such as Import and Export, and third party products that access Oracle databases may not function properly unless '%%oracle_home%%\BIN' is on the PATH.  The PATH variable in %boot_drive%:\AUTOEXEC.BAT does not currently include the directory '%%oracle_home%%\BIN'.%carriage_return%%carriage_return%The Installer has also detected that adding '%%oracle_home%%\BIN' to the PATH will cause the PATH to exceed a length of 128 characters.  Some older DOS programs may fail with a PATH length in excess of 128 characters.%carriage_return%%carriage_return%Select 'Yes' if you want the Installer to modify your '%boot_drive%:\AUTOEXEC.BAT' file to add this directory to the PATH.  Choose 'No' if you want to modify '%boot_drive%:\AUTOEXEC.BAT' yourself.%carriage_return%%carriage_return%If you choose 'Yes', you will need to restart your computer for the change to your PATH variable to take effect."));
  51.  
  52.   set_path_prompt = instantiate(nls("set_path_prompt", "In order for Personal Oracle7's console programs and third party applications to function properly with Personal Oracle7 for Windows 95, the following system modification should be made:
  53.  
  54. Add '%%oracle_home%%\BIN' to the PATH statement in your '%%boot_drive%%:\AUTOEXEC.BAT' file.
  55.  
  56. Would you like this modification to be made automatically?"));
  57.   set_path_content = nls("set_path_content", "Path Configuration");
  58.   set_path_help = instantiate(nls("set_path_help", "Personal Oracle7 for Windows 95 console (MS-DOS Prompt) programs, such as Import and Export, and third party products that access Oracle databases may not function properly unless '%%oracle_home%%\BIN' is on the PATH.  The PATH variable in %boot_drive%:\AUTOEXEC.BAT does not currently include the directory '%%oracle_home%%\BIN'.%carriage_return%%carriage_return%Select 'Yes' if you want the Installer to modify your '%%boot_drive%%:\AUTOEXEC.BAT' file to add this directory to the PATH. Choose 'No' if you want to modify '%%boot_drive%%:\AUTOEXEC.BAT' yourself.%carriage_return%%carriage_return%If you choose 'Yes', you will need to restart your computer for the change to your PATH variable to take effect."));
  59.  
  60.  
  61.   path_file_exist = TRUE;
  62.   path_variable = "SET PATH";
  63.   path_separator = " = ";
  64.   path_file = "%boot_drive%:\AUTOEXEC.BAT";
  65.   if (not(exists(path_file)))
  66.   {
  67.     path_file_exist = FALSE;
  68.     path_in_file = "%path_to_add%";
  69.     exploded_path_in_file = list();
  70.     path_variable = "PATH";
  71.     path_separator = " ";
  72.   }
  73.   else
  74.   {
  75.    {
  76.      { path_in_file = translate(path_variable,path_file,path_separator); }
  77.      [ 'UNBOUND_ENVIRONMENT_VARIABLE:
  78.       { path_variable = "PATH";
  79.     { path_in_file = translate(path_variable,path_file,path_separator); }
  80.       [ 'UNBOUND_ENVIRONMENT_VARIABLE:
  81.             { path_separator = " ";           
  82.           { path_in_file = translate(path_variable,path_file,
  83.                      path_separator); }
  84.             [ 'UNBOUND_ENVIRONMENT_VARIABLE:
  85.           { path_in_file = ""; continue(); } ] 
  86.         } ]
  87.     } ]
  88.    }
  89.  
  90.    exploded_path_in_file = explode(path_in_file,";");
  91.  
  92.    path_in_file = "%path_in_file%;%path_to_add%";
  93.  
  94.    path_in_file = replace(path_in_file, ";;", ";");
  95.  
  96.   }
  97.  
  98.   if (member(exploded_path_in_file,path_to_add))
  99.   {
  100.     return(FALSE);
  101.   }
  102.   else
  103.   {
  104.     len = length(path_in_file);
  105.     if (len > 127)
  106.     {
  107.         add_to_path = TRUE;
  108.         add_to_path = single_selection_dialog(set_path_long_prompt, ynprompt, yes_prompt, set_path_long_content, set_path_long_help);
  109.     }
  110.     else
  111.     {
  112.         add_to_path = TRUE;
  113.         add_to_path = single_selection_dialog(set_path_prompt, ynrprompt, yesr_prompt, set_path_content, set_path_help);
  114.     }
  115.     if (add_to_path == no_prompt)
  116.         return(FALSE);
  117.  
  118.   }
  119.  
  120.   if (not(path_file_exist))
  121.     create_file(path_file);
  122.  
  123.   modify(path_variable,path_in_file,path_file,path_separator);
  124.  
  125.   if (not(member(remind_list, reboot_msg)))
  126.     add(remind_list, reboot_msg);  
  127.  
  128.   return(TRUE);
  129. }
  130.