;
;  PPT Installer script
;
;  $Revision: 1.2 $
;      $Date: 1996/11/24 20:52:47 $
;

(message "\n"
         "IMPORTANT!\n"
         "\n"
         "This is a pre-release version of PPT and\n"
         "\n"
         "NOT TO BE DISTRIBUTED\n"
         "\n"
         "without the written permission of the author"
         )

(welcome "This is the PPT Installation utility."
         "Thank you for choosing to test it.")

;
;  Set defaults
;

(set ##installdir "Work:")

; Processor

(set ##use020 (not (patmatch "68000|68010" (database "cpu"))))

; If user-level is expert, ask which versions to install.

;(if (= @user-level 2)
;    (set ##use020
;         (askbool
;          (prompt "\n"
;                  "Do you wish to use the 68020+ optimized\n"
;                  "versions of the BGUI library and PPT?")
;          (help @askbool-help)
;          (default ##use020)
;          )
;         )
;  )

(debug "Use020 : " ##use020)

;
;  Ask the directory to be installed in
;

(set ##installdir
    (askdir
        (prompt "Choose the directory you wish to install\n"
                "PPT in.  A directory called 'PPT' will be\n"
                "created for you in this directory"
        )
        (help   @askdir-help)
        (default ##installdir)
    )
)

(debug "You chose" ##installdir)

;
;   Tack on the dir name
;

(set @default-dest (tackon ##installdir "PPT"))
(debug "You chose" @default-dest)

;
;   Copy files.
;

(copyfiles
    (prompt "Copying PPT executables & modules")
    (source "")
    (dest @default-dest)
    (pattern "~(libs)")
    (help   @copyfiles-help)
)

(copyfiles
    (prompt "Installing icons")
    (source "/PPT.info")
    (dest   (tackon @default-dest "/"))
    (help   @copyfiles-help)
    (infos)
)

;
;   Install libraries
;

(message "\nNow make sure you have BGUI 41.7 installed")

;(copylib
;    (prompt "Copying BGUI library")
;    (confirm)
;    (source (if (= ##cpu020 1) ("libs/bgui.library_e") ("libs/bgui.library")))
;    (dest   "libs:")
;    (newname "bgui.library")
;    (help   @copylib-help)
;)

;(copylib
;    (prompt "Copying BGUI support gadgets")
;    (confirm)
;    (source "libs/bgui_palette.gadget")
;    (dest   "SYS:Classes/Gadgets")
;    (help   @copylib-help)
;)

;(copylib
;    (prompt "Copying BGUI LOCALES DEUTSCH")
;    (confirm)
;    (source "locales/Deutsch/BGUI.catalog")
;    (dest   "SYS:Locale/catalogs/deutsch")
;    (help   @copylib-help)
;)
;
;   Make assigns
;

(set ##jpegdir
    (askdir
        (prompt "You must now choose a place for any "
                "temporary JPEG files to be put in. "
                "(See Help for more info)"
        )
        (help   "The JPEG loader needs a JPEGTMP: assign "
                "in order to handle really large progressive "
                "or multi-scan files.  If you already happen "
                "to have this assign, just say 'Skip This Phase'. "
                "If not, then you should pick up a hard drive "
                "directory with plenty of space."
        )
        (default ##installdir)
    )
)

(makeassign "JPEGTMP" ##jpegdir)

(set ##jpegassign ("Assign >NIL: JPEGTMP: %s" ##jpegdir))

(startup "PPT JPEG loader"
    (prompt ( "\nI shall now add the following line\nto your S:User-Startup:\n\n%s"
               ##jpegassign)
            )
    (command ##jpegassign )
    (help @startup-help)
)

;
;   The END.
;
