home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
swCHIP 1991 January
/
swCHIP_95-1.bin
/
utility
/
wincmd78
/
setupwcl.cbf
< prev
next >
Wrap
Text File
|
1995-12-09
|
3KB
|
96 lines
@ECHO OFF
ECHO -----------------
ECHO SAMPLE WCL SCRIPT
ECHO -----------------
REM - THIS IS A SAMPLE (COMPLEX) SCRIPT OR BATCH FILE WHICH ATTEMPTS
REM - TO USE MANY OF THE SCRIPT COMMANDS OF WCL. WHAT IT DOES IS TO
REM - COPY THE WCL FILES TO A DIRECTORY, CREATE A PROGRAM MANAGER ICON,
REM - LOAD ANOTHER COPY OF WCL, AND THEN CLOSE ITSELF DOWN.
REM - THIS SCRIPT WILL ONLY RUN FROM "BIGWCL".
REM - BLANK LINES ARE IGNORED!
REM - SEMI-COLONS SHOULD NOT APPEAR ON "IF" LINES, UNLESS THEY ARE
REM - FOLLOWED BY A "REM"
REM - THE SCRIPT STARTS!!
REM - check whether we are running the BIG version or the SMALL version
IF SMALLVERSION GOTO NOTVALID
SAY This is a sample BATCH FILE which uses many of the SCRIPTING features of WCL.
IF CONFIRM "Should I start running the script?" GOTO START
BEEP ; REM - make an annoying beep!
SAY Script aborted by user .... quitting. ; REM - show message
RETURN ; REM - close this batch file.
REM - the installation begins here
:START
IF GETS "Install FROM directory $Sd1" CHGSTR @Sd1=$Sd1 $ELSE GOTO END
IF ISDIR "$Sd1 $Src" CHGSTR @Src=$Src $ELSE GOTO ERR2
IF GETS "Enter target Directory $Dest" CHGSTR @Dest=$Dest $ELSE GOTO END
IF ISDIR "$Dest $i" REM $ELSE MD $Dest
IF ISDIR "$Dest $i" CD $Dest $ELSE GOTO ERR1
REM - if we get here, its safe to copy the WCL files
COPY $Src\*.EXE
COPY $Src\WCL*.HLP
COPY $Src\*.INI
COPY $Src\WCL*.DLL
COPY $Src\*.WXX
If EXIST $Src\*.WCL COPY $Src\*.WCL
If EXIST $Src\*.TXT COPY $Src\*.TXT
If EXIST $Src\*.FAQ COPY $Src\*.FAQ
If NOT EXIST $Src\BWCC.DLL GOTO SKIPBWCC
REM - next line is skipped if BWCC.DLL is not in the source directory
IF ISDIR "SYSDIR $i" COPY $Src\BWCC.DLL $i $ELSE COPY $Src\BWCC.DLL
:SKIPBWCC
Say Installation completed
REM - the next line looks for Program Manager, or continues elsewhere
IF ISWIN "Program Manager $pm" CHGSTR @pm=$pm $ELSE GOTO END2
REM - the next line sends keys to Progman to create a program icon for WCL
SENDKEYS $pm @FN~WCL{tab}$Dest\BIGWCL.EXE{tab}$Dest~
SENDMESSAGE $pm MIN ; REM minimize Program Manager
SETFOCUS ; REM return to WCL window
IF CONFIRM "Use BIGWCL as Windows SHELL?" WINSHELL $Dest\BIGWCL.EXE
IF CONFIRM "Run the WCL configuration? program?" CFG
$Dest\BIGWCL.EXE ; REM try to run the new BIGWCL
SENDMESSAGE $pm SHOW ; REM restore Program Manager
WMCLOSE ; REM close down this copy of WCL
REM - error 1 comes next
:ERR1
Say Could not create $Dest. Quitting ...
RETURN
REM - error 2 comes next
:ERR2
BEEP
Say The directory "$Sd1" does NOT exist! Quitting ...
RETURN
REM - end 1 comes next
:END
Say Script discontinued by user. Quitting ...
RETURN
REM - end 2 comes next
:END2
PROGMAN ; REM try to run Program Manager
DELAY 4 ; REM delay for 4 seconds
IF ISWIN "Program Manager $i" SENDKEYS $i @FN~WCL{tab}$Dest\BIGWCL.EXE{tab}$Dest~
$Dest\BIGWCL.EXE ; REM try to run the new BIGWCL
WMCLOSE ; REM close down this copy of WCL
:NOTVALID
BEEP
Say SORRY! You should only run this script from BIGWCL.
RETURN