home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: InfoMgt / InfoMgt.zip / noteman.zip / INSTALL.CMD next >
OS/2 REXX Batch file  |  1994-12-28  |  3KB  |  127 lines

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