home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: SysTools / SysTools.zip / hrun103.zip / INSTALL.CMD < prev    next >
OS/2 REXX Batch file  |  1996-11-19  |  4KB  |  143 lines

  1. /* REXX installation script for Slip Dialer */
  2.  
  3. /*call SysLoadFuncs */
  4. call RxFuncAdd 'SysCls', 'RexxUtil', 'SysCls'
  5. call RxFuncAdd 'SysIni', 'RexxUtil', 'SysIni'
  6. call RxFuncAdd 'SysCreateObject', 'RexxUtil', 'SysCreateObject'
  7. call RxFuncAdd 'SysCurPos', 'RexxUtil', 'SysCurPos'
  8. call RxFuncAdd 'SysGetKey', 'RexxUtil', 'SysGetKey'
  9. call RxFuncAdd 'SysTextScreenRead', 'RexxUtil', 'SysTextScreenRead'
  10.  
  11.  
  12. call SysCls
  13. say ""
  14. say "****************************************************************"
  15. say "                      HOMERUN Installation"
  16. say "****************************************************************"
  17. say ""
  18.  
  19. rc = stream('homerun.exe','c','query exists')
  20. if rc='' then
  21. do
  22.   say " Sorry, homerun.exe not found.  Must not be wrong directory.  Terminating."
  23.   exit
  24. end
  25.  
  26. instdir=""
  27.  
  28. curdir = directory()
  29. if curdir='A:\' | curdir='B:\' then
  30. do
  31.    flopdir=directory()
  32.    instdir='C'
  33.    say ' Press enter to Install HOMERUN on drive 'instdir' or enter alternative'
  34.    say ' drive such as D, E etc (type [exit] to cancel) >C'
  35.    pos=SysCurPos(6, 49)
  36.    do forever
  37.       key = SysGetKey('ECHO')
  38.       if key='0D'x then leave
  39.    end
  40.    answer=SysTextScreenRead(6,49,1)
  41.    say " "
  42.    if answer='exit' | answer='EXIT' then exit
  43.    if answer<>'' then
  44.    do
  45.       parse upper var answer answer
  46.       count=length(answer)
  47.       if count<>1 then
  48.       do
  49.          count=count-1
  50.          end=substr(answer,count,1)
  51.          if end=":" then instdir=answer''"\"
  52.          if end="\" then instdir=answer
  53.       end
  54.       if count=1 then instdir=answer''":\"
  55.       check=directory(instdir)
  56.       if check<>instdir then
  57.       do
  58.          say " Cannot find drive "answer
  59.          say " Cancelling installation"
  60.          exit
  61.       end
  62.       if check=instdir then
  63.       do
  64.           instd=instdir''"HOMERUN"
  65.       end
  66.    end
  67.  
  68.    say ""
  69.    say " Homerun installation drive is "instdir
  70.    say ""
  71.    say " Continue with installation? Answer Y or N >Y"
  72.    pos=SysCurPos(10, 44)
  73.    pull answer .
  74.    if answer<>"" & answer<>"Y" & answer<>"yes" then
  75.    do
  76.       say ""
  77.       say " Answer was not Y, installation cancelled"
  78.       enddir=directory(flopdir)
  79.       exit
  80.    end
  81.    check=directory(instd)
  82.    newdir=directory(instdir)
  83.    if check<>instd then 'MD homerun'
  84.    'copy A:\*.* 'instd
  85.    newdir=directory(flopdir)
  86.    newdir=newdir'runtime\'
  87.    newdir'unzip 'newdir'vrobj.zip -d 'instd
  88.    newdir=instd
  89. end
  90.  
  91. if curdir<>'A:\' & curdir<>'B:\' then
  92. do
  93.    instd=curdir
  94.    newdir=instd
  95.    say ""
  96.    say " Homerun installation directory is "instd
  97.    say ""
  98.    say " Continue with installation? Answer Y or N >Y"
  99.    pos=SysCurPos(8, 44)
  100.    pull answer .
  101.    if answer<>"" & answer<>"Y" & answer<>"yes" then
  102.    do
  103.       say ""
  104.       say " Answer was not Y, installation cancelled"
  105.       exit
  106.    end
  107. end
  108.  
  109. call SysIni instd'\schedule.ini', inetlink, PROG, instd
  110.  
  111. filename = stream(instd'\homerun.exe','c','query exists')
  112. if filename \= '' then
  113. do
  114.   title = "Homerun"
  115.   classname = 'WPProgram'
  116.   location = '<WP_DESKTOP>'
  117.   setup = 'EXENAME='filename';STARTUPDIR='newdir
  118.   if existed = '' then setup = setup';PARAMETERS=%*'
  119.   call SysCreateObject classname,title,location,setup,u
  120. end
  121.  
  122. /*call SysCls */
  123.  
  124. say ""
  125. say ""
  126. say "----------------------------------------------------------------"
  127. say " Homerun Scheduler "
  128. say " Written by Geoff Brown - All rights reserved "
  129. say "----------------------------------------------------------------"
  130. say ""
  131. say " Homerun icon successfully created on the desktop..."
  132. say ""
  133. say " Start Homerun by double-clicking on the program object."
  134. say ""
  135. say "****************************************************************"
  136. say " This program is  distributed as Shareware! You MUST register"
  137. say " this product if you  continue  to  use it. Please  see the help"
  138. say " directory for registration details."
  139. say "****************************************************************"
  140. say ""
  141.  
  142. exit
  143.