; AutoPEG.Install
; Install AutoPEG and AutoPEG.exe to HardDisk
; Copyright © 1994 John Corigliano
; $VER: AutoPEG.Install 1.0 (07.27.94)

(set vernum (getversion "dos.library" (resident)))
(set ver (/ vernum 65536))
(set rev (- vernum (* ver 65536)))

(if (< ver 37)
    (abort ("\nYou have WorkBench %ld.%ld\nAutoPEG needs v37+" ver rev))
    (welcome "I will now install AutoPEG an your system")
)

(set @dest-dir "Sys:Utilities")

(set new_name
    (askdir
        (prompt "Where do you want to put AutoPEG?")
        (help @ask_dir-help)
        (default "Sys:Utilities")
    )
)

(set @default-dest new_name)

(copyfiles
    (prompt ("Copying AutoPEG to %s" new_name))
    (help @copyfiles-help)
    (source "AutoPEG")
    (dest new_name)
    (infos)
    (optional "force")
)

(set this_cpu (database "cpu"))

(if (OR (= "68040" this_cpu) (= "68030" this_cpu))
    (copyfiles
        (prompt "Copying AutoPEG.exe ('030) to C:")
        (help @copyfiles-help)
        (files)
        (source "AutoPEG.exe.030")
        (dest "C:")
        (newname "AutoPEG.exe")
    )
    (copyfiles
        (prompt "Copying AutoPEG.exe to C:")
        (help @copyfiles-help)
        (files)
        (source "AutoPEG.exe")
        (dest "C:")
        (optional "force")
    )
)

(set icon_name (cat new_name "/AutoPEG"))

(set quiet_help
"\n\n If you select 'Yes - notify on', a\n \
requester will appear evertime you\n \
start or stop AutoPEG. \n \
 If you select 'No - notify off', \n \
no requesters will appear."
)

(if (askbool
        (prompt "\n\n\n\nDo you want AutoPEG to\nstart in non-QUIET mode?")
        (help quiet_help)
        (choices "Yes - notify on" "No - notify off"))
            (set null 0)
            (tooltype
                (prompt "Setting tooltype")
                (help "Setting AutoPEG tooltype to USEMEM")
                (dest icon_name)
                (settooltype "QUIET=TRUE")
            )
)


(set ram_help
"\n\n If you select 'Yes - use RAM:', \n \
AutoPEG will decompress files to RAM:, \n \
then copy those file to disk. \n \
 If you select 'No - use disk', \n \
AutoPEG will decompress files \n \
directly to disk."
)

(if (askbool
        (prompt "\n\n\n\nDo you want AutoPEG to\nuse RAM:?")
        (help ram_help)
        (choices "Yes - use RAM:" "No - use disk"))
            (tooltype
                (prompt "Setting tooltype")
                (help "Setting AutoPEG tooltype to USEMEM")
                (dest icon_name)
                (settooltype "USEMEM=TRUE")
            )
            (set null 0)
)

