; $VER: FinderV3 Installer V1.00 (17.6.97)
;  by Chris Jones
;  ©1997 Dynamic Software
;  All rights reserved

; Pinch this code if you want :)

;First, welcome the user
(welcome "Welcome to the Installation process for FinderV3\n\n"
         "You will be asked to provide a path for Finder's\n"
         "main executable. All other files have pre-dictated\n"
         "locations (e.g. the help file must reside in HELP:")

(message "\nPlease note: FinderV3 is FREEWARE\n")

;setup some variables
(set #binary "FinderV3")
(set #help   "FinderV3.guide")
(set #logo   "FinderLogo.iff")
(set #mui    "ReadMe.mui")
(set #readme "Readme")
(set #source "Source")
(set @default-dest "work:")
(set #dest @default-dest)

(complete 0)

;get from the user where he wants Finder installed
(set #dest (askdir (prompt "Please choose where FinderV3's drawer will be installed") (disk) (help "Please choose a place for the FinderV3 drawer") (default "Work:")))
(set #dest (tackon #dest "FinderV3"))

(complete 25)

;copy the main executable to the new drawer which we make
(if (= (exists #dest (noreq)) 0 )
   (makedir #dest (prompt "Creating directory: " #dest) (infos) (help "This will create FinderV3's drawer") (confirm)))
(if (= (exists #dest (noreq)) 1 )
   (abort "Error: The drawer name you gave already exists as a file"))

(copyfiles (source #binary) (dest #dest) (infos) (prompt "Copying 'FinderV3' to " #dest) (confirm) (help "This will copy the main Finder executable and icon"))

(complete 50)

;copy the logo to the new drawer
(copyfiles (source #logo) (dest #dest) (prompt "Copying logo image (required) to " #dest) (help "This will copy the Finder logo image (required)"))

;copy the MUI readme
(copyfiles (source #mui) (dest #dest) (prompt "Copying MUI readme to " #dest) (help "This copies the MUI readme"))

(complete 75)

;copy the Helpfile to HELP:
(copyfiles (source #help) (dest "HELP:") (infos) (confirm) (prompt "Copying helpfile to HELP:") (help "This will install the on-line helpfile"))

;set the default-dest for the exit messages
(set @default-dest #dest)

;copy the source directory
(makedir (tackon #dest "Source"))
(set #dest (tackon #dest "Source"))
(copyfiles (source #source) (dest #dest) (infos) (confirm) (all) (prompt "Copying C source files") (help "This copies the C source"))

(complete 100)

(message "Thank you for installing FinderV3\n"
         "Please consider taking the time to e-mail the author\n"
         "since you got this fine piece of software for free\n\n"
         "E-Mail: Chris Jones <aces@calweb.com>\n"
         "(My PGP key is in the Readme for this archive)")

;End of Installer
