(set #inst_text "BackClock Installation on Hard Disk")
(set #prog "backclock")
(set #rtlib "rtracker.library")
(set #pulib "popupmenu.library")
(set #qhlib "quickhelp.library")
(set #ledlib "led.image")
(set @appname "BackClock")
(set #gosrc 1)
(set #gobootup 1)
(set #defpathprefs "sys:prefs/")
(set #libs_src "libs")
(set #libs_dst "libs:")
(set #clas_dst "SYS:Classes/images")
(set #prefsprompt "Do you want to install default preferences\nThis will erase your last settings !")
(set #prefshelp "This will overwrite the file\nbackclock.prefs in env: & envarc:")
(set #destdir_prompt "Where do you want to install BackClock\nA drawer will be created.")
(set #destdirprefs "Where do you want to install BackClock preferences.")
; asks where to put the prog
(set #destdir (askdir
(prompt #destdir_prompt)
(help @askdir-help)
(default "Work:")
)
)
(set @default-dest (tackon #destdir "BackClock"))
(if (not (exists (@default-dest)))
(makedir @default-dest (infos))
)
; update rtracker.library if needed
(copylib
(prompt "Updating rtracker.library")
(source (tackon #libs_src #rtlib))
(dest #libs_dst)
(help @copylib-help)
(confirm expert)
)
; update popupmenu.library if needed
(copylib
(prompt "Updating popupmenu.library")
(source (tackon #libs_src #pulib))
(dest #libs_dst)
(help @copylib-help)
(confirm expert)
)
; update quickhelp.library if needed
(copylib
(prompt "Updating quickhelp.library")
(source (tackon #libs_src #qhlib))
(dest #libs_dst)
(help @copylib-help)
(confirm expert)
)
; update or copy led.image
(copylib
(prompt "Update or copy led.image")
(source (tackon #libs_src #ledlib))
(dest #clas_dst)
(help @copylib-help)
(confirm expert)
)
; asks if the user wants to start backclock at startup
(if (>= @user-level 1)
(set #gobootup
(askbool
(prompt "Do you want to run BackClock each startup ?")
(help "If you answer yes, then BackClock will be copied to SYS:WBStartup.")
)
)
)
(set #sourcepath @default-dest)
; asks the path for the prefs prog (BCPrefs & style)
(if (>= @user-level 1)
(set #defpathprefs
(askdir
(prompt #destdirprefs)
(help "Please choose where to place the preferences utility.")
(default #defpathprefs)
)
)
)
(message "Installer will set env variable\nBACKPREFS_PATH\nThis variable contains a string\nwhich indicates the path & name of\nBackclockPrefs\nIf you move this program\ndon't forget to modify this variable")
(textfile
(dest "ENV:BACKPREFS_PATH")
(append #defpathprefs)
)
(textfile
(dest "ENVARC:BACKPREFS_PATH")
(append #defpathprefs)
)
(if (>= @user-level 1)
(if (askbool
(prompt "Do you want to install sources ?")
(help "This will install the sources of the program in the directory sources./")
)
(
;install sources
(set #gosrc 1)
(if (= 2 @user-level)
(
(set #sourcepath (askdir
(prompt "Where do you want to install sources codes ?\nA drawer called sources will be created there.")
(help "You have to choose where the sources be placed.")
(default @default-dest)
)
)
)
)
)
; don't install sources
(set #gosrc 0)
)
)
; asks the user if he wants to use default prefs
(run "c/defconf"
(prompt #prefsprompt)
(help #prefshelp)
(confirm)
)
; here the script asks for the guide to install
; english or german
(set #catalog
(askchoice
(prompt "Select your desired guide file")
(help "If you know english then choose english\nIf you know german then choose german")