; $VER: sFilter_Install 1.0 (18-Aug-97)
;
; Installation script for sFilter
; Written by Hans-Jörg Frieden
;

(set #cpu (database "cpu"))  ; 68000, 68010, 68020...
(set #fpu (database "fpu"))  ; NOFPU 68881 68882 FPU040
(set #default-version 0)

(if (= #cpu "68020")
    (set #default-version 1)
)
(if (= #cpu "68040")
    (set #default-version 2)
)
(if (= #cpu "68060")
    (set #default-version 3)
)
(if (= #fpu "NOFPU")
    (set #default-version 0)
)

;
; --- English text -------------------------------------------------------
;
(set #welcome-text (cat
        "Welcome to the sFilter Installation program. sFilter is \n"
        "a script-based animation processor especially designed for\n"
        "post-processing raytraced animations. It can be used without one, too.\n"
        "\n\nThis installation procedure will copy the program and related\n"
        "files onto your hard drive. You will be asked a few simple questions\n"
        "concerning the installation."
    )
)
(set #versp (cat
        "There are special versions of sFilter available for different\n"
        "processor/floating point combinations. The installation program\n"
        "has tried to pick a reasonable default. You may change this now\n"
        "or proceed with the copy."
    )
)
(set #destp "Please select the directory where the sFilter drawer will be installed")
(set #destp-help "A drawer will be created")
(set #destd
    (cat
        "Select where the documentation directory should be placed.\n"
        "A good place would obviously be the directory where the main program\n"
        "was installed. A drawer 'Docs' will be created if you choose to install\n"
        "them in the same directory. Otherwise, you'll have to create a directory."
    )
)
(set #desta
    (cat
        "Select a place for the AREXX example scripts. No directory will\n"
        "be created."
    )
)
(set #insta
    (cat
        "sFilter is entirely based on AREXX. There are a few example scripts\n"
        "that come with the program to illustrate what you can do with sFilter.\n"
        "These files are not strictly needed, but it is recommended that\n"
        "you install them anyway.\n\nDo you want to install the sample script files?"
    )
)
(set #instd (cat
        "If you want to build your own custom plugin filters for sFilter,\n"
        "you will need the SDK files from the 'developer' directory. The\n"
        "installation program can copy those to your hard drive if you choose\n"
        "so. You will need a C compiler to use these files. You cannot use these\n"
        "files if you don't know how to program, in this case, better do not install\n"
        "them. \n\n\nDo you want to install the developer files?"
    )
)
(set #instd-help "Just select one of the \"Yes\" or \"No\" buttons.")
(set #devel-dest (cat
        "Select a place for the developer files. No directory will be created,\n"
        "so you have to make one yourself.\n"
    )
)
(set #done
    (cat
        "Thank you for trying sFilter. If you have comments or ideas for\n"
        "improvements, please do not hesitate to contact us. If you have\n"
        "written some plugins yourself which you feel might be interesting\n"
        "for other people then why not contribute them to the project?\n"
        "\nFor email contacts use\n"
        "tfrieden@uni-trier.de (Thomas Frieden)\n"
        "or\nhfrieden@uni-trier.de (Hans-Jörg Frieden)\n"
        "\nOr visit our Web Page at \n"
        "http://www.informatik.uni-trier.de/CIP/hfrieden\n"
        "Thank you, and good night"
    )
)


;
;-------------------------------------------------------------------------------------
(complete 0)
(set #source-path (pathonly @icon))
(message #welcome-text)
(set @default-dest "C4D:")
(set #dest-dir
    (askdir
        (prompt #destp)
        (help (cat #destp-help @askdir-help))
        (default @default-dest)
    )
)
(set @default-dest #dest-dir)
(set #dest-dir (tackon #dest-dir "sFilter"))
(makedir #dest-dir)
(set #vinst
    (askchoice
        (prompt #versp)
        (help @askchoice-help)
        (choices "68000" "68020+FPU" "68040+FPU" "68060+FPU")
        (default #default-version)
    )
)
(set #source-dir
    (tackon #source-path
        (select #vinst "000" "020fpu" "040fpu" "060fpu")
    )
)
(copyfiles
    (source #source-dir)
    (dest #dest-dir)
    (all)
    (help @copyfiles-help)
    (infos)
)
(complete 30)
(if (= @user-level 2)
    (set #docu-dir
        (askdir
            (prompt #destd)
            (help @askdir-help)
            (default #dest-dir)
        )
    )
    (set #docu-dir #dest-dir)
)

(if (= #docu-dir #dest-dir)
    (
        (set #docu-dir (tackon #dest-dir "Docs"))
        (makedir #docu-dir)
    )
)

(copyfiles
    (source
        (tackon #source-path "Docs")
    )
    (dest #docu-dir)
    (all)
    (infos)
    (help @copyfiles-help)
)
(complete 60)

(set #devel-inst
    (askbool
        (prompt #instd)
        (help #instd-help)
        (default 0)
    )
)

(if (= #devel-inst 1)
    (
        (set #devel-dir
            (askdir
                (prompt #devel-dest)
                (help (cat #destp-help @askdir-help))
                (default @default-dest)
            )
        )
        (copyfiles
            (source
                (tackon #source-path "Developer")
            )
            (dest #devel-dir)
            (all)
            (infos)
            (help @copyfiles-help)
        )
    )
)

(set #rexx-inst
    (askbool
        (prompt #insta)
        (help #instd-help)
        (default 0)
    )
)

(if (exists "REXX:" (noreq))
    (set #rexx-default "REXX:")
    (set #rexx-default #source-path)
)

(if (= #rexx-inst 1)
    (
        (set #rexx-dir
            (askdir
                (prompt #desta)
                (help @askdir-help)
                (default #rexx-default)
            )
        )
        (copyfiles
            (source
                (tackon #source-path "Examples")
            )
            (dest #rexx-dir)
            (all)
            (infos)
            (help @copyfiles-help)
        )
    )
)
(complete 100)
(message #done)

