home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 8 Other / 08-Other.zip / tmtrk112.zip / install.cmd < prev    next >
OS/2 REXX Batch file  |  1998-05-10  |  2KB  |  85 lines

  1. /* Install.CMD for Time Tracker */
  2. /* Author Trevor Hemsley */
  3.  
  4. Call RxFuncAdd 'SysLoadFuncs', 'RexxUtil', 'SysLoadFuncs'
  5. Call SysLoadFuncs
  6. /* trace i  */
  7. instdir = "C:\TIMETRAK"
  8. workdir = "C:\timetrak"
  9.  
  10. say "Welcome to the Time Tracker install routine."
  11. say "I need to copy some program files to your hard disk."
  12.  
  13. drive_path = "N"
  14. do while drive_path = "N"
  15.   say "Enter the full pathname for installation (default "instdir") ?"
  16.   pull answer .
  17.   if answer = "" then answer = instdir
  18.   rx = SysFileTree(answer,rx.,"D") 
  19.   if rx.0 = 0 then                          
  20.      do
  21.      say "Directory "answer" does not exist. Create it Y/N?"
  22.      parse upper pull answer1
  23.      if answer1 ¬= "Y" then drive_path="N"
  24.        else 
  25.        do
  26.        "@MD "answer
  27.        rx = SysFileTree(answer,rx.,"D")
  28.        if rx.0 ¬= 0 then
  29.           do
  30.           instdir = answer
  31.           workdir = answer
  32.           drive_path = "Y"
  33.           end
  34.        end
  35.      end
  36.   else
  37.      do
  38.       workdir = answer
  39.       instdir = answer
  40.       drive_path = "Y"
  41.      end
  42. end
  43.  
  44. drive_path = "N"
  45. do while drive_path = "N"
  46.   say "Enter the full pathname for your log files to be kept (default "workdir") ?"
  47.   pull answer .
  48.   if answer = "" then answer = workdir
  49.   rx = SysFileTree(answer,rx.,"D") 
  50.   if rx.0 = 0 then                          
  51.      do
  52.      say "Directory "answer" does not exist. Create it Y/N?"
  53.      parse upper pull answer1
  54.      if answer1 ¬= "Y" then drive_path="N"
  55.        else 
  56.        do
  57.        "@MD "answer
  58.        rx = SysFileTree(answer,rx.,"D")
  59.        if rx.0 ¬= 0 then
  60.           do
  61.           workdir = answer
  62.           drive_path = "Y"
  63.           end
  64.        end
  65.      end
  66.   else
  67.      do
  68.       workdir = answer
  69.       drive_path = "Y"
  70.      end
  71. end
  72.  
  73.  
  74. parse upper source os2 command instpath
  75. parse value instpath WITH instpath "\INSTALL.CMD" junk
  76.  
  77. "@copy "instpath"\pmtmtrak.exe "instdir"\pmtmtrak.exe 1>nul"
  78. "@copy "instpath"\tmtkhelp.hlp "instdir"\tmtkhelp.hlp 1>nul"
  79. "@copy "instpath"\*.cmd "instdir"\*.cmd 1>nul"
  80.  
  81. rrc = SysCreateObject("WPProgram", "Time Tracker", "<WP_DESKTOP>", "OBJECTID=<TIMETRACKER>;EXENAME="instdir"\PMTMTRAK.EXE;STARTUPDIR="workdir";PARAMETERS=-q")
  82.  
  83. say "Thank you for installing Time Tracker. If you want to remove it, please "
  84. say "run the UNINST command before deleting the program files."
  85.