;********************************************************;
;                                                        ;
;        Video Toaster/Flyer 3.1cd NEW  Installer        ;
;                                                        ;
;                      by Gary Penn                      ;
;                                                        ;
;               ©1995,1996,1997,1998,1999 NewTek, Inc.   ;
;                                                        ;
;  $VER: Video Toaster/Flyer 4.3 NEW CD Installer 4.3    ;
;                        (04-26-99)                      ;
;            Project Director Greg Roadruck              ;                              ;
;********************************************************;

;****************** INITIALIZATION ****************************

(set disk_label "4.3Install")
(set flyer_drive_1 "VT4_3")
(set num_disks 1)

(set string_len "       ")

(set default_drive (if (exists "Work:" (noreq))
                       "Work:"
                       (cat (getdevice "c:") ":")))
(set machine_type (if (= (database "chiprev") "AA")
                      "AGA"
                      "NON-AGA"))

(set FLY_LIB_VERSION "4.04")

(set install_flyer 0)
(set toaster_type 1)

(set not_enough_space (cat "\n\nSorry... Not enough space on drive "
                           "for selected components. Please free up "))

;************************ HELP TEXT ***********************************

(set toast_drive_help (cat "The Toaster 3.1 Installer needs to know where you "
                      "would like to install the software.  In most cases "
                      "you will want to choose the root of any drive that "
                      "has enough room to install the parts of the "
                      "software that you intend to install.  If you choose "
                      "to install to a directory called 'NewTek', you will "
                      "want to make sure that you answer 'NO' on the next "
                      "requester which will ask if you would like to install "
                      "the software inside a NewTek directory.  This option "
                      "is provided for first time installation, when there "
                      "is not usually an existing NewTek directory.  It "
                      "will create a NewTek directory for you inside the "
                      "directory that you have chosen. "))
(set newtek_newtek_help (cat "The Toaster 3.1 Installer has detected that you "
                        "have chosen to install the software in a "
                        "directory called Newtek, and have also chosen to "
                        "have the Installer create a NewTek directory "
                        "(inside the existing NewTek directory) to install "
                        "the software into.  This will result in a Newtek/"
                        "Newtek directory, which is probably not what you "
                        "wanted.  By choosing 'YES' you tell the Installer "
                        "that you did understand what you were doing and "
                        "really did want a NewTek/NewTek directory to be "
                        "created.  If you choose 'NO' then you are telling "
                        "the Installer that you would like it to install to "
                        "the existing NewTek directory without making "
                        "another NewTek directory that would be nested in "
                        "the existing NewTek directory."))





;*************** PROCEDURE DEFINITIONS ********************************


(procedure DO_STARTUP
   (set start_lines (cat start_lines "assign vt35: " newtek_dir " add\n"))



   (startup "Toaster3.1/3.5" (command start_lines)
                    (help user_startup_help)
                    (prompt (cat "\n\nThe following lines must be added to "
                                 "your user-startup file:\n\n" start_lines))
   )
)
(procedure GET_DRIVE
   ((set toast_drive (askdir
                    (prompt (cat "Please Select a drive "
                                 "to install the Video Toaster/Flyer 3.1 "
                                 "software on. "))
                             (default default_drive)
                             (help toast_drive_help)
                             (disk)))
         (if (= ":" (substr toast_drive (- (strlen toast_drive) 1) 1))
                        (set newtek_dir (cat toast_drive "Toaster"))
                        (set newtek_dir (cat toast_drive "/Toaster"))
         )
    (set slash (if (= ":" (substr newtek_dir (- (strlen newtek_dir) 1) 1))
                          ""
                   "/"))
    (if (= "NewTek/NewTek" (substr newtek_dir (- (strlen newtek_dir) 13) 13))
        (set newtek_dir (if (askbool (prompt (cat "Are you sure that you "
                                              "want to install the Flyer 3.1 "
                                              "software to the " newtek_dir
                                              " directory?\n\nIf you choose "
                                              "'NO' then the Flyer 3.1 software "
                                              "will be installed into the "
                                              (substr newtek_dir 0
                                                 (- (strlen newtek_dir) 7)
                                              ) " directory instead."))
                                      (help newtek_newtek_help)
                                      (default 0))
                             newtek_dir
                             (substr newtek_dir 0 (- (strlen newtek_dir) 7))))
    )
        )
)


(procedure GET_START_OPTIONS
   (set start_option2 (askbool (prompt (cat "Would you like the Video Toaster "
                                   "software to "
                                   "be started as soon as the computer "
                                   "is turned on?"))
                           (help start_option2_help)))
)

