home *** CD-ROM | disk | FTP | other *** search
/ Chip 2000 May / chip-cd_2000_05.zip / 05 / aktualnosci / shareware / euphoria / 1.DAT < prev    next >
Text File  |  1999-12-23  |  18KB  |  672 lines

  1.         -----------------------------------
  2.         --  Program to Install Euphoria  --
  3.         --  (see install.doc)            --
  4.         -----------------------------------
  5.  
  6. -- install.bat runs this install.ex program, then it runs Junko Miura's 
  7. -- documentation generator to create both the HTML and DOC files from a
  8. -- common source (HTX). You can download the generator and HTX files
  9. -- from the RDS Web site.
  10.  
  11. without warning
  12. constant KEYBOARD = 0, SCREEN = 1
  13. constant SUCCESS = 1, FAILURE = 0, NO_EDIT = 2
  14. constant TRUE = 1, FALSE = 0
  15. constant CLEAR = 0, NO_CLEAR = 2
  16.  
  17.     -------------------------------------------------
  18.     -- Subdirectory structure for Euphoria files.  --
  19.     --     (before documentation generator)        --
  20.     -------------------------------------------------
  21.  
  22. constant file_list = {
  23.   {"INCLUDE", 
  24.    "GRAPHICS.E", "SORT.E", "GET.E", "MOUSE.E", "FILE.E", "MACHINE.E",
  25.    "WILDCARD.E", "IMAGE.E", "SAFE.E", "DLL.E", "MISC.E", "MSGBOX.E"},
  26.  
  27.   {"BIN", 
  28.    "BIN.DOC", "SYNCOLOR.E", "LINES.BAT", "LINES.EX", "EPRINT.EX", "GURU.BAT",
  29.    "GURU.EX", "EPRINT.BAT", "ED.BAT", "ED.EX", "KEYWORDS.E", "CDGURU.BAT", 
  30.    "SEARCH.EX", "SEARCH.BAT", "EXW.EXE", "ASCII.EX", "ASCII.BAT", 
  31.    "WHERE.EX", "WHERE.BAT", "KEY.BAT", "KEY.EX"},
  32.   
  33.   {"DEMO",
  34.    "DEMO.DOC", "ANIMAL.EX", "ALLSORTS.EX", "SANITY.EX", "QUEENS.EX", 
  35.    "BUZZ.EX", "MYDATA.EX", "CSORT.EX", "TREE.EX", "HASH.EX"},
  36.   
  37.   {"DEMO\\DOS32",
  38.    "DOS32.DOC", "BITMAP.EX", "PLOT3D.EX", "SB.EX", "SELECT.E", "TTT.EX", 
  39.    "WIRE.EX", "MOUSE.EX", "MSET.EX", "POLYGON.EX", "CALLMACH.EX", "STEREO.EX", 
  40.    "PICTURE", "DOSINT.EX", "HARDINT.EX"},
  41.   
  42.   {"DEMO\\WIN32",
  43.    "WIN32.DOC" , "EMAIL.EXW", "WINDOW.EXW", "WINWIRE.EXW", "DSEARCH.EXW"},
  44.  
  45.   {"DEMO\\LANGWAR", 
  46.    "LW.DOC", "LW.SUM", "WEAPONS.E", "SCREEN.E", "COMMANDS.E", "DAMAGE.E",  
  47.    "DISPLAY.E", "EMOVE.E", "ENEMY.E", "SCHED.E", "VARS.E", "SOUNDEFF.E",  
  48.    "PUTSXY.E", "PICTURES.E", "LW.EX"},   
  49.  
  50.   {"DEMO\\BENCH", 
  51.    "BENCH.DOC", "SHELL.EX", "SHELL.BAS", "DATABASE.EX", "DATABASE.BAS", 
  52.    "SIEVE.EX", "SIEVE.BAS", "SEQUENCE.EX", "SEQUENCE.BAS", "FILESORT.EX",
  53.    "SIEVE1.PRO", "SIEVE2.PRO"},   
  54.   
  55.   {"TUTORIAL",
  56.    "TUTORIAL.DOC", "CALC.EX", "GETC.EX", "GETS.EX", "HELLO.EX", "SEQCALC.EX",
  57.    "CELCIUS.EX", "APPEND.EX", "LEARN.EX", "SIMPLE.EX", "EXAMPLE.EX"},
  58.   
  59.   {"REGISTER",
  60.    "REGISTER.DOC", "HOW2REG.EX"},
  61.   
  62.   {"HTML"
  63.   },  -- docall.bat does the rest
  64.   
  65.   {"DOC"
  66.   }   -- docall.bat does the rest
  67. }
  68.  
  69. -- Some imported routines, so we don't need any include files
  70. -- to be available during the install
  71.  
  72. -- from file.e:
  73.  
  74. constant M_DIR   = 22,
  75.      M_CURRENT_DIR = 23
  76.  
  77. function dir(sequence name)
  78.     return machine_func(M_DIR, name)
  79. end function
  80.  
  81. function current_dir()
  82.     return machine_func(M_CURRENT_DIR, 0)
  83. end function
  84.  
  85. -- from graphics.e:
  86.  
  87. constant M_GRAPHICS_MODE = 5,
  88.      M_SET_T_COLOR = 9,
  89.      M_VIDEO_CONFIG = 13,
  90.      M_GET_POSITION = 25
  91.  
  92. constant VC_COLOR = 1
  93.  
  94. global function graphics_mode(integer m)
  95.    return machine_func(M_GRAPHICS_MODE, m)
  96. end function
  97.  
  98. if graphics_mode(3) then  -- make it a full-screen DOS window
  99. end if
  100.  
  101. function video_config()
  102.     return machine_func(M_VIDEO_CONFIG, 0)
  103. end function
  104.  
  105. global procedure text_color(integer c)
  106.     machine_proc(M_SET_T_COLOR, c)
  107. end procedure
  108.  
  109. function get_position()
  110.     return machine_func(M_GET_POSITION, 0)
  111. end function
  112.  
  113. -- from wildcard.e:
  114.  
  115. constant TO_LOWER = 'a' - 'A' 
  116.  
  117. function upper(object x)
  118.     return x - (x >= 'a' and x <= 'z') * TO_LOWER
  119. end function
  120.  
  121. function exist(sequence path)
  122. -- check if file or directory exists
  123.     return sequence(dir(path))
  124. end function
  125.  
  126. procedure eu_copy(sequence source, sequence dest)
  127. -- copy a file from source to dest using Euphoria getc()/puts()
  128.     integer s, d, c
  129.      
  130.     s = open(source, "rb")
  131.     if s = -1 then
  132.     return
  133.     end if
  134.     d = open(dest, "wb")
  135.     if d = -1 then
  136.     close(s)
  137.     return
  138.     end if
  139.     while 1 do
  140.     c = getc(s)
  141.     if c = -1 then
  142.         exit
  143.     end if
  144.     puts(d, c)
  145.     end while  
  146.     close(s)
  147.     close(d)
  148. end procedure
  149.  
  150. object move_command
  151. move_command = "C:\\DOS\\MOVE.EXE " -- DOS 6
  152. if not exist(move_command) then
  153.     move_command = "C:\\WINDOWS\\COMMAND\\MOVE.EXE " -- DOS 7
  154.     if not exist(move_command) then
  155.     move_command = -1 -- assume no move command
  156.     end if
  157. end if
  158.  
  159. sequence vc
  160. vc = video_config()
  161.  
  162. integer color_monitor
  163. color_monitor = vc[VC_COLOR]
  164.  
  165. procedure the_end(integer status)
  166. -- exit install
  167.     puts(SCREEN, '\n')
  168.     abort(status)
  169. end procedure
  170.  
  171. procedure fore_color(integer c)
  172. -- change foreground color
  173.     if color_monitor then
  174.     text_color(c)
  175.     end if
  176. end procedure
  177.  
  178. procedure move(sequence source, sequence dest)
  179. -- move one file into a directory
  180.     sequence p
  181.     
  182.     -- MOVE (DOS 6,7)
  183.     if sequence(move_command) then
  184.     system(move_command & source & ' ' & dest & " > NUL", NO_CLEAR)
  185.     if exist(dest & "\\" & source) then
  186.         return
  187.     else
  188.         puts(SCREEN, "OK - no MOVE command - use COPY instead...\n")
  189.         move_command = -1 -- doesn't work
  190.     end if
  191.     end if
  192.  
  193.     -- use Euphoria copy routine
  194.     eu_copy(source, dest & "\\" & source)
  195.     if exist(dest & "\\" & source) then
  196.     system("del " & source, NO_CLEAR)
  197.     else
  198.     -- copy failed
  199.     puts(SCREEN, "Unable to copy " & source & 
  200.              " to " & dest & " subdirectory\n")
  201.     if exist(source) and exist("EUPHOR22.ZIP") then
  202.         puts(SCREEN, "Perhaps you can delete euphor22.zip to get extra space\n")
  203.     end if
  204.     end if
  205. end procedure
  206.  
  207. procedure moveall()
  208. -- move all files into the correct subdirectories
  209.     sequence command
  210.  
  211.     puts(SCREEN, "creating Euphoria subdirectories\n")
  212.     for i = 1 to length(file_list) do
  213.     puts(SCREEN, file_list[i][1] & "            \r")
  214.     command = "mkdir " & file_list[i][1]
  215.     system(command, NO_CLEAR) 
  216.     for j = 2 to length(file_list[i]) do
  217.         move(file_list[i][j], file_list[i][1])
  218.     end for
  219.     end for
  220.     puts(SCREEN, "        \r")
  221. end procedure
  222.  
  223. function unbundle()
  224. -- unbundle files stored in 0.dat
  225.     integer bundle, newfile, size
  226.     object line
  227.  
  228.     puts(SCREEN, "unbundling files\n")
  229.  
  230.     bundle = open("0.dat", "rb")
  231.     if bundle = -1 then
  232.     puts(SCREEN, "Couldn't find 0.dat\n")
  233.     return FAILURE
  234.     end if
  235.  
  236.     -- skip first 3 lines
  237.     line = gets(bundle)
  238.     line = gets(bundle)
  239.     line = gets(bundle)
  240.     
  241.     while TRUE do
  242.     line = gets(bundle) -- file name
  243.     if atom(line) then
  244.         exit -- EOF
  245.     end if
  246.     
  247.     line = line[1..length(line)-1]
  248.     
  249.     if length(line) > 12 then
  250.         puts(SCREEN, "0.dat has been corrupted\n")
  251.         return FAILURE
  252.     end if
  253.     
  254.     newfile = open(line, "wb")
  255.     if newfile = -1 then
  256.         puts(SCREEN, "Couldn't open " & line & " for write\n")
  257.         return FAILURE
  258.     end if
  259.     
  260.     printf(SCREEN, "%s\t\t\t\r", {line})
  261.     
  262.     line = gets(bundle)  -- size of file
  263.     if atom(line) then
  264.         puts(SCREEN, "0.dat has been corrupted\n")
  265.         return FAILURE
  266.     end if
  267.     
  268.     -- compute size of file
  269.     size = 0
  270.     for i = 1 to length(line) do
  271.         if line[i] < '0' then
  272.         exit
  273.         end if
  274.         size = size * 10 + line[i] - '0'
  275.     end for
  276.     
  277.     if size < 20 or size > 200000 then
  278.         puts(SCREEN, "0.dat has been corrupted\n")
  279.         return FAILURE
  280.     end if
  281.     
  282.     -- copy to file
  283.     for i = 1 to size do
  284.         puts(newfile, getc(bundle))
  285.     end for
  286.     close(newfile)
  287.     end while
  288.     close(bundle)
  289.     system("DEL 0.DAT", NO_CLEAR)
  290.     return SUCCESS
  291. end function
  292.  
  293. function setupdir()
  294. -- set up subdirectories 
  295.  
  296.     if unbundle() = FAILURE then
  297.     return FAILURE
  298.     end if
  299.     moveall()
  300.     if not exist("BIN\\EXW.EXE") then
  301.     puts(SCREEN, "Subdirectory set up failed - see INSTALL.DOC\n")
  302.     return FAILURE
  303.     end if
  304.     return SUCCESS
  305. end function
  306.  
  307. procedure rename_it()
  308.     puts(SCREEN, 
  309.      "Please remove it or rename it before installing a new version.\n")
  310. end procedure
  311.  
  312. function copy_to_hard_disk(integer drive)
  313. -- copy Euphoria files to EUPHORIA directory 
  314.     sequence eu_dir, rename_dir
  315.     integer rename_letter
  316.  
  317.     eu_dir = drive & ":\\EUPHORIA"
  318.  
  319.     if equal(upper(current_dir()), eu_dir) then
  320.     -- we're in EUPHORIA directory already - just set up subdirectories
  321.     clear_screen()
  322.     return setupdir() 
  323.     end if
  324.  
  325.     if exist(eu_dir) then
  326.     puts(SCREEN,
  327.     "An existing EUPHORIA directory was found on drive " & drive & ".\n")
  328.     if sequence(move_command) then
  329.         rename_letter = 'F'
  330.         while rename_letter <= 'Z' do
  331.         rename_dir = drive & ":\\" & rename_letter & "UPHORIA"
  332.         if not exist(rename_dir) then
  333.             exit
  334.         end if
  335.         rename_letter += 1
  336.         end while
  337.         if rename_letter <= 'Z' then
  338.         system(move_command & eu_dir & ' ' & rename_dir & "> NUL", NO_CLEAR)
  339.         if exist(rename_dir) then
  340.             puts(SCREEN,"It has been renamed as " & rename_dir & "\n\n")
  341.         else
  342.             rename_it()
  343.             return FAILURE
  344.         end if
  345.         else
  346.         rename_it()
  347.         return FAILURE
  348.         end if
  349.     else
  350.         rename_it()
  351.         return FAILURE
  352.     end if
  353.     end if
  354.  
  355.     puts(SCREEN, "The EUPHORIA files will now be copied to " & eu_dir & '\n')
  356.     puts(SCREEN, "    * Press Enter to start copying. [recommended action]\n")
  357.     puts(SCREEN, "    * or type ! to abort.\n")
  358.  
  359.     if find('!', gets(KEYBOARD)) then
  360.     puts(SCREEN, "\ninstallation aborted - try again later\n")
  361.     the_end(1)
  362.     end if
  363.  
  364.     system("mkdir " & eu_dir, NO_CLEAR)
  365.     if not exist(eu_dir) then
  366.     puts(SCREEN, "\n\nCouldn't create " & eu_dir & ".\n")
  367.     puts(SCREEN, "See install.doc\n")
  368.     return FAILURE
  369.     end if
  370.  
  371.     -- copy all files to EUPHORIA directory
  372.     clear_screen()
  373.     puts(SCREEN, "copying files to: ")
  374.     fore_color(13)
  375.     puts(SCREEN, eu_dir & "\n")
  376.     fore_color(7)
  377.     eu_copy("EUPHOR22.ZIP", eu_dir & "\\EUPHOR22.ZIP")
  378.     eu_copy("README.DOC",   eu_dir & "\\README.DOC")
  379.     eu_copy("FILE_ID.DIZ",  eu_dir & "\\FILE_ID.DIZ")
  380.     eu_copy("INSTALL.DOC",  eu_dir & "\\INSTALL.DOC")
  381.     eu_copy("INSTALL.BAT",  eu_dir & "\\INSTALL.BAT")
  382.     eu_copy("0.DAT",        eu_dir & "\\0.DAT")
  383.     eu_copy("INSTALL.EX",   eu_dir & "\\INSTALL.EX")
  384.     eu_copy("EX.EXE",       eu_dir & "\\EX.EXE")
  385.     
  386.     if not exist(eu_dir & "\\EX.EXE") or 
  387.        not exist(eu_dir & "\\INSTALL.EX") then 
  388.     puts(SCREEN, "copy failed - see INSTALL.DOC\n")
  389.     return FAILURE
  390.     end if
  391.  
  392.     -- copy worked, now cd to EUPHORIA
  393.     system(drive & ':', NO_CLEAR)
  394.     system("cd " & eu_dir, NO_CLEAR)
  395.     if not equal(upper(current_dir()), eu_dir) then
  396.     puts(SCREEN, "cd failed - see install.doc\n")
  397.     return FAILURE
  398.     end if
  399.  
  400.     -- cd worked, now set up subdirectories
  401.     return setupdir() 
  402. end function
  403.  
  404. function Yes()
  405. -- return TRUE if answer is "y"
  406.     sequence answer
  407.     
  408.     while TRUE do
  409.     answer = upper(gets(KEYBOARD))
  410.     puts(SCREEN, '\n')
  411.     if find('Y', answer) then
  412.         return TRUE
  413.     elsif find('N', answer) then
  414.         return FALSE
  415.     else
  416.         puts(SCREEN, "Please answer with y or n: ")
  417.     end if
  418.     end while
  419. end function
  420.  
  421. -- Looks like the PATH can be longer than this now - just give a warning
  422. constant MAX_PATH = 127
  423.  
  424. function edit_auto_exec(integer drive)
  425. -- edit the autoexec.bat file
  426. -- add to the PATH, set EUDIR
  427.     integer path_found, q, auto_exec_no, p, white, semi_pos, d, new_path_length
  428.     sequence path, auto_exec, auto_name, base_name, answer, set_line
  429.     object line
  430.  
  431.     path = getenv("PATH")
  432.     if sequence(path) then
  433.     path = upper(path)
  434.     p = match("EUPHORIA\\BIN", path) 
  435.     if p then
  436.         q = p + length("EUPHORIA\\BIN") - 1
  437.         while p > 1 do
  438.         p -= 1
  439.         if path[p]=';' then
  440.             p += 1
  441.             exit
  442.         end if
  443.         end while
  444.         puts(SCREEN, "\nYour current PATH already has " & path[p..q] & '\n')
  445.         d = upper(path[p])
  446.         if find(':', path[p..q]) and d >= 'A' and d <= 'Z' and 
  447.            d != upper(drive) then
  448.         fore_color(4)
  449.         puts(SCREEN, "WARNING: ")
  450.         fore_color(7)
  451.         puts(SCREEN, 
  452.           "You are installing to a different drive than before.\n")
  453.         puts(SCREEN, 
  454.           "You must set up your AUTOEXEC.BAT for the version of Euphoria\n")
  455.         puts(SCREEN, "that you want to use.\n")
  456.         end if
  457.         return NO_EDIT
  458.     end if
  459.     end if
  460.     
  461.     puts(SCREEN, "\n\nEditing AUTOEXEC.BAT...\n")
  462.     set_line = "SET EUDIR=" & drive & ":\\EUPHORIA\n"
  463.     base_name = ":\\AUTOEXEC.BAT"
  464.     auto_name = "C" & base_name  -- try C first
  465.     auto_exec = {}
  466.     path_found = 0
  467.     
  468.     auto_exec_no = open(auto_name, "r")
  469.     while auto_exec_no = -1 do
  470.     puts(SCREEN, "Couldn't open " & auto_name & '\n')
  471.     puts(SCREEN, "On what drive is your AUTOEXEC.BAT file?\n")
  472.     puts(SCREEN, "Type a letter: (! to abort)\n")
  473.     answer = gets(KEYBOARD)
  474.     if find('!', answer) then
  475.         puts(SCREEN, "creating C:\\AUTOEXEC.BAT\n")
  476.         exit
  477.     end if
  478.     auto_name = answer[1] & base_name
  479.     auto_exec_no = open(auto_name, "r")
  480.     end while
  481.     
  482.     new_path_length = 0
  483.     while auto_exec_no != -1 do
  484.     -- read next line from autoexec.bat
  485.     line = gets(auto_exec_no)
  486.     if atom(line) then
  487.         exit
  488.     end if
  489.     p = match("PATH", upper(line))
  490.     if p then
  491.         -- line contains the word "PATH" in upper or lower case
  492.         -- at position p
  493.         white = TRUE
  494.         q = p - 1
  495.         while q >= 1 do
  496.         if not find(line[q], " \t") then
  497.             -- non whitespace - only "SET" is allowed
  498.             if q >= 3 then
  499.             if equal("SET", upper(line[q-2..q])) then
  500.                 q -= 2
  501.             else
  502.                 white = FALSE
  503.                 exit
  504.             end if
  505.             else
  506.             white = FALSE
  507.             exit
  508.             end if
  509.         end if
  510.         q -= 1
  511.         end while
  512.  
  513.         if white and find(line[p+4], " \t=") then
  514.         -- this is a PATH line
  515.         path_found += 1
  516.         if path_found = 1 then
  517.             -- only change the first one encountered
  518.             auto_exec = append(auto_exec, set_line)
  519.             if match(drive & ":\\EUPHORIA\\BIN", upper(line)) then
  520.             -- its already there
  521.             puts(SCREEN, "PATH already has " & drive & 
  522.                      ":\\EUPHORIA\\BIN\n")
  523.             close(auto_exec_no)
  524.             return NO_EDIT
  525.             end if
  526.             semi_pos = find(';', line)
  527.             if semi_pos = 0 then
  528.             semi_pos = length(line)
  529.             line = line[1..length(line)-1] & ";\n"
  530.             end if
  531.             -- add EUPHORIA\BIN to path
  532.             puts(SCREEN, "Changing this line:\n")
  533.             fore_color(2)
  534.             puts(SCREEN, line)
  535.             fore_color(7)
  536.             puts(SCREEN, "to:\n")
  537.             fore_color(2)
  538.             puts(SCREEN, line[1..semi_pos])
  539.             fore_color(4)
  540.             puts(SCREEN, drive & ":\\EUPHORIA\\BIN;")
  541.             fore_color(2)
  542.             puts(SCREEN, line[semi_pos+1..length(line)])
  543.             line = line[1..semi_pos] &
  544.                drive & ":\\EUPHORIA\\BIN;" &
  545.                line[semi_pos+1..length(line)]
  546.             new_path_length = length(line)
  547.             fore_color(7)
  548.             puts(SCREEN, "and inserting the following line:\n")
  549.             fore_color(4)
  550.             puts(SCREEN, set_line)
  551.             fore_color(7)
  552.         end if
  553.         end if
  554.     end if
  555.     auto_exec = append(auto_exec, line)
  556.     end while
  557.  
  558.     if auto_exec_no = -1 or not path_found then
  559.     -- no autoexec.bat file, or no PATH command was found - make one:
  560.     line = "SET PATH=%PATH%;" & drive & ":\\EUPHORIA\\BIN\n"
  561.     puts(SCREEN, "adding the following lines:\n")
  562.     fore_color(4)
  563.     puts(SCREEN, set_line)
  564.     puts(SCREEN, line)
  565.     fore_color(7)
  566.     auto_exec &= {set_line, line}
  567.     path_found = 1
  568.     end if
  569.     
  570.     -- write out the new autoexec.bat
  571.     puts(SCREEN, 
  572.     "Is it OK to make these changes to your AUTOEXEC.BAT file? (y or n) \n")
  573.     puts(SCREEN, "-----> ") 
  574.     if not Yes() then
  575.     return FAILURE
  576.     end if
  577.     if path_found = 2 then
  578.     puts(SCREEN, "One other \"PATH\" line was found but not changed.\n") 
  579.     puts(SCREEN, "Please take a look at it.\n")
  580.     elsif path_found > 2 then
  581.     printf(SCREEN, "%d other \"PATH\" lines were found but not changed.\n",
  582.     path_found - 1)
  583.     puts(SCREEN, "Please take a look at them.\n")
  584.     end if
  585.     if auto_exec_no != -1 then
  586.     close(auto_exec_no)
  587.     end if
  588.     auto_exec_no = open(auto_name, "w")
  589.     if auto_exec_no = -1 then
  590.     puts(SCREEN, "Couldn't write out the new AUTOEXEC.BAT!\n")
  591.     puts(SCREEN, "Your AUTOEXEC.BAT file is read-only.\n")
  592.     return FAILURE
  593.     end if
  594.     for i = 1 to length(auto_exec) do
  595.     puts(auto_exec_no, auto_exec[i])
  596.     end for
  597.     close(auto_exec_no)
  598.     if new_path_length > MAX_PATH then
  599.     -- line may be too long (old MS-DOS restriction)
  600.     fore_color(4)
  601.     puts(SCREEN, "WARNING: ")
  602.     fore_color(7)
  603.     printf(SCREEN, 
  604.      "Your PATH line in AUTOEXEC.BAT is getting quite long (%d characters).\n", 
  605.      new_path_length)
  606.     puts(SCREEN, "You might have to delete a directory from it.\n\n")
  607.     end if
  608.     return SUCCESS
  609. end function
  610.  
  611. procedure install()
  612. -- main routine for Euphoria installation
  613.     integer drive
  614.     integer edit_status
  615.     sequence answer
  616.  
  617.     clear_screen()
  618.     fore_color(13)
  619.     puts(SCREEN, "\nEuphoria")
  620.     fore_color(7)
  621.     puts(SCREEN, " Installation Program\n\n")
  622.  
  623.     if exist("EXW.EXE") then
  624.     puts(SCREEN, "You have already installed Euphoria.\n")
  625.     puts(SCREEN, "If you need to set up AUTOEXEC.BAT see INSTALL.DOC.\n")
  626.     return
  627.     end if
  628.  
  629.     puts(SCREEN, "On which drive do you want to put the EUPHORIA directory?\n")
  630.     puts(SCREEN, "Type the drive letter, or just hit Enter for drive C\n")
  631.     puts(SCREEN, "-----> ")
  632.  
  633.     answer = upper(gets(KEYBOARD))
  634.  
  635.     while answer[1] = ' ' or answer[1] = '\t' do
  636.     answer = answer[2..length(answer)]
  637.     end while
  638.  
  639.     drive = answer[1]
  640.     if drive < 'A' or drive > 'Z' then
  641.     drive = 'C'
  642.     end if
  643.  
  644.     puts(SCREEN, '\n')
  645.  
  646.     if copy_to_hard_disk(drive) = FAILURE then
  647.     the_end(1)
  648.     end if
  649.  
  650.     edit_status = edit_auto_exec(drive)
  651.  
  652.     if edit_status = FAILURE then
  653.     puts(SCREEN, 
  654.       "To complete the install you should edit AUTOEXEC.BAT manually.\n") 
  655.     puts(SCREEN, 
  656.       "See DOC\\INSTALL.DOC - How To Manually Edit AUTOEXEC.BAT\n")
  657.     return
  658.     end if
  659.  
  660.     if edit_status != NO_EDIT then
  661.     puts(SCREEN, "When the install is completed you must\n")
  662.     fore_color(2)
  663.     puts(SCREEN, "shut down and restart (soft-reboot) your computer")
  664.     fore_color(7)
  665.     puts(SCREEN, ".\nThis will set your PATH and EUDIR variables.\n\n")
  666.     end if
  667. end procedure
  668.  
  669. install()
  670. the_end(0)
  671.  
  672.