home *** CD-ROM | disk | FTP | other *** search
/ Oracle Video Server 3.0.3.1 / OVS_3031_NT.iso / win32 / install / path.vrf < prev    next >
Encoding:
Text File  |  1997-06-16  |  2.8 KB  |  94 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 
  30.          {
  31.          { dosver = dos_version(); }
  32.          ['default(a,b) : 
  33.            { 
  34.              if(operating_system == "win95")
  35.                dosver = "7"; /* Guessing */
  36.              else
  37.                signal(a,b);
  38.            }
  39.          ]
  40.          if (earlier_version(dosver,"4"))
  41.           {
  42.               mapped_drives = dos_mapped_drives();
  43.  
  44.               extract(mapped_drives,"A"); extract(mapped_drives,"B");
  45.  
  46.             boot_drive = single_selection_dialog(boot_drive_prompt,
  47.                          mapped_drives,
  48.                          boot_drive_content,
  49.                          boot_drive_help);
  50.           }
  51.     else
  52.           boot_drive = dos_boot_drive();
  53.          }
  54.       }
  55.     ]
  56.  
  57.   path_variable = "SET PATH";
  58.   path_separator = " = ";
  59.   path_file = "%boot_drive%:\AUTOEXEC.BAT";
  60.   if (not(exists(path_file)))
  61.     create_file(path_file);
  62.  
  63.   { { path_in_file = translate(path_variable,path_file,path_separator); }
  64.     [ 'UNBOUND_ENVIRONMENT_VARIABLE:
  65.       { path_variable = "PATH";
  66.     { path_in_file = translate(path_variable,path_file,path_separator); }
  67.       [ 'UNBOUND_ENVIRONMENT_VARIABLE:
  68.             { path_separator = " ";           
  69.           { path_in_file = translate(path_variable,path_file,
  70.                      path_separator); }
  71.             [ 'UNBOUND_ENVIRONMENT_VARIABLE:
  72.           { path_in_file = ""; continue(); } ] 
  73.         } ]
  74.     } ]
  75.   }
  76.  
  77.   exploded_path_in_file = explode(path_in_file,";");
  78.  
  79.   if (member(exploded_path_in_file,path_to_add))
  80.     return(FALSE);
  81.  
  82.   path_in_file = "%path_to_add%;%path_in_file%";
  83.  
  84.   len = length(path_in_file);
  85.   if (len > 127)
  86.     information_dialog(instantiate(path_too_long_prompt),
  87.                        path_too_long_content,
  88.                instantiate(path_too_long_help));
  89.  
  90.   modify(path_variable,path_in_file,path_file,path_separator);
  91.  
  92.   return(TRUE);
  93. }
  94.