home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Wizard Games 2
/
W_GAMES2.ISO
/
instger.cmd
< prev
next >
Wrap
OS/2 REXX Batch file
|
1995-03-02
|
8KB
|
228 lines
/***INSTALL-Procedure für WKSHELL/2***/
signal on halt name SignalHandler /* Exception handler */
call RxFuncAdd 'SysLoadFuncs', 'RexxUtil', 'SysLoadFuncs'
call SysLoadFuncs
/* ******************************************* */
SourceDrive=""
SourceDir="\GERMAN\"
ExeDest="C:\WKSHELL\"
File.0 = 5
File.1="WKSHELL.EXE"
File.2="WKSHELL.HLP"
File.3="WKSHELL.INF"
File.4="WKSLIST.CMD"
File.5="UNZIP.EXE"
global_again=1
/* ******************************************* */
call InitColors
rc = SysFileTree("instger.cmd", dummy, "F" ,"*****") /* GET CD-ROM-Letter */
if dummy.0 > 0 then do
SourceDrive=substr(dummy.1,38,2)
end
else do
say
say
say bred||"FEHLER :"
say bred||"Bitte wechseln Sie zuerst auf Ihr CD-ROM-Laufwerk und starten dann INSTGER.CMD"
say normal
exit
end
do while global_again = 1
Men = MainMenu()
if Men="1" then do
call GotoXY 5,21
a = charout(,byellow||"Welchen Laufwerks-Buchstaben hat Ihr CD-ROM ? ")
SourceDrive=Translate(SysGetKey('NOECHO'))
SourceDrive=SourceDrive || ":"
end
if Men="2" then do
call GotoXY 5,21
a = charout(,byellow||"Neues WK-Shell/2 -Verzeichnis: ")
pull ExeDest
if right(ExeDest,1) \= "\" then
ExeDest=ExeDest||"\"
end
if Men="3" then do
say normal
Installed=1
Call Install
end
if Men="4" then do
call SysCls
global_again=0
say "Ende...!"
if Installed=1 then do
say
say "Sie können die WK-Shell/2 jetzt von der Festplatte starten :"
say bred||ExeDest||"WKSHELL.EXE"||" "||SourceDrive
say bcyan||"Der Parameter <"||SourceDrive||"> wird benötigt, damit das CD-ROM gefunden wird."
end
say normal
exit
end
end
/* ******************************************* */
MainMenu:
call SysCls
a = charout(,byellow||"┌──────────────────────────────────────────────────────────────────────────────┐")
a = charout(,"│ WK-Shell/2 INSTALL │")
a = charout(,"├──────────────────────────────────────────────────────────────────────────────┤")
a = charout(,"│ │")
a = charout(,"│ │")
a = charout(,"│ │")
a = charout(,"│ │")
a = charout(,"│ │")
a = charout(,"│ │")
a = charout(,"│ │")
a = charout(,"├──────────────────────────────────────────────────────────────────────────────┤")
a = charout(,"│ │")
a = charout(,"│ │")
a = charout(,"│ │")
a = charout(,"│ │")
a = charout(,"│ │")
a = charout(,"├──────────────────────────────────────────────────────────────────────────────┤")
a = charout(,"│ │")
a = charout(,"│ │")
a = charout(,"│ │")
a = charout(,"├──────────────────────────────────────────────────────────────────────────────┤")
a = charout(,"│ │")
a = charout(,"└────────────────────────────────────────────────────────────────────(C)'95 WOK┘")
call GotoXY 5,4
a = charout(,bcyan||"1) CD-ROM Laufwerk : "||bred||SourceDrive)
call GotoXY 5,6
a = charout(,bcyan||"2) Programm-Verzeichnis : "||bred||ExeDest)
call GotoXY 5,12
a = charout(,bcyan||"3) JETZT INSTALLIEREN ! ")
call GotoXY 5,14
a = charout(,bcyan||"4) ENDE! Raus hier... ! ")
call GotoXY 5,18
a = charout(,bcyan||"_ <--- Ihre Wahl ? ")
call GotoXY 5,18
again=1
do while again=1
MM_key=Translate(SysGetKey('NOECHO'))
if MM_key="1"|,
MM_key="2"|,
MM_key="3"|,
MM_key="4" then do
again=0
say MM_key
end
end
return MM_key
// ******************** INSTALL ***************************
Install:
call SysCls
Error = 0
do i = 1 to File.0 /* Copy EXE-Files */
Source=SourceDrive||SourceDir||File.i
if FileExists(Source) = 0 then do
say bred||"FEHLER: Quelldatei nicht vorhanden: "||Source
'pause'
Error=1
Installed = 0
say normal
end
else 'xcopy 'Source ExeDest
end
'pause'
if Error = 0 then do /* Make Desktop-Object ? */
MM_input=""
do while MM_input\="J" & MM_input\="N" /* Security question */
say bcyan
say "Soll ein WK-Shell/2 Objekt auf der Arbeitsoberfläche erzeugt werden (J/N) ?"
pull MM_input
end /* do while */
if MM_input = "J" then
call MakeObject
end
return
/* *+++++++++++++++++++++++++++ */
SignalHandler:
call SysCls
say bred||"Unterbrechung !"
say normal
exit
/* ******************************** */
FileExists: procedure
Maske = arg(1)
rc = SysFileTree(Maske, dummy, "FO" ,"*****")
if dummy.0 > 0 then
return 1
else
return 0
/* ******************************+ */
MakeObject:
SetupString="TITLE=WK-Shell/2 (D);OBJECTID=<WKSHELL2G>;ASSOCFILTER=*.IDX;EXENAME="||ExeDest||"WKSHELL.EXE;PARAMETERS="||SourceDrive
rc=SysCreateObject("WPProgram",,
ExeDest||"WKSHELL.EXE",,
"<WP_DESKTOP>",,
SetupString)
if rc=0 then do
say "WPS-Objekt konnte NICHT erstellt werden."
pause
end
else do
say "WPS-Objekt wurde erzeugt !"
end
return
/* ***********************************************
* Set Color Strings for AnsiColor
*********************************************** */
InitColors:
esc = '1B'x /* define ESCape character */
red = esc||"[31m" /* ANSI.SYS-control for red foreground */
yellow = esc||"[33m" /* ANSI.SYS-control for yellow foreground */
cyan = esc||"[36m" /* ANSI.SYS-control for cyan foreground */
normal = esc||"[0m" /* ANSI.SYS-control for resetting attributes to normal */
bright = esc||"[1m" /* ANSI.SYS-control for bright foreground colors */
bred = bright || red
byellow = bright || yellow
bcyan = bright || cyan
upline = esc||'[1A' /* Cursor one line up */
RETURN
/* ************************************************
* WhereX()
************************************************ */
WhereX: procedure
parse value SysCurPos() with W_z W_s
return W_s
/* ************************************************
* WhereY()
************************************************ */
WhereY: procedure
parse value SysCurPos() with W_z W_s
return W_z
/* ************************************************
* GotoXY(x,y)
************************************************ */
GotoXY: procedure
G_s=arg(1)
G_z=arg(2)
G_dummy=SysCurPos(G_z, G_S)
return