home *** CD-ROM | disk | FTP | other *** search
/ Monster Media 1994 #1 / monster.zip / monster / OS2 / ARCM20.ZIP / INSTALL.CMD < prev    next >
OS/2 REXX Batch file  |  1994-03-18  |  7KB  |  226 lines

  1. /*
  2. @echo off
  3. cls
  4. echo.
  5. echo.
  6. echo ERROR:
  7. echo REXX support not installed
  8. echo You must have REXX support installed to run this
  9. echo program.
  10. echo.
  11. echo To run this program, run Selective Install from
  12. echo your System Setup folder, and install REXX.
  13. exit
  14. */
  15. /*----------------------------------------------*/
  16. /*-- REXX                                     --*/
  17. /*----------------------------------------------*/
  18. /*-- PROGRAM NAME:                            --*/
  19. /*-- install                                  --*/
  20. /*--                                          --*/
  21. /*-- DESCRIPTION:                             --*/
  22. /*-- Installs Archive Manager                 --*/
  23. /*----------------------------------------------*/
  24. /*-- AUTHOR:                                  --*/
  25. /*-- Kelly Schrock                            --*/
  26. /*----------------------------------------------*/
  27. /*-- DATE:                                    --*/
  28. /*-- 03.17.94                                 --*/
  29. /*----------------------------------------------*/
  30.  
  31. TRACE n
  32. signal on HALT
  33. call LoadLibs
  34.  
  35. /*-- get the command line --*/
  36. parse arg sourcedir destdir
  37.  
  38. /*-- Do the intro thing --*/
  39. call SysCls
  40. say ''
  41. say '                     Archive Manager Installation'
  42. say ''
  43.  
  44. /*-- get dest dir --*/
  45. if destdir = '' then do
  46.   say ''
  47.   say 'Please enter a directory name for Archive Manager'
  48.   say '(Default: C:\ARCMAN):'
  49.   parse pull destdir
  50.   /*-- if error --*/
  51.   if destdir = ' ' then do
  52.     destdir = 'C:\ARCMAN'
  53.   end
  54. end
  55.  
  56. if sourcedir = ' ' then do
  57.   thisdir = directory()
  58.   say ''
  59.   say 'Please enter the directory where the program is being installed'
  60.   say 'from(Default: 'thisdir'):'
  61.   parse pull sourcedir
  62.   /*-- if another error --*/
  63.   if sourcedir = ' ' then do
  64.     sourcedir = thisdir
  65.     say 'using the current directory as the source directory.'
  66. end
  67.  
  68. /*-- make sure path is good --*/
  69. If substr( sourcedir, length(sourcedir), 1 ) \= '\' then
  70.     sourcedir = sourcedir||'\'
  71.  
  72. /*-- do main screen --*/
  73. call SysCls
  74. say
  75. say '                 Archive Manager Installation'
  76. say
  77. say 'Archive Manager will be Installed with the following settings:'
  78. say
  79. say 'Source directory: "'sourcedir'"'
  80. say 'Destination directory: "'destdir'"'
  81. say
  82. say 'Okay to continue(Y/n)?'
  83. k = SysGetKey('NOECHO')
  84. if k = 'N' | k = 'n' then do
  85.   say
  86.   say 'Installation cancelled.'
  87.   exit
  88. end
  89.  
  90. /*-- see if the dest directory exists --*/
  91. Call SysFileTree destdir, file, 'D'
  92.  
  93. if file.0 = '0' then do
  94.   say 'The directory: 'destdir' does not exist on your hardfile. Create it(Y/n)?'
  95.   k = SysGetKey('NOECHO')
  96.   if k = 'N'| k = 'n' then do
  97.     say
  98.     say 'Installation cancelled.'
  99.     exit
  100.   end
  101.   /*-- create the dest. dir --*/
  102.   rc = SysMkDir(destdir)
  103.   if rc = 0 then do
  104.     say 'The directory ' destdir ' was created successfully.'
  105.   end
  106.   else do
  107.     say 'The directory ' destdir ' could not be created successfully; cancelling.'
  108.     exit
  109.   end
  110. end
  111.  
  112. /*-- copy the files --*/
  113. call SysCls
  114. say
  115. say 'Install is copying files, please wait...'
  116. call CopyFile 'ARCMAN.EXE',       sourcedir,    destdir
  117. call CopyFile 'AMDOS.EXE',       sourcedir,    destdir
  118. call CopyFile 'ARCMAN.ICO',       sourcedir,    destdir
  119. call CopyFile 'ARCMAN.INF',       sourcedir,    destdir
  120. call CopyFile 'ARCMAN.HLP',       sourcedir,    destdir
  121. call CopyFile 'README.TXT',     sourcedir,    destdir
  122. call CopyFile 'LICENSE.TXT',   sourcedir,    destdir
  123. call CopyFile 'REGISTER.TXT',   sourcedir,    destdir
  124.  
  125. /*-- create a program object --*/
  126. call SysCls
  127. say
  128. say 'Archive Manager can be installed as an object on your desktop.'
  129. say 'Do you want to create it now(Y/n)?'
  130. k = SysGetKey('NOECHO')
  131. if k = 'N' | k = 'n' then call GoodBye
  132.  
  133. say
  134. say 'Creating the program folder,'
  135. x = SysCreateObject("WPFolder",,
  136.                     "Archive Manager",,
  137.                     "<WP_DESKTOP>",,
  138.                     "OBJECTID=<ARCMAN>;ICONFILE="||destdir||"\ARCMAN.ICO", "replace")
  139. if x = 0 then do
  140.   say 'Unable to create folder; cancelling.'
  141.   exit
  142. end
  143.  
  144. say 'Adding the'
  145. say 'Manual,'
  146. x = SysCreateObject("WPProgram",,
  147.                     "Manual",,
  148.                     "<ARCMAN>",,
  149.                     "EXENAME=VIEW.EXE;PARAMETERS="||destdir||"\ARCMAN.INF")
  150.  
  151. say 'ReadMe file,'
  152. x = SysCreateObject("WPProgram",,
  153.                     "Read Me",,
  154.                     "<ARCMAN>",,
  155.                     "EXENAME=E.EXE;PARAMETERS="||destdir||"\README.TXT")
  156.  
  157. say 'Liscense agreement,'
  158. x = SysCreateObject("WPProgram",,
  159.                     "License Agreement",,
  160.                     "<ARCMAN>",,
  161.                     "EXENAME=E.EXE;PARAMETERS="||destdir||"\LICENSE.TXT")
  162.  
  163. say 'Registration Form,'
  164. x = SysCreateObject("WPProgram",,
  165.                     "Registration Form",,
  166.                     "<ARCMAN>",,
  167.                     "EXENAME=E.EXE;PARAMETERS="||destdir||"\REGISTER.TXT")
  168.  
  169. say 'and the Program file.'
  170. x = SysCreateObject("WPProgram",,
  171.                     "Archive Manager",,
  172.                     "<ARCMAN>",,
  173.     "EXENAME="||destdir||"\ARCMAN.EXE;STARTUPDIR="||destdir";ASSOCFILTER=*.ZIP,*.LZH")
  174.  
  175.  
  176. GoodBye:
  177. /*-- exit with a goodbye --*/
  178. say
  179. say 'Done.'
  180. say
  181. say
  182. say 'Archive Manager has been installed on your system.'
  183. say
  184. say 'Be sure to read the file README.TXT for up-to-date information.'
  185. say
  186. say 'Press any key to exit installation...'
  187. k = SysGetKey('NOECHO')
  188. call SysCls
  189. "@start e.exe "||destdir||"\readme.txt"
  190. exit
  191.  
  192. /*----------------------------------------------*/
  193. /*-- FUNCTION:                                --*/
  194. /*-- LoadLibs                                 --*/
  195. /*-- ACTION:                                  --*/
  196. /*-- loads the libraries needed by this REXX  --*/
  197. /*----------------------------------------------*/
  198. LoadLibs:
  199.   if RxFuncQuery('SysLoadFuncs') THEN
  200.   do
  201.     /*-- load the load-function --*/
  202.     CALL RxFuncAdd 'SysLoadFuncs', 'RexxUtil', 'SysLoadFuncs'
  203.     /*-- load the Sys* utilities --*/
  204.     CALL SysLoadFuncs
  205.   end
  206. return
  207.  
  208. HALT:
  209.   say
  210.   say 'Program cancelled; Interrupted by user.'
  211.   exit
  212.  
  213. /*-----------------------------------------------------------------------------*/
  214. /*-- CopyFile                                                                --*/
  215. /*-----------------------------------------------------------------------------*/
  216. CopyFile: Arg ArgFile2Copy, ArgFloppyDir, ArgInstallDir
  217.  
  218.     Say 'Copying 'ArgFloppyDir||ArgFile2Copy' to 'ArgInstallDir||'\'||ArgFile2Copy'...'
  219.     Command = '@Copy 'ArgFloppyDir||ArgFile2Copy' 'ArgInstallDir||'\'||ArgFile2Copy' >NUL'
  220.     Command
  221.     if rc \= 0 Then Do
  222.         say 'Error! 'ArgFile2Copy' was not installed properly.'
  223.         Pull ConfirmIt
  224.     End
  225.     Return
  226.