home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: InfoMgt / InfoMgt.zip / smlclk.zip / INSTALL.CMD < prev    next >
OS/2 REXX Batch file  |  1995-08-04  |  3KB  |  103 lines

  1. /*****************************/
  2. /* REXX command-line install */
  3. /*****************************/
  4. /*         Small Clock       */
  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.  
  18. say ''
  19. say '*********************************************'
  20. say '*    Welcome to the Small Clock Install     *'
  21. say '*********************************************'
  22. say ''
  23. say 'The install will create objects on your desktop using the'
  24. say 'current directory.  If this is not what you want, move the'
  25. say 'program file(s) to their destination directory and re-run'
  26. say 'the install program.'
  27. say ''
  28. call charout,'Press any key to start Install or Q to quit...'
  29. parse upper value SysGetKey('NOECHO') with key
  30. if key='Q' then
  31.   EXIT
  32.  
  33. say ''
  34.  
  35. classname='WPProgram'
  36. title='Small Clock'
  37. location='<WP_DESKTOP>'
  38. setup='EXENAME='||CurDir||'\SML_CLK.EXE;OBJECTID=<SMLCLK_PROG>;'
  39. option='R'
  40. call BldObj
  41.  
  42. say ''
  43. call charout,'Would you like to place Small Clock in your start-up folder also (Y/N)? '
  44. parse upper value SysGetKey('NOECHO') with key
  45. if key ='Y' then
  46.   do
  47.     classname='WPProgram'
  48.     title='Small Clock'
  49.     location='<WP_START>'
  50.     setup='EXENAME='||CurDir||'\SML_CLK.EXE;OBJECTID=<SMLCLK_START>;'
  51.     option='R'
  52.     say ''
  53.     call BldObj
  54.   end
  55.  
  56. if STREAM('VROBJ.DLL','C','QUERY EXISTS') \= '' then
  57. do
  58.   StartupDrive=SysSearchPath('PATH','CONFIG.SYS')
  59.   StartupDrive=FILESPEC("drive",StartupDrive)
  60.   say ''
  61.   say 'VROBJ.DLL must be present in a directory contained in the LIBPATH'
  62.   say 'variable in config.sys.  I recommend '||StartupDrive||'\OS2\DLL'
  63.   call charout,'Would you like to copy VROBJ.DLL to '||StartupDrive||'\OS2\DLL (Y/N)?'
  64.   parse upper value SysGetKey('NOECHO') with key
  65.   say ''
  66.   if key ='Y' then
  67.        'COPY VROBJ.DLL '||StartupDrive||'\OS2\DLL > nul'
  68.   else
  69.        say 'Okay, then remember to place VROBJ.DLL in a directory contained in your LIBPATH!'
  70. end
  71.  
  72. say ''
  73. call charout,'Press any key to exit...'
  74. key=SysGetKey('NOECHO')
  75. EXIT
  76.  
  77. /* Build Object Procedure */
  78. BldObj:
  79. call charout ,'Building: 'title substr(classname,3,)
  80.  
  81. result = SysCreateObject(classname, title, location, setup, option)
  82.  
  83. If result=1 Then call charout ,' ...Created!'
  84. else
  85.   call charout ,' ...Not created! Return code='result
  86. say ' '
  87. Return
  88.  
  89. /*****************************************************************************/
  90.  * Standard REXX program error handler
  91.  *****************************************************************************/
  92. ERROR:
  93.     say ''
  94.     SAY 'An install error has occurred...'
  95.     EXIT
  96.  
  97. FAILURE:
  98.     say ''
  99.     SAY 'An install error has occurred...'
  100.     EXIT
  101.  
  102. /* End */
  103.