(procedure REMOVE_ALLICONS
   (if (exists "c:allicons")
      ((textfile (dest "ram:remove.allicons")
             (append (cat "cd " newtek_dir "\n"
                          "c:allicons all delete\n")))
       (run "execute ram:remove.allicons")
       (delete "c:allicons")))
)





;*********************** MAIN PROGRAM **************************************





(welcome)

(if (= machine_type "NON-AGA")
  (if (askbool (prompt (cat "\n\nDo you have a TOASTER 4000 or a "
                          "TOASTER 2000 BOARD installed on your "
                          "Amiga? The TOASTER not the Computer."))

                     (help (cat "You can find out by looking at the"
                                "cover of your box. If you jus got it"
                                "it most likely a Toaster 4000 card."
                                "We are not refering to the make of your"
                                "computer but your toaster."))

                     (choices "Toaster 4000" "Toaster 2000"))

        (set card_type "AGA")
        (set card_type "NON-AGA")
 )
)

(GET_DRIVE)
(run "c:voidall >nil:")

(set @default-dest newtek_dir)

(DO_STARTUP)


(if (= ":" (substr toast_drive (- (strlen toast_drive) 1) 1))
                 (set project_dir (cat toast_drive "Project"))
                 (set project_dir (cat Toast_drive "/Project"))
)


(copyfiles (source (cat flyer_drive_1 ":3.1/systemstuff"))
                 (dest (cat "sys:" ))
                                      (optional "force")
                 (all))

(copyfiles (source (cat flyer_drive_1 ":3.1/rootdir"))
                 (dest (cat toast_drive ))
                                     (optional "force")
                 (all))

(copyfiles (source (cat flyer_drive_1 ":3.1/toasterall"))
                 (dest (cat newtek_dir ))
                                     (optional "force")
                 (all))
(copyfiles (source (cat flyer_drive_1 ":3.1/toaster2k/effects"))
                 (dest (cat newtek_dir "/effects" ))
                                      (optional "force")
                 (all))

(if (= machine_type "AGA")
      (
            (copyfiles (source (cat flyer_drive_1 ":3.1/toaster4k"))
                 (dest (cat newtek_dir ))
                                      (optional "force")
                 (all))
      (copyfiles (source (cat flyer_drive_1 ":3.1/toaster2k/effects"))
                 (dest (cat newtek_dir "/effects" ))
                                      (optional "force")
                 (all))
      (copyfiles (source (cat flyer_drive_1 ":3.1/project4k"))
                 (dest (cat project_dir ))
                                      (optional "force")
                 (all))


   )
     )
(if (= card_type "NON-AGA")
 (if (= machine_type "NON-AGA")
    ((copyfiles (source (cat flyer_drive_1 ":3.1/toaster2k"))
                 (dest (cat newtek_dir ))
                                      (optional "force")
                 (all))
      (copyfiles (source (cat flyer_drive_1 ":3.1/project2k"))
                 (dest (cat project_dir ))
                                      (optional "force")
                 (all))
))
)
(if (= card_type "AGA")
 (if (= machine_type "NON-AGA")

     ((copyfiles (source (cat flyer_drive_1 ":3.1/toaster2ak"))
                 (dest (cat newtek_dir ))
                                      (optional "force")
                 (all))
     (copyfiles (source (cat flyer_drive_1 ":3.1/project2k"))
                 (dest (cat project_dir ))
                                      (optional "force")
                 (all))
))

)
(if (= card_type "NON-AGA")
  (delete (cat frame_dir slash "100.FS.VT4000")))


(if (= card_type "AGA")
  (delete (cat frame_dir slash "100.FS.VTLogo")))





(run (cat "C:hunter " newtek_dir "/currentproject dh1 REPLACE "(substr string_len (strlen (getdevice toast_drive)) 1) (getdevice toast_drive)" QUIET"  ))

(complete 100)
(if (askbool (prompt (cat "\n\nThe ReadMe file has been updated with "
                          "new features and bug fixes since the "
                          "last update.  Please read this file "
                          "before using the new software.  Would "
                          "you like to view the ReadMe file now?"))

                     (help (cat "The ReadMe file has been updated with "
                                "new features and bug fixes since the "
                                "last update.  Please read this file "
                                "before using the new software."))
                     (choices "Read it Now" "Read it Later"))

        (run (cat "run sys:utilities/more " disk_label ":readme43"))
)


(delete ("ram:lz.decomp"))
(delete ("ram:remove.allicons"))
(run "c:assign tempnt: remove")
(run "c:assign tempsys: remove")
(delete ("ram:nttemp"))





(message "Installation is now complete."
         "Please reboot your computer to allow all changes to take effect.")

