home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Format 107
/
af107sub.adf
/
gui4cli.LZX
/
Gui4Cli
/
INSTALL
< prev
next >
Wrap
Text File
|
2003-05-13
|
8KB
|
308 lines
G4C
; This is a program for the installation of Gui4Cli to your system.
; Click on it's icon to install.
; Comodore's Installer, would do a better job, but since I don't
; know how to write scripts for it, and since this is an other
; excuse for making a gui, here it is.
; If you have any problems (God forbid), just install it by hand.
; Instructions are in the ReadMe.now file
WINBIG 171 12 320 139 "Install Gui4Cli"
WinType 11110001
WinOut "con:0/12/400/80/Gui4Cli Installation/CLOSE/AUTO/WAIT"
varpath ''
BOX 0 0 0 0 out button
BOX 10 5 300 68 in button
BOX 10 95 300 39 IN BUTTON
;--------------------------------- Start up events --------------------
xOnLoad
extract Install GUIPATH path
cd $path
; --------- Check to find gui4cli
joinfile $path Gui4Cli g4cname
ifexists file $g4cname
; ok
else
ezreq "Gui4Cli not found.\nPlease read the ReadMe.now\nfile and try again" "OK" ''
Quit
endif
; --------- Set default variable values
dir = SYS:Gui4Cli
dirinfo = SYS:Gui4Cli.info
assign = ON
dirmake = YES
; --------- Warn user if Gui4Cli already exists
ifexists assign GUIs
if guis: F= $path
; it's ok it's this dir
else
dirmake = NO
dir = GUIs:
assign = OFF
update Install 7 0
update Install 2 "Directory exists."
endif
endif
GuiOpen Install
update Install 1 $dir
xOnClose
Quit
;------------------------------ Install Gui4Cli program -----------------
CTEXT 20 10 "Gui4Cli Installation" topaz.font 8 2 0 0001
XBUTTON 210 10 89 14 "Browse.."
gdir = ''
ReqFile -1 -1 250 -60 "Choose path for Gui4Cli" DIR gdir $dir
if $gdir != ""
joinfile $gdir Gui4Cli dir
joinfile $gdir Gui4Cli.info dirinfo
ifexists DIR $dir
dirmake = NO
assign = OFF
update Install 7 0
update Install 2 "Directory Gui4Cli exists"
else
dirmake = YES
assign = ON
update Install 7 1
update Install 2 "Will create Directory Gui4Cli"
endif
update Install 1 $dir
endif
TEXT 20 25 280 14 "sys:" 120 BOX
GadID 1
TEXT 20 40 280 14 "Creates Directory named Gui4Cli" 60 NOBOX
GadID 2
TEXT 20 55 280 14 "File Gui will be copied to c:" 50 NOBOX
GadID 3
;====================> Assign GUIs:
TEXT 20 80 236 11 "Add commands to User-Startup?" 30 NOBOX
GadID 4
XCHECKBOX 260 80 26 13 "" assign "ON" "OFF" ON
gadID 7
;----------------------- Run Install -------------------------------
XBUTTON 25 115 100 14 Install!
SetWinTitle Install "Installing..."
guiwindow install wait
FailAt 10
; copy Gui
copy gui c:
update Install 3 "File Gui copied."
update Install 10 5 ; gauge
; Make G4C dir & dir icon
if $dirmake = YES
makedir $dir
copy g4cdrawer $dirinfo
update Install 2 "Gui4Cli dir created."
Assign GUIs: $dir
endif
update Install 10 10 ; gauge
; add the assign to s:user-startup
if $assign = ON
update Install 4 "Assigning..."
Append s:user-startup "\n;START of Gui4Cli assign\n"
Append s:user-startup 'Assign GUIs: $dir \n'
Append s:user-startup 'Path GUIs:c add\n'
Append s:user-startup ";END of Gui4Cli assign\n"
update Install 4 "GUIs: Assign added."
endif
update Install 10 15 ; gauge
; copy the fonts
update Install 1 "Copying font..."
copy fonts/#? fonts:
update Install 10 20 ; gauge
; ----- copy the files
; tools
update Install 1 "Copying Tools..."
; get & save new players
joinfile $dir "tools/prefs/players" playfile
ifexists file $playfile
guiload tools/prefs/players
guiload $playfile ; overlay old prefs
flag = 1
endif
action copy tools $dir
if $flag = 1
gosub install saveprefs
endif
; check favourites files
gosub install savefavs
update Install 10 40
; C
update Install 1 "Copying C..."
copy c $dir
update Install 10 45
; docs
update Install 1 "Copying Docs..."
action copy docs $dir
update Install 10 60
; dir.gc
update Install 1 "Copying Dir.gc..."
joinfile $dir dir/dir.user userfile
ifexists file $userfile
rename dir/dir.user dir/dir.user.empty
endif
copy Dir $dir
update Install 10 70
; G4C
update Install 1 "Copying G4C..."
copy G4C $dir
update Install 10 80
; ------- copy the files
; icons
update Install 1 "Copying Files..."
rename Install.info ginfo ; so that it's not copied
copy #?.info $dir
rename ginfo Install.info
update Install 10 85
ifexists file c:Gui4Cli
delete c:Gui4Cli
endif
copy Gui4Cli $dir
update Install 10 95
copy Gui4Cli.gc $dir
copy Demo.gc $dir
copy ReadMe.now $dir
update Install 10 100
update Install 1 "Gui4Cli Installed."
cli 'c:path guis:c add'
SetWinTitle Install "Gui4Cli Installation"
guiwindow install resume
ezreq "Installation finished.\nGui4Cli can be found in\n$dir" "Yeah!" ""
; quit since this is another port
ifexists port Gui4Cli
else
run 'gui guis:Gui4Cli.gc'
endif
Quit
;------------> On failing
xOnFail
SetWinTitle Install "**** ERROR ****"
guiwindow install resume
EZREQ "ERROR in installation\nPlease read the ReadMe.Now file\nand install manually." "OK" ""
Quit
;----------------------- Cancel button ------------------------------
XBUTTON 200 115 100 14 CANCEL
Quit
GAUGE 22 99 281 13 IN RIDGE 3 0 0
gadid 10
; --------------------------- ROUTINES -------------------------
; Same routine as in guis:tools/config.gc
xroutine saveprefs
.dir.prefs = "G4C - Players\n\nxOnLoad\n"
append env:.dir.prefs '*DEF.EDITOR = \"$*DEF.EDITOR\"\n'
append env:.dir.prefs '*DEF.ILBM = \"$*DEF.ILBM\"\n'
append env:.dir.prefs '*DEF.ANIM = \"$*DEF.ANIM\"\n'
append env:.dir.prefs '*DEF.GIF = \"$*DEF.GIF\"\n'
append env:.dir.prefs '*DEF.JPG = \"$*DEF.JPG\"\n'
append env:.dir.prefs '*DEF.GFX = \"$*DEF.GFX\"\n'
append env:.dir.prefs '*DEF.PAINT = \"$*DEF.PAINT\"\n'
append env:.dir.prefs '*DEF.GFXCON = \"$*DEF.GFXCON\"\n'
append env:.dir.prefs '*DEF.SMPL = \"$*DEF.SMPL\"\n'
append env:.dir.prefs '*DEF.MOD = \"$*DEF.MOD\"\n'
append env:.dir.prefs '*DEF.GUIDE = \"$*DEF.GUIDE\"\n'
append env:.dir.prefs '*DEF.LHA = \"$*DEF.LHA\"\n'
append env:.dir.prefs '*DEF.ZIP = \"$*DEF.ZIP\"\n'
append env:.dir.prefs '*DEF.UNZIP = \"$*DEF.UNZIP\"\n'
append env:.dir.prefs '*DEF.HEX = \"$*DEF.HEX\"\n'
append env:.dir.prefs '*DEF.PP = \"$*DEF.PP\"\n'
append env:.dir.prefs '*DEF.PPM = \"$*DEF.PPM\"\n'
append env:.dir.prefs '*DEF.TGA = \"$*DEF.TGA\"\n'
append env:.dir.prefs '*DEF.PNG = \"$*DEF.PNG\"\n'
append env:.dir.prefs '*DEF.FONT = \"$*DEF.FONT\"\n'
append env:.dir.prefs '*DEF.HTML = \"$*DEF.HTML\"\n'
append env:.dir.prefs '*DEF.GFXED = \"$*DEF.GFXED\"\n'
append env:.dir.prefs '*DEF.FLC = \"$*DEF.FLC\"\n'
append env:.dir.prefs '*DEF.AVI = \"$*DEF.AVI\"\n'
append env:.dir.prefs '*DEF.MPG = \"$*DEF.MPG\"\n'
append env:.dir.prefs '*DEF.QT = \"$*DEF.QT\"\n'
append env:.dir.prefs '*DEF.MPGA = \"$*DEF.MPGA\"\n'
append env:.dir.prefs '*DEF.DT = \"$*DEF.DT\"\n'
append env:.dir.prefs "GuiQuit Players\n"
copy env:.dir.prefs guis:tools/prefs/players
delete env:.dir.prefs
xROUTINE savefavs
.temp = "GUIs:"
; check if fav directory exists
joinfile $dir "tools/fav" favdir
ifexists directory $favdir
else
makedir $favdir
endif
; check & create fav files
joinfile $dir "tools/fav/dirdef" favfile
ifexists file $favfile ; dir favourites files
else
copy env:.temp $favfile
endif
joinfile $dir "tools/fav/cedfav" favfile
ifexists file $favfile ; ced
else
copy env:.temp $favfile
endif
joinfile $dir "tools/fav/default" favfile
ifexists file $favfile ; default
else
copy env:.temp $favfile
endif