home *** CD-ROM | disk | FTP | other *** search
/ Winzipper / Winzipper_ISO.iso / programming / oracle7 7.2 / INSTALL / PATH.VRF < prev    next >
Encoding:
Text File  |  1995-09-29  |  2.6 KB  |  82 lines

  1. /* Copyright (c) Oracle Corporation 1993.  All Rights Reserved */
  2.  
  3. /*****************************************************************************
  4.   NAME
  5.     path.vrf - V3 common add-to-path script for Windows products
  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.   sagarwal   09/28/95 Do not check dos_version() if in Windows 95
  16.   zzerhoun   09/17/95 Ported to 32 bit installer 
  17.   zzerhoun   01/10/95 Create path_file if does not exist
  18.   dgalatin   12/17/93 Created.
  19. *****************************************************************************/
  20.  
  21. {
  22.   { evaluate("boot_drive"); }
  23.     [ 'UNBOUND_VARIABLE:
  24.       {
  25.        ui_action(identifying_boot_drive);
  26.  
  27.         if (operating_system == "win95")
  28.           boot_drive = dos_boot_drive();
  29.         else if (earlier_version(dos_version(),"4"))
  30.           {
  31.               mapped_drives = dos_mapped_drives();
  32.  
  33.               extract(mapped_drives,"A"); extract(mapped_drives,"B");
  34.  
  35.             boot_drive = single_selection_dialog(boot_drive_prompt,
  36.                          mapped_drives,
  37.                          boot_drive_content,
  38.                          boot_drive_help);
  39.           }
  40.     else
  41.           boot_drive = dos_boot_drive();
  42.       }
  43.     ]
  44.  
  45.   path_variable = "SET PATH";
  46.   path_separator = " = ";
  47.   path_file = "%boot_drive%:\AUTOEXEC.BAT";
  48.   if (not(exists(path_file)))
  49.     create_file(path_file);
  50.  
  51.   { { path_in_file = translate(path_variable,path_file,path_separator); }
  52.     [ 'UNBOUND_ENVIRONMENT_VARIABLE:
  53.       { path_variable = "PATH";
  54.     { path_in_file = translate(path_variable,path_file,path_separator); }
  55.       [ 'UNBOUND_ENVIRONMENT_VARIABLE:
  56.             { path_separator = " ";           
  57.           { path_in_file = translate(path_variable,path_file,
  58.                      path_separator); }
  59.             [ 'UNBOUND_ENVIRONMENT_VARIABLE:
  60.           { path_in_file = ""; continue(); } ] 
  61.         } ]
  62.     } ]
  63.   }
  64.  
  65.   exploded_path_in_file = explode(path_in_file,";");
  66.  
  67.   if (member(exploded_path_in_file,path_to_add))
  68.     return(FALSE);
  69.  
  70.   path_in_file = "%path_to_add%;%path_in_file%";
  71.  
  72.   len = length(path_in_file);
  73.   if (len > 127)
  74.     information_dialog(instantiate(path_too_long_prompt),
  75.                        path_too_long_content,
  76.                instantiate(path_too_long_help));
  77.  
  78.   modify(path_variable,path_in_file,path_file,path_separator);
  79.  
  80.   return(TRUE);
  81. }
  82.