home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
AmigActive 20
/
AACD20.BIN
/
AACD
/
Information
/
AmiBench
/
InstallAmiBench
< prev
next >
Wrap
Text File
|
2000-03-01
|
5KB
|
245 lines
; $VER: AmiBench Installer 1.0 (29.2.2000) Neil Bothwick
;========================== Define Procedures ==========================
;;; Setup message, prompt and help strings
(procedure SetStrings
(set
WelcomeMsg1
(cat
'\nWelcome to the ' @app-name ' software installation.\n'
'\nThis will install or update the ' @app-name '\n'
'along with any required MUI classes.\n'
)
WelcomeMsg2
(cat
'\nThis installer will also update your data files, but only if the files '
'on the CD are later than your current installation.\n\n'
'It will not overwrite newer data that you have downloaded.'
)
DirMsg
(cat
'Where do you want to install ' @app-name'?\n'
'A directory will NOT be created.'
)
DirHelp
(cat
'Choose the path to create a directory for ' @app-name
)
IconSetPrompt
(cat
'\nWhich icon style do you want to install for ' @app-name '?\n'
)
IconSetHelp
(cat
'\nIcons are available in OS 3.5, NewIcon, Magic Workbench and Original styles.\n'
'\nSelect whichever you prefer.'
)
AssignPrompt
(cat
'\n' @app-name ' needs an assign of ADD: to be added to your user-startup.\n\n'
'Should it be added now?'
)
AssignHelp
(cat
'The ADD: assign is needed by ' @app-name ' whenver you update the data files, '
'either online or from a CD. It should be added to your user-startup by this Installer.'
)
)
)
;;;
;;; Abort with message
(procedure GetOut GetOutMsg
(message GetOutMsg)
(exit (quiet))
)
;;;
;;; Say hello :-}
(procedure WaitX (set X 1) ( (while (< X 300) (set X (+ X 1)) ) ) )
(procedure LineFeed lines
(substr '\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n' 0 lines)
)
(procedure SayHello
(set
Line1 '\nWelcome to the'
Line2 @app-name
Line3 'software installation'
)
(set LFs 12 LFmin 1)
(while (> LFs LFmin)
(working (cat (LineFeed LFs) Line1)) (WaitX)
(set LFs (- Lfs 1))
)
(WaitX)
(set LFs 12 LFmin 3)
(while (> LFs LFmin)
(working (cat Line1 (LineFeed LFs) Line2)) (WaitX)
(set LFs (- Lfs 1))
)
(WaitX)
(set LFs 9 LFmin 2)
(while (> LFs LFmin)
(working (cat Line1 (LineFeed 3) Line2 (LineFeed LFs) Line3)) (WaitX)
(set LFs (- Lfs 1))
)
(message (cat '\n\n' Line1 (LineFeed 3) Line2 (LineFeed 3) Line3))
(message WelcomeMsg1)
(message WelcomeMsg2)
(welcome)
)
;;;
;;; Check for existing installation
(procedure CheckForInstall
(set Update (= 2 (exists 'ADD:' (noreq))))
)
;;;
;;; Get install directory
(procedure GetDrawer
(set InstallDir
(askdir
(prompt DirMsg)
(help DirHelp)
(if Update
(default (getassign 'ADD'))
(
(default 'RAM:')
(disk)
)
)
)
)
(makeassign 'ADD' InstallDir)
(set @default-dest InstallDir)
)
;;;
;;; Ask which type of icon should be used
(procedure GetIconSet
(if (exists (tackon InstallDir 'AmiBench.info'))
(set IconSet 4)
(set IconSet
(askchoice
(prompt '\nWhich icon style do you want to install?\n')
(help IconSetHelp)
(choices
'\x1B[2pOS 3.5 Icons'
'MagicWB Icons'
'NewIcons'
'Pre-OS 3.5 Icons'
)
(default 0)
)
)
)
)
;;;
;;; Copy executable and guide
(procedure CopyMain
(copylib
(prompt '\nCopying AmiBench\n')
(help 'This copies the AmiBench executable')
(source 'AmiBench')
(dest InstallDir)
)
(copylib
(prompt '\nCopying ADD.guide\n')
(help 'This copies the AmiBench documentation')
(source 'ADD.guide')
(dest InstallDir)
)
)
;;;
;;; Copy icons
(procedure CopyIcons
(set IconDir
(tackon
'Icons'
(select IconSet
('OS35')
('MWB')
('NI')
('OS30')
('NOICONSTOCOPY')
)
)
)
(if (exists IconDir)
(copyfiles
(prompt '\nCopying icons\n')
(help 'Copying the selected icon set')
(source IconDir)
(dest InstallDir)
(all)
)
)
)
;;;
;;; Install MUI classes and libs
(procedure CopyClasses
(copylib
(prompt '\nCopying BetterBalance.mcc\n')
(help (cat 'This MUI class is needed by ' @app-name))
(source 'Libs/mui/libs/BetterBalance.mcc')
(dest 'MUI:Libs/mui')
)
(copylib
(prompt '\nCopying twflists.library\n')
(help (cat 'This library is needed by ' @app-name))
(source 'Libs/twflists.library')
(dest (tackon Installdir 'Libs'))
)
)
;;;
;;; Copy or update data files
(procedure CopyData
(foreach 'Data' '#?'
(if (not (exists (tackon (tackon InstallDir 'Data') @each-name)))
(set CopyThis True)
(if (earlier (tackon (tackon InstallDir 'Data') @each-name) (tackon 'Data' @each-name))
(set CopyThis True)
(set CopyThis False)
)
)
(if (= CopyThis True)
(copyfiles
(prompt 'Copying datafiles')
(help 'Copying datafiles')
(source (tackon 'Data' @each-name))
(dest (tackon InstallDir 'data'))
)
)
)
)
;;;
;;; Modify user-startup
(procedure AddAssign
(startup
@app-name
(prompt AssignPrompt)
(help AssignHelp)
(confirm)
(command (cat 'Assign >NIL: ADD: ' InstallDir))
)
)
;;;
;;; ========================== Main installation ==========================
(SetStrings)
(SayHello)
(CheckForInstall)
(GetDrawer)
(GetIconSet)
(CopyMain)
(CopyIcons)
(CopyClasses)
(CopyData)
(AddAssign)
(exit)
;;;