;Seka Installation

(complete 0)


; The amount of space needed on the hard disk to install
(set HDSizeNeeded 0.55)


; Start string definitions
(set #ProgName
(cat "SekaTrial"
))

(set #CopySekaGFX
(cat "\nDo you want to copy the Seka32 Graphics?\n"
))

(set #LongProgName
    (cat #ProgName " Seka32 Profession"
))

(set #Welcome-Pirate
(cat "\nWelcome to the Seka32 Professional Installer\n\n"
    "Seka32 by Mark Dennison\n"
;   "of Scissorsoft\n\n"
    "PD Demo Version\n\n"
;   "\n\nPlease ensure you have 800Kb of Spare HD Space"
    "To register, send £8 to:\n\n"
    "Seka Registration, \n"
    "Scissorsoft, \n"
    "7 Knab Road, \n"
    "Ecclesall, \n"
    "Sheffield, \n"
    "S7 2ET. \n"


    
))

(set #InsertDiskMsg
(cat "\nPlease insert the disk labelled\n\n"
))

(set #InsertAmigaDiskMsg
(cat "\nPlease insert the Amiga Workbench disk labelled\n\n"
))

(set #diskhelp
    (cat "\n    If you know that the correct disk is in the drive, but you still cannot proceed, "
        "then the name of the disk is incorrect.\n"
        "    Ensure that the disk name is not preceded by 'copy_of_', or blank spaces before or after the disk name.\n\n\n" @askdisk-help
    )
)

(set #WwDiskName
(cat "SekaTrial"
))

(set #AgfaFontsDiskName
(cat "Agfa-Fonts"
))

(set #WwSpellDiskName
(cat "WwSpell"
))

(set #WwSystemDiskName
(cat "WwSystem"
))

(set #WwSystemMiscFiles
(cat #WwSystemDiskName ":MiscFiles"
))

(set #WwUtilities
(cat #WwDiskName ":Utilities"
))

(set #WwMiscFiles
(cat #WwDiskName ":MiscFiles"
))

(set #InstallIconName
(cat #WwDiskName "SekaTrial:Install"
))

(set #BadKick
(cat #LongProgName " requires Workbench 3 or above to work correctly."
))

(set #DestChoicePrompt
(cat "\n\n\nWhere would you like to install " #ProgName "?"
))

(set #RAMChoiceMsg
(cat "On the RAM disk"
))

(set #HardDiskChoiceMsg
(cat "On a hard disk"
))

(set #DestChoiceHelp
(cat "\n    Select the radio button \"On a hard disk\" to "
    "install " #ProgName " onto your hard disk.\n\n"
    "    Select the radio button \"On floppy disks\" to "
    "install " #ProgName " onto a set of backup disks.\n\n\n"
))

(set #RAMBackupsMsg
(cat "\n\nIMPORTANT:  Do not use your original " #ProgName
    " disks for this installation. Make backup copies of your original " #ProgName
    " disks before proceeding."
))

;(set #FloppyFontDest
;(cat #WwDiskName ":Fonts"
;))
;
;(set #FloppyDriverDest
;(cat #WwDiskName ":Devs/Printers"
;))
;
;(set #FloppyDriverSource
;(cat #WwDiskName ":Devs/Printers"
;))
;
(set #FloppyWorkingMsg
(cat "Please wait... Your disks are being installed."
))
;
;(set #FloppySpellLoc
;(cat #WwSpellDiskName ":Spell"
;))
;
;(set #FloppyPrefsDest
;(cat #WwDiskName ":WordworthPrefs"
;))


(set #HardDiskDefaultDest
(cat "DH1:"
))

;(set #FontSource
;(cat #WwDiskName ":Fonts"
;))

(set #LibSource
(cat #WwDiskName ":Libs"
))

;(set #DocSource
;(cat #WwDiskName ":Docs"
;))

;(set #ClipArtSource
;(cat #WwDiskName ":DigitaClipArt"
;))

;(set #AgfaFontSource
;(cat #AgfaFontsDiskName ":Intellifont"
;))

;(set #SpellSource
;(cat #WwSpellDiskName ":Spell"
;))

;(set #AmigaDriverDiskName
;(cat "Storage3.0"
;))

;(set #AmigaDriverSource
;(cat #AmigaDriverDiskName ":printers"
;))

(set #AllWwFiles
(cat "Wordworth#?"              ; Wordworthmenus, messages etc.
))

(set #HelpFileName
(cat "Help"
))

(set #HardDiskFontDest
(cat "SYS:Fonts"
))

