home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Mega Top 1
/
os2_top1.zip
/
os2_top1
/
APPS
/
FILEMAN
/
FM2_222A
/
INSTALL.CMD
< prev
next >
Wrap
OS/2 REXX Batch file
|
1994-12-31
|
11KB
|
361 lines
/*
* FM/2 2.x installation program copyright (c) 1994/95 by M. Kimes
*
* This program creates a folder to hold program objects,
* then creates program objects for each executable. It only needs to be
* run once (unless you move the FM/2 directory -- see say notes at end).
* It also calls MIGINI.CMD if it finds an old FM2.INI file to migrate
* some information to the new version's FM3.INI file.
*
* For unattended installation, remove the lines marked with "NOTE:" below.
*/
/* see if we might be in the right directory... */
'@Echo off'
'cls'
say' ┌───────────────────────────────────────────────────────────────────┐'
say' │ FM/2 2.x Installation Program │'
say' │ FM/2 is copyright (c) 1993-95 by M. Kimes │'
say' │ All rights reserved │'
say' ├───────────────────────────────────────────────────────────────────┤'
say' ├───────────────────────────────────────────────────────────────────┤'
say' │ Have you read the READ.ME file yet? │'
say' │ By running this program, you agree to the license │'
say' │ as specified in that file, │'
say' │ and it tells you how to install, so you should read it. │'
say' └───────────────────────────────────────────────────────────────────┘'
/*
* allow user to eliminate associations from being placed on AV/2.
* seemed to upset some fellow on CIS (I guess he doesn't know about
* Settings notebooks on WPS objects).
*/
assocfilter = ';ASSOCFILTER=*.ZIP,*.ARC,*.LZH,*.ARJ,*.ZOO,*.MO0,READ.ME,README,README.1ST,README.OS2,REGISTER.TXT'
existed = ''
parse upper arg dummy
if dummy = 'NOASSOC' then assocfilter = ''
rc = stream('fm3.exe','c','query exists')
if rc = '' then
do
say 'Sorry, FM3.EXE not found. Must not be right directory. Terminating.'
exit
end
/* tell user what we're doing, give him a chance to hit CTRL-C */
say ''
say 'This program creates objects for FM/2.'
say ''
/* NOTE: remove following 3 lines for unattended use... */
say 'Press [Enter].'
pull dummy .
say ''
/* save current directory */
curdir = directory()
/* load rexx utility functions */
call RxFuncAdd 'SysLoadFuncs', 'RexxUtil', 'SysLoadFuncs'
call SysLoadFuncs
/* say it, then do it */
say "Creating File Manager/2 folder and program objects..."
/* first, create FM/2 folder */
title = "File Manager/2"
classname = 'WPFolder'
location = '<WP_DESKTOP>'
setup = 'OBJECTID=<FM3_Folder>;OPEN=DEFAULT'
result=SysCreateObject(classname,title,location,setup,f)
/* NOTE: remove following 9 lines for unattended use... */
if result = 0 then
do
assocfilter = ''
existed = 'TRUE'
say ''
say 'The File Manager/2 folder already exists.'
say 'Should I update the objects? (Y/N)'
parse upper pull dummy
if left(dummy,1) = 'N' then exit
say ''
end
/* now, create program objects in FM/2 folder */
title = "FM/2"
classname = 'WPProgram'
location = '<FM3_Folder>'
setup = 'EXENAME='curdir'\FM3.EXE;STARTUPDIR='curdir
if existed = '' then setup = setup';PARAMETERS=%*'
call SysCreateObject classname,title,location,setup,u
rc = stream('av2.exe','c','query exists')
if rc \= '' then
do
title = "Archive Viewer/2"
classname = 'WPProgram'
location = '<FM3_Folder>'
setup = 'EXENAME='curdir'\AV2.EXE;STARTUPDIR='curdir''assocfilter
if existed = '' then setup = setup';PARAMETERS=%*'
call SysCreateObject classname,title,location,setup,u
end
rc = stream('doicon.exe','c','query exists')
if rc \= '' then
do
title = "SysIcon"
classname = 'WPProgram'
location = '<FM3_Folder>'
setup = 'EXENAME='curdir'\DOICON.EXE;STARTUPDIR='curdir
if existed = '' then setup = setup';PARAMETERS=%*'
call SysCreateObject classname,title,location,setup,u
end
rc = stream('eas.exe','c','query exists')
if rc \= '' then
do
title = "EA Viewer"
classname = 'WPProgram'
location = '<FM3_Folder>'
setup = 'EXENAME='curdir'\EAS.EXE;STARTUPDIR='curdir
if existed = '' then setup = setup';PARAMETERS=%*'
call SysCreateObject classname,title,location,setup,u
end
rc = stream('ini.exe','c','query exists')
if rc \= '' then
do
title = "INI Viewer"
classname = 'WPProgram'
location = '<FM3_Folder>'
setup = 'EXENAME='curdir'\INI.EXE;STARTUPDIR='curdir';ASSOCFILTER=*.INI'
if existed = '' then setup = setup';PARAMETERS=%*'
call SysCreateObject classname,title,location,setup,u
end
rc = stream('viewinfs.exe','c','query exists')
if rc \= '' then
do
title = "Bookshelf Viewer"
classname = 'WPProgram'
location = '<FM3_Folder>'
setup = 'EXENAME='curdir'\VIEWINFS.EXE;STARTUPDIR='curdir
call SysCreateObject classname,title,location,setup,u
title = "Helpfile Viewer"
classname = 'WPProgram'
location = '<FM3_Folder>'
setup = 'EXENAME='curdir'\VIEWINFS.EXE;PARAMETERS=DUMMY;STARTUPDIR='curdir
call SysCreateObject classname,title,location,setup,u
end
rc = stream('killproc.exe','c','query exists')
if rc \= '' then
do
title = "Process Killer"
classname = 'WPProgram'
location = '<FM3_Folder>'
setup = 'EXENAME='curdir'\KILLPROC.EXE;PARAMETERS=%;STARTUPDIR='curdir
call SysCreateObject classname,title,location,setup,u
end
rc = stream('undel.exe','c','query exists')
if rc \= '' then
do
title = "Undeleter"
classname = 'WPProgram'
location = '<FM3_Folder>'
setup = 'EXENAME='curdir'\UNDEL.EXE;STARTUPDIR='curdir
if existed = '' then setup = setup';PARAMETERS=%*'
call SysCreateObject classname,title,location,setup,u
end
rc = stream('vtree.exe','c','query exists')
if rc \= '' then
do
title = "Visual Tree"
classname = 'WPProgram'
location = '<FM3_Folder>'
setup = 'EXENAME='curdir'\VTREE.EXE;STARTUPDIR='curdir
call SysCreateObject classname,title,location,setup,u
end
rc = stream('vdir.exe','c','query exists')
if rc \= '' then
do
title = "Visual Directory"
classname = 'WPProgram'
location = '<FM3_Folder>'
setup = 'EXENAME='curdir'\VDIR.EXE;STARTUPDIR='curdir
if existed = '' then setup = setup';PARAMETERS=%*'
call SysCreateObject classname,title,location,setup,u
end
rc = stream('vcollect.exe','c','query exists')
if rc \= '' then
do
title = "Collector"
classname = 'WPProgram'
location = '<FM3_Folder>'
setup = 'EXENAME='curdir'\VCOLLECT.EXE;STARTUPDIR='curdir
call SysCreateObject classname,title,location,setup,u
end
rc = stream('READ.ME','c','query exists')
if rc \= '' then
do
title = "Read.Me"
classname = 'WPShadow'
location = '<FM3_Folder>'
setup = 'SHADOWID='rc
call SysCreateObject classname,title,location,setup,u
end
rc = stream('HISTORY.TXT','c','query exists')
if rc \= '' then
do
title = "History.Txt"
classname = 'WPShadow'
location = '<FM3_Folder>'
setup = 'SHADOWID='rc
call SysCreateObject classname,title,location,setup,u
end
rc = stream('REGISTER.TXT','c','query exists')
if rc \= '' then
do
title = "Register.Txt"
classname = 'WPShadow'
location = '<FM3_Folder>'
setup = 'SHADOWID='rc
call SysCreateObject classname,title,location,setup,u
end
rc = stream('ASSOCIAT.TXT','c','query exists')
if rc \= '' then
do
title = "Associat.Txt"
classname = 'WPShadow'
location = '<FM3_Folder>'
setup = 'SHADOWID='rc
call SysCreateObject classname,title,location,setup,u
end
rc = stream('FM3.HLP','c','query exists')
if rc \= '' then
do
rc = stream('SEEHELP.EXE','c','query exists')
if rc \= '' then
do
title = "FM/2 Online Help"
classname = 'WPProgram'
location = '<FM3_Folder>'
setup = 'EXENAME='curdir'\SEEHELP.EXE;STARTUPDIR='curdir';PARAMETERS='curdir'\FM3.HLP'
call SysCreateObject classname,title,location,setup,u
end
end
/*
* create an FM2.CMD file that the user can copy into a directory
* in their PATH if they'd like to be able to start FM/2 from any
* directory via command line.
*/
'del FM2.CMD 1>NUL 2>NUL'
dummy = stream('FM2.CMD','C','open')
if dummy = 'READY:' then
do
say 'Creating an FM2.CMD file.'
call lineout 'FM2.CMD', "/* FM/2 command file. Locate in a directory"
call lineout 'FM2.CMD', " * on your PATH. */"
call lineout 'FM2.CMD', "'@echo off'"
call lineout 'FM2.CMD', "arg dummy"
call lineout 'FM2.CMD', "if dummy = '' then"
call lineout 'FM2.CMD', " curdir = directory()"
call lineout 'FM2.CMD', "else"
call lineout 'FM2.CMD', " curdir = ''"
call lineout 'FM2.CMD', "n = setlocal()"
call lineout 'FM2.CMD', "n = directory('"curdir"')"
call lineout 'FM2.CMD', "'start fm3.exe 'curdir' %1 %2 %3 %4 %5 %6 %7 %8 %9'"
call lineout 'FM2.CMD', "n = endlocal()"
call stream 'FM2.CMD','C','close'
'del AV2.CMD 1>NUL 2>NUL'
dummy = stream('AV2.CMD','C','open')
if dummy = 'READY:' then
do
say 'Creating an AV2.CMD file.'
call lineout 'AV2.CMD', "/* AV/2 command file. Locate in a directory"
call lineout 'AV2.CMD', " * on your PATH. */"
call lineout 'AV2.CMD', "'@echo off'"
call lineout 'AV2.CMD', "n = directory('"curdir"')"
call lineout 'AV2.CMD', "'start av2.exe %1 %2 %3 %4 %5 %6 %7 %8 %9'"
call stream 'AV2.CMD','C','close'
end
else say "Couldn't create AV2.CMD file."
say ''
end
else say "Couldn't create FM2.CMD file."
say ''
rc = stream('fm3.ini','c','query exists')
if rc \= '' then
say 'An FM3.INI exists -- not attempting to migrate 1.x information.'
else
do
/* if we can find FM2.INI, run MIGINI.CMD */
fm2ini = value('fm2ini',,'OS2ENVIRONMENT')
if fm2ini \= '' then fm2ini = stream(fm2ini,'c','query exists')
if fm2ini = '' then
do
fm2ini = value('fm2ini',,'OS2ENVIRONMENT')
if fm2ini \= '' then
do
fm2ini = insert('\FM2.INI',fm2ini,length(fm2ini))
fm2ini = stream(fm2ini,'c','query exists')
end
end
fm2ini = SysSearchPath('PATH', 'FM2.INI')
if fm2ini = '' then fm2ini = SysSearchPath('DPATH', 'FM2.INI')
if fm2ini = '' then fm2ini = SysSearchPath('XPATH', 'FM2.INI')
if fm2ini \= '' then
do
'call migini.cmd dummy'
say ''
say ' (You can remove the old FM/2 1.x files when installation completes.)'
call SysSleep 2
say ''
end
end
rc = stream('install.dat','c','query exists')
if rc \= '' then
do
/* type the install.dat file to show any critical info/notices */
/* NOTE: remove following 4 lines for unattended use... */
rc = stream('install.dat','c','query exists')
if rc \= '' then 'type install.dat'
say 'Press [Enter].'
pull dummy .
end
say 'To move FM/2 to another directory, move the files, delete the FM/2 folder,'
say 'then rerun INSTALL. To remove FM/2, run UNINSTAL and follow its directions.'
say "If you'd like to be able to run FM/2 from any OS/2 command line, copy the"
say 'FM2.CMD file in this directory to a directory on your PATH. I also built'
say 'an AV2.CMD file you may also want on your PATH.'
say ''
say "I'm done now."