home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: SysTools / SysTools.zip / btask10a.zip / install.cmd < prev    next >
OS/2 REXX Batch file  |  1995-12-03  |  4KB  |  142 lines

  1. /************************************************************
  2.  
  3.              The Btask Installation procedure
  4.          (REXX must be installed on your system)
  5.    Version 1.01 (C)1995 EDM Software, ALL RIGHTS RESERVED
  6.  
  7. *************************************************************/
  8.  
  9. '@Echo off'
  10. 'cls'
  11. call RxFuncAdd 'SysLoadFuncs', 'RexxUtil', 'SysLoadFuncs'
  12. call SysLoadFuncs
  13. call banner 'Components Check'
  14. say'Checking for components...'
  15. call check 'BTask.exe'
  16. call check 'Btask.inf'
  17. call check 'Btask.txt'
  18. /*call check 'Warptask.exe'*/
  19. call check 'btaskdll.dll'
  20. say 'All needed components found.'
  21. call banner 'Installation Directory'
  22. say 'Press [Enter] to begin BTask Installation.'
  23. say ''
  24. pull dummy .
  25. say ''
  26. instdir='C:\OS2\APPS\BTask'
  27. dlldir='C:\OS2\APPS\DLL'
  28. exename='BTask.exe'
  29. call banner 'Installation directory'
  30. say 'The default installation directory for BTask is ' instdir
  31. say 'Do you want to change it ? (N)'
  32. parse upper pull dummy
  33. if dummy = 'Y' then do
  34. say 'Enter new installation path :'
  35. parse upper pull instdir
  36. end
  37. call checkdir instdir
  38. say ''
  39. call banner 'DLL Installation'
  40. say ''
  41. say 'IN ORDER TO WORK, BTASK MUST FIND ITS DLL. THE DLL MUST RESIDE'
  42. say 'IN A DIRECTORY SPECIFIED IN THE LIBPATH ENTRY OF YOUR CONFIG.SYS.'
  43. say ''
  44. say 'The default directory for the DLL is C:\OS2\APPS\DLL.'
  45. say 'Do you want tho change it ? (N)'
  46. parse upper pull dummy
  47. if dummy = 'Y' then
  48. do
  49. say 'Enter new DLL path :'
  50. parse upper pull dlldir
  51. end
  52. call checkdir dlldir
  53. call banner 'Installing files...'
  54. say 'Copying program and manual...'
  55. 'copy 'exename' 'instdir
  56. 'copy Btask.inf ' instdir
  57. 'copy Btask.txt ' instdir
  58. say 'Copying DLl...'
  59. 'copy btaskdll.dll ' dlldir
  60. say 'Done.'
  61. call banner 'WPS Migration'
  62. call SysDestroyObject('<BTsk_Folder>')
  63. say "Creating BTask folder..."
  64. title = "BTask"
  65. classname = 'WPFolder'
  66. location = '<WP_DESKTOP>'
  67. setup = 'OBJECTID=<BTsk_Folder>;OPEN=DEFAULT'
  68. call SysCreateObject classname,title,location,setup,f
  69. say 'Creating Objects...'
  70.  
  71. title = "BTask"
  72. classname = 'WPProgram'
  73. location = '<BTsk_Folder>'
  74. setup = 'EXENAME='instdir'\'exename';PARAMETERS=%*;STARTUPDIR='instdir
  75. call SysCreateObject classname,title,location,setup,u
  76.  
  77.  
  78. title = "BTask Manual"
  79. classname = 'WPProgram'
  80. location = '<BTsk_Folder>'
  81. setup = 'EXENAME=?:\OS2\VIEW.EXE;PARAMETERS='instdir'\BTask.inf'
  82. call SysCreateObject classname,title,location,setup,u
  83.  
  84. title = "BTask Manual (ASCII)"
  85. classname = 'WPProgram'
  86. location = '<BTsk_Folder>'
  87. setup = 'EXENAME=?:\OS2\E.EXE;PARAMETERS='instdir'\BTask.txt'
  88. call SysCreateObject classname,title,location,setup,u
  89.  
  90.  
  91. say 'Installation complete.'
  92.  
  93. exit
  94.  
  95. check: procedure
  96.  
  97. rc = stream(ARG(1),'c','query exists')
  98. if rc = '' then
  99. do
  100.   call banner 'ERROR ERROR ERROR ERROR ERROR'
  101.   say 'The component file 'ARG(1)' was not found.'
  102.   say 'You must run this program from the directory where you unpacked the archive.'
  103.   exit
  104. end
  105. return
  106.  
  107. checkdir: procedure
  108. parse upper arg DIR;
  109. curdir=directory()
  110. tstdir=directory(DIR);
  111. if tstdir\=DIR then
  112. do
  113. 'mkdir 'DIR
  114. end
  115. tstdir=directory(DIR);
  116. if tstdir\=DIR then
  117. do
  118.  
  119.  call banner 'ERROR ERROR ERROR ERROR ERROR'
  120.  say 'An invalid path was specified.'
  121.  say tstdir ' -' DIR
  122.  say 'Correct the problem and run the installation program again.'
  123.  tstdir=directory(curdir)
  124.  exit
  125.  
  126. end
  127. tstdir=directory(curdir)
  128. return
  129.  
  130.  
  131. banner: procedure
  132. call SysCls
  133. say'     'ARG(1)
  134. say'     ┌───────────────────────────────────────────────────────────────────┐'
  135. say'     │                The BTask Installation Procedure                   │'
  136. say'     │             BTask is Copyright 1995 by Enrico Demarin             │'
  137. say'     │                       All rights reserved                         │'
  138. say'     └───────────────────────────────────────────────────────────────────┘'
  139. say ''
  140. return
  141.  
  142.