;(set #HardDiskDriverDest
;(cat "SYS:Devs/Printers"
;))
;
(set #HardDiskLibDest
(cat "SYS:Libs"
))

(set #HardDiskDestChoiceMsg
(cat "Where do you want to install the\n" #ProgName " program?"
))

(set #HardDiskDestChoiceHelp
(cat "    Select the drawer where you want to install " #ProgName ", then click Proceed (a new drawer titled \"" #ProgName "\" will be created and will contain the " #ProgName " program.)"
))

(set #HardDiskDestChoiceConfirmMsg1
(cat "\nAre you sure you want to install " #ProgName " in the destination:\n\n\""
))

(set #HardDiskDestChoiceConfirmMsg2
(cat "\"\n\n\n\n(A new drawer titled \"Seka\" will be created and this will contain the Seka32 program.)"
))

(set #HardDiskDestChoiceConfirmHelp
(cat "    Click YES to keep the destination drawer.\n\n    Click NO if you want to change the destination drawer."
))

(set #DrawerExistsMsg
(cat "\nA drawer titled \"Seka\" already exists in the destination you have chosen.\n\nDo you wish to replace it or choose a new destination?"
))

(set #DrawerExistsChoice1
(cat "Replace it"
))

(set #DrawerExistsChoice2
(cat "Choose new destination"
))

(set #DrawerExistsHelp
(cat "\n    You have chosen a destination drawer which already has \"Seka\" installed there.\n\n    Click \"" #DrawerExistsChoice1 "\" to replace the contents with this new version of " #ProgName ".\n    Click \"" #DrawerExistsChoice2 "\" to choose a new destination drawer."
))

(set #NoDiskSpaceMsg
(cat "There is insufficient available space on your hard disk to install " #ProgName ". You will need at least " HDSizeNeeded "Kb of free space.\n\nEither Abort this installation and delete some files from your hard disk, or try a different partition on your hard disk."
))

(set #HardDiskWorkingMsg
(cat "Please wait... Installation is proceeding."
))

