;;;;
;;;;
;;;; Install_RB - RunBar installation script for Installer
;;;;
;;;; Copyright © 1996 Sergej Kravchenko
;;;;                  All Right reserved.
;;;;                  email dlife@pub.osf.lt
;;;;
;;;;     Installer and Installer project icon
;;;;     (c) Copyright 1991-93 Commodore-Amiga, Inc.  All Rights Reserved.
;;;;     Reproduced and distributed under license from Commodore.
;;;;
;;;;     INSTALLER SOFTWARE IS PROVIDED "AS-IS" AND SUBJECT TO CHANGE;
;;;;     NO WARRANTIES ARE MADE.  ALL USE IS AT YOUR OWN RISK.  NO LIABILITY
;;;;     OR RESPONSIBILITY IS ASSUMED.
;;;;
(complete 0)


(set #welcome           (cat "Welcome to the RunBar 3.1 installation\n\nThis program is shareware\nPlease register\n\n\n\n© 1996 Sergej Kravchenko\nemail: dlife@pub.osf.lt"))
(set #dir-choice        (cat "Select the directory where copy guide and Images." ))
(set #dir-choic         (cat "Select the directory where Guide files will be copyed." ))
(set #dir-ch            (cat "Select WBStartup directory."))
(set #copy              (cat "Copying RunBar "))
(set #copy-guide        (cat "Copying Guide"))
(set #copy-u            (cat "Copying Utils"))
(set #copy-unin         (cat "Copying Images"))
(set #copy-p            (cat "Copying Prefs"))
(set #copy-key          (cat "Copying Library"))
(set #msg  (cat "!!!!!!!!!ATTENTION!!!!!!!!!\n\nWhen program run, no window appears\non screen.To activate window\nmove mouse pointer to bottom of\nworkbench screen or\npress HotKey (default F1).\n\nReboot computer now to run program."))
(set #msg1 (cat "!!!!!!!!!ATTENTION!!!!!!!!!\n\nInfo for all coders and programmers\nyou can find in guide.\n\nPlease READ this!!!!!!!"))
(set #copy-dev          (cat "Copying SDK"))
;=============================================================================
(message #welcome)
(welcome)


;========================================================================
;
; Select the RunBar directory
;
(complete 0)

(if (> (exists ("SYS:WBStartup/RunBar")) 0)
    (delete "SYS:WBStartup/RunBar")
)

(if (> (exists ("SYS:WBStartup/RunBar.info")) 0)
    (delete "SYS:WBStartup/RunBar.info")
)

(procedure towbs
(copyfiles
   (prompt #copy)
   (source "RunBar")
   (help   @copyfiles-help)
   (infos)
   (dest "SYS:WBStartup")
)
(copyfiles
   (prompt #copy)
   (source "CpuControl")
   (help   @copyfiles-help)
   (infos)
   (dest "SYS:WBStartup")
)
(copyfiles
   (prompt #copy)
   (source "FilterControl")
   (help   @copyfiles-help)
   (infos)
   (dest "SYS:WBStartup")
)
)

(procedure toother
(set NTdir
   ( askdir
      ( prompt #dir-ch )
      (help "")
      (default "SYS:WBStartup")
      (newpath)
   )
)
(copyfiles
   (prompt #copy)
   (source "RunBar")
   (help   @copyfiles-help)
   (infos)
   (dest NTdir)
)
(copyfiles
   (prompt #copy)
   (source "CpuControl")
   (help   @copyfiles-help)
   (infos)
   (dest NTdir)
)
(copyfiles
   (prompt #copy)
   (source "FilterControl")
   (help   @copyfiles-help)
   (infos)
   (dest NTdir)
)
)

(complete 10)
(set choice
     (askchoice
      (prompt "Slect one of following:")
      (help "")
      (choices
      "Standard WBStartup" ; 0
      "WBStartup+ or other" ; 1)
      (default 0))))
(select choice
        (towbs)
        (toother))

(complete 20)
(set NTdir
   ( askdir
      ( prompt #dir-choic )
      (help "")
      (default "sys:")
      (newpath)
   )
)
;----------------
(if
   (askbool
      (prompt "Should I create a new directory in\n" @default-dest "?")
      (help "Yes = install RunBar here.\nNo  = install RunBar in here/RunBar")
      (default 0)
   )
   (set NTdir
      (tackon NTdir "RunBar")
   )
)

(set FileThere
   (exists NTdir
      (noreq)
   )
)

(if
   (= FileThere 1)
   (abort NTdir "\nis a file. I can't install RunBar here.")
)

(if
   (= FileThere 0)
   ((makedir NTdir)
   
   (copyfiles
   (prompt #copy-guide)
   (source "Icons/RunBar.info")
   (dest (tackon NTdir "/"))
)   
   )
)


(complete 30)
(copyfiles
   (prompt #copy-guide)
   (source "RunBar.guide")
   (help   @copyfiles-help)
   (infos)
   (dest NTdir)
)

(complete 30)
(copyfiles
   (prompt #copy-unin)
   (source "Images.iff")
   (help   @copyfiles-help)
   (infos)
   (dest NTdir)
)
(makedir (tackon NTdir "Develop"))
(copyfiles
   (prompt #copy-dev)
   (source "Develop/")
   (help   @copyfiles-help)
   (infos)
   (all)
   (dest (tackon NTdir "Develop"))
)
(complete 40)
(copylib
   (prompt "Updating wbstart.library")
   (help "This action will install wbstart.library on your HD.")
   (source "Libs/wbstart.library")
   (dest "Libs:")
   (confirm)
)
(copylib
   (prompt "Updating RunBar.library")
   (help "This action will install RunBar.library on your HD.")
   (source "Libs/RunBar.library")
   (dest "Libs:")
   (confirm)
)
(complete 50)
(copylib
   (prompt #copy-key)
   (source "L/WBStart-Handler")
   (help   @copyfiles-help)
   (dest "L:")
   (confirm)
)
(complete 60)
(copyfiles
   (prompt #copy-u)
   (source "Utils")
   (help   @copyfiles-help)
   (infos)
   (dest "SYS:Utilities")
   (all)
)
(complete 70)
(copyfiles
   (prompt #copy-p)
   (source "RunBarPrefs")
   (help   @copyfiles-help)
   (infos)
   (dest "SYS:Prefs")
)
(complete 80)
(set Images
   (exists "ENVARC:RunBar"
      (noreq)
   )
)
(set Image1 0)
(if
   (= Images 0)
(copyfiles
   (prompt #copy-unin)
   (source "Images/")
   (help   @copyfiles-help)
   (infos)
   (all)
   (dest "ENVARC:RunBar")
)
)
;------------
(if (= Images 2)
(if
   (askbool
      (prompt "Replace Images")
      (help "Yes = Replace.\nNo  = No")
      (default 0)
   )
   (set Images1 1)
)
)
(if
   (= Images1 1)
(copyfiles
   (prompt #copy-unin)
   (source "Images/")
   (help   @copyfiles-help)
   (infos)
   (all)
   (dest "ENVARC:RunBar")
)
)
(complete 85)
(message #msg)
(message #msg1)
(complete 90)
(run "SYS:Prefs/RunBarPrefs"
) 
(complete 100)

(exit)

