home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format 63 / af063a.adf / psutil.dms / psutil.adf / Misc / HDInstall < prev    next >
Encoding:
AmigaDOS Script File  |  1989-12-07  |  4.2 KB  |  161 lines

  1. .KEY dest,help/s
  2. .BRA {
  3. .KET }
  4.  
  5. ; :ts=3
  6. ; HDInstall - Install PageSetterII onto a hard drive.
  7. ;
  8. ; Inputs:
  9. ;    dest   Directory to install PageSetterII into
  10. ;    help   Print instructions
  11. ;
  12.  
  13. ;
  14. ; Some preliminary setup.
  15. ;
  16. ASSIGN PSInstUtil: PSUtil:    ; Hook we can use when disk has been removed
  17. ASSIGN PSInstOrig: ""         ; Save initial directory
  18.  
  19. ; Make sure he's running WB 1.3!
  20. ; Under 1.3, the "1 gt 2" test fails; we proceed to "FAILAT 10".
  21. ; Under 1.2, however, the IF command itself dies, since GT is not defined;
  22. ; execution is not suspended, and the ECHO and SKIP are seen.
  23. FAILAT 21
  24. IF >NIL: 1 gt 2
  25.         ECHO "*NVersion 1.3 of the Amiga Workbench software *E[;1mmust*E[m be"
  26.         ECHO "present before this installation can proceed.*N"
  27.    SKIP wrapup
  28. ENDIF
  29. FAILAT 10
  30.  
  31. ; Start with a fresh copy, to avoid any screwups
  32. IF EXISTS RAM:PSInstall
  33.    DELETE RAM:PSInstall/#? quiet
  34. ELSE
  35.    MAKEDIR RAM:PSInstall
  36. ENDIF
  37.  
  38.  
  39. C:COPY             C:Copy         RAM:PSInstall
  40. RAM:PSInstall/Copy C:Assign       RAM:PSInstall
  41. RAM:PSInstall/Copy C:Echo         RAM:PSInstall
  42. RAM:PSInstall/Copy C:FailAt       RAM:PSInstall
  43. RAM:PSInstall/Copy C:If           RAM:PSInstall
  44. RAM:PSInstall/Copy C:Else         RAM:PSInstall
  45. RAM:PSInstall/Copy C:Endif        RAM:PSInstall
  46. RAM:PSInstall/Copy C:Makedir      RAM:PSInstall
  47. RAM:PSInstall/Copy C:Execute      RAM:PSInstall
  48. CD ram:PSInstall              ; Search it without adding it to path
  49.  
  50. COPY PSInstUtil:misc/DiskMount    RAM:PSInstall
  51. COPY PSInstUtil:misc/InstUtil     RAM:PSInstall
  52. COPY PSInstUtil:Misc/Install-Proc RAM:PSInstall
  53.  
  54. Assign PSInstPgm:             ; Make sure these start fresh, too.
  55.  
  56. ;
  57. ; Make sure needed system assignments exist.
  58. ;
  59. INSTUTIL isdir T:
  60. IF WARN
  61.    INSTUTIL isdir RAM:T
  62.    IF WARN
  63.       MAKEDIR ram:T
  64.    ENDIF
  65.    ASSIGN T: ram:T
  66. ENDIF
  67.  
  68. INSTUTIL isdir ENV:
  69. IF WARN
  70.    INSTUTIL isdir RAM:ENV
  71.    IF WARN
  72.       MAKEDIR ram:ENV
  73.    ENDIF
  74.    ASSIGN ENV: ram:ENV
  75. ENDIF
  76.  
  77.  
  78. ;
  79. ; HELP processing
  80. ;
  81. IF "{help}" eq "HELP"
  82.    SKIP showme
  83. ENDIF
  84.  
  85. INSTUTIL ask -dy "Do you need instructions [Y/N]? Y"
  86. IF WARN
  87.    SKIP noshow
  88. ENDIF
  89.  
  90. LAB showme
  91. ;   EXECUTE RAM:PSInstall/DiskMount Program PageSetterII: PSInstPgm:
  92.    PSInstUtil:showme PSInstUtil:Misc/HELP-Install
  93. LAB noshow
  94.  
  95.  
  96. ;
  97. ; Make sure that the destination exists, that its name is
  98. ; in a useable form (ie. that it ends with a '/' if it's a directory),
  99. ; and that the user in fact wants to install into it.
  100. ;
  101. IF NOT EXISTS {dest$SYS:}
  102.    ECHO "*N ********** Couldn't find Hard Disk drawer {dest$SYS:} **********"
  103.    SKIP forhelp
  104. ENDIF
  105.  
  106. INSTUTIL isdir {dest$SYS:}
  107. IF WARN
  108.    CD RAM:PSInstall
  109.    ECHO "*N ********** {dest$SYS:} is not a drawer! **********"
  110. LAB forhelp
  111.    ECHO "*N For help, type"
  112.    ECHO "      EXECUTE PSUtil:Misc/HDInstall help"
  113.    ECHO "*N or double-click on the *"Help*" icon in this drawer*N"
  114.    SKIP wrapup
  115. ENDIF
  116. CD RAM:PSInstall
  117.  
  118. ECHO "*N Answering *"No*" to the following question will cancel"
  119. ECHO " the installation.  Your hard drive will not be changed.*N"
  120. INSTUTIL ask -dy "Install PageSetterII onto {dest$SYS:} [Y/N]? Y"
  121. IF warn
  122.    ECHO " Installation aborted!*N"
  123.    SKIP wrapup
  124. ENDIF
  125.  
  126. ECHO >ram:PSInstall/DestPath1 "{dest$SYS:}"
  127. INSTUTIL <ram:PSInstall/DestPath1 >ram:PSInstall/DestPath2 fixdir
  128.  
  129.  
  130. ECHO "*N*N ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*N"
  131. ECHO " Begin installation of PageSetterII onto {dest$SYS:}*N"
  132.  
  133. EXECUTE <ram:PSInstall/DestPath2 >nil: ram:PSInstall/Install-Proc ?
  134.  
  135. ECHO "*N*N --------------------------------------------------------------------"
  136. ECHO "  Please add the following command to the file s:Startup-sequence:"
  137. ECHO "*N    Execute s:PageSetterII-Startup"
  138. ECHO "*N    or"
  139. ECHO "*N    Double Click on the `PS2Assigns' icon"
  140. ECHO "    before you run PageSetterII"
  141.  
  142. ECHO "*N --------------------------------------------------------------------"
  143. ECHO "*N*N Installation of PageSetterII complete."
  144. ECHO "*N Please remove all PageSetterII floppy disks from the drives."
  145. ECHO "*N ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*N"
  146.  
  147. ;
  148. ; Clean up after ourselves
  149. ; Can't depend on anything but PSInstOrig: and PSInstUtil:,
  150. ; since we can come here from right after their definition.
  151. ;
  152. LAB wrapup
  153.  
  154. CD PSInstOrig:
  155. Assign PSInstOrig:
  156. Assign PSInstPgm:
  157. DELETE >NIL: RAM:PSInstall all quiet
  158.  
  159. PSInstUtil:Misc/InstUtil ask "Press RETURN."
  160. Assign PSInstUtil:
  161.