home *** CD-ROM | disk | FTP | other *** search
AMOS Source Code | 1996-03-06 | 3.4 KB | 171 lines |
- '---------------------------------------------------------------------
- ' Amoszine installer - By Andrew Smith 1994
-
- ' Written for Amoszine using AMOS Professional v2.0
- '---------------------------------------------------------------------
-
- ' This is very old and is of no practical use anymore, but the routines
- ' can be used to create your own pwersonal installers.
- '
- ' I don't think Az ever used this for some reason or another!
- '
- ' Thanx anyway Andy. -AG
- '
- Dim CL(16) : Dim SCRIPT$(50)
-
- Unpack 15 To 0
- Screen Display 0,,150,,
- Screen Hide 0
-
- ' Make mouse pointer prettier
-
- Colour 17,$FFF : Colour 19,$A
-
- ' Store colour palette in array
-
- For T=0 To 15
- CL(T)=Colour(T)
- Next T
-
- ' Wipe colours
-
- For T=0 To 15
- Colour T,$0
- Next T
-
- ' Show screen and do a nice fade in
-
- Screen Show 0
-
- Fade 3,CL(0),CL(1),CL(2),CL(3),CL(4),CL(5),CL(6),CL(7),CL(8),CL(9),CL(10),CL(11),CL(12),CL(13),CL(14),CL(15)
- Wait 45
-
- ' Move logo to top of screen
-
- For Y=150 To 40 Step -2
- Screen Display 0,,Y,,
- Wait Vbl
- Next Y
-
- Global DESTDIR$
-
- ' The DEST$ variable contains the path to install to
-
- Wind Save
- Wind Open 1,124,100,48,4,3
- Window 1
- Border 3,6,15
- Title Top "Enter device to install to ..."
- Pen 15
- Input DEST$
- Wind Close
- Clear Key
-
- Paper 0 : Pen 15
-
- ' Store script in array to minimize on disk swapping.
-
- Open In 1,"dirs.dta"
- COUNT=1
- Repeat
- Input #1,LINE$
- SCRIPT$(COUNT)=LINE$
- Inc COUNT
- Until Eof(1)
- Close 1
-
- COUNT=1
- Repeat
- LINE$=SCRIPT$(COUNT)
- Inc COUNT
-
- ' Find position of first colon
-
- POS=Instr(LINE$,":")
-
- ' Get size of line minus POS.
-
- SIZEOFDIR=Len(LINE$)-POS
-
- ' Get directory name without shite
-
- DESTDIR$=Mid$(LINE$,POS+1,SIZEOFDIR-1)
-
- ' Get ARCHIVE: and stick it with directory name
- ' e.g. archive:source_code
-
- DESTDIR$=DEST$+DESTDIR$
-
- ' If directory already exists then don't bother creating it
-
- If Not Exist(DESTDIR$)
- Mkdir DESTDIR$
- End If
-
- ' Copy one directory at a time
-
- Dir$=LINE$
- Centre At(,31)+" "
- Centre At(,31)+"Installing : "+LINE$
- F$=Dir First$("**")
- Repeat
- If Left$(F$,1)<>"*"
-
- ' Strip uneeded leading space from f$
-
- F$=Mid$(F$,2,35)
-
- ' Find position of first space, after filename
-
- POS=Instr(F$," ")
-
- ' Get filename without any junk and store in f$
-
- F$=Mid$(F$,1,POS-1)
- If Len(F$)=>29
- F$=Left$(F$,29)
- End If
-
- ' Copy file
-
- If Right$(LINE$,1)=":"
- _COPYFILE[F$,DESTDIR$+F$,14]
- Else
- _COPYFILE[F$,DESTDIR$+"/"+F$,14]
- End If
- End If
- F$=Dir Next$
- Until F$=""
-
- Until SCRIPT$(COUNT)=""
- Bell
- Wind Save
- Wind Open 1,124,100,48,4,3
- Window 1
- Border 3,6,15
- Title Top "Amoszine Installer Message"
- Pen 15
- Centre At(,0)+"Installation complete!"
- Centre At(,1)+"Click mouse or press a key"
- Repeat
- X$=Inkey$
- Until(Mouse Key) or(X$<>"")
- Wind Close
-
- Fade 3 : Wait 45
-
- Procedure _COPYFILE[SOURCE$,DESTINATION$,BANK]
-
- Open In 2,SOURCE$
- Reserve As Work BANK,Lof(2)
- Bload SOURCE$,BANK
- Close 2
- Bsave DESTINATION$,Start(BANK) To Start(BANK)+Length(BANK)
-
- ' This line is provided for compatability with AMOS 1.3
- ' If it is removed, then the error 'Bank already reserved' appears
- ' under AMOS classic.
-
- Erase BANK
-
- End Proc[ERRMESS$]