home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Software of the Month Club 1995 February
/
SOFM_Feb1995.bin
/
pc
/
os2
/
easylo
/
setup.cmd
< prev
Wrap
OS/2 REXX Batch file
|
1994-09-28
|
8KB
|
291 lines
/* rexx */
/*
========================================================================
------------------------------- SETUP ----------------------------------
easyLOOK Setup Module
Copyright (C) 1994 Global Automation Co.
All Rights Reserved
Simon Husin Production
-------------------------- S H A R E W A R E ---------------------------
========================================================================
To execute:
Improved GUI/OOUI Approach:
Double-click the drives icon (and subsequent folders) to get to
see easyLOOK files, and double-click on SETUP icon.
Command driven:
Type SETUP from an OS/2 prompt with the current directory set to
where this and easyLOOK.EXI/.EXQ files reside, then press Enter.
------------------------------------------------------------------------
*/
'@echo off'
/*
Register IBM OS/2 RexxUtil Functions
*/
if rxfuncquery('sysloadfuncs') then do
call rxfuncadd sysloadfuncs, rexxutil, sysloadfuncs
call sysloadfuncs
end
do until result = 0 | result = -1
call DeterminePath
end
if result = -1 then call SetupTermination
call DetermineInterpreter
call CreateeasyLOOKObject
call DisplayLicense
call Completion
return 0
CreateeasyLOOKObject: procedure
/*
------------------------------------------------------------------------
Create or replace easyLOOK object on the desktop
------------------------------------------------------------------------
*/
call DisplayCopyright
say 'Creating easyLOOK object on the desktop...'
call SysSetIcon 'easyLOOK.EXE', 'easyLOOK.ICO'
startupdir = syssearchpath('PATH', 'easyLOOK.EXE')
startupdir = left(startupdir, length(startupdir) - 12)
if right(startupdir, 1) = '\' then
execprog = startupdir'easyLOOK.EXE'
else
execprog = startupdir'\easyLOOK.EXE'
classname='WPProgram' /* to be used as a program */
title='easy' || x2c('0A') || 'LOOK' /* title */
location='<WP_DESKTOP>' /* place it on OS/2 DESKTOP*/
setup='OBJECTID=<easyLOOK>;' ||, /* other settings */
'EXENAME='execprog';' ||,
'STARTUPDIR='startupdir';' ||,
'PROGTYPE=OS2WINDOW;' ||,
'MINIMIZED=;' ||,
'MAXIMIZED=;' ||,
'PARAMETERS=%*;' ||,
'NOAUTOCLOSE=;' ||,
'CCVIEW=YES;' ||,
'ASSOCTYPE=Plain Text,,;' ||,
'ASSOCFILTER=*.ELP,,;'
call SysCreateObject classname, title, location, setup, 'REPLACE'
return result
Completion: procedure
/*
------------------------------------------------------------------------
Installation completion screen
------------------------------------------------------------------------
*/
call DisplayCopyright
say 'easyLOOK installation has been completed!'
say
say 'easyLOOK Icon has been created on your OS/2 Desktop.'
say
say 'Please read files LICENSE.TXT for license agreement, and'
say 'easyLOOK.DOC for a complete documentation.'
say
say 'Thank you for using easyLOOK.'
say
say 'Simon Husin'
say 'Global Automation Co.'
say copies('_', 78)
say
say 'Type Y to read easyLOOK.DOC now, or any other key to quit'
choice = translate(sysgetkey('NOECHO')); say choice
if choice = 'Y' then 'E easyLOOK.DOC'
return 0
DeterminePath: procedure
/*
------------------------------------------------------------------------
Request for drive and path (if not on hard disk)
------------------------------------------------------------------------
*/
call DisplayCopyright
parse source . . cursource
cursource = translate(cursource)
curset = filespec('DRIVE', cursource) || filespec('PATH', cursource)
say 'easyLOOK files found in' curset'...'
say 'Do you want to keep them there? Type Y to confirm.'
choices = 'Y'
say
drives = translate(sysdrivemap('A:'), ' ', ':')
drives = translate(drives, ' ', 'ABQY')
if filespec('PATH', cursource) = '\EASYLOOK\' &,
pos(left(curset, 1), drives) > 0 then
drives = translate(drives, ' ', left(curset, 1))
choices = choices || space(drives, 0)'Q'
if strip(drives) \= '' then do
say 'Otherwise, please type one of the following drives found on'
say 'your system. If you choose one of these drives, SETUP will'
say 'create and place all files in directory \EASYLOOK\.'
say
blanks = copies(' ', 78)
say ' Drive Label Bytes Avail. % Avail'
do i = 1 to words(drives)
dl = word(drives, i)
parse value sysdriveinfo(dl':') with . dif dit dil
if dif < 720000 then iterate
sl = overlay(dl, blanks, 6)
sl = overlay(strip(dil), sl, 11)
sl = overlay(format(dif, 12), sl, 24)
sl = overlay(format(dif/dit*100, 3, 2), sl, 40)
say sl
end
end
say
call charout 'CON', 'Your choice (or Q to quit): '
choice = translate(sysgetkey('NOECHO'))
say choice
if pos(choice, choices) = 0 then return 1
if choice = 'Q' then return -1
if choice = 'Y' then return 0
say
newset = choice':\EASYLOOK'
say 'Creating' newset'...'
call sysmkdir newset
if result = 0 | result = 5 then do
say 'Copying files to' newset'...'
'@copy *.*' newset
choice':'
'@cd\easylook'
return 0
end
select
when result = 0 then say 'Directory creation was successful'
when result = 2 then say 'File not found'
when result = 3 then say 'Path not found'
when result = 5 then say 'Access denied'
when result = 26 then say 'Not a DOS disk'
when result = 87 then say 'Invalid parameter'
when result = 108 then say 'Drive locked'
when result = 206 then say 'Filename exceeds range'
otherwise say 'Unknown error detected!'
end
return -1
DisplayCopyright: procedure
/*
------------------------------------------------------------------------
Display copyright information
------------------------------------------------------------------------
*/
'cls'
say
say 'SETUP --- easyLOOK Set up program'
say 'Copyright (C) 1994 Global Automation Co.'
say 'All Rights Reserved'
say copies('_', 78)
return 0
DisplayLicense: procedure
/*
------------------------------------------------------------------------
Display copyright information
------------------------------------------------------------------------
*/
call DisplayCopyright
say 'Displaying License Information...'
Call SysSetObjectData '<easyLOOK>', 'PARAMETERS=LICENSE;OPEN=DEFAULT;'
Call SysSetObjectData '<easyLOOK>', 'PARAMETERS=%*;'
call syssleep 10
return 0
SetupTermination: procedure
/*
------------------------------------------------------------------------
Termination screen
------------------------------------------------------------------------
*/
say
say 'easyLOOK installation has been abrupted!'
say
say 'Thank you for considering installing easyLOOK.'
say
say 'Simon Husin'
say 'Global Automation Co.'
say copies('_', 78)
say
say 'Type any key to close this task now...'
call sysgetkey 'NOECHO'
exit -1
DetermineInterpreter: procedure
/*
------------------------------------------------------------------------
Determine interpreter being used & install the fastest easyLOOK for it
------------------------------------------------------------------------
*/
call DisplayCopyright
say 'Checking for the REXX engine currently used...'
say 'Install the best easyLOOK version for it.'
say
startupdir = syssearchpath('PATH', 'easyLOOK.DOC')
startupdir = left(startupdir, length(startupdir) - 12)
if right(startupdir, 1) = '\' then do
sourceprog = startupdir'easyLOOK.EX'
targetprog = startupdir'easyLOOK.EXE'
end
else do
sourceprog = startupdir'\easyLOOK.EX'
targetprog = startupdir'\easyLOOK.EXE'
end
parse version interpreter .
interpreter = translate(interpreter)
if interpreter = 'REXX/PERSONAL' then do
say 'Optimizing easyLOOK for Quercus Personal/REXX...'
sourceprog = sourceprog'Q' /* Quercus Personal/REXX */
end
else do
say 'Optimizing easyLOOK for IBM OS/2 PL/2 REXX...'
sourceprog = sourceprog'I' /* IBM OS/2 PL/2 REXX */
end
'@copy' sourceprog targetprog '>NUL'
call syssleep 4
return 0