; Installer script for HippoPlayer.
;
; 30.11.1996 by K-P Koljonen
;


(complete 0)

(delete "s:hip-script")

(message 
  "\n\nHippoPlayer is shareware.\n\nPlease consider registering!"
  "\n\nSee the doc for more info."
;  (ALL)
)

(complete 3)

(set #DEST0
  (askdir
    (prompt "Where do you want to install HippoPlayer? A drawer will be created there.")
    (help (cat @askdir-help)
    )
    (default "Work:")
  )
)

(complete 6)

(set #DEST (tackon #DEST0 "HippoPlayer"))
(makedir #DEST (infos))

(copyfiles (dest #DEST) (source "HiP"))
(copyfiles (dest #DEST) (source "HiP.info"))
(copyfiles (dest #DEST) (source "Readme!"))
(copyfiles (dest #DEST) (source "Readme!.info"))
(copyfiles (dest #DEST) (source "RegisteredUsers"))
(copyfiles (dest #DEST) (source "RegisteredUsers.info"))

(complete 10)

; ******* Install icon

(run "c:run SYS:Utilities/MultiView Icons/Overview.iff")

(set #ICONS
	(askchoice
	(prompt "Choose an icon for HippoPlayer")
	(help (cat @askchoice-help))
	(default 0)
	(choices
		"#1: 4 colors"
		"#2: 4 colors"
		"#3: MagicWB 8 colors"
		"#4: MagicWB 8 colors"
		"#5: MagicWB 8 colors"
		"#6: MagicWB 8 colors"
		"#7: MagicWB 8 colors"
		"#8: NewIcons"
		)
	)
)

(complete 15)

(if (= #ICONS 1) (copyfiles (source "Icons/HiP2.info") (dest #DEST) (newname "HiP.info") (optional "nofail")) )
(if (= #ICONS 2) (copyfiles (source "Icons/HiP_MWB.info") (dest #DEST) (newname "HiP.info") (optional "nofail")) )
(if (= #ICONS 3) (copyfiles (source "Icons/HiP_MWB2.info") (dest #DEST) (newname "HiP.info") (optional "nofail")) )
(if (= #ICONS 4) (copyfiles (source "Icons/HiP_MWB3.info") (dest #DEST) (newname "HiP.info") (optional "nofail")) )
(if (= #ICONS 5) (copyfiles (source "Icons/HiP_MWB4.info") (dest #DEST) (newname "HiP.info") (optional "nofail")) )
(if (= #ICONS 6) (copyfiles (source "Icons/HiP_MWB5.info") (dest #DEST) (newname "HiP.info") (optional "nofail")) )
(if (= #ICONS 7) (copyfiles (source "Icons/HiP_NI.info") (dest #DEST) (newname "HiP.info") (optional "nofail")) )

; ******* Reqtools.library

(complete 20)

(if (= (exists "Libs:reqtools.library") 0)
  (copylib
    (source "Libs/ReqTools.library")
    (dest "Libs:")
    (confirm)
    (prompt "\n\nInstall reqtools.library?\nOnly do so if you already don't have it installed!")
    (help
      (cat
        "Reqtools.library is needed for requesters in HippoPlayer."
        " Library version for kickstart 1.2/1.3 is included."
        @copylib-help
      )
    )
  )
)

; ******* Group

(complete 30)

(copyfiles
  (source "")
  (dest
    (askdir
      (prompt
        (cat
          "Select destination directory for HippoPlayer.group"
        )
      )
      (help
        (cat
	  "This file contains some play routines for different music"
	  " formats. It is adviced to install it."
          " The place of HippoPlayer.group can also be defined"
          " later in HippoPlayer's preferences.\n\n"
          @askdir-help
        )
      )
      (default "S:")
    )
  )
  (choices
    "HippoPlayer.group"
  )
)

; ******* Player libraries

(complete 32)

(set #LI 0)

(if (=
  (askbool
    (prompt (cat
          "\n\nDo you want to install the player libraries?\n\n"
          "HiP needs some external player libraries to be " 
          "able to play the following music formats:\n"
          "MED, OctaMED, OctaMED SoundStudio, PSID and MusiclineEditor."
        )
    )
    (help
      (cat "HiP needs some external player libraries to be " 
           "able to play some music formats.")
    )
  ) 1)
  (set #LI 1)
)

(complete 35)

(if (= #LI 1)
(copylib
  (source "Libs/medplayer.library")
  (dest "Libs:")
  (confirm)
  (prompt "\nInstall medplayer.library V7?\n\n"
          "Required for playing 1-4 channel MED/OctaMED/OctaMED SoundStudio modules. The version number below is probably wrong!"
  (help (cat "The version number Installer shows is wrong!\n\n" @copylib-help ))
)
))

(complete 37)

(if (= #LI 1)
(copylib
  (source "Libs/octaplayer.library")
  (dest "Libs:")
  (confirm)
  (prompt "\nInstall octaplayer.library V7?\n\n"
          "Required for playing 5-8 channel MED/OctaMED/OctaMED SoundStudio modules. The version number below is probably wrong!"
  (help (cat "The version number Installer shows is wrong!\n\n" @copylib-help ))
)
))

(complete 39)

(if (= #LI 1)
(copylib
  (source "Libs/octamixplayer.library")  
  (dest "Libs:")
  (confirm)
  (prompt "\nInstall octaplayer.library V7?\n\n"
          "Required for playing 1-64 channel OctaMED SoundStudio modules. The version number below is probably wrong!"
  (help (cat "The version number Installer shows is wrong!\n\n" @copylib-help ))
)
))

(complete 41)

(if (= #LI 1)
(copylib
  (source "Libs/PlaySID.library")  
  (dest "Libs:")
  (confirm)
  (prompt "\nInstall PlaySID.library V1.1?\n\n"
          "Required for playing PSID tunes (those from the C-64)."
  (help (cat @copylib-help ))
)
))

(complete 43)

(if (= #LI 1)
(copylib
  (source "Libs/mline.library")  
  (dest "Libs:")
  (confirm)
  (prompt "\nInstall mline.library V1.1?\n\n"
          "Required for playing MusiclineEditor modules."
  (help (cat @copylib-help ))
)
))

; ******* PS3M settings

(complete 45)

(if (exists "S:HippoPlayer.PS3M")
  (if (=
    (askbool
      (prompt (cat
            "\n\n\n\nDo you want to overwrite S:HippoPlayer.PS3M?"
          )
      )
      (help
        (cat "Don't overwrite if you want to keep your PS3M settings." 
	     " Do overwrite if you're updating from v2.12 or older.")
      )
    ) 1)
    (copyfiles
      (source "HippoPlayer.PS3M")
      (dest "S:")
    )
  )
)


(complete 50)


; ******* Select stuff to copy

(set #NUM
	(askoptions 
	(prompt "Which of these do you want to install?")
	(help (cat
		 "Documentation: Docs for HippoPlayer in text or guide format.\n\n" 
		 "ARexx scripts: Various ARexx scripts for HippoPlayer.\n\n"
		 "Icons: Different WB icons for HippoPlayer.\n\n"
                 "Toolmanager brush: A brush for use with ToolManager for example.\n\n"
                 "External scopes: A couple of external scopes which must be started from Shell or WB.\n\n"
                 "Support stuff: Some little tools, including the useful 14-bit calibration program.\n\n"
		 @askoptions-help))
	(default %100001)
	(choices
		"Documentation"
		"ARexx scripts"
		"Icons"
		"Toolmanager brush"
		"External scopes"
		"Support stuff"
		)
	)
)

(complete 60)

; ******* Copy docs

(if (IN #NUM 0)
   (set #DOC
    (askoptions
      (prompt "Select type of documentation")
      (help (cat @askoptions-help))
      (default 1)
      (choices "AmigaGuide" "Text")
      )
   )
)

(if (IN #DOC 0) (copyfiles (source "") (dest #DEST) (pattern "HiP.guide#?")))	
(if (IN #DOC 1) (copyfiles (source "") (dest #DEST) (pattern "HiP.doc#?")))	

; ******* ARexx

(complete 65)
(if (IN #NUM 1)	(makedir (tackon #DEST "ARexx") (infos)))
(if (IN #NUM 1)	(copyfiles (source "ARexx/") (dest (tackon #DEST "ARexx")) (all)))

; ******* Icons

(complete 70)
(if (IN #NUM 2) (makedir (tackon #DEST "Icons") (infos)))
(if (IN #NUM 2)	(copyfiles (source "Icons/") (dest (tackon #DEST "Icons")) (all)))

; ******* Toolmanager brushes

(complete 80)
(if (IN #NUM 3)	(makedir (tackon #DEST "Brushes") (infos)))
(if (IN #NUM 3)	(copyfiles (source "Brushes/") (dest (tackon #DEST "Brushes")) (all)))

; ******* External scopes

(complete 90)
(if (IN #NUM 4)	(makedir (tackon #DEST "Scopes") (infos)))
(if (IN #NUM 4)	(copyfiles (source "Scopes/") (dest (tackon #DEST "Scopes")) (all)))

; ******* Support stuff

(complete 95)
(if (IN #NUM 5)	(makedir (tackon #DEST "Support") (infos)))
(if (IN #NUM 5)	(copyfiles (source "Support/") (dest (tackon #DEST "Support")) (all)))

; ******

(complete 100)
