home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 35 Internet
/
35-Internet.zip
/
dragen1.zip
/
setup.cmd
< prev
next >
Wrap
OS/2 REXX Batch file
|
2000-03-26
|
7KB
|
181 lines
/* Obtain user's preferences and create Dragen Objects */
Call RxFuncAdd 'SysLoadFuncs', 'REXXUTIL', 'SysLoadFuncs'
Call SysLoadFuncs
parse source operatingsystem commandtype sourcefilename
fpos=lastpos("\",sourcefilename)
if fpos \= 0 then
fpath=left(sourcefilename,fpos)
say fpath
echo off
cls
say "Dragen FTP Setup Script"
downagain:
say ""
say "Please type full path for your preferred download directory (i.e. f:\download):"
say "(To use default of " fpath"download - Press Enter)"
pull download
if download = '' then download = 'download'
if right(download,1) = '\' then download = left(download,length(download) - 1)
call sysfiletree download,'drag','D'
if drag.0 \= 1 then
do
say download 'does not exist. Setup will attempt to create it.'
if lastpos(':',download) = 0 & lastpos('\',download) = 0 then download = fpath||download
rc = SysMkDir(download)
if rc = 0 then
say download 'successfully created'
else
do
say download 'could not be created.'
say 'Press Enter to try again or "Q" to skip this entry.'
say 'If you skip this entry you must manually edit' fpath'DPATH'
say 'and enter the fully qualified download directory name'
say 'as the first line or Dragen will not function.'
parse upper pull oops; if oops = '' then signal downagain
download = ' '
end
end
else
do
parse var drag.1 . . . . download
download = strip(download)
end
say ""
oldhost = SysTempFileName(fpath'hosts.???')
say 'Would you like to place the default download directory'
say 'into each Host entry? (y/N)'
say '(The existing HOSTS.TXT file will be saved as' oldhost')'
parse upper pull oops
if oops = 'Y' then
do
call stream oldhost, 'c', 'open write'; call stream oldhost, 'c', 'close'
'copy' fpath'hosts.txt' oldhost
newhost = SysTempFileName(fpath'hosts.???')
myline = 0
do while lines(fpath'hosts.txt')
ism = linein(fpath'hosts.txt')
myline = myline + 1
if myline = 6 then
call lineout newhost, download
else
call lineout newhost, ism
if myline = 8 then myline = 0
end
oc = stream(fpath'hosts.txt','c','close'); nc = stream(newhost,'c','close')
if oc = 'READY:' & nc = 'READY:' then
do
call sysfiledelete fpath'hosts.txt'
'rename' newhost 'hosts.txt'
end
else
do
say 'Setup encountered an unresolved error in creating a new HOSTS file.'
say 'HOSTS.TXT will not be replaced.'
call SysFileDelete newhost; call SysFileDelete oldhost
end
end
edagain:
say ""
say "Please type full path and name for your preferred text editor:"
say "(To use default, C:\OS2\E.EXE, press Enter.)"
parse upper pull editor
if editor = '' then editor = 'C:\OS2\E.EXE'
call sysfiletree editor,'drag','F'
if drag.0 \= 1 then
do
say editor 'was not found.'
say 'Press Enter to try again or enter a "Q" to accept "E.EXE" using your'
say 'existing PATH environment.'
parse upper pull oops; if oops = '' then signal edagain
say '"E.EXE" has been inserted into' fpath'DPATH'
say 'If this is not satisfactory, you must manually correct'
say 'the entry in the second line of ' fpath'DPATH'
editor = 'E.EXE'
end
say ""
playagain:
say ""
say "Which program do you want to use to play your mp3 files?"
say "Type mplay1 for high quality, mplay2 for medium quality, or"
say "mplay3 for low quality."
say "If you have your own player, enter its full path and name:"
say "(To use default, MPLAY2 - press Enter.)"
parse upper pull mplay
if mplay = '' then mplay = 'MPLAY2'
call sysfiletree mplay,'drag','F'
if drag.0 \= 1 & mplay \= 'MPLAY1' & mplay \= 'MPLAY2' & mplay \= 'MPLAY3' then
do
say mplay 'was not found.'
say 'Press Enter to try again or "Q" to accept ' fpath'MPLAY2'
parse upper pull oops; if oops = '' then signal playagain
say 'Setup will assume "mplay2" and use existing PATH environment.'
say 'If this is not satisfactory, you must manually put the'
say ' correct entry in the third line of ' fpath'DPATH'
mplay = 'mplay2'
end
say ""
say "Please enter the length of time in seconds that you want Dragen"
say "to wait before it terminates a logon attempt:"
say "(To use default, 45 seconds, press Enter.)"
pull killdelay
if killdelay = '' then killdelay = 45
if \datatype(killdelay,'n') then
do
say killdelay 'is not numeric. It will be set to 45 seconds.'
killdelay = 45
end
if killdelay > 300 then say "Personally, I wouldn't use a server *THAT* bloody slow!"
say ""
say "Please enter your proxy hostname, url, or ip address if you"
say "are behind a firewall."
say "If you are not behind a firewall, press Enter:"
proxyport = ''
pull proxy
if proxy \= '' then
do
say "Please enter your proxy port number if it is not 21, otherwise press Enter:"
pull proxyport
if proxyport = '' then proxyport = '21'
end /* do */
say ""
say ""
getstr="del dpath"
getstr
rc=lineout(dpath,download)
rc=lineout(dpath,editor)
rc=lineout(dpath,mplay)
rc=lineout(dpath,killdelay)
rc=lineout(dpath,proxy)
rc=lineout(dpath,proxyport)
rc=lineout(dpath)
say ""
if rc = 0 then
say "setup file created"
else
say "error in creating setup file"
say ""
iconname="dragen.ico"
iconid="Dragen FTP"
Folder = '<WP_DESKTOP>'
Type = 'WPProgram'
Title = "dragen.exe"
pathfile=fpath||"dragen.exe"
path=left(sourcefilename,fpos-1)
iconsource=fpath"\"iconname
Parms = "MINIMIZED=yes;ICONFILE="iconsource";MINWIN=SYMBOL;PROGTYPE=WP;EXENAME="pathfile";STARTUPDIR="fpath";OBJECTID=<"title">;NOPRINT=YES;Title="iconid";"
Result = SysCreateObject( Type, Title, Folder, Parms, 'ReplaceIfExists' )
say "Placing Dragen program icon on the desktop."
iconname="dragdrp.ico"
iconid="Dragen DropZone"
Folder = '<WP_DESKTOP>'
Type = 'WPProgram'
Title = "dragstrt.cmd"
pathfile=fpath||"dragstrt.cmd"
path=left(sourcefilename,fpos-1)
iconsource=fpath"\"iconname
Parms = "MINIMIZED=yes;ICONFILE="iconsource";MINWIN=SYMBOL;PROGTYPE=WP;EXENAME="pathfile";STARTUPDIR="fpath";OBJECTID=<"title">;NOPRINT=YES;Title="iconid";"
Result = SysCreateObject( Type, Title, Folder, Parms, 'ReplaceIfExists' )
say "Placing Dragen DropZone icon on the desktop."
say "Done."