home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: Educate / Educate.zip / plnet212.zip / INSTALL.CMD next >
OS/2 REXX Batch file  |  1995-04-03  |  4KB  |  137 lines

  1. /*****************************/
  2. /* REXX command-line install */
  3. /*****************************/
  4. /*        Planets            */
  5. /*****************************/
  6.  
  7. '@echo off'
  8. 'cls'
  9.  
  10. SIGNAL ON FAILURE
  11. SIGNAL ON ERROR
  12.  
  13. CALL RxFuncAdd "SysLoadFuncs","REXXUTIL","SysLoadFuncs"
  14. CALL SysLoadFuncs
  15.  
  16. CurDir=DIRECTORY()
  17. ViewPath=SysSearchPath('PATH','VIEW.EXE')
  18. if ViewPath='' then
  19.   do
  20.      say ''
  21.      say 'Error!  VIEW.EXE not found!  INF Files will use C:\OS2\VIEW.EXE...'
  22.      ViewPath='C:\OS2\VIEW.EXE'
  23.   end
  24. EPath=SysSearchPath('PATH','E.EXE')
  25. if EPath='' then
  26.   do
  27.      say ''
  28.      say 'Error!  E.EXE not found!  Text Files will use C:\OS2\E.EXE...'
  29.      ViewPath='C:\OS2\E.EXE'
  30.   end
  31.  
  32. say ''
  33. say '*********************************************'
  34. say '*      Welcome to the Planets Install       *'
  35. say '*********************************************'
  36. say ''
  37. say 'The install will create objects on your desktop using the'
  38. say 'current directory.  If this is not what you want, move the'
  39. say 'program file(s) to their destination directory and re-run'
  40. say 'the install program.'
  41. say ''
  42. call charout,'Press any key to start Install or Q to quit...'
  43. parse upper value SysGetKey('NOECHO') with key
  44. if key='Q' then
  45.   EXIT
  46.  
  47. say ''
  48.  
  49. classname='WPFolder'
  50. title='Planets'
  51. location='<WP_DESKTOP>'
  52. setup='CCVIEW=NO;ICONFILE='||CurDir||'\PLNTFOLD.ICO;OBJECTID=<PLANETS_FOLDER>;'
  53. option='R'
  54. call BldObj
  55.  
  56. classname='WPProgram'
  57. title='Planets'
  58. location='<PLANETS_FOLDER>'
  59. setup='EXENAME='||CurDir||'\PLANETS.EXE;STARTUPDIR='||CurDir||';OBJECTID=<PLANETS_PROG>;'
  60. option='R'
  61. call BldObj
  62.  
  63. classname='WPProgram'
  64. title='Planets'||'0A'x||'Information'
  65. location='<PLANETS_FOLDER>'
  66. setup='EXENAME='||ViewPath||';ICONFILE='||CurDir||'\PLNTINF.ICO;PARAMETERS=PLANETS.INF;STARTUPDIR='||CurDir||';OBJECTID=<PLANETS_INFO>;'
  67. option='R'
  68. call BldObj
  69.  
  70. classname='WPProgram'
  71. title='Order Form'
  72. location='<PLANETS_FOLDER>'
  73. setup='EXENAME='||EPath||';PARAMETERS='||CurDir||'\ORDER.FRM;STARTUPDIR='||CurDir||';OBJECTID=<PLANETS_ORDERFRM>;'
  74. option='R'
  75. call BldObj
  76.  
  77. say ''
  78. call charout,'Would you like to place Planets in your start-up folder also (Y/N)? '
  79. parse upper value SysGetKey('NOECHO') with key
  80. if key ='Y' then
  81.   do
  82.     classname='WPProgram'
  83.     title='Planets'
  84.     location='<WP_START>'
  85.     setup='EXENAME='||CurDir||'\PLANETS.EXE;STARTUPDIR='||CurDir||';OBJECTID=<PLANETS_START>;'
  86.     option='R'
  87.     say ''
  88.     call BldObj
  89.   end
  90.  
  91. StartupDrive=SysSearchPath('PATH','CONFIG.SYS')
  92. StartupDrive=FILESPEC("drive",StartupDrive)
  93. if STREAM('VPREXX.DLL','C','QUERY EXISTS') \= '' then
  94. do
  95.   say ''
  96.   say 'VPREXX.DLL must be present in a directory contained in the LIBPATH'
  97.   say 'variable in config.sys.  I recommend '||StartupDrive||'\OS2\DLL'
  98.   call charout,'Would you like to copy VPREXX.DLL to '||StartupDrive||'\OS2\DLL (Y/N)?'
  99.   parse upper value SysGetKey('NOECHO') with key
  100.   say ''
  101.   if key ='Y' then
  102.        'COPY VPREXX.DLL '||StartupDrive||'\OS2\DLL > nul'
  103.   else
  104.        say 'Okay, then remember to place VPREXX.DLL in a directory contained in your LIBPATH!'
  105. end
  106.  
  107. say ''
  108. call charout,'Press any key to exit...'
  109. key=SysGetKey('NOECHO')
  110. EXIT
  111.  
  112. /* Build Object Procedure */
  113. BldObj:
  114. call charout ,'Building: 'title substr(classname,3,)
  115.  
  116. result = SysCreateObject(classname, title, location, setup, option)
  117.  
  118. If result=1 Then call charout ,' ...Created!'
  119. else
  120.   call charout ,' ...Not created! Return code='result
  121. say ' '
  122. Return
  123.  
  124. /*****************************************************************************/
  125.  * Standard REXX program error handler
  126.  *****************************************************************************/
  127. ERROR:
  128.     say ''
  129.     SAY 'An install error has occurred...'
  130.     EXIT
  131.  
  132. FAILURE:
  133.     say ''
  134.     SAY 'An install error has occurred...'
  135.     EXIT
  136.  
  137.