home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Best Objectech Shareware Selections
/
UNTITLED.iso
/
boss
/
util
/
menu
/
010
/
inst.mnu
< prev
next >
Wrap
Text File
|
1992-08-25
|
13KB
|
443 lines
Comment
=========================================================
MarxMenu installation Menu:
Copyright 1989-1992 by Marc Perkel * All rights reserved.
This is an example of how MarxMenu can be used as a job control
language. There is quite an education in MarxMenu tricks here. If
you want to write a similar program, this menu is worth studying.
=========================================================
EndComment
Var
EchoSt
FileLine
FileLinePtr
ProgName
BatExit
EchoTail
ConfigSysPath
ConfigSysLines
WorkStr
DosVerNumber
Const
PauseTime = 100
DelFile 'MENUS.EXE'
InitialDisplay
Shadow Off
DrawBox 25 11 31 7
DosVerNumber = DosVersion * 100 + MinorDosVersion
;MXECHO is a debugging environment variable. Use SET MXMENU=OFF for
;normal use. SET MXECHO=ON to watch the MARX.BAT run.
If ReadEnv('MXECHO') > ''
EchoTail = '%MXECHO%'
Else
EchoTail = 'ON'
EndIf
if DosVerNumber >= 330
EchoSt = '@ECHO ' + EchoTail
else
EchoSt = 'ECHO ' + EchoTail
endif
ProgName = CleanFileName(Path + '\MARXMENU.EXE')
Write ' Creating MARX.BAT ... '
;----- BatExit is a 0k bat file used to exit batch files
FileAssign (BatExit,'BATEXIT.BAT')
FileCreate BatExit
FileClose BatExit
;----- Here we create the MARX.BAT file.
ClearLineBuffer
AddLine (EchoSt)
AddLine (ProgName + ' %1 ')
AddLine ('%MXCMD%')
AddLine (CleanFileName(Path + '\MARX.BAT') + ' %1')
AddLine ('')
AddLine ('Goto ERROR1')
AddLine ('')
AddLine ('*-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-*')
AddLine ('')
AddLine ('MarxMenu * CopyRight 1989-92 by Marc Perkel')
AddLine ('')
AddLine ('Once you are confident that MarxMenu is working correctly')
AddLine ('the first line of this file can be changed to ECHO OFF.')
AddLine ('')
AddLine ('MarxMenu controls this batch file by writing to the environment')
AddLine ('variable MXCMD.')
AddLine ('')
AddLine ('MXSTOP.BAT is executed to exit this batch file.')
AddLine ('')
AddLine ('*-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-*')
AddLine ('')
AddLine (' MARX.BAT')
AddLine (' -------- +--MarxMenu Creates--+')
AddLine (' +----> @ECHO OFF | |')
AddLine (' | MARXMENU.EXE %1 |')
AddLine (' | %MXCMD% >--+ +-> $MX00000.BAT')
AddLine (' | +--> MARX %1 + | ------------')
AddLine (' | | | +----------------------> CD\WORDSTAR')
AddLine (' +-|------<-----+ WS --+')
AddLine (' | |')
AddLine (' +-------------------------------------------<-+')
AddLine ('')
AddLine ('Note: MarxMenu sets MXCMD = CALL $MX00000.BAT')
AddLine ('')
AddLine ('By Default, MarxMenu creates the temporary batch file in the same')
AddLine ('directory as MARXMENU.EXE. If a second parameter is specified, and')
AddLine ('the second parameter is a directory, then MarxMenu will create the')
AddLine ('batch file there. If the second paramerer is a file name, then MarxMenu')
AddLine ('will use it for the temporary file.')
AddLine ('')
AddLine ('If you set and environment variable TEMP to the name of a directory,')
AddLine ("MarxMenu will use this directory for it's temporary batch files.")
AddLine ('')
AddLine ('Example SET TEMP=C:\TEMPFILE')
AddLine ('')
AddLine ('The MARX.BAT file must be path accessable or you will get a')
AddLine ('"Bad Command or FileName" error. MARXMENU.EXE must also be path')
AddLine ('accessable. The directory where MarxMenu creates temporary batch')
AddLine ('files does not need to be path accessable.')
AddLine ('')
AddLine ('*-=-=-=-=-=-=-=-=-=-=[ Error Trapping Section ]-=-=-=-=-=-=-=-=-*')
AddLine ('')
AddLine ('If you get here it is probably because you moved the MARX.BAT file')
AddLine ("from the directory you installed it to a new directory and didn't")
AddLine ('change the path to MARXMENU.EXE and MARX.BAT in lines 2 and 4 of')
AddLine ('this batch file.')
AddLine ('')
AddLine (':ERROR1')
AddLine ('CLS')
AddLine ('Echo * * * * * * Warning * * * * * * *')
AddLine ('Echo.')
AddLine ('Echo Line 4 of this batch file does not point to the directory')
AddLine ('Echo where MARX.BAT is located. Change to the directory where')
AddLine ('Echo the MARXMENU files are located and type MARXMENU INST to')
AddLine ('Echo re-create the MARX.BAT file for that directory.')
AddLine ('')
AddLine ('Goto ENDBAT')
AddLine ('')
AddLine ('*-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-*')
AddLine ('')
AddLine ('This exit point is used if MXSTOP.BAT can not be found. It is')
AddLine ('usually caused by moving the MarxMenu files from one directory')
AddLine ('to another and not copying all the BAT files. MarxMenu sets the')
AddLine ('environment variable MXCMD to GOTO E in order to get here.')
AddLine ('')
AddLine ('*-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-*')
AddLine ('')
AddLine (':E')
AddLine ('CLS')
AddLine ('Echo * * * * * * Warning * * * * * * *')
AddLine ('Echo.')
AddLine ('Echo The file MXSTOP.BAT, DROPTO.BAT, and BATEXIT.BAT should be in')
AddLine ('Echo the same directory as the MARX.BAT file. Run MARXMENU INST in')
AddLine ('Echo the directory where you want MARX.BAT to reside.')
AddLine (':ENDBAT')
WriteTextFile 'MARX.BAT' FileLine
ClearLineBuffer
;----- Here we create the DROPTO.BAT file.
Writeln
Write ' Creating DROPTO.BAT ... '
AddLine ('DEL %1')
AddLine ('SET KSV=')
AddLine ('SET MXCMD=')
AddLine ('%2 %3 %4 %5 %6 %7 %8 %9')
AddLine ('BATEXIT')
AddLine ('')
AddLine ('*-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-*')
AddLine ('')
AddLine ('DropTo is used when you want to eliminate the temporary batch')
AddLine ('file created by MarxMenu. This is useful if you shell to DOS')
AddLine ('and then run MarxMenu from the dos shell. It avoids the')
AddLine ('"Missing Batch File" error.')
AddLine ('')
AddLine ('DropTo is run from within the temporary batch file you want')
AddLine ('to eliminate.')
AddLine ('')
AddLine ('Usage: DROPTO %0 <command line>')
AddLine ('')
AddLine ("Here's how it works:")
AddLine ('')
AddLine (' $MX00000.BAT <------deletes this file--------+')
AddLine (' ------------ |')
AddLine (' DROPTO %0 COMMAND.COM ------------> DEL %1 >-+')
AddLine (' SET KSV=')
AddLine (' SET MXCMD=')
AddLine (' %2 executes command.com--> %2 %3 %4 %5 %6 %7 %8 %9')
AddLine ('')
AddLine ('*-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-*')
WriteTextFile 'DROPTO.BAT' FileLine
ClearLineBuffer
;----- Here we create the MXSTOP.BAT file.
Writeln
Write ' Creating MXSTOP.BAT ... '
AddLine ('SET MXCMD=')
AddLine ('SET KSV=')
AddLine ('REM From here, you control the menu exit process!')
WriteTextFile 'MXSTOP.BAT' FileLine
ClearLineBuffer
;----- Here we create the GOFILE.BAT file.
Writeln
Write ' Creating GOFILE.BAT ... '
AddLine (EchoSt)
AddLine ('MARXMENU GOFILE %1')
AddLine ('REM This batch file is used only with the GOFILE menu.')
WriteTextFile 'GOFILE.BAT' FileLine
ClearLineBuffer
;----- Here we create the \LOGIN\OFF.BAT file.
if ExistDir '\LOGIN' and NetworkVersion
if not ExistFile '\LOGIN\OFF.BAT'
Writeln
Write ' Creating OFF.BAT ... '
AddLine ('ECHO ON')
AddLine ('')
AddLine ('REM This batch file is used to log off the network.')
AddLine ('REM Add the commands you want to execute when logoff occurs here.')
AddLine ('')
AddLine ('LOGOUT')
WriteTextFile '\LOGIN\OFF.BAT' FileLine
ClearLineBuffer
endif
endif
Wait PauseTime
EraseTopWindow
CheckEnvSize
EraseTopWindow
BoxBorderColor Yellow Mag
BoxInsideColor White Mag
DrawBox 18 10 44 7
BoxBorderColor LGreen Blue
BoxInsideColor Yellow Blue
DrawBox 23 12 34 3
WriteCenter 'MarxMenu Installed!'
Wait PauseTime * 2
EraseTopWindow