home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Devil's Doorknob BBS Capture (1996-2003)
/
devilsdoorknobbbscapture1996-2003.iso
/
Dloads
/
PROGRAMM
/
BUILDER.ZIP
/
TUTOR1.BLD
< prev
next >
Wrap
Text File
|
1992-11-17
|
2KB
|
77 lines
' First we declare our variables.
' These are the Longints we will use:
LongInt LI1, LI2, LI3
' These are the integers we will use:
Integer Int1
' Let's check drive C: for free space, to see if there's enough
' to install our program.
Put DiskFree "C:" into LI1
' Let's check drive A: for free space, the first step toward
' seeing how much we're installing.
Put DiskFree "A:" into LI2
' Let's see how much space we need on drive C:
Put 360000-LI2 into LI3
' Let's compare what we need to what we've got, and instruct the user
' if it isn't going to work.
if LI1 < LI3
Say "You don't have the disk space on Drive C: to ";
say "install this program."
say "Please clear at least "; LI3; " bytes from drive C:";
say " and try again."
exit 1
end
' Now let's set up our installation menu.
' This will keep the menu active until {Esc} is pressed or an Exit
' command is issued
While not cancelled
' simple screen colors.
Cls bright white on blue
' Make a DropDown menu called Installation Menu, and give it two choices
' (items).
' *** NOTE THIS LINE OF CODE IS DIFFERENT THAN THE EXAMPLE ON PAGE 36 ***
DropDown "Installation Menu" @10,10
Item "Begin Installation"
' This call the subroutine show below.
FilesON
Item "Exit Installation"
' This is a BUILDER statement telling the program to quit.
Exit 0
End
End
' Here's the subroutine being called.
Sub FilesON
' First we check for the exists of our target installation directory
Int1:= DirExists "C:\Programs"
' If it's there we inform the user and give them a choice.
If Int1 == 1
Say @20,1 "Program directory already exists, continues?"
GetYN
' *** NOTE THIS LINE OF CODE IS ADDED TO THE EXAMPLE ON PAGE 36 ***
end
' If the choice was "Y" then we go on.
If Errorlevel 1 Run Copy A:\*.* C:\Programs
' If the choice was "N" then we exit with an errorlevel of 1, that
' we could act upon with another program if we wanted to.
If Errorlevel 0
exit 1
' If the target directory didn't exist, we create it.
end else
BLDMkDir "C:\Programs"
end
' And we install by copying the contents of A: to C: in the Programs directory.
Run Copy A:\*.* C:\Programs
End