home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 2 BBS / 02-BBS.zip / mpbeta-2.zip / install.cmd < prev    next >
OS/2 REXX Batch file  |  1994-07-12  |  4KB  |  176 lines

  1. /* REXX Install for MaxFile/PM */
  2. '@echo off'
  3. Say "MaxFile/PM Installation Aid."
  4. Say 'Copyright 1994 Craig Morrison, All Rights Reserved.'
  5.  
  6. Parse Upper Arg iDir .
  7. If iDir = ' ' Then Do
  8.     Say
  9.     Say 'What directory do want to install MaxFile/PM in?'
  10.     Pull iDir .
  11.     If iDir = ' ' Then Exit
  12. End
  13.  
  14. Call RxFuncAdd 'SysIni', 'RexxUtil', 'SysIni'
  15.  
  16. iDir = Strip(iDir, 'T', '\')
  17. cDir = Translate(Directory())
  18. If iDir = cDir Then Do
  19.     Say
  20.     Say "Can't install to the current directory!"
  21.     Say 'Please try again.'
  22.     Exit
  23. End
  24.  
  25. Say
  26. Say 'MaxFile/PM will be installed in 'iDir', continue (Y or N)?'
  27. Pull YesNo .
  28.  
  29. If YesNo \= 'Y' Then Do
  30.     Say
  31.     Say 'Installation aborted.'
  32.     Exit
  33. End
  34.  
  35. nDir = Directory(iDir)
  36. nDir = Translate(Directory())
  37. If nDir \= iDir Then 'MD 'iDir
  38. nDir = Directory(iDir)
  39. nDir = Translate(Directory())
  40. if nDir \= iDir Then Do
  41.     Say
  42.     Say 'Error creating install directory 'iDir'!'
  43.     Say 'Installation aborted.'
  44.     Exit
  45. End
  46.  
  47. nDir = Directory(cDir)
  48.  
  49. Say
  50. Say 'Copying program files to 'iDir'.'
  51. Say
  52. Say 'Copying 'cDir'\maxfmpm.exe to 'iDir
  53. Command = 'COPY 'cDir'\maxfmpm.exe 'iDir' > nul'
  54. Command
  55. If rc = 0 Then Do
  56.     Command = 'COPY 'cDir'\maxfmpm.txt 'iDir' > nul'
  57.     Command
  58. End
  59. If rc = 0 Then Do
  60.     Say 'Copying 'cDir'\register.frm to 'iDir
  61.     Command = 'COPY 'cDir'\register.frm 'iDir' > nul'
  62.     Command
  63. End
  64. If rc = 0 Then Do
  65.     Say 'Copying 'cDir'\announce.cmd to 'iDir
  66.     Command = 'COPY 'cDir'\announce.cmd 'iDir' > nul'
  67.     Command
  68. End
  69. If rc = 0 Then Do
  70.     Say 'Copying 'cDir'\tann.cmd to 'iDir
  71.     Command = 'COPY 'cDir'\tann.cmd 'iDir' > nul'
  72.     Command
  73. End
  74. If rc = 0 Then Do
  75.     Say 'Copying 'cDir'\showini.cmd to 'iDir
  76.     Command = 'COPY 'cDir'\showini.cmd 'iDir' > nul'
  77.     Command
  78. End
  79. If rc = 0 Then Do
  80.     Say 'Copying 'cDir'\fixini.cmd to 'iDir
  81.     Command = 'COPY 'cDir'\fixini.cmd 'iDir' > nul'
  82.     Command
  83. End
  84. If rc = 0 Then Do
  85.     Say 'Copying 'cDir'\testrexx.cmd to 'iDir
  86.     Command = 'COPY 'cDir'\testrexx.cmd 'iDir' > nul'
  87.     Command
  88. End
  89. If rc = 0 Then Do
  90.     Say 'Copying 'cDir'\listarea.cmd to 'iDir
  91.     Command = 'COPY 'cDir'\listarea.cmd 'iDir' > nul'
  92.     Command
  93. End
  94. If rc = 0 Then Do
  95.     Say 'Copying 'cDir'\fmtdesc.cmd to 'iDir
  96.     Command = 'COPY 'cDir'\fmtdesc.cmd 'iDir' > nul'
  97.     Command
  98. End
  99. If rc = 0 Then Do
  100.     Say 'Copying 'cDir'\insobj.cmd to 'iDir
  101.     Command = 'COPY 'cDir'\insobj.cmd 'iDir' > nul'
  102.     Command
  103. End
  104. If rc = 0 Then Do
  105.     Say 'Copying 'cDir'\scalar.cmd to 'iDir
  106.     Command = 'COPY 'cDir'\scalar.cmd 'iDir' > nul'
  107.     Command
  108. End
  109. If rc = 0 Then Do
  110.     Say 'Copying 'cDir'\readme.txt to 'iDir
  111.     Command = 'COPY 'cDir'\readme.txt 'iDir' > nul'
  112.     Command
  113. End
  114. If rc = 0 Then Do
  115.     Say 'Copying 'cDir'\probwks.txt to 'iDir
  116.     Command = 'COPY 'cDir'\probwks.txt 'iDir' > nul'
  117.     Command
  118. End
  119. If rc = 0 Then Do
  120.     Say 'Copying 'cDir'\execdos.exe to 'iDir
  121.     Command = 'COPY 'cDir'\execdos.exe 'iDir' > nul'
  122.     Command
  123. End
  124. If rc = 0 Then Do
  125.     Say 'Copying 'cDir'\license.txt to 'iDir
  126.     Command = 'COPY 'cDir'\license.txt 'iDir' > nul'
  127.     Command
  128. End
  129. If rc = 0 Then Do
  130.     Say 'Copying 'cDir'\maxfmpm.inf to 'iDir
  131.     Command = 'COPY 'cDir'\maxfmpm.inf 'iDir' > nul'
  132.     Command
  133. End
  134.  
  135. If rc \= 0 Then Do
  136.     Say
  137.     Say 'Error #'rc' occured while copying files.'
  138.     Say 'MaxFile/PM was not installed correctly.'
  139.     Say 'Installation aborted.'
  140.     Exit
  141. End
  142.  
  143. Say
  144. Say 'Do you want this installation aid to create the WorkPlace Shell'
  145. Say 'objects on your desktop for MaxFile/PM (Y or N)?'
  146. Pull YesNo .
  147. If YesNo = 'Y' Then Do
  148.     nDir = Directory(iDir)
  149.     call insobj
  150.     nDir = Directory(cDir)
  151. End
  152.  
  153. If Stream(iDir'\MAXFMPM.INI', 'c', 'query exists') \= '' Then Do
  154.     Say
  155.     Say 'MAXFMPM.INI detected, do you want to use this file for this'
  156.     Say 'installation of MaxFile/PM (Y or N)?'
  157.     Pull YesNo .
  158.     If YesNo = 'Y' Then Do
  159.         rc = SysIni(iDir'\MAXFMPM.INI', 'MaxFilePM', 'Installed', '1')
  160.         rc = SysIni(iDir'\MAXFMPM.INI', 'MaxFilePM', 'Installed')
  161.         If rc \= '1' Then Do
  162.             Say
  163.             Say 'Error setting installed flag in 'iDir'\MAXFMPM.INI!'
  164.         End
  165.     End
  166. End
  167.  
  168. Say
  169. Say "Installation complete!"
  170. Say
  171. Say 'About to start View to show the MaxFile/PM Online Reference.'
  172. Say 'Press ENTER to continue...'
  173. Pull .
  174.  
  175. 'view 'iDir'\maxfmpm OverView'
  176.