home *** CD-ROM | disk | FTP | other *** search
/ The Pier Shareware 6 / The_Pier_Shareware_Number_6_(The_Pier_Exchange)_(1995).iso / 035 / mpm1_22a.zip / install.cmd < prev    next >
OS/2 REXX Batch file  |  1994-10-17  |  4KB  |  171 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'\testrexx.cmd to 'iDir
  81.     Command = 'COPY 'cDir'\testrexx.cmd 'iDir' > nul'
  82.     Command
  83. End
  84. If rc = 0 Then Do
  85.     Say 'Copying 'cDir'\listarea.cmd to 'iDir
  86.     Command = 'COPY 'cDir'\listarea.cmd 'iDir' > nul'
  87.     Command
  88. End
  89. If rc = 0 Then Do
  90.     Say 'Copying 'cDir'\fmtdesc.cmd to 'iDir
  91.     Command = 'COPY 'cDir'\fmtdesc.cmd 'iDir' > nul'
  92.     Command
  93. End
  94. If rc = 0 Then Do
  95.     Say 'Copying 'cDir'\insobj.cmd to 'iDir
  96.     Command = 'COPY 'cDir'\insobj.cmd 'iDir' > nul'
  97.     Command
  98. End
  99. If rc = 0 Then Do
  100.     Say 'Copying 'cDir'\scalar.cmd to 'iDir
  101.     Command = 'COPY 'cDir'\scalar.cmd 'iDir' > nul'
  102.     Command
  103. End
  104. If rc = 0 Then Do
  105.     Say 'Copying 'cDir'\readme.txt to 'iDir
  106.     Command = 'COPY 'cDir'\readme.txt 'iDir' > nul'
  107.     Command
  108. End
  109. If rc = 0 Then Do
  110.     Say 'Copying 'cDir'\probwks.txt to 'iDir
  111.     Command = 'COPY 'cDir'\probwks.txt 'iDir' > nul'
  112.     Command
  113. End
  114. If rc = 0 Then Do
  115.     Say 'Copying 'cDir'\execdos.exe to 'iDir
  116.     Command = 'COPY 'cDir'\execdos.exe 'iDir' > nul'
  117.     Command
  118. End
  119. If rc = 0 Then Do
  120.     Say 'Copying 'cDir'\license.txt to 'iDir
  121.     Command = 'COPY 'cDir'\license.txt 'iDir' > nul'
  122.     Command
  123. End
  124. If rc = 0 Then Do
  125.     Say 'Copying 'cDir'\maxfmpm.inf to 'iDir
  126.     Command = 'COPY 'cDir'\maxfmpm.inf 'iDir' > nul'
  127.     Command
  128. End
  129.  
  130. If rc \= 0 Then Do
  131.     Say
  132.     Say 'Error #'rc' occured while copying files.'
  133.     Say 'MaxFile/PM was not installed correctly.'
  134.     Say 'Installation aborted.'
  135.     Exit
  136. End
  137.  
  138. Say
  139. Say 'Do you want this installation aid to create the WorkPlace Shell'
  140. Say 'objects on your desktop for MaxFile/PM (Y or N)?'
  141. Pull YesNo .
  142. If YesNo = 'Y' Then Do
  143.     nDir = Directory(iDir)
  144.     call insobj
  145.     nDir = Directory(cDir)
  146. End
  147.  
  148. If Stream(iDir'\MAXFMPM.INI', 'c', 'query exists') \= '' Then Do
  149.     Say
  150.     Say 'MAXFMPM.INI detected, do you want to use this file for this'
  151.     Say 'installation of MaxFile/PM (Y or N)?'
  152.     Pull YesNo .
  153.     If YesNo = 'Y' Then Do
  154.         rc = SysIni(iDir'\MAXFMPM.INI', 'MaxFilePM', 'Installed', '1')
  155.         rc = SysIni(iDir'\MAXFMPM.INI', 'MaxFilePM', 'Installed')
  156.         If rc \= '1' Then Do
  157.             Say
  158.             Say 'Error setting installed flag in 'iDir'\MAXFMPM.INI!'
  159.         End
  160.     End
  161. End
  162.  
  163. Say
  164. Say "Installation complete!"
  165. Say
  166. Say 'About to start View to show the MaxFile/PM Online Reference.'
  167. Say 'Press ENTER to continue...'
  168. Pull .
  169.  
  170. 'view 'iDir'\maxfmpm OverView'
  171.