.KEY dest
.BRA {
.KET }

;
; Do the Page installation:
;
; Inputs:
;    dest  Where stuff should go.


IF NOT EXISTS {dest}Page
   ECHO "     Creating Directory {dest}Page ..."
   MAKEDIR {dest}Page
   COPY PSInstUtil:Misc/Icons/Drawer.info {dest}Page.info
ENDIF

;
; Install the program itself.
;
ECHO "*N"
INSTUTIL ask -dy "Install the Page program [Y/N]? Y"
IF NOT WARN
   EXECUTE RAM:PSInstall/DiskMount Program Page: PSInstPgm:

   ECHO "*N     Copying Page program ..."
   COPY PSInstPgm:Page {dest}Page/Page
   COPY PSInstPgm:Page.info {dest}Page/Page.info
   INSTUTIL reseticon {dest}Page/Page


;
; these libraries are necessary for Page, make sure that they are there:
; (This is near the copying of Page, to eliminate a disk swap.)
;
   IF NOT EXISTS LIBS:mathtrans.library
      ECHO "*N     Copying mathtrans.library"
      COPY PSInstPgm:libs/mathtrans.library LIBS:
   ENDIF
   IF NOT EXISTS LIBS:diskfont.library
      ECHO "*N     Copying diskfont.library"
      COPY PSInstPgm:libs/diskfont.library LIBS:
   ENDIF

   ;
   ; While we've got this diskette, grab the new paintjet driver in case
   ; he wants it.
   COPY PSInstPgm:devs/printers/HP_PaintJet RAM:PSInstall

;   COPY PSInstUtil:MakeFont {dest}Page
;   COPY PSInstUtil:MakeFont.info {dest}Page
;   INSTUTIL reseticon {dest}Page/MakeFont

;  For `Office Page' copy PostScript prologue file:
;
   IF EXISTS PSInstUtil:Data
      MAKEDIR {dest}Page/Data
      COPY PSInstUtil:Data {dest}Page/Data all quiet
   ENDIF
   COPY PSInstUtil:MakeMetric {dest}Page

ENDIF


;ECHO "*N"
INSTUTIL ask -dy "Copy Tutorial Files to {dest}Page [Y/N]? Y"
IF NOT warn

   IF NOT EXISTS {dest}Page/NewsLetter
      MAKEDIR {dest}Page/NewsLetter
   ENDIF
   COPY PSInstUtil:NewsLetter {dest}Page/NewsLetter ALL QUIET
   COPY PSInstUtil:NewsLetter.info {dest}Page
   INSTUTIL reseticon {dest}Page/NewsLetter

ENDIF	; copy Tutorial files

ECHO "*N"
INSTUTIL ask -dy "Copy new HP PaintJet printer driver to DEVS:printers [Y/N]? Y"
IF NOT warn
   COPY RAM:PSInstall/HP_PaintJet DEVS:printers
ENDIF


ECHO "*N"
INSTUTIL ask -dy "Copy Page Bitmap fonts to FONTS: directory [Y/N]? Y"
IF NOT warn

   FAILAT 21
   ECHO "*N     Copying Bitmap fonts to FONTS:"
   COPY PSInstUtil:fonts FONTS: ALL QUIET
   IF error
      ECHO "*N      Not enough room on the FONTS: directory*N"
   ENDIF
   FAILAT 10

ELSE

   INSTUTIL ask -dy "Copy Page Bitmap fonts to {dest}Page/Fonts [Y/N]? Y"
   IF NOT warn

      ECHO "*N     Copying Bitmap fonts to {dest}Page/Fonts:"
      IF NOT EXISTS {dest}Page/Fonts
	 MAKEDIR {dest}Page/Fonts
      ENDIF
      COPY PSInstUtil:fonts {dest}Page/Fonts ALL QUIET

      ;
      ; Make a couple of IconX files to switch between Page and normal fonts.
      ;
      CD RAM:PSInstall
      ECHO >SelPS.1 "Echo *"Selecting Page fonts: *" NOLINE"
      ECHO >SelPS.2 "Assign FONTS: {dest}Page/Fonts"
      ECHO >Sel.Done "Echo *"Done.*""
      JOIN SelPS.1 SelPS.2 Sel.Done AS {dest}Page/PageFonts
      COPY PSInstUtil:misc/Icons/PageFonts.info {dest}Page/PageFonts.info

      ECHO >SelAm.1 "Echo *"Selecting Amiga fonts: *" NOLINE"
      ECHO >SelAm.2a "Assign FONTS: " NOLINE

      CD FONTS:
      CD >RAM:PSInstall/SelAm.2b
      CD RAM:PSInstall

      JOIN SelAm.1 SelAm.2a SelAm.2b Sel.Done AS {dest}Page/AmigaFonts
      COPY PSInstUtil:misc/Icons/AmigaFonts.info {dest}Page/AmigaFonts.info

   ENDIF

ENDIF	; copy FONTS

ECHO "*N"
INSTUTIL ask -dy "Copy Compugraphic Fonts to {dest}Page/CGFonts [Y/N]? Y"
IF NOT warn
   ; Copy the CGFonts stuff
   ECHO "*N     Copying Compugraphic Fonts ..."
   IF NOT EXISTS {dest}Page/CGFonts
      MAKEDIR {dest}Page/CGFonts
   ENDIF
   COPY PSInstUtil:CGFonts {dest}Page/CGFonts ALL QUIET

   ; Post-processing:
   ; - Move CacheEditII up into the main Page drawer
   RENAME {dest}Page/CGFonts/CacheEditII {dest}Page/CacheEditII
   RENAME {dest}Page/CGFonts/CacheEditII.info {dest}Page/CacheEditII.info
   INSTUTIL reseticon {dest}Page/CacheEditII

ENDIF	; copy CG Fonts

ENDSKIP

;
; The Assign commands for startup-sequence
;
CD RAM:PSInstall
ECHO >AsnPS	   "ASSIGN Page:  {dest}Page"

IF EXISTS {dest}Page/NewsLetter/NewsLetter.Final
   ECHO >AsnPSUtil "ASSIGN PSUtil:        {dest}Page"
ELSE
   COPY NIL: to AsnPSUtil
ENDIF

If EXISTS {dest}Page/CGFonts
   ECHO >AsnCFonts "ASSIGN CGFonts:       {dest}Page/CGFonts"
ELSE
   COPY NIL: to AsnCFonts
ENDIF

IF EXISTS {dest}Page/CGFonts/CGCache
   ECHO >AsnCCache "ASSIGN CGCache:       {dest}Page/CGFonts/CGCache"
ELSE
   COPY NIL: to AsnCCache
ENDIF

JOIN AsnPS AsnPSUtil AsnCFonts AsnCCache as S:Page-Startup
COPY s:Page-Startup {dest}Page/PageAssigns
COPY PSInstUtil:misc/Icons/PageAssigns.info {dest}Page/PageAssigns.info
INSTUTIL reseticon {dest}Page/PageAssigns


