; Installer Script for TypeSmith
; 2/25/92  Soft-Logik Publishing Corporation

; set up an error cleanup routine
(onerror
        (makeassign "TSinstpgm" (safe))
)

;just started
(complete 0)

;cancel the assign in case of installation restart
(makeassign "TSinstpgm" (safe))

; get the dest dir for TypeSmith
(set ts_dest
        (tackon
                (askdir
                        (prompt "In which disk or drawer should TypeSmith be installed? (A drawer named `TypeSmith' will be created there.)")
                        (help @askdir-help)
                        (default @default-dest)
                )
                "TypeSmith"
        )
)

;lock on to volume 'TypeSmith'
(askdisk
        (prompt "Please ensure the TypeSmith disk is in any drive.")
        (help "\n\n\n\nThe TypeSmith program and related files will be copied from the "
              "TypeSmith disk onto your system."
        )
        (dest   "TypeSmith")
        (newname "TSinstpgm")
)

(complete 10)

;We now have a valid destination, so tell Installer where TS will end up
;so the exit page will be correct.
(set @default-dest ts_dest)

;copy program files from source to dest
(if
        (askbool
                (prompt "\n\n\n\n\nDo you want to copy the TypeSmith program?")
                (help "\n\n\n\nClicking 'Copy' will copy the TypeSmith program file to your system. Clicking 'Do Not Copy' will skip to the next step.")
                (choices "Copy" "Do Not Copy")
                (default 1)
        )
        (
                (copyfiles
                        (source "TSinstpgm:TypeSmith")
                        (dest ts_dest)
                        (infos)
                )
        )
)

(complete 40)

;copy ARexx files from source to dest
(if
        (askbool
                (prompt "\n\n\n\n\nDo you wish to copy the TypeSmith ARexx files?")
                (help "\n\n\n\nThe ARexx files are necessary to use TypeSmith's ARexx macro features. ARexx is required to use these features.")
                (choices "Copy" "Do Not Copy")
                (default 1)
        )
        (
                (makedir
                        (tackon ts_dest "Rexx")
                        (infos)
                )
                (copyfiles
                        (source "TSinstpgm:Rexx")
                        (dest (tackon ts_dest "Rexx"))
                        (all)
                )
        )
)

(complete 50)

;copy font files from source to dest
(if
        (askbool
                (prompt "\n\n\n\n\nDo you wish to copy the demo fonts and composition tables?")
                (help "\n\n\n\nThese files are not required, but are recommended for learning TypeSmith.")
                (choices "Copy" "Do Not Copy")
                (default 1)
        )
        (
                (makedir
                        (tackon ts_dest "TSFonts")
                        (infos)
                )
                (copyfiles
                        (source "TSinstpgm:TSFonts")
                        (dest (tackon ts_dest "TSFonts"))
                        (all)
                )
        )
)

(complete 60)

;copy art files from source to dest
(if
        (askbool
                (prompt "\n\n\n\n\nDo you wish to copy the demo IFF ILBM and IFF DR2D files?")
                (help   "\n\n\n\nThese files are not required, but are recommended for learning TypeSmith.")
                (choices "Copy" "Do Not Copy")
                (default 1)
        )
        (
                (makedir
                        (tackon ts_dest "TSArt")
                        (infos)
                )
                (copyfiles
                        (source "TSinstpgm:TSArt")
                        (dest (tackon ts_dest "TSArt"))
                        (all)
                )
        )
)

(complete 70)

;copy Font Downloader from source to dest
(if
        (askbool
                (prompt "\n\n\n\n\nDo you wish to copy the Font Downloader?")
                (help "\n\n\nThe Font Downloader is a separate program used to download PostScript fonts to a PostScript printer before printing from an application..")
                (choices "Copy" "Do Not Copy")
                (default 1)
        )
        (
                (copyfiles
                        (source "TSinstpgm:FontDownloader")
                        (dest ts_dest)
                        (infos)
                )
        )
)

(complete 80)

;copy the iff.library and arp.library to LIBS:
(copylib
        (prompt "TypeSmith requires the iff.library for handling IFF ILBM files.")
        (source "TSInstPgm:libs/iff.library")
        (dest "LIBS:")
        (confirm)
        (help @copylib-help)
)

(complete 85)

;copy the arp.library and arp.library to LIBS: if necessary
(if (< (/ (getversion) 65536) 37)
        (
                (copylib
                        (prompt "You are using Kickstart 1.2 or 1.3.\nTypeSmith requires arp.library for its file requester\npattern matching feature.")
                        (source "libs/arp.library")
                        (dest "LIBS:")
                        (confirm)
                        (help @copylib-help)
                )
        )
)

(complete 90)

;add the assign for TypeSmith: to user-startup
(set tsassign ("Assign TypeSmith: \"%s\"\n" ts_dest))
(startup
                "TypeSmith"
                (prompt "If you would like to start TypeSmith by double clicking on "
                        "its project icons you need to add the following line to your "
                        "user-startup file:\n\n"
                        tsassign
                        "\nWould you like this line to be added now automatically?")
                (help @startup-help)
                (command tsassign)
)

(complete 95)

;un-snapshot the TS drawer icon
(tooltype
        (dest ts_dest)
        (noposition)
)

;done with the install
(complete 100)

;cleanup
(makeassign "TSinstpgm" (safe))

;and get out
(exit)