;(set #HardDiskDocsDrawerName
;(cat "Docs"
;))
;
;(set #HardDiskClipArtDrawerName
;(cat "DigitaClipArt"
;))
; ;(set #HardDiskIntelliDrawerName ;(cat "Intellifont" ;)) ; ;(set
;#HardDiskSpellDrawerName ;(cat "Spell" ;)) ; (set #FloppyFinishedMsg (cat
;"\nWhen the installation is finished, place the \"" #WwDiskName "\" disk in the
;internal disk drive and reset your Amiga." ))



;BEGINNING OF INSTALLATION

;(if (not (exists "RAM:Temp"))
;   (
;       (makedir "RAM:Temp" )
;   )
;)
;
;(makeassign "T" "RAM:Temp")
;
(askdisk
    (prompt #InsertDiskMsg #WwDiskName)
    (help #diskhelp)
    (dest #WwDiskName )
)


;;(if (< (/ (getversion) 65536) 39)
;   ( abort #badkick )
;)
;
;
;(copyfiles
;   (source #WwUtilities )
;   (dest "T:" )
;   (pattern "Display")
;   (nogauge)
;   (optional "nofail")
;)
;
;(copyfiles
;   (source #WwMiscFiles)
;   (dest "T:")
;   (pattern "stu#?.iff")
;   (nogauge)
;   (optional "nofail")
;)
;(if (exists "T:Display")
;;  (run "T:Display T:stu.iff T:stu2.iff opt mt=7")
;)


; INSTALLATION
(message #Welcome-Pirate)

(if
    (askchoice
        (prompt #DestChoicePrompt)
        (choices #HardDiskChoiceMsg
                 #RAMChoiceMsg
        )
        (help #DestChoiceHelp)
        (default 0)
    )

    ;INSTALL ON FLOPPIES
    (

;(set #rm-in
;(cat "\nThis process requires at least 1.5Mb\n\n"
;   "\nof free system RAM"\n
;))
; 
;(message #rm-in)

        (complete 10)
;       (message #RAMBackupsMsg)
(complete 10)
    (copyfiles
            (source "SekaTrial:")
            (dest "RAM:Seka")
            (Pattern "X*")      ; copy the prefs writing prog to ram
            (nogauge)
        )
        (copyfiles
            (source "SekaTrial:Tutorial.SEK")
            (dest "Ram:Seka")
        )

(complete 35)
	(copyfiles
		(source "SekaTrial:Tutorial.SEV")
		(dest "Ram:Seka/Tutorial.SEV")
)
(complete 50)
	(copyfiles
		(source "SekaTrial:Tutorial.SEO")
		(dest "Ram:Seka/Tutorial.SEO")
)

(complete 70)

(makeassign "Seka" "Ram:Seka")

(complete 99)


(exit)
)



    ;INSTALL ON HARD DISK
    (
(set #hd-install
(cat "\nThis process requires at least 600Kb\n"
   "of Hard Drive Space\n"
   "\nIf you have booted from this"
   "\nfloppy disk, you will need to"
   "\nreboot from your hard disk as"
   "\nsome user-assigns need to be"
   "\nadded."
))

(message #hd-install)

        (complete 5)
        (set MyDefault #HardDiskDefaultDest)
        (set OK 0)

        (until (= OK 1)
            (set DestPath
                (askdir
                    (prompt #HardDiskDestChoiceMsg)
                    (help #HardDiskDestChoiceHelp)
                    (default MyDefault)
                )
            )

            (if
                (askbool
                    (prompt #HardDiskDestChoiceConfirmMsg1 DestPath #HardDiskDestChoiceConfirmMsg2)
                    (help #HardDiskDestChoiceConfirmHelp)
                )
                (set OK 1)
            ) ;endif

            (if (= OK 1)
                (if (exists (tackon DestPath "Seka")) ; if there is already a drawer named Seka
                    (
                        (if
                            (askbool
                                (prompt #DrawerExistsMsg)
                                (choices #DrawerExistsChoice1 #DrawerExistsChoice2)
                                (help #DrawerExistsHelp)
                                (default 0)
                            )
                            ( ; [true] Lets replace it
                                (set OK 1)
                            )
                            ( ;else [false]
                                (set OK 0)
                            )
                        )
                    )
                ) ;endif
            )

            (if (= OK 1)
                (
                    ; Multiply MB by 1024 twice to get number of bytes
                    (set SpaceNeeded (* (* HDSizeNeeded 1024) 1024))
                    (if (< (getdiskspace DestPath) SpaceNeeded)
                        (
                            (message #NoDiskSpaceMsg)
                            (set OK 0)
                        )
                    ) ;endif
                )
            ) ;endif
        ) ;end until


        (set WwDrawerDest (tackon DestPath "Seka"))
        (set Sekadata (tackon WWDrawerDest "SekaData"))

        ; Okay to copy files
        (makedir WwDrawerDest)

        (askdisk
            (prompt #InsertDiskMsg #WwDiskName)
            (help #diskhelp)
            (dest #WwDiskName)
        )

        (working
            (prompt #HardDiskWorkingMsg)
        )
(complete 20)
        (copyfiles
            (source "SekaTrial:")
            (dest WwDrawerDest)
            (Pattern "X*")      ; copy the prefs writing prog to ram
            (nogauge)
        )
(complete 30)
        (copyfiles
            (source "SekaTrial:Editor")
            (dest WwDrawerDest)
            (infos)
;           (confirm)
        )
(complete 40)
        (copyfiles
            (source "SekaTrial:Player")
            (dest WwDrawerDest)
            (infos)
;           (confirm)
        )

(complete 50)
        (copyfiles
            (source "SekaTrial:Manual")
            (dest WwDrawerDest)
            (infos)
;           (confirm)
        )
;(set #SekaDiskName
;(cat "SekaData"
;))

;
;    (askdisk
;        (prompt #InsertDiskMsg #SekaDiskName)
;       (help #diskhelp)
;        (dest #SekaDiskName)
;    )


(copyfiles
    (source "SekaTrial:SekaData")
    (dest sekadata)
    (all)
)
(complete 75)
(copyfiles
	(source "SekaTrial:Tutorial.SEK")
	(dest wwdrawerdest)
)
(copyfiles
	(source "SekaTrial:Tutorial.SEV")
	(dest wwdrawerdest)
) 
(copyfiles
	(source "SekaTrial:Tutorial.SEO")
	(dest wwdrawerdest)
)

;


(makeassign "Seka" WwDrawerDest)

(complete 95)


(set #UserStartup 
(cat "Assign Seka: "wwdrawerdest "\nAssign SekaData: " sekadata
))

(startup "Seka32"
    (prompt (cat
            "Two assigns needs to be added to the\n" 
            "User-Startup file so that your system\n"
            "will be properly configured to use\n"
            "Seka32.\n"))
    (command #UserStartup)
    (help @Startup-help)
)
(makedir sekadata)
(Makeassign "SekaData" sekadata)


(complete 100) 
;(message #ImportantFinishedMsg) 
(exit)
))