home *** CD-ROM | disk | FTP | other *** search
- /***********************************************************************/
- /* EPM Installation Tool */
- /* */
- /* Handles all installation tasks for EPM. Locked files are not */
- /* handled. */
- /* */
- /***********************************************************************/
- /* (C) Copyright IBM Corporation 1994 */
- /***********************************************************************/
-
- parse upper arg BDr CDr .
- trace 'o'
-
- call Initialize
-
- 'cls'
- say
- say '┌────────────────────────────────────────────────────────────────────────────┐'
- say '│ The Developer Connection │'
- say '│ Enhanced Editor ver. 5.51 Installation │'
- say '│ (C) Copyright IBM Corporation 1994 │'
- say '├────────────────────────────────────────────────────────────────────────────┤'
- say '│ ** Warning ** │'
- say '│ If the current version of EPM is installed on your system, it will be │'
- say '│ upgraded to ver 5.51. Also, many sample macros will be installed in │'
- say '│ the E_MACROS directory added to your EPMPATH in CONFIG.SYS. │'
- say '│ │'
- say '│ Type [Q] to Quit or [ENTER] to continue. │'
- say '│ │'
- say '└────────────────────────────────────────────────────────────────────────────┘'
- answer = translate(linein(STDIN))
- if answer = 'Q'
- then do
- call 'MessageBox' 'EPM', 'Installation aborted by user.'
- exit 0
- end /* Do */
-
- /* Check EPMPATH and Add OS2\APPS\E_MACROS */
- size = stream(BDr'\CONFIG.SYS', 'C', 'QUERY SIZE')
- data = charin(BDr'\CONFIG.SYS', '1', size)
- temp = stream(BDr'\CONFIG.SYS', 'C', 'CLOSE')
-
- num = 0
- do while length(data) <> 0
- num = num + 1
- parse var data line.num'0d0a'x rest
- data = rest
- end /* do */
- line.0 = num
-
- hits.=0
- num2 = 0
- do num = 1 to line.0
- if pos('SET EPMPATH', line.num) <> 0
- then do
- num2 = num2 + 1
- hits.num2 = num line.num
- end /* Do */
- end /* do */
-
- hits.0 = num2
- if hits.0 = 0
- then Resp = LINEOUT(BDr'\CONFIG.SYS', 'SET EPMPATH='BDr'\OS2\APPS;'BDr'\OS2\APPS\E_MACROS;')
- else do
- dirty = 0
- do num = 1 to hits.0
- parse var hits.num linenum .
- if right(line.linenum,1) <> ';'
- then line.linenum = line.linenum';'
- if pos('OS2\APPS\E_MACROS', line.linenum) = 0
- then do
- line.linenum = line.linenum||BDr'\OS2\APPS\E_MACROS;'
- dirty = 1
- end /* Do */
- end /* do */
- if dirty
- then do
- '@ECHO OFF'
- 'copy 'BDr'\CONFIG.SYS 'BDr'\CONFIG.BAK >nul 2>nul'
- 'erase 'BDr'\CONFIG.SYS'
- do num = 1 to line.0
- Resp = lineout(BDr'\CONFIG.SYS', line.num)
- end /* Do */
- end /* Do */
- end /* Do */
-
- /* Use PACKINST.CMD to install all packages. */
- say '┌────────────────────────────────────────────────────────────────────────────┐'
- say '│ Updating EPM Executable files to the OS2\APPS directory. │'
- say '└────────────────────────────────────────────────────────────────────────────┘'
- '@XCOPY 'CDr'EDITORS\EPM\APPS 'BDr'\OS2\APPS\*.* /s /e >nul 2>nul'
- resp = rc
- if resp = 0
- then do
- say '┌────────────────────────────────────────────────────────────────────────────┐'
- say '│ Updating EPM DLL files to the OS2\APPS\DLL directory. │'
- say '└────────────────────────────────────────────────────────────────────────────┘'
- '@XCOPY 'CDr'EDITORS\EPM\DLL 'BDr'\OS2\APPS\DLL\*.* /s /e >nul 2>nul'
- resp = rc
- end
- else call MyExit resp
- if resp = 0
- then do
- say '┌────────────────────────────────────────────────────────────────────────────┐'
- say '│ Updating EPM HELP files to the OS2\HELP directory. │'
- say '└────────────────────────────────────────────────────────────────────────────┘'
- '@XCOPY 'CDr'EDITORS\EPM\HELP 'BDr'\OS2\HELP\*.* /s /e > nul 2>nul'
- resp = rc
- end
- else call MyExit resp
- if resp = 0
- then do
- say '┌────────────────────────────────────────────────────────────────────────────┐'
- say '│ Updating EPM BOOK files to the OS2\BOOK directory. │'
- say '└────────────────────────────────────────────────────────────────────────────┘'
- '@XCOPY 'CDr'EDITORS\EPM\BOOK 'BDr'\OS2\BOOK\*.* /s /e >nul 2>nul'
- resp = rc
- end
- else call MyExit resp
- if resp = 0
- then do
- say '┌────────────────────────────────────────────────────────────────────────────┐'
- say '│ Updating EPM Macro files to the OS2\APPS\E_MACROS directory. │'
- say '└────────────────────────────────────────────────────────────────────────────┘'
- '@XCOPY 'CDr'EDITORS\EPM\E_MACROS 'BDr'\OS2\APPS\E_MACROS\*.* /s /e >nul 2>nul'
- resp = rc
- end
- else call MyExit resp
-
- call 'MessageBox' 'EPM', 'Upgrade of the Enhanced Editor for OS/2 was successful.',
- 'You may try this application without rebooting your system.'
- call 'CaddComplete' 0
- call 'CaddExit'
- exit
-
- Initialize:
- CurDir = directory()
- call directory CDr'INSTALL'
- call Rxfuncadd 'CADDINIT', 'RXCADD', 'CADDINIT'
- signal on syntax
- ver = 'CAddInit'()
- signal off syntax
- if abbrev(ver, 'ERROR:')
- then call syntax
- return 0
-
-
- MyExit:
- call beep 300, 150
- call 'MessageBox' 'EPM', 'Installation failed. You may be running another EPM editor!'
- call 'CaDDExit'
- exit 0
-